Have this spell for example:
someone knows how to check the distance between the creature and the target?
thanks
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_ENERGYAREA)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
function onCastSpell(creature, variant)
-- if creature:distance from target > 1 then
return combat:execute(creature, variant)
--end
end
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_ENERGYAREA)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
function onCastSpell(creature, variant)
-- if creature:distance from target > 1 then
return combat:execute(creature, variant)
--end
end
someone knows how to check the distance between the creature and the target?
thanks