Hello guys, I need some help with this, I Don't Know how to add a formula to this spell (custom Apocalypse spell). Already this spells hits -900, -1800 ramdomly, and I need to add a LevelMagic Formula like a Eternal Winter/Rage of the Skies spell and then deals damage depends the formula values.
I'm explain it well?
Sorry for my BAD RLLY BAD ENGLASH.
Thanks.
I'm explain it well?
Sorry for my BAD RLLY BAD ENGLASH.
Thanks.
Code:
local combat = createCombatObject()
arr = {
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
}
local area = createCombatArea(arr)
setCombatArea(combat, area)
local function spellCallback(param)
if param.count > 0 or math.random(0, 1) == 1 then
doSendMagicEffect(param.pos, CONST_ME_BIGCLOUDS)
doAreaCombatHealth(param.cid, COMBAT_ENERGYDAMAGE, param.pos, 0, -900, -1800, CONST_ME_PURPLEENERGY)
doSendMagicEffect(param.pos, CONST_ME_FIREWORK_YELLOW)
end
if(param.count < 5) then
param.count = param.count + 1
addEvent(spellCallback, math.random(1000, 2000), param)
end
end
function onTargetTile(cid, pos)
local param = {}
param.cid = cid
param.pos = pos
param.pos = pos
param.count = 1
spellCallback(param)
end
setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTile")
function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end