• 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 2 Shaman Spells [TFS 1.4]

Adorius Black

Advanced OT User
Joined
Mar 31, 2020
Messages
301
Solutions
3
Reaction score
180
Great Shaman Beam

XML:
<instant group="attack" spellid="28" name="Great Shaman Beam" words="exevo gran flam sham" lvl="29" mana="110" prem="0" direction="1" exhaustion="2000" groupcooldown="6000" needlearn="0" script="custom/great_shaman_beam.lua">
        <vocation name="Shaman" />
        <vocation name="Raised Shaman" />
</instant>

Lua:
-- Delay between animations.
local animationDelay = 100
local combat = {}

-- Frames (1 = Area, 2 = Player, 3 = Player + Self Damaging)
local area = {
    {
        {0},
        {0},
        {0},
        {3}
    },
    {
        {0},
        {0},
        {1},
        {2}
    },
    {
        {0},
        {1},
        {0},
        {2}
    },
    {
        {1},
        {0},
        {0},
        {2}
    },
    {
        {1},
        {0},
        {0},
        {0},
        {2}
    },
    {
        {1},
        {0},
        {0},
        {0},
        {0},
        {2}
    },
}

for i = 1, #area do
    combat[i] = Combat()
    combat[i]:setParameter(COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
    combat[i]:setParameter(COMBAT_PARAM_EFFECT,  CONST_ME_CARNIPHILA)
end

for x, _ in ipairs(area) do
    combat[x]:setArea(createCombatArea(area[x]))
end

function executeCombat(p, i)
    if not p.player then
        return false
    end
    if not p.player:isPlayer() then
            return false
    end
    p.combat[i]:execute(p.player, p.var)
end

function onCastSpell(player, var)

    local p = {player = player, var = var, combat = combat}

    -- Damage formula
    local level = player:getLevel()
    local maglevel = player:getMagicLevel()
    local min = (level / 5) + (maglevel * 3.6) + 22
    local max = (level / 5) + (maglevel * 6) + 37


    for i = 1, #area do
        combat[i]:setFormula(COMBAT_FORMULA_LEVELMAGIC, 0, -min, 0, -max)
        if i == 1 then
            combat[i]:execute(player, var)
        else
            addEvent(executeCombat, (animationDelay * i) - animationDelay, p, i)
        end
    end

    return true
end

Shaman Wave

XML:
<instant group="attack" spellid="28" name="Shaman Wave" words="exevo sham hur" lvl="38" mana="170" prem="0" direction="1" exhaustion="8000" groupcooldown="2000" needlearn="0" script="custom/shaman_wave.lua">
        <vocation name="Shaman" />
        <vocation name="Raised Shaman" />
</instant>

Lua:
-- Delay between animations.
local animationDelay = 200
local combat = {}

-- Frames (1 = Area, 2 = Player, 3 = Player + Self Damaging)
local area = {
    {
        {0},
        {0},
        {0},
        {3}
    },
    {
        {1},
        {1},
        {1},
        {2}
    },
    {
        {0, 1, 0},
        {1, 0, 1},
        {1, 0, 1},
        {0, 0, 0},
        {0, 2, 0}
    },
    {
        {1, 0, 1},
        {0, 0, 0},
        {0, 0, 0},
        {0, 0, 0},
        {0, 2, 0},
        {0, 0, 0},
        {1, 0, 1}
    }
}

for i = 1, #area do
    combat[i] = Combat()
    combat[i]:setParameter(COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
    combat[i]:setParameter(COMBAT_PARAM_EFFECT,  CONST_ME_FIREATTACK)
end

for x, _ in ipairs(area) do
    combat[x]:setArea(createCombatArea(area[x]))
end

function executeCombat(p, i)
    if not p.player then
        return false
    end
    if not p.player:isPlayer() then
            return false
    end
    p.combat[i]:execute(p.player, p.var)
end

function onCastSpell(player, var)

    local p = {player = player, var = var, combat = combat}

    -- Damage formula
    local level = player:getLevel()
    local maglevel = player:getMagicLevel()
    local min = (level / 5) + (maglevel * 4.5) + 20
    local max = (level / 5) + (maglevel * 7.6) + 48
    for i = 1, #area do
        combat[i]:setFormula(COMBAT_FORMULA_LEVELMAGIC, 0, -min, 0, -max)
        if i == 1 then
            combat[i]:execute(player, var)
        else
            addEvent(executeCombat, (animationDelay * i) - animationDelay, p, i)
        end
    end

    return true
end

If you know how to make this code more easy, stable, correct or you are just bored and you have created nice modification of this code please post it here. OTLand users will be grateful. :)
 
Back
Top