Postado Fevereiro 26, 2021 4 anos Alguém sabe como resolver esse problema? o erro é o seguinte, ao executar a magia e trocar de target o effect acompanha o novo target, meu pedido para resolução seria que o effect só pudesse ir ao novo target com o fim da spell ou que o dano acompanhasse o effect. local combat1 = createCombatObject() setCombatParam(combat1, COMBAT_PARAM_HITCOLOR, 205) setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat1, COMBAT_PARAM_DISTANCEEFFECT, 1) setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -99.0, 0, -190.5, 0) local function onCastSpell1(parameters) doCombat(parameters.cid, parameters.combat1, parameters.var) end function KiBullet(cid) if isCreature(cid) and isCreature(getCreatureTarget(cid)) then local position = {x=getThingPosition(getCreatureTarget(cid)).x+1, y=getThingPosition(getCreatureTarget(cid)).y+1, z=getThingPosition(getCreatureTarget(cid)).z} doSendMagicEffect(position, 329) end end function onCastSpell(cid, var) local waittime = 9 local storage = 99 if exhaustion.check(cid, storage) then doPlayerSendCancel(cid, "You are exhausted.") doSendMagicEffect(getCreaturePosition(cid), 2) return false end local parameters = {cid = cid, var = var, combat1 = combat1} for i = 1, 10 do addEvent(function() if isCreature(cid) then addEvent(onCastSpell1, 100, parameters) addEvent(KiBullet,100,cid) end end, 1 + ((i-1) * 300)) end exhaustion.set(cid, storage, waittime) return true end 2021-02-26 14-03-40.mp4
Postado Fevereiro 27, 2021 4 anos Solução local combat1 = createCombatObject() setCombatParam(combat1, COMBAT_PARAM_HITCOLOR, 205) setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat1, COMBAT_PARAM_DISTANCEEFFECT, 1) setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -99.0, 0, -190.5, 0) function onTargetCreature(cid, target) local position = {x=getThingPosition(target).x+1, y=getThingPosition(target).y+1, z=getThingPosition(target).z} doSendMagicEffect(position, 329) end setCombatCallback(combat1, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature") function onCastSpell(cid, var) local waittime = 9 local storage = 99 if exhaustion.check(cid, storage) then doPlayerSendCancel(cid, "You are exhausted.") doSendMagicEffect(getCreaturePosition(cid), 2) return false end for i = 1, 10 do addEvent(function() if isCreature(cid) and isCreature(variantToNumber(var)) then doCombat(cid, combat1, var) end end, ((i-1) * 300)) end exhaustion.set(cid, storage, waittime) return true end
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.