Ir para conteúdo

[ Resolvido ][Spell] Bug Na Magia Criada


ymmotthep

Posts Recomendados

Protocolo: 8.54

Server: SQL

Mapa: Alissow

Tipo: TFS

 

Gente, eu criei essa magia:

local scom1 = createCombatObject()

local scom2 = createCombatObject()

local scom3 = createCombatObject()

 

local combat1 = createCombatObject()

setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)

setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, 24)

setAttackFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 2.5, 300, 3.0, 500)

 

local combat2 = createCombatObject()

setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)

setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, 23)

setAttackFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 2.5, 300, 3.0, 500)

 

local combat3 = createCombatObject()

setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)

setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, 22)

setAttackFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 2.5, 300, 3.0, 500)

 

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

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

{0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0},

{0, 0, 0, 1, 0, 2, 0, 1, 0, 0, 0},

{0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0},

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

}

 

arr3 = {

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

{0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0},

{0, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0},

{0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0},

{0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0},

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

}

 

local area1 = createCombatArea(arr1)

local area2 = createCombatArea(arr2)

local area3 = createCombatArea(arr3)

setCombatArea(scom1, area1)

setCombatArea(scom2, area2)

setCombatArea(scom3, area3)

 

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

 

setCombatCallback(scom1, CALLBACK_PARAM_TARGETTILE, "onTargetTile")

setCombatCallback(scom2, CALLBACK_PARAM_TARGETTILE, "onTargetTile2")

setCombatCallback(scom3, CALLBACK_PARAM_TARGETTILE, "onTargetTile3")

 

local function onCastSpell1(parameters)

doCombat(parameters.cid, scom1, parameters.var)

end

 

local function onCastSpell2(parameters)

doCombat(parameters.cid, scom2, parameters.var)

end

 

local function onCastSpell3(parameters)

doCombat(parameters.cid, scom3, parameters.var)

end

 

function onCastSpell(cid, var)

local parameters = { cid = cid, var = var}

addEvent(onCastSpell1, 100, parameters)

addEvent(onCastSpell2, 200, parameters)

addEvent(onCastSpell3, 300, parameters)

 

return TRUE

end

 

e da esse erro:

cmdolha.jpg

Link para o comentário
Compartilhar em outros sites

local scom1 = createCombatObject()

local scom2 = createCombatObject()

local scom3 = createCombatObject()

 

local scom1 = createCombatObject()

setCombatParam(scom1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)

setCombatParam(scom1, COMBAT_PARAM_DISTANCEEFFECT, 24)

setCombatFormula(scom1, COMBAT_FORMULA_LEVELMAGIC, 2.5, 300, 3.0, 500)

 

local scom2 = createCombatObject()

setCombatParam(scom2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)

setCombatParam(scom2, COMBAT_PARAM_DISTANCEEFFECT, 23)

setCombatFormula(scom2, COMBAT_FORMULA_LEVELMAGIC, 2.5, 300, 3.0, 500)

 

local scom3 = createCombatObject()

setCombatParam(scom3, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)

setCombatParam(scom3, COMBAT_PARAM_DISTANCEEFFECT, 22)

setCombatFormula(scom3, COMBAT_FORMULA_LEVELMAGIC, 2.5, 300, 3.0, 500)

 

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

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

{0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0},

{0, 0, 0, 1, 0, 2, 0, 1, 0, 0, 0},

{0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0},

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

}

 

arr3 = {

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

{0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0},

{0, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0},

{0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0},

{0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0},

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

}

 

local area1 = createCombatArea(arr1)

local area2 = createCombatArea(arr2)

local area3 = createCombatArea(arr3)

setCombatArea(scom1, area1)

setCombatArea(scom2, area2)

setCombatArea(scom3, area3)

 

 

local function onCastSpell1(parameters)

doCombat(parameters.cid, scom1, parameters.var)

end

 

local function onCastSpell2(parameters)

doCombat(parameters.cid, scom2, parameters.var)

end

 

local function onCastSpell3(parameters)

doCombat(parameters.cid, scom3, parameters.var)

end

 

function onCastSpell(cid, var)

local parameters = { cid = cid, var = var}

addEvent(onCastSpell1, 100, parameters)

addEvent(onCastSpell2, 200, parameters)

addEvent(onCastSpell3, 300, parameters)

 

return TRUE

end

Oque foi mudado?

 

Retirado:

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

 

setCombatCallback(scom1, CALLBACK_PARAM_TARGETTILE, "onTargetTile")

setCombatCallback(scom2, CALLBACK_PARAM_TARGETTILE, "onTargetTile2")

setCombatCallback(scom3, CALLBACK_PARAM_TARGETTILE, "onTargetTile3")

 

/\ Qual era o objetivo disso?

________________________________

Renomeados os combats combat1,combat2,combat3 para scom1,scom2 e scom3

________________________________

setAttackFormula foi retirado e posto setCombatFormula

________________________________

 

Nessas Partes:

local combat3 = createCombatObject()

setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)

setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, 22)

setAttackFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 2.5, 300, 3.0, 500)

 

As partes em vermelho tem que concorda com a azul

Editado por MatheusMkalo
Link para o comentário
Compartilhar em outros sites

Sim, tentei criar por outra magia que ja está pronta aqui no meu server... Jaja edito esse post dizendo se funfou

 

---EDIT---

Vei, essa explicação pequenina sobre o erro do script que fiz proporcionou muuuuitas futuras magias nos meus futuros servers (H) TANKS

Editado por Ryuuzin
Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...