• 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 0.X If player advenced to 1000 level get new vocation

vexler222

Active Member
Joined
Apr 22, 2012
Messages
714
Solutions
15
Reaction score
46
Hey, how i can create new vocation for level? In vocation.xml i dont see anything for level.
 
Solution
Lua:
function onAdvance(cid, skill, oldLevel, newLevel)
    if newLevel >= 100000 and getPlayerVocation(cid) == 6 then
        if getPlayerStorageValue(cid, 88372) == -1 then
            doPlayerSetVocation(cid, 10)
            doPlayerSetStorageValue(cid, 88372, 1)
        end
    end
    return true
end
Hello vexler222,

in vocations.xml you can refer to which vocation the new one relates, e.g.: vocation 1 is sorcerer, vocation 5 is master sorcerer and has the attribute 1, which relates to the vocation it derived from.

Basically what you need to do is to create a new vocation in vocations.xml and then check where you get promoted (if you're running a real map server then check King Tibianus, he provides the option to get promoted), you can then either copypaste the same code and do the tweaks to get promoted once again if requirements are met or you can do a little research and add it on creaturescripts that when a player reaches the required level he automatically gets promoted.

Best Wishes,
Okke
 
Hello vexler222,

in vocations.xml you can refer to which vocation the new one relates, e.g.: vocation 1 is sorcerer, vocation 5 is master sorcerer and has the attribute 1, which relates to the vocation it derived from.

Basically what you need to do is to create a new vocation in vocations.xml and then check where you get promoted (if you're running a real map server then check King Tibianus, he provides the option to get promoted), you can then either copypaste the same code and do the tweaks to get promoted once again if requirements are met or you can do a little research and add it on creaturescripts that when a player reaches the required level he automatically gets promoted.

Best Wishes,
Okke

I have this code, but how to set vocation?

Code:
function onAdvance(cid, skill, oldLevel, newLevel)
if newLevel == 50 then
doPlayerAddMoney(cid, 50000)
end
return true
end
 
Okey, i have this

Code:
function onAdvance(cid, skill, oldLevel, newLevel)
if newLevel == 100000 and getPlayerVocation(cid) == 6 then
doPlayerSetVocation(cid, 10)
end
return true
end

But it not work ;/ If i get 100k level i will still be elder druid not legendary.
 
Lua:
function onAdvance(cid, skill, oldLevel, newLevel)
    if newLevel >= 100000 and getPlayerVocation(cid) == 6 then
        if getPlayerStorageValue(cid, 88372) == -1 then
            doPlayerSetVocation(cid, 10)
            doPlayerSetStorageValue(cid, 88372, 1)
        end
    end
    return true
end
 
Solution
Lua:
function onAdvance(cid, skill, oldLevel, newLevel)
    if newLevel >= 100000 and getPlayerVocation(cid) == 6 then
        if getPlayerStorageValue(cid, 88372) == -1 then
            doPlayerSetVocation(cid, 10)
            doPlayerSetStorageValue(cid, 88372, 1)
        end
    end
    return true
end

Not work ;/
 
Back
Top