• 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!

TFS 1.X+ Adding countdown and freezing monster

Lopaskurwa

Active Member
Joined
Oct 6, 2017
Messages
873
Solutions
2
Reaction score
49
Lua:
local config = {
    interval = 3000,

    attacks = {
        {
            effect = 126,  
            area = {
                {0, 0, 0, 1, 0, 0, 0},
                {0, 0, 1, 1, 1, 0, 0},
                {0, 1, 1, 1, 1, 1, 0},
                {1, 1, 1, 3, 1, 1, 1},
                {0, 1, 1, 1, 1, 1, 0},
                {0, 0, 1, 1, 1, 0, 0},
                {0, 0, 0, 1, 0, 0, 0}
            }
        },
        {
            type = COMBAT_ENERGYDAMAGE,
            effect = 126,

            onGetFormulaValues = function(level, maglevel)
                return -(((maglevel * 120.0) + (level * 20)) * 1.0), -(((maglevel * 131.0) + (level * 20)) * 1.0)
            end,

            area = {
                {0, 0, 0, 1, 0, 0, 0},
                {0, 0, 1, 1, 1, 0, 0},
                {0, 1, 1, 1, 1, 1, 0},
                {1, 1, 1, 3, 1, 1, 1},
                {0, 1, 1, 1, 1, 1, 0},
                {0, 0, 1, 1, 1, 0, 0},
                {0, 0, 0, 1, 0, 0, 0}
            }
        },
    }
}

local combats = createCombatAreas(config)
function onCastSpell(creature, variant)
    return rapidAreaCombatFire(creature:getId(), combats, variant, config.interval)
end

So i made this code which kinda works how i want, so basically it executes
area = {
{0, 0, 0, 1, 0, 0, 0},
{0, 0, 1, 1, 1, 0, 0},
{0, 1, 1, 1, 1, 1, 0},
{1, 1, 1, 3, 1, 1, 1},
{0, 1, 1, 1, 1, 1, 0},
{0, 0, 1, 1, 1, 0, 0},
{0, 0, 0, 1, 0, 0, 0}
}
which stays for 3 seconds so its like showing path of spell where it will be casted and after those 3 seconds passes it executes area again that deals damage, but i dont know how to make a countdown when it will deal damage so it would be possible to avoid it or run it away, and i want to freeze a monster when he executes this spell so he wont walk when the spell is executed or atleast the spell area would stick with the monsters so one of those two. Help would be appreciated.
 
Back
Top