Ir para conteúdo
  • 0

(luaDoCombatAreaHealth) Creature not found


Elrien

Pergunta

Acontece o seguinte... toda vez que o player solta esta magia, e quando o player morre ou deslogar dá esse bug.

 

 

--Created with RadBR--

local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE,COMBAT_DEATHDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 17)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC , -6, -1.5, -8, -2.5)
local combat2 = createCombatObject()
function spellCallback2(param)
if param.count > 0 or math.random(0, 1) == 1 then
doSendMagicEffect(param.pos, CONST_ME_MORTAREA)
doAreaCombatHealth(param.cid, COMBAT_DEATHDAMAGE, param.pos, 0, -13000, -15000, CONST_ME_EXPLOSIONHIT)
end
if(param.count < 5) then
param.count = param.count + 1
addEvent(spellCallback2, math.random(2000, 3500), param)
end
end
function onTargetTile(cid, pos)
local param = {}
param.cid = cid
param.pos = pos
param.count = 0
spellCallback2(param)
end
setCombatCallback(combat2, CALLBACK_PARAM_TARGETTILE, "onTargetTile")
setCombatParam(combat2, COMBAT_PARAM_TYPE,COMBAT_DEATHDAMAGE)
setCombatParam(combat2, COMBAT_PARAM_EFFECT, 17)
setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC , -6, -1.5, -8, -2.5)
local combat3 = createCombatObject()
function spellCallback3(param)
if param.count > 0 or math.random(0, 1) == 1 then
doSendMagicEffect(param.pos, CONST_ME_MORTAREA)
doAreaCombatHealth(param.cid, COMBAT_DEATHDAMAGE, param.pos, 0, -13000, -15000, CONST_ME_EXPLOSIONHIT)
end
if(param.count < 5) then
param.count = param.count + 1
addEvent(spellCallback3, math.random(2000, 3500), param)
end
end
function onTargetTile(cid, pos)
local param = {}
param.cid = cid
param.pos = pos
param.count = 0
spellCallback2(param)
end
setCombatCallback(combat3, CALLBACK_PARAM_TARGETTILE, "onTargetTile")
setCombatParam(combat3, COMBAT_PARAM_TYPE,COMBAT_DEATHDAMAGE)
setCombatPar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 1, 0, 1, 0, 3, 1, 0, 1, 0, 1},
{0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0},
{0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0},
{0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0},
{0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0},
}
local area1 = createCombatArea(arr1)
local area2 = createCombatArea(arr2)
local area3 = createCombatArea(arr3)
setCombatArea(combat1, area1)
setCombatArea(combat2, area2)
setCombatArea(combat2, area3)
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
function onCastSpell(cid, var)
local parameters = { cid = cid, var = var, combat1 = combat1, combat2 = combat2, combat3 = combat3}
addEvent(onCastSpell1, 101, parameters)
addEvent(onCastSpell2, 501, parameters)
addEvent(onCastSpell3, 100, parameters)
local mninja = {lookType = 290, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 3}
local fninja = {lookType = 290, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 3}
local sex = getPlayerSex(cid)
if sex == 0 then --sexo == 0 significa que o personagem é mulher
doSetCreatureOutfit(cid, mninja, 20000)
local mana = getCreatureMana(cid)
else
doSetCreatureOutfit(cid, fninja, 20000)
end
return true
end
end
function onCastSpell(cid, var)
return doSpell(cid, var)
end

 

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

1 resposta a esta questão

Posts Recomendados

  • 0

Abaixo dos dois:

if param.count > 0 or math.random(0, 1) == 1 then

coloque:

if not isPlayer(param.cid) then return true end
Editado por zipter98
Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...