hello guys, hey can u help me in this fcking spells?
its hits 8 times, but dont teleport to monster and in console say this:
help plz? (rep++)
Code:
local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 0)
setCombatParam(combat1, COMBAT_PARAM_DISTANCEEFFECT, 3)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -4.0, -0, -4.1, 0)
local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat2, COMBAT_PARAM_EFFECT, 0)
setCombatParam(combat2, COMBAT_PARAM_DISTANCEEFFECT, 3)
setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -4.0, -0, -4.1, 0)
local combat3 = createCombatObject()
setCombatParam(combat3, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat3, COMBAT_PARAM_EFFECT, 0)
setCombatParam(combat3, COMBAT_PARAM_DISTANCEEFFECT, 3)
setCombatFormula(combat3, COMBAT_FORMULA_LEVELMAGIC, -4.0, -0, -4.1, 0)
local combat4 = createCombatObject()
setCombatParam(combat4, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat4, COMBAT_PARAM_EFFECT, 0)
setCombatParam(combat4, COMBAT_PARAM_DISTANCEEFFECT, 3)
setCombatFormula(combat4, COMBAT_FORMULA_LEVELMAGIC, -4.0, -0, -4.1, 0)
local combat5 = createCombatObject()
setCombatParam(combat5, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat5, COMBAT_PARAM_EFFECT, 0)
setCombatParam(combat5, COMBAT_PARAM_DISTANCEEFFECT, 3)
setCombatFormula(combat5, COMBAT_FORMULA_LEVELMAGIC, -4.0, -0, -4.1, 0)
local combat6 = createCombatObject()
setCombatParam(combat6, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat6, COMBAT_PARAM_EFFECT, 0)
setCombatParam(combat6, COMBAT_PARAM_DISTANCEEFFECT, 3)
setCombatFormula(combat6, COMBAT_FORMULA_LEVELMAGIC, -4.0, -0, -4.1, 0)
local combat7 = createCombatObject()
setCombatParam(combat7, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat7, COMBAT_PARAM_EFFECT, 0)
setCombatParam(combat7, COMBAT_PARAM_DISTANCEEFFECT, 3)
setCombatFormula(combat7, COMBAT_FORMULA_LEVELMAGIC, -4.0, -0, -4.1, 0)
local combat8 = createCombatObject()
setCombatParam(combat8, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat8, COMBAT_PARAM_EFFECT, 0)
setCombatParam(combat8, COMBAT_PARAM_DISTANCEEFFECT, 3)
setCombatFormula(combat8, COMBAT_FORMULA_LEVELMAGIC, -4.0, -0, -4.1, 0)
local combat9 = createCombatObject()
setCombatParam(combat9, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat9, COMBAT_PARAM_EFFECT, 0)
setCombatParam(combat9, COMBAT_PARAM_DISTANCEEFFECT, 3)
setCombatFormula(combat9, COMBAT_FORMULA_LEVELMAGIC, -4.0, -0, -4.1, 0)
local function onCastSpell1(parameters)
doCombat(parameters.cid, combat1, parameters.var)
end
local function onCastSpell2(parameters)
doCombat(parameters.cid, combat2, parameters.var)
end
local function onCastSpell3(parameters)
doCombat(parameters.cid, combat3, parameters.var)
end
local function onCastSpell4(parameters)
doCombat(parameters.cid, combat4, parameters.var)
end
local function onCastSpell5(parameters)
doCombat(parameters.cid, combat5, parameters.var)
end
local function onCastSpell6(parameters)
doCombat(parameters.cid, combat6, parameters.var)
end
local function onCastSpell7(parameters)
doCombat(parameters.cid, combat7, parameters.var)
end
local function onCastSpell8(parameters)
doCombat(parameters.cid, combat8, parameters.var)
end
local function onCastSpell9(parameters)
victim = getCreatureTarget(cid)
victimpos = getCreaturePosition(victim)
playerpos = getCreaturePosition(cid)
if getPlayerLookDir(cid) == 0 then --NORTH
local pos = {x = victimpos.x, y = victimpos.y + 1, z = victimpos.z}
if getTilePzInfo(pos) == 0 then
doSendMagicEffect(playerpos, 10)
doTeleportThing(cid, pos, TRUE)
doSendMagicEffect(pos, 10)
doCombat(parameters.cid, combat9, parameters.var)
else
doPlayerSendCancel(cid, "You can not teleport to a pz.")
end
end
if getPlayerLookDir(cid) == 2 then --SOUTH
local pos = {x = victimpos.x, y = victimpos.y - 1, z = victimpos.z}
if getTilePzInfo(pos) == 0 then
doSendMagicEffect(playerpos, 10)
doTeleportThing(cid, pos, TRUE)
doSendMagicEffect(pos, 10)
doCombat(parameters.cid, combat9, parameters.var)
else
doPlayerSendCancel(cid, "You can not teleport to a pz.")
end
end
if getPlayerLookDir(cid) == 1 then --EAST
local pos = {x = victimpos.x - 1, y = victimpos.y, z = victimpos.z}
if getTilePzInfo(pos) == 0 then
doSendMagicEffect(playerpos, 10)
doTeleportThing(cid, pos, TRUE)
doSendMagicEffect(pos, 10)
doCombat(parameters.cid, combat9, parameters.var)
else
doPlayerSendCancel(cid, "You can not teleport to a pz.")
end
end
if getPlayerLookDir(cid) == 3 then --WEST
local pos = {x = victimpos.x + 1, y = victimpos.y, z = victimpos.z}
if getTilePzInfo(pos) == 0 then
doSendMagicEffect(playerpos, 10)
doTeleportThing(cid, pos, TRUE)
doSendMagicEffect(pos, 10)
doCombat(parameters.cid, combat9, parameters.var)
else
doPlayerSendCancel(cid, "You can not teleport to a pz.")
end
end
end
function onCastSpell(cid, var)
local parameters = { cid = cid, var = var, combat1 = combat1, combat2 = combat2, combat3 = combat3, combat4 = combat4, combat5 = combat5, combat6 = combat6, combat7 = combat7, combat8 = combat8 }
addEvent(onCastSpell1, 1000, parameters)
addEvent(onCastSpell2, 1200, parameters)
addEvent(onCastSpell3, 1400, parameters)
addEvent(onCastSpell4, 1600, parameters)
addEvent(onCastSpell5, 1800, parameters)
addEvent(onCastSpell6, 2000, parameters)
addEvent(onCastSpell7, 2200, parameters)
addEvent(onCastSpell8, 2400, parameters)
addEvent(onCastSpell9, 2600, parameters)
return true
end
its hits 8 times, but dont teleport to monster and in console say this:
Code:
[18/09/2010 16:45:24] [Error - Spell Interface]
[18/09/2010 16:45:24] In a timer event called from:
[18/09/2010 16:45:24] data/spells/scripts/test.lua:onCastSpell
[18/09/2010 16:45:24] Description:
[18/09/2010 16:45:24] (luaGetCreatureTarget) Creature not found
[18/09/2010 16:45:24] [Error - Spell Interface]
[18/09/2010 16:45:24] In a timer event called from:
[18/09/2010 16:45:24] data/spells/scripts/test.lua:onCastSpell
[18/09/2010 16:45:24] Description:
[18/09/2010 16:45:24] (luaGetThingPosition) Thing not found
[18/09/2010 16:45:24] [Error - Spell Interface]
[18/09/2010 16:45:25] In a timer event called from:
[18/09/2010 16:45:25] data/spells/scripts/test.lua:onCastSpell
[18/09/2010 16:45:25] Description:
[18/09/2010 16:45:25] (luaGetThingPosition) Thing not found
[18/09/2010 16:45:25] [Error - Spell Interface]
[18/09/2010 16:45:25] In a timer event called from:
[18/09/2010 16:45:25] data/spells/scripts/test.lua:onCastSpell
[18/09/2010 16:45:25] Description:
[18/09/2010 16:45:25] (luaGetCreatureLookDirection) Creature not found
[18/09/2010 16:45:25] [Error - Spell Interface]
[18/09/2010 16:45:25] In a timer event called from:
[18/09/2010 16:45:25] data/spells/scripts/test.lua:onCastSpell
[18/09/2010 16:45:25] Description:
[18/09/2010 16:45:25] (luaGetCreatureLookDirection) Creature not found
[18/09/2010 16:45:25] [Error - Spell Interface]
[18/09/2010 16:45:25] In a timer event called from:
[18/09/2010 16:45:25] data/spells/scripts/test.lua:onCastSpell
[18/09/2010 16:45:25] Description:
[18/09/2010 16:45:25] (luaGetCreatureLookDirection) Creature not found
[18/09/2010 16:45:25] [Error - Spell Interface]
[18/09/2010 16:45:25] In a timer event called from:
[18/09/2010 16:45:25] data/spells/scripts/test.lua:onCastSpell
[18/09/2010 16:45:25] Description:
[18/09/2010 16:45:25] (luaGetCreatureLookDirection) Creature not found
help plz? (rep++)