• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Spell Formula

hellpsy

Mapper
Joined
Dec 16, 2008
Messages
345
Reaction score
466
Location
Mexico
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.
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
 
Try this:

Erase this part:

Code:
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

Put this:

Code:
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, -min, -max, CONST_ME_PURPLEENERGY)
        doSendMagicEffect(param.pos, CONST_ME_FIREWORK_YELLOW)
    end

local min = getPlayerLevel(cid) * 1/5 + getPlayerMagLevel(cid) * 11/2 + 51/2
local max = getPlayerLevel(cid) * 1/5 + getPlayerMagLevel(cid) * 11 + 50

Formula based on the damage from Tibia-stats calcDMG (eternal winter)
 
Last edited:
Back
Top