T
Tibia Demon
Guest
How can i make distance effect hit each time it go through player on way?
like if sd runes are standing players they get hit and not only the ones on the end of distance effect
Lua:
local combatOne = Combat()
combatOne:setParameter(COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
combatOne:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_SMALLCLOUDS)
combatOne:setArea(createCombatArea(testOne))
function onGetFormulaValuesOne(creature, level, magicLevel)
local min = 1
local max = 2
return -min, -max
end
function onTargetTile(creature, position)
creature:getPosition():sendDistanceEffect(position, CONST_ANI_DEATH)
end
combatOne:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValuesOne")
combatOne:setCallback(CALLBACK_PARAM_TARGETTILE, "onTargetTile")
local function castSpellOne(creatureId, variant)
local creature = Creature(creatureId)
if not creature then
return
end
combatOne:execute(creature, variant)
end
function onCastSpell(creature, variant)
addEvent(castSpellOne, 0, creature:getId(), variant)
return true
end
like if sd runes are standing players they get hit and not only the ones on the end of distance effect