• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

[TFS 1.2] Second Promotion

Caduceus

Unknown Member
Joined
May 10, 2010
Messages
321
Solutions
2
Reaction score
24
I am looking for info on creating a second promotion Example: knight->elite knight->warlord
 
Code:
player:setPromotionLevel(2)
or
Code:
if player:getVocation():getId() == 5 then
        player:setVocation(9)
elseif player:getVocation():getId() == 6 then
        player:setVocation(10)
elseif player:getVocation():getId() == 7 then
       player:setVocation(11)
elseif player:getVocation():getId() == 8 then
      player:setVocation(12)
end
 
Code:
player:setPromotionLevel(2)
or
Code:
if player:getVocation():getId() == 5 then
        player:setVocation(9)
elseif player:getVocation():getId() == 6 then
        player:setVocation(10)
elseif player:getVocation():getId() == 7 then
       player:setVocation(11)
elseif player:getVocation():getId() == 8 then
      player:setVocation(12)
end
Don't you know how to use tables? all of "your" code is so excessive...
 
Code:
local vocations = {
[5] = {id = 9},
[6] = {id = 10},
[7] = {id = 11},
[8] = {id = 12}
}

QT = vocations[player:getVocation():getId()]

if not QT then return false end

player:setVocation(QT.id)

Happy?
 
You have to setup your vocations.xml file with the new vocations and then create a function with a table, taken from one of my scripts.
Code:
function getNewVocation(id)
    local vocations = {
        [{1, 5}] = 9,
        [{2, 6}] = 10,
        [{3, 7}] = 11,
        [{4, 8}] = 12
    }
    for oldVocation, newVocation in pairs(vocations) do
        if isInArray(oldVocation, id) then
            return newVocation
        end
    end
    return id
end

This too uses promotions
https://otland.net/threads/super-vocation-transformation-ring-for-1-0-1-1-1-2.242243/

Code:
local vocations = {
[5] = {id = 9},
[6] = {id = 10},
[7] = {id = 11},
[8] = {id = 12}
}

QT = vocations[player:getVocation():getId()]

if not QT then return false end

player:setVocation(QT.id)

Happy?
No, because it is not dynamic.
 
Last edited by a moderator:
when given a specific script to "copy & paste", then yes.. Face it, your script did not work, as stated to do so.
 
when given a specific script to "copy & paste", then yes.. Face it, your script did not work, as stated to do so.
What are you blind? have you not seen the video..

Don't be angry with me because none of you "developers" seem to know anything about developing.. and no copy and pasting is not a skill.
 
don't be angry because of us "developers" are not on your level of Elitist Dick. See past your over inflated ego for 5 seconds and actually listen to what others are saying to you. Clearly, you have zero people skills, which in itself speaks volumes of your "skills". If this is what it takes to be a "developer" count me out.
 
Last edited:
don't be angry because of us "developers" are not on your level of Elitist Dick. See past your over inflated ego for 5 seconds and actually listen to what others are saying to you. Clearly, you have zero people skills, which in itself speaks volumes of your "skills". If this is what it takes to be a "developer" count me out.
do not be mad cus of ur stupidness, im sure that the code works flawless also because of your attitude I hope that the code do not work for you
 
Back
Top