Ir para conteúdo
  • 0

Ajuda Em Spell, Pequeno Bug


craigmabbit

Pergunta

fiz uma função pra a spell só funciona com certo item, mas ela funciona com o item e sem o item

 

alguem pode me ajudar, ai vai o script

eu achei o bug no doCombat, mas como eu usei docombat em addevent, não sei como fazer pra funcionar

 

ars1 = {

 

{{1,2,0},

{0,0,0},

{0,0,}},

 

{{0,3,0},

{0,0,0},

{0,0,0}},

 

{{0,2,1},

{0,0,0},

{0,0,0}},

 

}

 

ars2 = {

 

{{0,2,1},

{0,0,0},

{0,0,0}},

 

{{0,3,0},

{0,0,0},

{0,0,0}},

 

{{1,2,0},

{0,0,0},

{0,0,0}},

 

}

 

ars3 = {

 

{{1,2,0},

{0,0,0},

{0,0,0}},

 

{{0,3,0},

{0,0,0},

{0,0,0}},

 

{{0,2,1},

{0,0,0},

{0,0,0}},

 

 

{{0,2,0},

{0,0,1},

{0,0,0}},

 

{{0,2,0},

{0,0,0},

{0,0,1}},

 

}

 

ars4 = {

 

{{0,2,1},

{0,0,0},

{0,0,0}},

 

{{0,3,0},

{0,0,0},

{0,0,0}},

 

{{1,2,0},

{0,0,0},

{0,0,0}},

 

 

{{0,2,0},

{1,0,0},

{0,0,0}},

 

{{0,2,0},

{0,0,0},

{1,0,0}},

 

}

 

ars5 = {

 

{{0,2,1},

{0,0,0},

{0,0,0}},

 

{{0,3,0},

{0,0,0},

{0,0,0}},

 

{{1,2,0},

{0,0,0},

{0,0,0}},

 

 

{{0,2,0},

{1,0,0},

{0,0,0}},

 

{{0,2,0},

{0,0,0},

{1,0,0}},

 

{{0,2,0},

{0,0,0},

{0,1,0}},

 

{{0,2,0},

{0,0,0},

{0,0,1}},

 

{{0,2,0},

{0,0,1},

{0,0,0}},

 

}

 

 

 

ars6 = {

 

{{0,2,0},

{0,0,0},

{0,1,0}},

 

{{0,2,0},

{0,0,0},

{0,0,1}},

 

{{0,2,0},

{0,0,0},

{0,0,0}},

 

 

{{0,2,0},

{0,0,1},

{0,0,0}},

 

{{0,2,1},

{0,0,0},

{0,0,0}},

 

{{0,3,0},

{0,0,0},

{0,0,0}},

 

{{1,2,0},

{0,0,0},

{0,0,0}},

 

{{0,2,0},

{1,0,0},

{0,0,0}},

 

}

 

 

 

 

 

combats1 = createCombatObjects(#ars1)

combats2 = createCombatObjects(#ars2)

combats3 = createCombatObjects(#ars3)

combats4 = createCombatObjects(#ars4)

combats5 = createCombatObjects(#ars5)

combats6 = createCombatObjects(#ars6)

 

for x=1,#combats1 do

setCombatParam(combats1[x], COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)

setCombatParam(combats1[x], COMBAT_PARAM_EFFECT, 10)

setCombatFormula(combats1[x], COMBAT_FORMULA_LEVELMAGIC, -0.1, -2, -0.3, -4)

setCombatArea(combats1[x], createCombatArea(ars1[x]))

end

 

for x=1,#combats2 do

setCombatParam(combats2[x], COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)

setCombatParam(combats2[x], COMBAT_PARAM_EFFECT, 10)

setCombatFormula(combats2[x], COMBAT_FORMULA_LEVELMAGIC, -0.1, -2, -0.3, -4)

setCombatArea(combats2[x], createCombatArea(ars2[x]))

end

 

for x=1,#combats3 do

setCombatParam(combats3[x], COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)

setCombatParam(combats3[x], COMBAT_PARAM_EFFECT, 10)

setCombatFormula(combats3[x], COMBAT_FORMULA_LEVELMAGIC, -0.1, -2, -0.3, -4)

setCombatArea(combats3[x], createCombatArea(ars3[x]))

end

 

for x=1,#combats4 do

setCombatParam(combats4[x], COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)

setCombatParam(combats4[x], COMBAT_PARAM_EFFECT, 10)

setCombatFormula(combats4[x], COMBAT_FORMULA_LEVELMAGIC, -0.1, -2, -0.3, -4)

setCombatArea(combats4[x], createCombatArea(ars5[x]))

end

 

for x=1,#combats5 do

setCombatParam(combats5[x], COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)

setCombatParam(combats5[x], COMBAT_PARAM_EFFECT, 10)

setCombatFormula(combats5[x], COMBAT_FORMULA_LEVELMAGIC, -0.1, -2, -0.3, -4)

setCombatArea(combats5[x], createCombatArea(ars5[x]))

end

 

for x=1,#combats6 do

setCombatParam(combats6[x], COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)

setCombatParam(combats6[x], COMBAT_PARAM_EFFECT, 10)

setCombatFormula(combats6[x], COMBAT_FORMULA_LEVELMAGIC, -0.1, -2, -0.3, -4)

setCombatArea(combats6[x], createCombatArea(ars6[x]))

end

 

combeaiats = {combats1, combats2, combats3, combats4, combats5, combats6}

 

function onCastSpell(cid, var)

if getPlayerItemCount(cid,4684) <= 1 then

doPlayerSendTextMessage(cid,27,"You don't have the item for use spell.")

end

if hasWater(cid,3) then

end

local v = getPlayerStorageValue(cid, 9800)

if v == -1 then v = 1 end

local xit = combeaiats[v]

for x=1,#xit do

addEvent(doCombat, 50*x, cid, xit[x], var)

end

setPlayerStorageValue(cid, 9800, (v%#combeaiats)+1)

doSendAnimatedText(getThingPos(cid), "Tornado", 129)

return FALSE

end

 

Link para o comentário
Compartilhar em outros sites

4 respostass a esta questão

Posts Recomendados

  • 0

mechi só no fimzinho

 

function onCastSpell(cid, var)
if getPlayerItemCount(cid,4684) <= 1 then
 doPlayerSendTextMessage(cid,27,"You don't have the item for use spell.")
 return false
end

if not hasWater(cid,3) then
 return false
end

local v = getPlayerStorageValue(cid, 9800)

if v == -1 then
 v = 1
end


 local xit = combeaiats[v]
 for x=1,#xit do
  addEvent(doCombat, 50*x, cid, xit[x], var)
 end
setPlayerStorageValue(cid, 9800, (v%#combeaiats)+1)
doSendAnimatedText(getThingPos(cid), "Tornado", 129)
return true
end

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...