Ir para conteúdo

Adaptar spell


Duuhzinhow

Posts Recomendados

Galera, tem como alguem adaptar esse script de spell para a versao 8.6 TFS 0.4? obrigado!

 

-- Level 1 - 10 --

--.::.CONFIG.::.--
local feared_time = 2.0
--.::.CONFIG.::.--

setCombatParam(combat0, COMBAT_PARAM_TARGETCASTERORTOPMOST, true)
setCombatParam(combat0, COMBAT_PARAM_EFFECT, 62)

local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
setCombatParam(combat1, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -1, -10, -1, -20, 5, 5, 1.4, 2.1)

local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat2, COMBAT_PARAM_EFFECT, 59)
setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -1, -10, -1, -20, 5, 5, 1.4, 2.1)

local combat3 = createCombatObject()
setCombatParam(combat3, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat3, COMBAT_PARAM_EFFECT, 59)
setCombatFormula(combat3, COMBAT_FORMULA_LEVELMAGIC, -1, -10, -1, -20, 5, 5, 1.4, 2.1)

local combat4 = createCombatObject()
setCombatParam(combat4, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat4, COMBAT_PARAM_EFFECT, 59)
setCombatFormula(combat4, COMBAT_FORMULA_LEVELMAGIC, -1, -10, -1, -20, 5, 5, 1.4, 2.1)

local combat5 = createCombatObject()
setCombatParam(combat5, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat5, COMBAT_PARAM_EFFECT, 59)
setCombatFormula(combat5, COMBAT_FORMULA_LEVELMAGIC, -1, -10, -1, -20, 5, 5, 1.4, 2.1)

local deathpowder = createConditionObject(CONDITION_CURSED)
setConditionParam(deathpowder, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(deathpowder, 10, 1000, -100)
setCombatCondition(combat5, deathpowder)

local function onCastSpell0(parameters)
doCombat(parameters.cid, parameters.combat1, parameters.var)
end

local function onCastSpell1(parameters)
doCombat(parameters.cid, parameters.combat1, parameters.var)
end

local function onCastSpell2(parameters)
doCombat(parameters.cid, parameters.combat2, parameters.var)
end

local function onCastSpell3(parameters)
doCombat(parameters.cid, parameters.combat3, parameters.var)
end

local function onCastSpell4(parameters)
doCombat(parameters.cid, parameters.combat4, parameters.var)
end

local function onCastSpell5(parameters)
doCombat(parameters.cid, parameters.combat5, parameters.var)
end

local function fear(cid)
local cpos = getCreaturePosition(cid)
local dir = {}
if queryTileAddThing(cid, {x=cpos.x,y=cpos.y-1,z=cpos.z}) == 1 then
table.insert(dir, NORTH)
end
if queryTileAddThing(cid, {x=cpos.x-1,y=cpos.y,z=cpos.z}) == 1 then
table.insert(dir, WEST)
end
if queryTileAddThing(cid, {x=cpos.x,y=cpos.y+1,z=cpos.z}) == 1 then
table.insert(dir, SOUTH)
end
if queryTileAddThing(cid, {x=cpos.x+1,y=cpos.y,z=cpos.z}) == 1 then
table.insert(dir, EAST)
end
if #dir > 0 then
doMoveCreature(cid, dir[math.random(1,#dir)])
end
end

local function allowMove(cid, target)
if isPlayer(cid) then
doCreatureSetNoMove(target, false)
end
end

function onCastSpell(cid, var)
if exhaustion.check(cid, 58743) == false then
exhaustion.set(cid, 58743, 20)

local parameters = {cid = cid, var = var, combat1 = combat1, combat2 = combat2, combat3 = combat3, combat4 = combat4, combat5 = combat5}
addEvent(onCastSpell1, 0000, parameters)
addEvent(onCastSpell2, 500, parameters)
addEvent(onCastSpell3, 1000, parameters)
addEvent(onCastSpell4, 1500, parameters)
addEvent(onCastSpell5, 2000, parameters)
local target = getCreatureTarget(cid)
doCreatureSetNoMove(target, true)
addEvent(fear, 0, target)
addEvent(fear, 500, target)
addEvent(fear, 1000, target)
addEvent(fear, 1500, target)
addEvent(fear, 2000, target)
addEvent(fear, 2500, target)
addEvent(allowMove, (feared_time*1000), cid, target)
else
doPlayerSendCancel(cid, "Cooldown for Bite is " ..exhaustion.get(cid, 58743).." seconds")
return false
end
return true
end

Link para o comentário
Compartilhar em outros sites

O problema pode ser no xml, onde você aponta qual script a spell vai usar.

Como você está fazendo a parte do xml?

 

certo, realmente foi um descuido na hora de formar a tag, a magia esta funcionando, porém esta dando alguns erros... se puder me ajudar

 

 

[Error - Spell Interface]

In a timer event called from:

data/spells/scripts/novas/fear.lua:onCastSpell

Description:

(luaDoCreatureSetNoMove) Creature not found

 

[Error - Spell Interface]

In a timer event called from:

data/spells/scripts/novas/fear.lua:onCastSpell

Description:

(luaGetThingPosition) Thing not found

 

[Error - Spell Interface]

In a timer event called from:

data/spells/scripts/novas/fear.lua:onCastSpell

Description:

data/spells/scripts/novas/fear.lua:68: attempt to index local 'cpos' (a boolean

value)

stack traceback:

data/spells/scripts/novas/fear.lua:68: in function <data/spells/scripts/

novas/fear.lua:65>

 

[Error - Spell Interface]

In a timer event called from:

data/spells/scripts/novas/fear.lua:onCastSpell

Description:

(luaGetThingPosition) Thing not found

 

[Error - Spell Interface]

In a timer event called from:

data/spells/scripts/novas/fear.lua:onCastSpell

Description:

data/spells/scripts/novas/fear.lua:68: attempt to index local 'cpos' (a boolean

value)

stack traceback:

data/spells/scripts/novas/fear.lua:68: in function <data/spells/scripts/

novas/fear.lua:65>

 

[Error - Spell Interface]

data/spells/scripts/novas/fear.lua:onCastSpell

Description:

(luaDoCreatureSetNoMove) Creature not found

 

[Error - Spell Interface]

In a timer event called from:

data/spells/scripts/novas/fear.lua:onCastSpell

Description:

(luaGetThingPosition) Thing not found

 

[Error - Spell Interface]

In a timer event called from:

data/spells/scripts/novas/fear.lua:onCastSpell

Description:

data/spells/scripts/novas/fear.lua:68: attempt to index local 'cpos' (a boolean

value)

stack traceback:

data/spells/scripts/novas/fear.lua:68: in function <data/spells/scripts/

novas/fear.lua:65>

 

[Error - Spell Interface]

In a timer event called from:

data/spells/scripts/novas/fear.lua:onCastSpell

Description:

(luaGetThingPosition) Thing not found

 

[Error - Spell Interface]

In a timer event called from:

data/spells/scripts/novas/fear.lua:onCastSpell

Description:

data/spells/scripts/novas/fear.lua:68: attempt to index local 'cpos' (a boolean

value)

stack traceback:

data/spells/scripts/novas/fear.lua:68: in function <data/spells/scripts/

novas/fear.lua:65>

 

[Error - Spell Interface]

In a timer event called from:

data/spells/scripts/novas/fear.lua:onCastSpell

Description:

(luaGetThingPosition) Thing not found

 

[Error - Spell Interface]

In a timer event called from:

data/spells/scripts/novas/fear.lua:onCastSpell

Description:

data/spells/scripts/novas/fear.lua:68: attempt to index local 'cpos' (a boolean

value)

stack traceback:

data/spells/scripts/novas/fear.lua:68: in function <data/spells/scripts/

novas/fear.lua:65>

 

[Error - Spell Interface]

In a timer event called from:

data/spells/scripts/novas/fear.lua:onCastSpell

Description:

(luaGetThingPosition) Thing not found

 

[Error - Spell Interface]

In a timer event called from:

data/spells/scripts/novas/fear.lua:onCastSpell

Description:

data/spells/scripts/novas/fear.lua:68: attempt to index local 'cpos' (a boolean

value)

stack traceback:

data/spells/scripts/novas/fear.lua:68: in function <data/spells/scripts/

novas/fear.lua:65>

 

[Error - Spell Interface]

In a timer event called from:

data/spells/scripts/novas/fear.lua:onCastSpell

Description:

(luaDoCreatureSetNoMove) Creature not found

 

[Error - Spell Interface]

In a timer event called from:

data/spells/scripts/novas/fear.lua:onCastSpell

Description:

(luaGetThingPosition) Thing not found

 

[Error - Spell Interface]

In a timer event called from:

data/spells/scripts/novas/fear.lua:onCastSpell

Description:

data/spells/scripts/novas/fear.lua:68: attempt to index local 'cpos' (a boolean

value)

stack traceback:

data/spells/scripts/novas/fear.lua:68: in function <data/spells/scripts/

novas/fear.lua:65>

 

[Error - Spell Interface]

In a timer event called from:

data/spells/scripts/novas/fear.lua:onCastSpell

Description:

(luaGetThingPosition) Thing not found

 

[Error - Spell Interface]

In a timer event called from:

data/spells/scripts/novas/fear.lua:onCastSpell

Description:

data/spells/scripts/novas/fear.lua:68: attempt to index local 'cpos' (a boolean

value)

stack traceback:

data/spells/scripts/novas/fear.lua:68: in function <data/spells/scripts/

novas/fear.lua:65>

 

[Error - Spell Interface]

data/spells/scripts/novas/fear.lua:onCastSpell

Description:

(luaDoCreatureSetNoMove) Creature not found

 

[Error - Spell Interface]

In a timer event called from:

data/spells/scripts/novas/fear.lua:onCastSpell

Description:

(luaGetThingPosition) Thing not found

 

[Error - Spell Interface]

In a timer event called from:

data/spells/scripts/novas/fear.lua:onCastSpell

Description:

data/spells/scripts/novas/fear.lua:68: attempt to index local 'cpos' (a boolean

value)

stack traceback:

data/spells/scripts/novas/fear.lua:68: in function <data/spells/scripts/

novas/fear.lua:65>

 

[Error - Spell Interface]

In a timer event called from:

data/spells/scripts/novas/fear.lua:onCastSpell

Description:

(luaGetThingPosition) Thing not found

 

[Error - Spell Interface]

In a timer event called from:

data/spells/scripts/novas/fear.lua:onCastSpell

Description:

data/spells/scripts/novas/fear.lua:68: attempt to index local 'cpos' (a boolean

value)

stack traceback:

data/spells/scripts/novas/fear.lua:68: in function <data/spells/scripts/

novas/fear.lua:65>

 

[Error - Spell Interface]

In a timer event called from:

data/spells/scripts/novas/fear.lua:onCastSpell

Description:

(luaGetThingPosition) Thing not found

 

Link para o comentário
Compartilhar em outros sites

  • 4 weeks later...

O tópico foi fechado e movido para lixeira por estar inativo a mais de 10 dias. Caso seja preciso reabrir o mesmo, favor entrar em contato com a equipe.

Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...