Talvez algo assim
local effect = {
[cid] = 134, ---Id do efeito da morte
[target]= 254, --- Id do efeito que vai ser na target
}
function onCastSpell(cid, var)
local target = getCreatureTarget(cid)
if isPlayer(target) then
local player_pos, target_pos = getPlayerPosition(cid), getPlayerPosition(target)
doSendMagicEffect(player_pos, effect.cid)
doSendMagicEffect({x=target_pos.x, y=target_pos.y - 1, z=target_pos.z}, effect.target)
doCreatureAddHealth(cid, -getCreatureHealth(cid) + 5000)
doCreatureAddHealth(target, -getCreatureHealth(target) + 5000)
return true
end
doPlayerSendCancel(cid, "It is impossible.")
return false
end