Hello,
I am having a little issue with my spell in TFS 1.3
My Code:
and my problem is I would like to let my character say Final then Flaaash (0.2seconds after I casted the spell) + the actuall animation/spell
and currently I tried it like this:
It actually does exactly what I said above and how I want it BUT when I run and cast the spell it shoots exactly in the opposite direction for example
I run west it shoots east I run north it shoots south,only when I stand its 100% accurate.
Anybody knows how to fix that little issue?
Thanks in Advance
Kind Regards
I am having a little issue with my spell in TFS 1.3
My Code:
Lua:
local west1 = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
}
local west2 = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
}
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_NONE)
combat:setFormula(COMBAT_FORMULA_DAMAGE, -250.0, 0, -300.0, 0)
--combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
combat:setArea(createCombatArea(west1))
local combat2 = Combat()
combat2:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat2:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_NONE)
combat2:setFormula(COMBAT_FORMULA_DAMAGE, -250.0, 0, -300.0, 0)
--combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
combat2:setArea(createCombatArea(west2))
local effect = {
[DIRECTION_NORTH] = 151,
[DIRECTION_EAST] = 148,
[DIRECTION_SOUTH] = 151,
[DIRECTION_WEST] = 148
}
local effect2 = {
[DIRECTION_NORTH] = 150,
[DIRECTION_EAST] = 149,
[DIRECTION_SOUTH] = 152,
[DIRECTION_WEST] = 147
}
function onCastSpell(creature, variant)
addEvent(function() creature:say("Final", TALKTYPE_MONSTER_SAY) end, 0)
addEvent(function() creature:say("Flaaash!", TALKTYPE_MONSTER_SAY) end, 0)
combat:setParameter(COMBAT_PARAM_EFFECT, effect[creature:getDirection()])
combat2:setParameter(COMBAT_PARAM_EFFECT, effect2[creature:getDirection()])
return combat:execute(creature, variant), combat2:execute(creature, variant)
end
and my problem is I would like to let my character say Final then Flaaash (0.2seconds after I casted the spell) + the actuall animation/spell
and currently I tried it like this:
Code:
addEvent(function() combat:setParameter(COMBAT_PARAM_EFFECT, effect[creature:getDirection()]) return combat:execute(creature, variant) end, 200)
addEvent(function() combat2:setParameter(COMBAT_PARAM_EFFECT, effect2[creature:getDirection()]) return combat2:execute(creature, variant) end, 200)
It actually does exactly what I said above and how I want it BUT when I run and cast the spell it shoots exactly in the opposite direction for example
I run west it shoots east I run north it shoots south,only when I stand its 100% accurate.
Anybody knows how to fix that little issue?
Thanks in Advance
Kind Regards