Newani
New Member
- Joined
- Sep 11, 2024
- Messages
- 20
- Reaction score
- 2
LUA:
local repeatAmount = 2
local deathFlamesArea = {
createCombatArea({
{0, 1, 0},
{1, 2, 1},
{0, 1, 0}
}),
createCombatArea({
{0, 1, 1, 1, 0},
{1, 1, 0, 1, 1},
{1, 0, 2, 0, 1},
{1, 1, 0, 1, 1},
{0, 1, 1, 1, 0}
}),
createCombatArea({
{0, 0, 1, 1, 1, 0, 0},
{0, 1, 0, 0, 0, 1, 0},
{1, 0, 0, 0, 0, 0, 1},
{1, 0, 0, 2, 0, 0, 1},
{1, 0, 0, 0, 0, 0, 1},
{0, 1, 0, 0, 0, 1, 0},
{0, 0, 1, 1, 1, 0, 0}
})
}
local bigFlamesArea = createCombatArea({
{0, 0, 1, 1, 1, 1, 1, 0, 0},
{0, 1, 1, 0, 0, 0, 1, 1, 0},
{1, 1, 0, 0, 0, 0, 0, 1, 1},
{1, 0, 0, 0, 0, 0, 0, 0, 1},
{1, 0, 0, 0, 2, 0, 0, 0, 1},
{1, 0, 0, 0, 0, 0, 0, 0, 1},
{1, 1, 0, 0, 0, 0, 0, 1, 1},
{0, 1, 1, 0, 0, 0, 1, 1, 0},
{0, 0, 1, 1, 1, 1, 1, 0, 0}
})
local deathFlames = {}
for k, area in ipairs(deathFlamesArea) do
deathFlames[k] = createCombatObject()
setCombatParam(deathFlames[k], COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
setCombatParam(deathFlames[k], COMBAT_PARAM_EFFECT, CONST_ME_HOLYAREA)
setCombatArea(deathFlames[k], area)
end
local bigFlames = createCombatObject()
setCombatParam(bigFlames, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(bigFlames, COMBAT_PARAM_EFFECT, 176)
setCombatArea(bigFlames, bigFlamesArea)
function onTargetTile(cid, pos)
doSendDistanceShoot(getCreaturePosition(cid), pos, CONST_ANI_ETHEREALSPEAR)
end
setCombatCallback(bigFlames, CALLBACK_PARAM_TARGETTILE, "onTargetTile")
function onGetFormulaValues(player, level, maglevel, factor)
local min = (level * 5) + (maglevel * 19)
local max = (level * 5) + (maglevel * 20.2)
return -min, -max
end
setCombatCallback(#deathFlames, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
local function castSpellDelay(p)
if(isCreature(p[1]) == TRUE) then
doCombat(unpack(p))
end
end
function onCastSpell(cid, var)
if getPlayerStorageValue(cid,23058) >= os.time() then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, "You are exhausted for 120 seconds.")
return false
end
setPlayerStorageValue(cid, 23058, os.time() + 120) -- last number "120" is the cooldown in seconds
for i = 0, repeatAmount - 1 do
for k, combat in ipairs(deathFlames) do
addEvent(castSpellDelay, (150 * k) + #deathFlames * 150 * i + 700 * i, {cid, combat, var})
end
addEvent(castSpellDelay, (150 * #deathFlames) + #deathFlames * 150 * i + 700 * i, {cid, bigFlames, var})
end
return LUA_NO_ERROR
end





