How can i add distanceeffect on this spell?
Big love to @Apollos that help me get this spell with 2 attacks
But now i need distanceeffect on this spell to xD
Code:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, 16)
combat:setParameter(COMBAT_PARAM_BLOCKARMOR, true)
combat:setParameter(COMBAT_PARAM_USECHARGES, true)
combat:setArea(createCombatArea(AREA_CIRCLE3X3))
local combat2 = Combat()
combat2:setParameter(COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
combat2:setParameter(COMBAT_PARAM_EFFECT, 22)
combat2:setParameter(COMBAT_PARAM_BLOCKARMOR, true)
combat2:setParameter(COMBAT_PARAM_USECHARGES, true)
combat2:setArea(createCombatArea(AREA_CIRCLE3X3))
-- callback function for combat
function onGetFormulaValues1(player, level, maglevel)
local min = (level / 1) + (maglevel * 3) + 32
local max = (level / 5) + (maglevel * 9) + 40
return -min, -max
end
-- callback function for combat2
function onGetFormulaValues2(player, level, maglevel)
local min = (level / 1) + (maglevel * 3) + 32
local max = (level / 5) + (maglevel * 9) + 40
return -min, -max
end
-- execute the callback functions after casting the spell for both combat & combat2 respectfully
combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues1")
combat2:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues2")
-- 2 second delay
local delay = 1000 * 2
function onCastSpell(creature, var)
-- if the spell casts successfully then continue
if combat:execute(creature, var) then
-- will execute when the delay time is reached
addEvent(function(cid, v)
-- check if the creature exists
local c = Creature(cid)
if c then
-- execute if it does
combat2:execute(c, v)
end
-- parameters the delay time, the creature id (cid) and var (v)
end, delay, creature:getId(), var)
-- return true (show the words above the player's head emote or regular text)
return true
end
-- if it doesn't cast successfully then return false and don't show any text
return false
end
Big love to @Apollos that help me get this spell with 2 attacks
But now i need distanceeffect on this spell to xD