From e9b3f4e51ee4ce060a2b84b243476fe89b218a66 Mon Sep 17 00:00:00 2001 From: Yogurt Date: Mon, 10 Jun 2019 21:32:22 -0700 Subject: [PATCH] Add playanimation script --- data/scripts/commands/gm/playanimation.lua | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 data/scripts/commands/gm/playanimation.lua diff --git a/data/scripts/commands/gm/playanimation.lua b/data/scripts/commands/gm/playanimation.lua new file mode 100644 index 00000000..54fcf46f --- /dev/null +++ b/data/scripts/commands/gm/playanimation.lua @@ -0,0 +1,28 @@ +require("global"); + +properties = { + permissions = 0, + parameters = "sss", + description = +[[ +Plays animation on target. +!playanimation +]], +} + + +function onTrigger(player, argc, animType, modelAnim, effectId) + local sender = "[battleaction] "; + local actor = GetWorldManager():GetActorInWorld(player.currentTarget) or nil; + if player and actor then + aid = tonumber(animType) or 0 + mid = tonumber(modelAnim) or 0 + eid = tonumber(effectId) or 0 + local id = bit32.lshift(aid, 24); + id = bit32.bor(id, bit32.lshift(mid, 12)); + id = bit32.bor(id, eid) + actor:PlayAnimation(id) + else + print(sender.."unable to add experience, ensure player name is valid."); + end; +end; \ No newline at end of file