2018-04-18 16:06:41 -05:00
|
|
|
require("global");
|
|
|
|
|
|
|
|
properties = {
|
|
|
|
permissions = 0,
|
2019-05-29 23:05:40 -07:00
|
|
|
parameters = "sss",
|
2018-04-18 16:06:41 -05:00
|
|
|
description =
|
|
|
|
[[
|
|
|
|
Adds experience <qty> to player or <targetname>.
|
|
|
|
!giveexp <qty> |
|
|
|
|
!giveexp <qty> <targetname> |
|
|
|
|
]],
|
|
|
|
}
|
|
|
|
|
2019-05-29 23:05:40 -07:00
|
|
|
function onTrigger(player, argc, animType, modelAnim, effectId)
|
2018-04-18 16:06:41 -05:00
|
|
|
local sender = "[battleaction] ";
|
|
|
|
|
2019-05-29 23:05:40 -07:00
|
|
|
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)
|
|
|
|
print((tonumber(id)))
|
|
|
|
player:DoBattleAction(30301, id);
|
2018-04-18 16:06:41 -05:00
|
|
|
else
|
|
|
|
print(sender.."unable to add experience, ensure player name is valid.");
|
|
|
|
end;
|
|
|
|
end;
|