X
Xikini
Guest
TFS 1.4.2
I want the direction of the spell to remain static. So if I'm facing south and cast, it will cast south 3 times, in the original casted spot.
So this works as expected, until I start moving my character around. xD
It seems like the direction of the character is checked everytime combat is called.. and there's no way to give the spell any information to get around that.
Is there something simple I'm missing?

I want the direction of the spell to remain static. So if I'm facing south and cast, it will cast south 3 times, in the original casted spot.
So this works as expected, until I start moving my character around. xD
It seems like the direction of the character is checked everytime combat is called.. and there's no way to give the spell any information to get around that.
Is there something simple I'm missing?

LUA:
local combat1 = Combat()
combat1:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
combat1:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
combat1:setArea(createCombatArea(AREA_SQUAREWAVE5, AREADIAGONAL_SQUAREWAVE5))
local combat2 = Combat()
combat2:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)
combat2:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_FIRE)
combat2:setArea(createCombatArea(AREA_SQUAREWAVE5, AREADIAGONAL_SQUAREWAVE5))
local combat3 = Combat()
combat3:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_GREEN)
combat3:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_POISON)
combat3:setArea(createCombatArea(AREA_SQUAREWAVE5, AREADIAGONAL_SQUAREWAVE5))
local function castDelayedSpell(creatureId, variant, combat)
local creature = Creature(creatureId)
if not creature then
return
end
combat:execute(creature, variant)
end
local spell = Spell("instant")
function spell.onCastSpell(creature, variant)
local creatureId = creature:getId()
addEvent(castDelayedSpell, 0, creatureId, variant, combat1)
addEvent(castDelayedSpell, 500, creatureId, variant, combat2)
addEvent(castDelayedSpell, 1000, creatureId, variant, combat3)
return
end
spell:name("triple effect spell")
spell:words("triple effect spell")
spell:group("attack")
spell:id(179)
spell:cooldown(1000)
spell:groupCooldown(1000)
spell:level(1)
spell:mana(10)
spell:isSelfTarget(false)
spell:isPremium(true)
spell:needLearn(false)
spell:needDirection(true)
spell:register()