Ir para conteúdo

Erro Spell


Huntre

Posts Recomendados

Bom eu add um script de spell aonde o script certo eu modifiquei para que tivesse uma animation, bom funciona so que aparece um erro gostaria de saber como arrumar esse erro, e outra queria que essa spell o hit fosse pelo level do player alguem pode me ajudar nisso

Script Certo

 

[spoiler=Certo]

local acombat1 = createCombatObject()
local acombat2 = createCombatObject()
local acombat3 = createCombatObject()
local acombat4 = createCombatObject()
local acombat5 = createCombatObject()
local acombat6 = createCombatObject()

local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 207)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -0.3, 0, -0.4, 0)


local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat2, COMBAT_PARAM_EFFECT, 207)
setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -0.3, 0, -0.4, 0)

local combat3 = createCombatObject()
setCombatParam(combat3, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat3, COMBAT_PARAM_EFFECT, 207)
setCombatFormula(combat3, COMBAT_FORMULA_LEVELMAGIC, -0.3, 0, -0.4, 0)


local combat4 = createCombatObject()
setCombatParam(combat4, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat4, COMBAT_PARAM_EFFECT, 207)
setCombatFormula(combat4, COMBAT_FORMULA_LEVELMAGIC, -0.3, 0, -0.4, 0)

local combat5 = createCombatObject()
setCombatParam(combat5, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat5, COMBAT_PARAM_EFFECT, 207)
setCombatFormula(combat5, COMBAT_FORMULA_LEVELMAGIC, -0.3, 0, -0.4, 0)

local combat6 = createCombatObject()
setCombatParam(combat6, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
set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0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
}

local area1 = createCombatArea(arr1)
local area2 = createCombatArea(arr2)
local area3 = createCombatArea(arr3)
local area4 = createCombatArea(arr4)
local area5 = createCombatArea(arr5)
local area6 = createCombatArea(arr6)
setCombatArea(acombat1, area1)
setCombatArea(acombat2, area2)
setCombatArea(acombat3, area3)
setCombatArea(acombat4, area4)
setCombatArea(acombat5, area5)
setCombatArea(acombat6, area6)

function onTargetTile(cid, pos)
   doCombat(cid,combat1,positionToVariant(pos))
end

function onTargetTile2(cid, pos)
   doCombat(cid,combat2,positionToVariant(pos))
end

function onTargetTile3(cid, pos)
   doCombat(cid,combat3,positionToVariant(pos))
end

function onTargetTile4(cid, pos)
   doCombat(cid,combat4,positionToVariant(pos))
end

function onTargetTile5(cid, pos)
   doCombat(cid,combat5,positionToVariant(pos))
end

function onTargetTile6(cid, pos)
   doCombat(cid,combat6,positionToVariant(pos))
end

setCombatCallback(acombat1, CALLBACK_PARAM_TARGETTILE, "onTargetTile")

setCombatCallback(acombat2, CALLBACK_PARAM_TARGETTILE, "onTargetTile2")


setCombatCallback(acombat3, CALLBACK_PARAM_TARGETTILE, "onTargetTile3")


setCombatCallback(acombat4, CALLBACK_PARAM_TARGETTILE, "onTargetTile4")


setCombatCallback(acombat5, CALLBACK_PARAM_TARGETTILE, "onTargetTile5")


setCombatCallback(acombat6, CALLBACK_PARAM_TARGETTILE, "onTargetTile6")

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

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

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

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

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

local function onCastSpell6(parameters)
   doCombat(parameters.cid, acombat6, parameters.var)
end


function onCastSpell(cid, var)
doCreatureSay(cid,"Electric", TALKTYPE_ORANGE_1) 
local parameters = { cid = cid, var = var}
addEvent(onCastSpell1, 100, parameters)
addEvent(onCastSpell2, 500, parameters)
addEvent(onCastSpell3, 900, parameters)
addEvent(onCastSpell4, 1300, parameters)
addEvent(onCastSpell5, 1700, parameters)
addEvent(onCastSpell6, 2100, parameters)

end

 

Script modificado

 

[spoiler=Modificado]

local electabuzz = {lookType = 939}
local shinyelectivire = {lookType = 938}
local electivire = {lookType = 937}
local acombat1 = createCombatObject()
local acombat2 = createCombatObject()
local acombat3 = createCombatObject()
local acombat4 = createCombatObject()
local acombat5 = createCombatObject()
local acombat6 = createCombatObject()

local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 207)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -0.3, 0, -0.4, 0)


local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat2, COMBAT_PARAM_EFFECT, 207)
setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -0.3, 0, -0.4, 0)

local combat3 = createCombatObject()
setCombatParam(combat3, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat3, COMBAT_PARAM_EFFECT, 207)
setCombatFormula(combat3, COMBAT_FORMULA_LEVELMAGIC, -0.3, 0, -0.4, 0)


local combat4 = createCombatObject()
setCombatParam(combat4, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat4, COMBAT_PARAM_EFFECT, 207)
setCombatFormula(combat4, COMBAT_FORMULA_LEVELMAGIC, -0.3, 0, -0.4, 0)

local combat5 = createCombatObject()
setCombatParam(combat5, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat5, COMBAT_PARAM_EFFECT, 207)
setCombatFormula(combat5, COMBAT_FORMULA_LEVELMAGIC, -0.3, 0, -0.4, 0)

local combat6 = createCombatObject()
setCombatParam(combat6, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat6, COMBAT_PARAM_EFFECT, 207)
setCombatFormula(combat6, COMBAT_FORMULA_LEVELMAGIC, -0.3, 0, -0.4, 0)

arr1 = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
}

arr2 = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0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0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
}

arr6 = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
}

local area1 = createCombatArea(arr1)
local area2 = createCombatArea(arr2)
local area3 = createCombatArea(arr3)
local area4 = createCombatArea(arr4)
local area5 = createCombatArea(arr5)
local area6 = createCombatArea(arr6)
setCombatArea(acombat1, area1)
setCombatArea(acombat2, area2)
setCombatArea(acombat3, area3)
setCombatArea(acombat4, area4)
setCombatArea(acombat5, area5)
setCombatArea(acombat6, area6)

function onTargetTile(cid, pos)
   doCombat(cid,combat1,positionToVariant(pos))
end

function onTargetTile2(cid, pos)
   doCombat(cid,combat2,positionToVariant(pos))
end

function onTargetTile3(cid, pos)
   doCombat(cid,combat3,positionToVariant(pos))
end

function onTargetTile4(cid, pos)
   doCombat(cid,combat4,positionToVariant(pos))
end

function onTargetTile5(cid, pos)
   doCombat(cid,combat5,positionToVariant(pos))
end

function onTargetTile6(cid, pos)
   doCombat(cid,combat6,positionToVariant(pos))
end

setCombatCallback(acombat1, CALLBACK_PARAM_TARGETTILE, "onTargetTile")

setCombatCallback(acombat2, CALLBACK_PARAM_TARGETTILE, "onTargetTile2")


setCombatCallback(acombat3, CALLBACK_PARAM_TARGETTILE, "onTargetTile3")


setCombatCallback(acombat4, CALLBACK_PARAM_TARGETTILE, "onTargetTile4")


setCombatCallback(acombat5, CALLBACK_PARAM_TARGETTILE, "onTargetTile5")


setCombatCallback(acombat6, CALLBACK_PARAM_TARGETTILE, "onTargetTile6")

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

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

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

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

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

local function onCastSpell6(parameters)
   doCombat(parameters.cid, acombat6, parameters.var)
end


function onCastSpell(cid, var)
if(getCreatureCondition(getCreatureMaster(cid), CONDITION_INFIGHT) == FALSE)then return true end
if getCreatureCondition(cid, CONDITION_OUTFIT) == true then
return true
end
doCreatureSay(cid, "Electric", TALKTYPE_MONSTER)

if getCreatureOutfit(cid).lookType == 281 then
doSetCreatureOutfit(cid, electabuzz, -1)
doChangeSpeed(cid, -1000)
damage = (getPlayerLevel(getCreatureMaster(cid)) * 5) + 200
elseif getCreatureOutfit(cid).lookType == 920 then
doSetCreatureOutfit(cid, electivire, -1)
doChangeSpeed(cid, -1000)
damage = (getPlayerLevel(getCreatureMaster(cid)) * 5) + 200
elseif getCreatureOutfit(cid).lookType == 936 then
doSetCreatureOutfit(cid, shinyelectivire, -1)
doChangeSpeed(cid, -1000)
damage = (getPlayerLevel(getCreatureMaster(cid)) * 5) + 200
end
doCreatureSay(cid,"Electric", TALKTYPE_ORANGE_1) 
local function voltar(params)
if isCreature(params.cid) then
doRemoveCondition(params.cid, CONDITION_OUTFIT)
doChangeSpeed(cid, 1000)
doRemoveCondition(getCreatureMaster(cid),CONDITION_INFIGHT)
end
end
local vezes = 2
local delay = 600 -- não mexe
for i = 1, vezes do
addEvent(damage, delay*i, {cid = cid, dmg = dmg})
end
addEvent(voltar, 800*vezes, {cid = cid})
local parameters = { cid = cid, var = var}
addEvent(onCastSpell1, 100, parameters)
addEvent(onCastSpell2, 500, parameters)
addEvent(onCastSpell3, 900, parameters)
addEvent(onCastSpell4, 1300, parameters)
addEvent(onCastSpell5, 1700, parameters)
addEvent(onCastSpell6, 2100, parameters)


end

 

 

ERRO que aparece

 

[spoiler=Erro]

[21/10/2011 14:07:16] [Error - Spell Interface] 
[21/10/2011 14:07:16] data/spells/scripts/poke/electric.lua:onCastSpell
[21/10/2011 14:07:16] Description: 
[21/10/2011 14:07:16] (luaAddEvent) Callback parameter should be a function.

 

 

Obrigado

Link para o comentário
Compartilhar em outros sites

Pra te ser sincero nem li o script, geralmente são erros bobos e achei que aquele tuto ia resolver, bom mais já que não foi o caso vou dar uma lida e ver se acho o erro, dai se ainda não tiver sido solucionada, eu volto aqui e te ajudo.

Falowz ai amigo, abração

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...