DU
pedido

Adaptar spell

Por Duuhzinhow, 06 de jul. de 2015 em Archived

spell
script
7
1.1k
DuuhzinhowD
06 de julho de 2015 às 22:42

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

BrunoB
08 de julho de 2015 às 11:22

Você já tentou usá-la? Da algum erro?

DuuhzinhowD
08 de julho de 2015 às 13:15

Você já tentou usá-la? Da algum erro?

 

ja tentei sim, nao funcionou.

 

"-No such file directory"... é algo assim o erro que da no distro

08 de julho de 2015 às 13:20

Poste seu spells.xml, e me diga em qual diretorio ta esse arquivo ai da spell

BrunoB
08 de julho de 2015 às 13:22

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

Como você está fazendo a parte do xml?

DuuhzinhowD
08 de julho de 2015 às 13:43

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

 

1 mês depois...
BrunoB
03 de agosto de 2015 às 11:50

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.