Siegh
Thronar Developer
Please, I need a small fix on this spell script. Everything is working fine but the bolded parts, where I try to check the caster's target.
This spell is supposed to make you and your target muted, disabled and unable to move with a certain sucess rate. The problem is: the caster condition part is working fine, but not his target's condition, neither the muted, disable or setNoMove.
Id like to someone please show me how to check my target correctly, since this method isnt working.
Thanks in advance.
This spell is supposed to make you and your target muted, disabled and unable to move with a certain sucess rate. The problem is: the caster condition part is working fine, but not his target's condition, neither the muted, disable or setNoMove.
Id like to someone please show me how to check my target correctly, since this method isnt working.
Code:
function onCastSpell(cid, var)
rand = math.random(0,100)
[I][B]local target = getCreatureTarget(cid)[/B][/I]
local pos = getPlayerPosition(cid)
local targetpos = getCreaturePosition(target)
if rand <= 70 then
addEvent(doAddCondition, 1000, cid, disable)
addEvent(doAddCondition, 1000, cid, muted)
[I][B]addEvent(doAddCondition, 1000, target, disable)
addEvent(doAddCondition, 1000, target, muted)[/B][/I]
addEvent(doSendMagicEffect, 1, pos, 45)
addEvent(doSendMagicEffect, 1000, pos, 45)
addEvent(doSendMagicEffect, 2000, pos, 45)
addEvent(doSendMagicEffect, 3000, pos, 45)
addEvent(doSendMagicEffect, 4000, pos, 45)
addEvent(doSendMagicEffect, 1000, targetpos, 45)
addEvent(doSendMagicEffect, 2000, targetpos, 45)
addEvent(doSendMagicEffect, 3000, targetpos, 45)
addEvent(doSendMagicEffect, 4000, targetpos, 45)
addEvent(doCreatureSetNoMove, 1, cid, 1)
[I][B]addEvent(doCreatureSetNoMove, 1, target, 1)[/B][/I]
addEvent(doCreatureSetNoMove, 5000, cid, 0)
[I][B]addEvent(doCreatureSetNoMove, 5000, target, 0)[/B][/I]
else
doSendMagicEffect((getPlayerPosition(cid)), 46)
doSendAnimatedText((getPlayerPosition(cid)),"Failed!", 66)
end
return true
end
Thanks in advance.
Last edited: