TFS 1.3
Guys, I need a little help with this spell I'm trying to create.
I'm trying to make the effect to appear on the target with the position x,y,z, but it keep appearing this error:
I also tried:
Guys, I need a little help with this spell I'm trying to create.
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, 47)
setCombatArea(combat0_Brush,createCombatArea({{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 1, 1, 1, 0, 0},
{0, 0, 1, 3, 1, 0, 0},
{0, 0, 1, 1, 1, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0}}))
function onGetFormulaValues(player, level, magicLevel)
local min = ((level / 5) + (magicLevel * 1.4) + 8)
local max = ((level / 5) + (magicLevel * 2.2) + 14)
return -min, -max
end
combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
function onCastSpell(creature, cid, variant)
local parameters = { cid = cid, var = var}
local position = {x=getTargetPosition(cid).x, y=getTargetPosition(cid).y, z=getTargetPosition(cid).z}
doSendMagicEffect(position, 79)
return combat:execute(creature, cid, variant)
end
I'm trying to make the effect to appear on the target with the position x,y,z, but it keep appearing this error:
Lua Script Error: [Spell Interface]
data/spells/scripts/attack/explosivaeelectricaaranea.luanCastSpell
data/spells/scripts/attack/explosivaeelectricaaranea.lua:23: attempt to call global 'getTargetPosition' (a nil value)
stack traceback:
[C]: in function 'getTargetPosition'
data/spells/scripts/attack/explosivaeelectricaaranea.lua:23: in function <data/spells/scripts/attack/explosivaeelectricaaranea.lua:20>
I also tried:
Lua:
local parameters = { cid = cid, var = var}
local position = {x=getCreaturePosition(cid).x, y=getCreaturePosition(cid).y, z=getCreaturePosition(cid).z}
doSendMagicEffect(position, 79)