Hello guys, I am having a problem with my rune, is she attacks normally everything works 100%, but what happens is that instead give two hits, she's giving three hits, how can I fix?
Code:
local damageTypes = {COMBAT_POISONDAMAGE, COMBAT_HOLYDAMAGE}
local shootEffects = {29, 30}
local effects = {20, 21}
local combats = {}
for i = 0, 2 do
combats[i] = createCombatObject()
setCombatParam(combats[i], COMBAT_PARAM_TYPE, (damageTypes[i] or 255))
setCombatParam(combats[i], COMBAT_PARAM_EFFECT, (effects[i] or 255))
setCombatParam(combats[i], COMBAT_PARAM_DISTANCEEFFECT, (shootEffects[i] or 255))
setCombatFormula(combats[i], COMBAT_FORMULA_LEVELMAGIC, -2400, -2400, -2400, -2400)
local area = createCombatArea( { {1, 1, 1}, {1, 3, 1}, {1, 1, 1} } )
setCombatArea(combats[i], area)
end
function onCastSpell(cid, var)
local vip = "yes"
local days = 0
if (vip == "yes") and getAccountVipDays(cid) <= days then
doPlayerSendCancel(cid, "Only Players Vip Can Use This.")
return false
end
for i = 0, (#combats - 0) do
addEvent(function()
if isCreature(cid) then
return doCombat(cid, combats[i], var)
end
return true
end, i * 200)
end
return true
end