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

Solved tfs 1.2 advance level and full mana

proudera

New Member
Joined
Jun 11, 2017
Messages
33
Reaction score
0
Where can I find and remove in my source code when you advance a level you get full mana?

It's not in creaturescripts.
 
Last edited:
You can try this:
add on 'creaturescripts.xml'
Code:
<event type="advance" name="AdvanceSave" script="advance_save.lua" />
then in 'login.lua'
Lua:
player:registerEvent("AdvanceSave")
then create a file called 'advance_save.lua' and add this:

Lua:
local config = {
    heal = true,
    save = true,
    effect = false
}

function onAdvance(player, skill, oldLevel, newLevel)
    if skill ~= SKILL_LEVEL or newLevel <= oldLevel then
        return true
    end

    if config.effect then
        player:getPosition():sendMagicEffect(math.random(CONST_ME_FIREWORK_YELLOW, CONST_ME_FIREWORK_BLUE))
        player:say('LEVEL UP!', TALKTYPE_MONSTER_SAY)
    end

    if config.heal then
        player:addHealth(player:getMaxHealth())
        player:addMana(player:getMaxMana())
    end

    if config.save then
        player:save()
    end
    return true
end
 
Last edited:
Back
Top