darkmu
Well-Known Member
I'm trying to convert a spell from player to monster, but when attacking spells, it's not damaging the player, can someone help me?
this attack that came out and the melee
Lua:
-- Delay between animations.
local animationDelay = 200
local combat = {}
-- Frames (1 = Area, 2 = Player, 3 = Player + Self Damaging)
local area = {
{
{0, 1, 0},
{1, 2, 1},
{0, 1, 0}
},
{
{1, 0, 1},
{0, 2, 0},
{1, 0, 1}
},
{
{0, 1, 1, 1, 0},
{1, 0, 0, 0, 1},
{1, 0, 2, 0, 1},
{1, 0, 0, 0, 1},
{0, 1, 1, 1, 0}
}
}
for i = 1, #area do
combat[i] = Combat()
combat[i]:setParameter(COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
combat[i]:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA)
end
for x, _ in ipairs(area) do
combat[x]:setArea(createCombatArea(area[x]))
end
function executeCombat(p, i)
p.combat[i]:execute(p.creature, p.var)
end
function onCastSpell(creature, var)
local p = {creature = creature, var = var, combat = combat}
local min = 300
local max = 500
for i = 1, #area do
combat[i]:setFormula(COMBAT_FORMULA_LEVELMAGIC, 0, -min, 0, -max)
if i == 1 then
combat[i]:execute(creature, var)
else
addEvent(executeCombat, (animationDelay * i) - animationDelay, p, i)
end
end
return true
end
this attack that came out and the melee
Spell - [TFS 1.X] Animated Spells (Dynamic vs Static)
I know spell animations are nothing new, but the way they've been done in the past calls multiple combat objects. This can be cool in how each square / animation has its own damage and the damage is applied with the animation, but this can introduce issues where; if the creature moves to a...
otland.net