Ir para conteúdo
  • 0

Porque a minha magia nao esta dando certo?


tonynamoral

Pergunta

Fala ai galera , eu tentei criar 1 magia aki mais nao saiu sucesso

 

Eu criei uma especie de Elemental Bolts...

 

Sai 2 bolts de cada tipo , tirando POISON , ENERGY E FIRE , SO QUE SÓ ESTÁ FUNCIONANDO A DE FIRE...

 

SE ALGUEM PODER AJUDAR AQUI :)

 

magia :

 

 

 

local combat = createCombatObject()

setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)

setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, 13)

local combat2 = createCombatObject()

setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_POISONDAMAGE)

setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, 1)

local combat3 = createCombatObject()

setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)

setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, 15)

 

function onGetFormulaValues(cid, level, skill, attack, factor)

return -(((skill + 25) / 3) + (level / 5)), -((skill + 25) + (level / 5))

end

 

setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

function onCastSpell(cid, var)

function onEnergy(cid)

doCombat(cid, combat, var)

end

function onPoison(cid)

doCombat(cid, combat2, var)

end

function onFlame(cid)

doCombat(cid, combat3, var)

end

onEnergy(cid)

addEvent(function() onPoison(cid) end,300)

addEvent(function() onFlame(cid) end,600)

addEvent(function() onEnergy(cid) end,900)

addEvent(function() onPoison(cid) end,1200)

addEvent(function() onFlame(cid) end,1500)

end

 

 

 

Link para o comentário
Compartilhar em outros sites

10 respostass a esta questão

Posts Recomendados

  • 0

Não manjo muito de Script ainda, mas tenta agora ..

 

local combat = createCombatObject()

setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)

setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, 13)

local combat2 = createCombatObject()

setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_POISONDAMAGE)

setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, 1)

local combat3 = createCombatObject()

setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)

setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, 15)

 

function onGetFormulaValues(cid, level, skill, attack, factor)

return -(((skill + 25) / 3) + (level / 5)), -((skill + 25) + (level / 5))

end

 

setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

function onCastSpell(cid, var)

function onEnergy(cid)

doCombat(cid, combat, var)

end

function onPoison(cid)

doCombat(cid, combat2, var)

end

function onFire(cid)

doCombat(cid, combat3, var)

end

onEnergy(cid)

addEvent(function() onPoison(cid) end,300)

addEvent(function() onFire(cid) end,600)

addEvent(function() onEnergy(cid) end,900)

addEvent(function() onPoison(cid) end,1200)

addEvent(function() onFire(cid) end,1500)

end

Link para o comentário
Compartilhar em outros sites

  • 0
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, 13)
local combat2 = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_POISONDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, 1)
local combat3 = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, 15)
function onGetFormulaValues(cid, level, skill, attack, factor)
return -(((skill + 25) / 3) + (level / 5)), -((skill + 25) + (level / 5))
end
function onCastSpell(cid, var)
function onEnergy(cid)
setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
doCombat(cid, combat, var)
end
function onPoison(cid)
doCombat(cid, combat2, var)
end
function onFlame(cid)
doCombat(cid, combat3, var)
end
onEnergy(cid)
addEvent(function() onPoison(cid) end,300)
addEvent(function() onFlame(cid) end,600)
addEvent(function() onEnergy(cid) end,900)
addEvent(function() onPoison(cid) end,1200)
addEvent(function() onFlame(cid) end,1500)
end

Link para o comentário
Compartilhar em outros sites

  • 0

eu realmente n sei mexer com spells mas..

 

local combat = createCombatObject()

setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)

setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, 13)

local combat2 = createCombatObject()

setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_POISONDAMAGE)

setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, 1)

local combat3 = createCombatObject()

setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)

setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, 15)

 

function onGetFormulaValues(cid, level, skill, attack, factor)

return -(((skill + 25) / 3) + (level / 5)), -((skill + 25) + (level / 5))

end

 

setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

setCombatCallback(combat2, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

setCombatCallback(combat3, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

function onCastSpell(cid, var)

 

function doDano(cid, combat, var)

if not isCreature(cid) then return true end

doCombat(cid, combat, var)

end

 

local combats = {combat, combat2, combat3}

for i = 0, 5 do

local c = i+1 >= 4 and i-3 or i+1

addEvent(doDano, i * 300, cid, combats[c], var)

end

end

 

Link para o comentário
Compartilhar em outros sites

  • 0

Caramba, passou esse tanto de gente e não percebeu o erro do script. Olhem os combats, galera.

 

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, 13)
local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_POISONDAMAGE)
setCombatParam(combat2, COMBAT_PARAM_DISTANCEEFFECT, 1)
local combat3 = createCombatObject()
setCombatParam(combat3, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatParam(combat3, COMBAT_PARAM_DISTANCEEFFECT, 15)

function onGetFormulaValues(cid, level, skill, attack, factor)
return -(((skill + 25) / 3) + (level / 5)), -((skill + 25) + (level / 5))
end

setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
setCombatCallback(combat2, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
setCombatCallback(combat3, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

function onCastSpell(cid, var)
doCombat(cid, combat, var)
addEvent(doCombat, 300, cid, combat2, var)
addEvent(doCombat, 600, cid, combat3, var)
addEvent(doCombat, 900, cid, combat, var)
addEvent(doCombat, 1200, cid, combat2, var)
addEvent(doCombat, 1500, cid, combat3, var)
return true
end

 

OBS: Talvez eu fiz alguma bobeira no script, apenas talvez.

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

  • 0

Testa aí, também coloquei uma verificação para que se o player deslogar durante o addEvent não aparecer erros no distro:

 

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, 13)

local combat2 = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_POISONDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, 1)

local combat3 = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, 15)

function onGetFormulaValues(cid, level, skill, attack, factor)
return -(((skill + 25) / 3) + (level / 5)), -((skill + 25) + (level / 5))
end

setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

function onEnergy(cid)
if not isCreature(cid) then return true end
doCombat(cid, combat, var)
end

function onPoison(cid)
if not isCreature(cid) then return true end
doCombat(cid, combat2, var)
end

function onFlame(cid)
if not isCreature(cid) then return true end
doCombat(cid, combat3, var)
end

function onCastSpell(cid, var)

addEvent(onPoison, 300, cid)
addEvent(onFlame, 600, cid)
addEvent(onEnergy, 900, cid)
addEvent(onPoison, 1200, cid)
addEvent(onFlame, 1500, cid)
end

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

  • 0

local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_BLOCKARMOR, TRUE)
setCombatParam(combat1, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_WEAPONTYPE)
setCombatParam(combat1, COMBAT_PARAM_USECHARGES, TRUE)
setCombatParam(combat1, COMBAT_PARAM_HITCOLOR, 215)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
setCombatParam(distanceCombat1, COMBAT_PARAM_HITCOLOR, 215)
setCombatFormula(combat1, COMBAT_FORMULA_SKILL, 2, 3, 0.5, 10)
local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat2, COMBAT_PARAM_BLOCKARMOR, TRUE)
setCombatParam(combat2, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_WEAPONTYPE)
setCombatParam(combat2, COMBAT_PARAM_USECHARGES, TRUE)
setCombatParam(combat2, COMBAT_PARAM_HITCOLOR, 215)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA)
setCombatParam(distanceCombat2, COMBAT_PARAM_HITCOLOR, 215)
setCombatFormula(combat2, COMBAT_FORMULA_SKILL, 2, 3, 0.5, 13)
local arr1 = {
{0, 0, 0,},
{0, 2, 0,},
{0, 0, 0,},
{1, 0, 0,},
}
local arr2 = {
{0, 0, 0,},
{0, 2, 0,},
{1, 0, 0,},
{0, 0, 0,},
}
local area1 = createCombatArea(arr1)
local area2 = createCombatArea(arr2)
setCombatArea(combat1, area1)
setCombatArea(combat2, area2)
local function onCastSpell1(parameters)
doCombat(parameters.cid, parameters.combat1, parameters.var)
end
local function onCastSpell2(parameters)
doCombat(parameters.cid, parameters.combat2, parameters.var)
end

 

é a minha alguem pode me ajuda porfavor?

Link para o comentário
Compartilhar em outros sites

  • 0

Toma, cara.

 

local spell_config = {
[1] = {
	damage = COMBAT_FIREDAMAGE,
	areaEffect = CONST_ME_FIREAREA,
	shootEffect = CONST_ANI_FLAMMINGARROW
},
[2] = {
	damage = COMBAT_ENERGYDAMAGE,
	areaEffect = CONST_ME_ENERGYAREA,
	shootEffect, CONST_ANI_FLASHARROW
},
[3] = {
	damage = COMBAT_EARTHDAMAGE,
	areaEffect = CONST_ME_SMALLPLANTS,
	shootEffect, CONST_ANI_EARTHARROW
}
}

local combats = {}
for _, config in ipairs(spell_config) do
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, config.damage)
setCombatParam(combat, COMBAT_PARAM_EFFECT, config.areaEffect)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, config.shootEffect)
function onGetFormulaValues(cid, level, skill, attack, factor)
	return -(((skill + 25) / 3) + (level / 5)), -((skill + 25) + (level / 5))
end
setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
table.insert(combats, combat)
end

function onCastSpell(cid, var)
for n = 1, #combats do
	addEvent(doCombat, n * 100, cid, combats[n], var)
end
return true
end

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

×
×
  • Criar Novo...