roriscrave
Advanced OT User
- Joined
- Dec 7, 2011
- Messages
- 1,188
- Solutions
- 34
- Reaction score
- 200
Hi, i made this spell in area, it paralyze all creatures (monster, players). So i want to change it, to paralyze only players.
So i make this code, and it print "target is player" fine, but i dont know how to pass condition paralyze into the function onTargetCreature, how can i do it?
So i make this code, and it print "target is player" fine, but i dont know how to pass condition paralyze into the function onTargetCreature, how can i do it?
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_HEALING)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
combat:setParameter(COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, false)
local condition = Condition(CONDITION_PARALYZE)
condition:setParameter(CONDITION_PARAM_TICKS, 5000)
condition:setFormula(-8, -5, -8, -5)
combat:addCondition(condition)
function onTargetCreature(creature, target)
local creature = Creature(creature.uid)
local target = Creature(target.uid)
if creature and target then
if creature:isPlayer and target:isPlayer() then
--need to paralyze target, if is player
print("target is player")
end
end
return true
end
combat:setCallback(CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")
function onCastSpell(creature, variant)
return combat:execute(creature, variant)
end