• 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+ problem with second promotion tfs 1.5

abdala ragab

Veteran OT User
Joined
Aug 18, 2018
Messages
461
Solutions
11
Reaction score
340
Location
gamelaot.sytes.net
action
2 promotion
Lua:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local vocation = player:getVocation():getId()
    if vocation >= 5 and vocation <= 8 then
        vocation = vocation + 4
        player:setVocation(vocation)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You've been promoted! Congratulations!")
        item:remove()
    else
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You're already at the maximum promotion level. Unable to utilize this item.")
    end
    return true
end
3 promotion
Code:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local vocation = player:getVocation():getId()
    if vocation >= 9 and vocation <= 12 then
        vocation = vocation + 4
        player:setVocation(vocation)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You've been promoted! Congratulations!")
        item:remove()
    else
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You're already at the maximum promotion level. Unable to utilize this item.")
    end
    return true
end
4 promotion
Code:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local vocation = player:getVocation():getId()
    if vocation >= 13 and vocation <= 16 then
        vocation = vocation + 4
        player:setVocation(vocation)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You've been promoted! Congratulations!")
        item:remove()
    else
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You're already at the maximum promotion level. Unable to utilize this item.")
    end
    return true
end
These scripts worked for me in TFS version 1.2
Now after converting to 1.5 it does not work
If the player buys the second upgrade and logs out and back in, he gets the third promotion, and if he logs out and back in, he gets the fourth promotion, and so on
What is the problem and how can I fix it?
Thanks in advance
 
Solution
What is the problem and how can I fix it?
You are probably using Nekiro downgrade to 8.x protocol - on 12.x you cannot modify vocations as they are defined in client/items files.
There is Lua onLogin script that gives back promotion, after it was removed after player lost PACC:
It looks like it increases promotion level with every relog, as it expects that there is only 1 promotion level, so increasing it 'to max' was fine with normal vocations (0-8).
Remove these lines and it should work fine.
What is the problem and how can I fix it?
You are probably using Nekiro downgrade to 8.x protocol - on 12.x you cannot modify vocations as they are defined in client/items files.
There is Lua onLogin script that gives back promotion, after it was removed after player lost PACC:
It looks like it increases promotion level with every relog, as it expects that there is only 1 promotion level, so increasing it 'to max' was fine with normal vocations (0-8).
Remove these lines and it should work fine.
 
Last edited:
Solution
I've encountered this issue before. How was it resolved? I simply made sure that 'fromov' matches the vocation's ID. For example, if the ID is 5 for 'master sorcerer' and 'fromov' remains 1, it will naturally revert to 'sorcerer' because 'fromov' triggers the reversion upon death or logout. If you don't want the vocation to revert, ensuring that the IDs and 'fromov' are the same resolves the issue.

XML:
<vocation id="5"
 fromvoc="5"
 
Last edited:
You are probably using Nekiro downgrade to 8.x protocol. There is Lua onLogin script that gives back promotion, after it was removed after player lost PACC:
It looks like it increases promotion level with every relog, as it expects that there is only 1 promotion level, so increasing it 'to max' was fine with normal vocations (0-8).
Remove these lines and it should work fine.
Works well thank you
Post automatically merged:

I've encountered this issue before. How was it resolved? I simply made sure that 'fromov' matches the vocation's ID. For example, if the ID is 5 for 'master sorcerer' and 'fromov' remains 1, it will naturally revert to 'sorcerer' because 'fromov' triggers the reversion upon death or logout. If you don't want the vocation to revert, ensuring that the IDs and 'fromov' are the same resolves the issue."

XML:
<vocation id="5"
 fromvoc="5"
I haven't tried that, but

Gesior

solution was easier
 
Last edited:
Back
Top