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
function onAdvance(cid, skill, oldLevel, newLevel)
if newLevel == 50 then
doPlayerAddMoney(cid, 50000)
end
return true
end
Code:doPlayerSetVocation(cid, vocation)
function onAdvance(cid, skill, oldLevel, newLevel)
if newLevel == 100000 and getPlayerVocation(cid) == 6 then
doPlayerSetVocation(cid, 10)
end
return true
end
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
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
Did you tried registering in login.lua?Not work ;/
Did you tried registering in login.lua?
Post your promotion NPC script along with login.lua and XML tag you're using for creaturescript.