TFS 1.2 Tested
-Has no demotion compatibility, you can add that. You can add " or player:getLevel() <= 19" to login.lua, after "if player.isPremium()" on line 22. Not the best route though.
-Register event in creaturescripts.xml as "advance."
[edit] Fixed a small bug with vocName
-Has no demotion compatibility, you can add that. You can add " or player:getLevel() <= 19" to login.lua, after "if player.isPremium()" on line 22. Not the best route though.
-Register event in creaturescripts.xml as "advance."
Code:
local config = {
level = 20
}
function onAdvance(player, skill)
local vocation = player:getVocation()
local promotion = vocation:getPromotion()
local vocName = player:getVocation():getName()
if player:isPlayer() and skill == SKILL_LEVEL then
if player:getLevel() == config.level then
player:setVocation(promotion)
player:sendTextMessage(MESSAGE_STATUS_WARNING, "You have gained an outstanding amount of experience.\nYou are now a " ..vocName.. ".", Player.getPosition())
end
end
end
[edit] Fixed a small bug with vocName
Last edited: