local time = 3 -- tempo em segundos que vai ficar imovel
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1, -10, -1, -20, 5, 5, 1.4, 2.1)
local condition = createConditionObject(CONDITION_PARALYZE)
setConditionParam(condition, CONDITION_PARAM_TICKS, time*1000)
setConditionParam(condition, CONDITION_PARAM_SPEED, -5000)
local function doSpell(cid, target, var)
if not isCreature(cid) or not isCreature(target) then return true end
if isPlayer(target) then
doCreatureSetNoMove(target, true)
addEvent(function()
if isPlayer(target) then
return doCreatureSetNoMove(target, false)
end
end,time*1000)
else
doAddCondition(target, condition)
end
return doCombat(cid, combat, var)
end
function onCastSpell(cid, var)
return doSpell(cid, getCreatureTarget(cid), var)
end