• 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!

Promoted Vocations Reverting When Logging In

tozikrulz

New Member
Joined
Jun 10, 2009
Messages
46
Reaction score
1
Hello,

As the title explains, I am having troubles with the new vocations i am trying to implement.
I have added an extra 4 vocations successfuly (id's 9-12) and have no problems with these, however, when i added another 4 (id's 13-16) which i did the exact same thing to implement, they revert to their previous promotion when logging back into the game. The only thing i am doing differently is instead of using the standard promotion NPC script i have used an onStepIn script which doesn't change the "promotion" in phpmyadmin but it does change the "vocation" to the correct id.
I have tried searching for a fix for this but i've not been able to find anything, i know this is possible as i have seen it in other servers so if you know the problem could you please help me? i would be very grateful.
I am using tfs 0.4 and znotes aac.

yours gratefully,
Tozik
 
Thank you, you wonderful person. So simple and works kinda.
The only problem i am having now is that spells cast by one specific vocation (id 21) is causing the server to crash but the other new vocations do not have this problem and can cast all spells with no problem.
Also i have found that after using a spell, the database shows his magic level has shot up probably higher than the limit, yet i have not edited it's mana multiplier, only it's damage formulae.
 
Last edited:
Thank you, this lets you walk around as the new vocation but the server crashes when using a spell with vocation required spell or even with no vocation requirement such as utevo lux :S
this is probably related to the spell, not the vocation I think.
post both the spell script and the vocation.xml and I will try to help you :D
 
I've been trying alot of different things after looking for similar problems throughout this forum but have not been successful in fixing the problem.
The vocations still return to the 2nd promotion level (in my case "enlightened" vocations) when logging in.
I have tried setting the fromVoc to their first vocation ids (1 - 4) and their previous promotion (5 - 9) which both revert to their 2nd promotion (enlightened), I have also tried setting them to their own ids, i.e. voc id = 20 and fromvoc = 20 which this reverts to id="0".
I have edited this in the data/vocations/vocations.xml and data/lib/031-vocations.lua.

1. XML
Lua:
<?xml version="1.0" encoding="UTF-8"?>
<vocations>
    <vocation id="0" name="None" description="none" needpremium="0" gaincap="5" gainhp="5" gainmana="5" gainhpticks="6" gainhpamount="1" gainmanaticks="6" gainmanaamount="1" manamultiplier="4.0" attackspeed="2000" soulmax="100" gainsoulticks="30" fromvoc="0" attackable="no">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="1" name="Sorcerer" description="a sorcerer" needpremium="0" gaincap="25" gainhp="15" gainmana="50" gainhpticks="1" gainhpamount="10" gainmanaticks="1" gainmanaamount="10" manamultiplier="1.1" attackspeed="2000" soulmax="100" gainsoulticks="30" fromvoc="1">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="2" name="Druid" description="a druid" needpremium="0" gaincap="25" gainhp="15" gainmana="75" gainhpticks="1" gainhpamount="10" gainmanaticks="1" gainmanaamount="10" manamultiplier="1.1" attackspeed="2000" soulmax="100" gainsoulticks="30" fromvoc="2">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="3" name="Paladin" description="a paladin" needpremium="0" gaincap="40" gainhp="35" gainmana="30" gainhpticks="1" gainhpamount="10" gainmanaticks="1" gainmanaamount="10" manamultiplier="1.4" attackspeed="2000" soulmax="100" gainsoulticks="30" fromvoc="3">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.2" club="1.2" sword="1.2" axe="1.2" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="4" name="Knight" description="a knight" needpremium="0" gaincap="50" gainhp="100" gainmana="15" gainhpticks="1" gainhpamount="10" gainmanaticks="1" gainmanaamount="10" manamultiplier="3.0" attackspeed="2000" soulmax="100" gainsoulticks="30" fromvoc="4">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="5" name="Master Sorcerer" description="a master sorcerer" needpremium="1" gaincap="40" gainhp="25" gainmana="75" gainhpticks="1" gainhpamount="200" gainmanaticks="1" gainmanaamount="200" manamultiplier="1.1" attackspeed="1666" soulmax="150" gainsoulticks="30" fromvoc="1" lessloss="30">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="6" name="Elder Druid" description="an elder druid" needpremium="1" gaincap="40" gainhp="25" gainmana="100" gainhpticks="1" gainhpamount="200" gainmanaticks="1" gainmanaamount="200" manamultiplier="1.1" attackspeed="1666" soulmax="150" gainsoulticks="30" fromvoc="2" lessloss="30">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="7" name="Royal Paladin" description="a royal paladin" needpremium="1" gaincap="75" gainhp="50" gainmana="50" gainhpticks="1" gainhpamount="200" gainmanaticks="1" gainmanaamount="200" manamultiplier="1.4" attackspeed="1666" soulmax="150" gainsoulticks="30" fromvoc="3" lessloss="30">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.2" club="1.2" sword="1.2" axe="1.2" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="8" name="Elite Knight" description="an elite knight" needpremium="1" gaincap="100" gainhp="150" gainmana="25" gainhpticks="1" gainhpamount="200" gainmanaticks="1" gainmanaamount="200" manamultiplier="3.0" attackspeed="1666" soulmax="150" gainsoulticks="30" fromvoc="4" lessloss="30">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="9" name="Enlightened Sorcerer" description="an enlightened sorcerer" needpremium="1" gaincap="40" gainhp="30" gainmana="100" gainhpticks="1" gainhpamount="500" gainmanaticks="1" gainmanaamount="500" manamultiplier="1.1" attackspeed="1333" soulmax="200" gainsoulticks="30" fromvoc="5" lessloss="50">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="10" name="Enlightened Druid" description="an enlightened druid" needpremium="1" gaincap="40" gainhp="30" gainmana="150" gainhpticks="1" gainhpamount="500" gainmanaticks="1" gainmanaamount="500" manamultiplier="1.1" attackspeed="1333" soulmax="200" gainsoulticks="30" fromvoc="6" lessloss="50">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="11" name="Enlightened Paladin" description="an enlightened paladin" needpremium="1" gaincap="75" gainhp="65" gainmana="65" gainhpticks="1" gainhpamount="500" gainmanaticks="1" gainmanaamount="500" manamultiplier="1.4" attackspeed="1333" soulmax="200" gainsoulticks="30" fromvoc="7" lessloss="50">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.2" club="1.2" sword="1.2" axe="1.2" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="12" name="Enlightened Knight" description="an enlightened knight" needpremium="1" gaincap="100" gainhp="200" gainmana="30" gainhpticks="1" gainhpamount="500" gainmanaticks="1" gainmanaamount="500" manamultiplier="3.0" attackspeed="1333" soulmax="200" gainsoulticks="30" fromvoc="8" lessloss="50">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="13" name="Warlock" description="a warlock" needpremium="1" gaincap="40" gainhp="100" gainmana="500" gainhpticks="1" gainhpamount="2000" gainmanaticks="1" gainmanaamount="2000" manamultiplier="1.1" attackspeed="1000" soulmax="200" gainsoulticks="30" fromvoc="9" lessloss="50">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.2" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="14" name="Arcanist" description="an arcanist" needpremium="1" gaincap="40" gainhp="50" gainmana="200" gainhpticks="1" gainhpamount="2000" gainmanaticks="1" gainmanaamount="2000" manamultiplier="1.1" attackspeed="1000" soulmax="200" gainsoulticks="30" fromvoc="9" lessloss="50">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.8" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="15" name="Shaman" description="a shaman" needpremium="1" gaincap="40" gainhp="50" gainmana="250" gainhpticks="1" gainhpamount="2000" gainmanaticks="1" gainmanaamount="2000" manamultiplier="1.1" attackspeed="1000" soulmax="200" gainsoulticks="30" fromvoc="10" lessloss="50">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.8" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="16" name="Cleric" description="a cleric" needpremium="1" gaincap="40" gainhp="100" gainmana="600" gainhpticks="1" gainhpamount="2000" gainmanaticks="1" gainmanaamount="2000" manamultiplier="1.1" attackspeed="1000" soulmax="200" gainsoulticks="30" fromvoc="10" lessloss="50">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.2" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="17" name="Sentinel" description="a sentinel" needpremium="1" gaincap="75" gainhp="350" gainmana="350" gainhpticks="1" gainhpamount="2000" gainmanaticks="1" gainmanaamount="2000" manamultiplier="1.4" attackspeed="1000" soulmax="200" gainsoulticks="30" fromvoc="11" lessloss="50">
        <formula meleeDamage="3.0" distDamage="3.2" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.2" club="1.2" sword="1.2" axe="1.2" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="18" name="Marksman" description="a marksman" needpremium="1" gaincap="75" gainhp="150" gainmana="150" gainhpticks="1" gainhpamount="2000" gainmanaticks="1" gainmanaamount="2000" manamultiplier="1.4" attackspeed="1000" soulmax="200" gainsoulticks="30" fromvoc="11" lessloss="50">
        <formula meleeDamage="3.0" distDamage="3.8" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.2" club="1.2" sword="1.2" axe="1.2" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="19" name="Warden" description="a warden" needpremium="1" gaincap="100" gainhp="1000" gainmana="100" gainhpticks="1" gainhpamount="2000" gainmanaticks="1" gainmanaamount="2000" manamultiplier="3.0" attackspeed="1000" soulmax="200" gainsoulticks="30" fromvoc="12" lessloss="50">
        <formula meleeDamage="3.2" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="20" name="Barbarian" description="a barbarian" needpremium="1" gaincap="100" gainhp="500" gainmana="100" gainhpticks="1" gainhpamount="2000" gainmanaticks="1" gainmanaamount="2000" manamultiplier="3.0" attackspeed="1000" soulmax="200" gainsoulticks="30" fromvoc="12" lessloss="50">
        <formula meleeDamage="3.8" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
</vocations>

2. Lua
Lua:
function isSorcerer(cid)
    return isInArray({1, 5, 9, 13, 14}, getPlayerVocation(cid))
end

function isDruid(cid)
    return isInArray({2, 6, 10, 15, 16}, getPlayerVocation(cid))
end

function isPaladin(cid)
    return isInArray({3, 7, 11, 17, 18}, getPlayerVocation(cid))
end

function isKnight(cid)
    return isInArray({4, 8, 12, 19, 20}, getPlayerVocation(cid))
end

function isRookie(cid)
    return isInArray({0}, getPlayerVocation(cid))
end

Edit:

3. This is the script i use to promote their vocations
Lua:
local pos = {x=1000, y=1000, z=7}

function onStepIn(cid, item, position, fromPosition)
    if getPlayerLevel(cid) >= 500 and getPlayerVocation(cid) == 9 and getPlayerItemCount(cid, 2159) >= 100 then
        doPlayerRemoveItem(cid, 2159, 100)
        doPlayerSetVocation(cid, 14)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Congratulations! you have become an Arcanist!")
        doTeleportThing(cid, pos, true)
    else
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Sorry, You Need to have 100kk, be level 500 and be enlightened to pass")
        doTeleportThing(cid, pos, true)
    end
return true
end

I have also tried replacing doPlayerSetVocation(cid, 14) with doPlayerSetVocation(cid, getPlayerVocation(cid) + 5). This is also just for the sorcerer to walk on a tile to promote to the chosen vocation, I have 8 of these (2 for each vocation to choose from).

Is there any reason why this keeps reverting them to previous vocations when logging in?
P.S.
I have looked for an onlogin script but i couldn't find one with anything to do with changing the vocation ids in them.
 
Last edited:
I've been trying alot of different things after looking for similar problems throughout this forum but have not been successful in fixing the problem.
The vocations still return to the 2nd promotion level (in my case "enlightened" vocations) when logging in.
I have tried setting the fromVoc to their first vocation ids (1 - 4) and their previous promotion (5 - 9) which both revert to their 2nd promotion (enlightened), I have also tried setting them to their own ids, i.e. voc id = 20 and fromvoc = 20 which this reverts to id="0".
I have edited this in the data/vocations/vocations.xml and data/lib/031-vocations.lua.

1. XML
Lua:
<?xml version="1.0" encoding="UTF-8"?>
<vocations>
    <vocation id="0" name="None" description="none" needpremium="0" gaincap="5" gainhp="5" gainmana="5" gainhpticks="6" gainhpamount="1" gainmanaticks="6" gainmanaamount="1" manamultiplier="4.0" attackspeed="2000" soulmax="100" gainsoulticks="30" fromvoc="0" attackable="no">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="1" name="Sorcerer" description="a sorcerer" needpremium="0" gaincap="25" gainhp="15" gainmana="50" gainhpticks="1" gainhpamount="10" gainmanaticks="1" gainmanaamount="10" manamultiplier="1.1" attackspeed="2000" soulmax="100" gainsoulticks="30" fromvoc="1">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="2" name="Druid" description="a druid" needpremium="0" gaincap="25" gainhp="15" gainmana="75" gainhpticks="1" gainhpamount="10" gainmanaticks="1" gainmanaamount="10" manamultiplier="1.1" attackspeed="2000" soulmax="100" gainsoulticks="30" fromvoc="2">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="3" name="Paladin" description="a paladin" needpremium="0" gaincap="40" gainhp="35" gainmana="30" gainhpticks="1" gainhpamount="10" gainmanaticks="1" gainmanaamount="10" manamultiplier="1.4" attackspeed="2000" soulmax="100" gainsoulticks="30" fromvoc="3">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.2" club="1.2" sword="1.2" axe="1.2" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="4" name="Knight" description="a knight" needpremium="0" gaincap="50" gainhp="100" gainmana="15" gainhpticks="1" gainhpamount="10" gainmanaticks="1" gainmanaamount="10" manamultiplier="3.0" attackspeed="2000" soulmax="100" gainsoulticks="30" fromvoc="4">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="5" name="Master Sorcerer" description="a master sorcerer" needpremium="1" gaincap="40" gainhp="25" gainmana="75" gainhpticks="1" gainhpamount="200" gainmanaticks="1" gainmanaamount="200" manamultiplier="1.1" attackspeed="1666" soulmax="150" gainsoulticks="30" fromvoc="1" lessloss="30">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="6" name="Elder Druid" description="an elder druid" needpremium="1" gaincap="40" gainhp="25" gainmana="100" gainhpticks="1" gainhpamount="200" gainmanaticks="1" gainmanaamount="200" manamultiplier="1.1" attackspeed="1666" soulmax="150" gainsoulticks="30" fromvoc="2" lessloss="30">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="7" name="Royal Paladin" description="a royal paladin" needpremium="1" gaincap="75" gainhp="50" gainmana="50" gainhpticks="1" gainhpamount="200" gainmanaticks="1" gainmanaamount="200" manamultiplier="1.4" attackspeed="1666" soulmax="150" gainsoulticks="30" fromvoc="3" lessloss="30">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.2" club="1.2" sword="1.2" axe="1.2" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="8" name="Elite Knight" description="an elite knight" needpremium="1" gaincap="100" gainhp="150" gainmana="25" gainhpticks="1" gainhpamount="200" gainmanaticks="1" gainmanaamount="200" manamultiplier="3.0" attackspeed="1666" soulmax="150" gainsoulticks="30" fromvoc="4" lessloss="30">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="9" name="Enlightened Sorcerer" description="an enlightened sorcerer" needpremium="1" gaincap="40" gainhp="30" gainmana="100" gainhpticks="1" gainhpamount="500" gainmanaticks="1" gainmanaamount="500" manamultiplier="1.1" attackspeed="1333" soulmax="200" gainsoulticks="30" fromvoc="5" lessloss="50">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="10" name="Enlightened Druid" description="an enlightened druid" needpremium="1" gaincap="40" gainhp="30" gainmana="150" gainhpticks="1" gainhpamount="500" gainmanaticks="1" gainmanaamount="500" manamultiplier="1.1" attackspeed="1333" soulmax="200" gainsoulticks="30" fromvoc="6" lessloss="50">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="11" name="Enlightened Paladin" description="an enlightened paladin" needpremium="1" gaincap="75" gainhp="65" gainmana="65" gainhpticks="1" gainhpamount="500" gainmanaticks="1" gainmanaamount="500" manamultiplier="1.4" attackspeed="1333" soulmax="200" gainsoulticks="30" fromvoc="7" lessloss="50">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.2" club="1.2" sword="1.2" axe="1.2" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="12" name="Enlightened Knight" description="an enlightened knight" needpremium="1" gaincap="100" gainhp="200" gainmana="30" gainhpticks="1" gainhpamount="500" gainmanaticks="1" gainmanaamount="500" manamultiplier="3.0" attackspeed="1333" soulmax="200" gainsoulticks="30" fromvoc="8" lessloss="50">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="13" name="Warlock" description="a warlock" needpremium="1" gaincap="40" gainhp="100" gainmana="500" gainhpticks="1" gainhpamount="2000" gainmanaticks="1" gainmanaamount="2000" manamultiplier="1.1" attackspeed="1000" soulmax="200" gainsoulticks="30" fromvoc="9" lessloss="50">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.2" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="14" name="Arcanist" description="an arcanist" needpremium="1" gaincap="40" gainhp="50" gainmana="200" gainhpticks="1" gainhpamount="2000" gainmanaticks="1" gainmanaamount="2000" manamultiplier="1.1" attackspeed="1000" soulmax="200" gainsoulticks="30" fromvoc="9" lessloss="50">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.8" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="15" name="Shaman" description="a shaman" needpremium="1" gaincap="40" gainhp="50" gainmana="250" gainhpticks="1" gainhpamount="2000" gainmanaticks="1" gainmanaamount="2000" manamultiplier="1.1" attackspeed="1000" soulmax="200" gainsoulticks="30" fromvoc="10" lessloss="50">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.8" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="16" name="Cleric" description="a cleric" needpremium="1" gaincap="40" gainhp="100" gainmana="600" gainhpticks="1" gainhpamount="2000" gainmanaticks="1" gainmanaamount="2000" manamultiplier="1.1" attackspeed="1000" soulmax="200" gainsoulticks="30" fromvoc="10" lessloss="50">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.2" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="17" name="Sentinel" description="a sentinel" needpremium="1" gaincap="75" gainhp="350" gainmana="350" gainhpticks="1" gainhpamount="2000" gainmanaticks="1" gainmanaamount="2000" manamultiplier="1.4" attackspeed="1000" soulmax="200" gainsoulticks="30" fromvoc="11" lessloss="50">
        <formula meleeDamage="3.0" distDamage="3.2" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.2" club="1.2" sword="1.2" axe="1.2" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="18" name="Marksman" description="a marksman" needpremium="1" gaincap="75" gainhp="150" gainmana="150" gainhpticks="1" gainhpamount="2000" gainmanaticks="1" gainmanaamount="2000" manamultiplier="1.4" attackspeed="1000" soulmax="200" gainsoulticks="30" fromvoc="11" lessloss="50">
        <formula meleeDamage="3.0" distDamage="3.8" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.2" club="1.2" sword="1.2" axe="1.2" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="19" name="Warden" description="a warden" needpremium="1" gaincap="100" gainhp="1000" gainmana="100" gainhpticks="1" gainhpamount="2000" gainmanaticks="1" gainmanaamount="2000" manamultiplier="3.0" attackspeed="1000" soulmax="200" gainsoulticks="30" fromvoc="12" lessloss="50">
        <formula meleeDamage="3.2" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="20" name="Barbarian" description="a barbarian" needpremium="1" gaincap="100" gainhp="500" gainmana="100" gainhpticks="1" gainhpamount="2000" gainmanaticks="1" gainmanaamount="2000" manamultiplier="3.0" attackspeed="1000" soulmax="200" gainsoulticks="30" fromvoc="12" lessloss="50">
        <formula meleeDamage="3.8" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
</vocations>

2. Lua
Lua:
function isSorcerer(cid)
    return isInArray({1, 5, 9, 13, 14}, getPlayerVocation(cid))
end

function isDruid(cid)
    return isInArray({2, 6, 10, 15, 16}, getPlayerVocation(cid))
end

function isPaladin(cid)
    return isInArray({3, 7, 11, 17, 18}, getPlayerVocation(cid))
end

function isKnight(cid)
    return isInArray({4, 8, 12, 19, 20}, getPlayerVocation(cid))
end

function isRookie(cid)
    return isInArray({0}, getPlayerVocation(cid))
end

Is there any reason why this keeps reverting them to previous vocations when logging in?
P.S.
I have looked for an onlogin script but i couldn't find one with anything to do with changing the vocation ids in them.
fromvoc="idhere" has to be the same as the vocation id in vocations.xml
you're welcome
 
i stated i had tried using the ids of 1-4 then 5-9 and their own id's i just pasted the latest variation i had tried, you just chose not to read everything i wrote, if it helps, this is how the script looks now and it still does the same thing.
Lua:
<?xml version="1.0" encoding="UTF-8"?>
<vocations>
    <vocation id="0" name="None" description="none" needpremium="0" gaincap="5" gainhp="5" gainmana="5" gainhpticks="6" gainhpamount="1" gainmanaticks="6" gainmanaamount="1" manamultiplier="4.0" attackspeed="2000" soulmax="100" gainsoulticks="30" fromvoc="0" attackable="no">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="1" name="Sorcerer" description="a sorcerer" needpremium="0" gaincap="25" gainhp="15" gainmana="50" gainhpticks="1" gainhpamount="10" gainmanaticks="1" gainmanaamount="10" manamultiplier="1.1" attackspeed="2000" soulmax="100" gainsoulticks="30" fromvoc="1">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="2" name="Druid" description="a druid" needpremium="0" gaincap="25" gainhp="15" gainmana="75" gainhpticks="1" gainhpamount="10" gainmanaticks="1" gainmanaamount="10" manamultiplier="1.1" attackspeed="2000" soulmax="100" gainsoulticks="30" fromvoc="2">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="3" name="Paladin" description="a paladin" needpremium="0" gaincap="40" gainhp="35" gainmana="30" gainhpticks="1" gainhpamount="10" gainmanaticks="1" gainmanaamount="10" manamultiplier="1.4" attackspeed="2000" soulmax="100" gainsoulticks="30" fromvoc="3">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.2" club="1.2" sword="1.2" axe="1.2" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="4" name="Knight" description="a knight" needpremium="0" gaincap="50" gainhp="100" gainmana="15" gainhpticks="1" gainhpamount="10" gainmanaticks="1" gainmanaamount="10" manamultiplier="3.0" attackspeed="2000" soulmax="100" gainsoulticks="30" fromvoc="4">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="5" name="Master Sorcerer" description="a master sorcerer" needpremium="1" gaincap="40" gainhp="25" gainmana="75" gainhpticks="1" gainhpamount="200" gainmanaticks="1" gainmanaamount="200" manamultiplier="1.1" attackspeed="1666" soulmax="150" gainsoulticks="30" fromvoc="1" lessloss="30">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="6" name="Elder Druid" description="an elder druid" needpremium="1" gaincap="40" gainhp="25" gainmana="100" gainhpticks="1" gainhpamount="200" gainmanaticks="1" gainmanaamount="200" manamultiplier="1.1" attackspeed="1666" soulmax="150" gainsoulticks="30" fromvoc="2" lessloss="30">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="7" name="Royal Paladin" description="a royal paladin" needpremium="1" gaincap="75" gainhp="50" gainmana="50" gainhpticks="1" gainhpamount="200" gainmanaticks="1" gainmanaamount="200" manamultiplier="1.4" attackspeed="1666" soulmax="150" gainsoulticks="30" fromvoc="3" lessloss="30">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.2" club="1.2" sword="1.2" axe="1.2" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="8" name="Elite Knight" description="an elite knight" needpremium="1" gaincap="100" gainhp="150" gainmana="25" gainhpticks="1" gainhpamount="200" gainmanaticks="1" gainmanaamount="200" manamultiplier="3.0" attackspeed="1666" soulmax="150" gainsoulticks="30" fromvoc="4" lessloss="30">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="9" name="Enlightened Sorcerer" description="an enlightened sorcerer" needpremium="1" gaincap="40" gainhp="30" gainmana="100" gainhpticks="1" gainhpamount="500" gainmanaticks="1" gainmanaamount="500" manamultiplier="1.1" attackspeed="1333" soulmax="200" gainsoulticks="30" fromvoc="5" lessloss="50">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="10" name="Enlightened Druid" description="an enlightened druid" needpremium="1" gaincap="40" gainhp="30" gainmana="150" gainhpticks="1" gainhpamount="500" gainmanaticks="1" gainmanaamount="500" manamultiplier="1.1" attackspeed="1333" soulmax="200" gainsoulticks="30" fromvoc="6" lessloss="50">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="11" name="Enlightened Paladin" description="an enlightened paladin" needpremium="1" gaincap="75" gainhp="65" gainmana="65" gainhpticks="1" gainhpamount="500" gainmanaticks="1" gainmanaamount="500" manamultiplier="1.4" attackspeed="1333" soulmax="200" gainsoulticks="30" fromvoc="7" lessloss="50">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.2" club="1.2" sword="1.2" axe="1.2" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="12" name="Enlightened Knight" description="an enlightened knight" needpremium="1" gaincap="100" gainhp="200" gainmana="30" gainhpticks="1" gainhpamount="500" gainmanaticks="1" gainmanaamount="500" manamultiplier="3.0" attackspeed="1333" soulmax="200" gainsoulticks="30" fromvoc="8" lessloss="50">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="13" name="Warlock" description="a warlock" needpremium="1" gaincap="40" gainhp="100" gainmana="500" gainhpticks="1" gainhpamount="2000" gainmanaticks="1" gainmanaamount="2000" manamultiplier="1.1" attackspeed="1000" soulmax="200" gainsoulticks="30" fromvoc="13" lessloss="50">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.2" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="14" name="Arcanist" description="an arcanist" needpremium="1" gaincap="40" gainhp="50" gainmana="200" gainhpticks="1" gainhpamount="2000" gainmanaticks="1" gainmanaamount="2000" manamultiplier="1.1" attackspeed="1000" soulmax="200" gainsoulticks="30" fromvoc="14" lessloss="50">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.8" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="15" name="Shaman" description="a shaman" needpremium="1" gaincap="40" gainhp="50" gainmana="250" gainhpticks="1" gainhpamount="2000" gainmanaticks="1" gainmanaamount="2000" manamultiplier="1.1" attackspeed="1000" soulmax="200" gainsoulticks="30" fromvoc="15" lessloss="50">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.8" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="16" name="Cleric" description="a cleric" needpremium="1" gaincap="40" gainhp="100" gainmana="600" gainhpticks="1" gainhpamount="2000" gainmanaticks="1" gainmanaamount="2000" manamultiplier="1.1" attackspeed="1000" soulmax="200" gainsoulticks="30" fromvoc="16" lessloss="50">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.2" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="17" name="Sentinel" description="a sentinel" needpremium="1" gaincap="75" gainhp="350" gainmana="350" gainhpticks="1" gainhpamount="2000" gainmanaticks="1" gainmanaamount="2000" manamultiplier="1.4" attackspeed="1000" soulmax="200" gainsoulticks="30" fromvoc="17" lessloss="50">
        <formula meleeDamage="3.0" distDamage="3.2" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.2" club="1.2" sword="1.2" axe="1.2" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="18" name="Marksman" description="a marksman" needpremium="1" gaincap="75" gainhp="150" gainmana="150" gainhpticks="1" gainhpamount="2000" gainmanaticks="1" gainmanaamount="2000" manamultiplier="1.4" attackspeed="1000" soulmax="200" gainsoulticks="30" fromvoc="18" lessloss="50">
        <formula meleeDamage="3.0" distDamage="3.8" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.2" club="1.2" sword="1.2" axe="1.2" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="19" name="Warden" description="a warden" needpremium="1" gaincap="100" gainhp="1000" gainmana="100" gainhpticks="1" gainhpamount="2000" gainmanaticks="1" gainmanaamount="2000" manamultiplier="3.0" attackspeed="1000" soulmax="200" gainsoulticks="30" fromvoc="19" lessloss="50">
        <formula meleeDamage="3.2" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="20" name="Barbarian" description="a barbarian" needpremium="1" gaincap="100" gainhp="500" gainmana="100" gainhpticks="1" gainhpamount="2000" gainmanaticks="1" gainmanaamount="2000" manamultiplier="3.0" attackspeed="1000" soulmax="200" gainsoulticks="30" fromvoc="20" lessloss="50">
        <formula meleeDamage="3.8" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
</vocations>
 
i stated i had tried using the ids of 1-4 then 5-9 and their own id's i just pasted the latest variation i had tried, you just chose not to read everything i wrote, if it helps, this is how the script looks now and it still does the same thing.
Lua:
<?xml version="1.0" encoding="UTF-8"?>
<vocations>
    <vocation id="0" name="None" description="none" needpremium="0" gaincap="5" gainhp="5" gainmana="5" gainhpticks="6" gainhpamount="1" gainmanaticks="6" gainmanaamount="1" manamultiplier="4.0" attackspeed="2000" soulmax="100" gainsoulticks="30" fromvoc="0" attackable="no">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="1" name="Sorcerer" description="a sorcerer" needpremium="0" gaincap="25" gainhp="15" gainmana="50" gainhpticks="1" gainhpamount="10" gainmanaticks="1" gainmanaamount="10" manamultiplier="1.1" attackspeed="2000" soulmax="100" gainsoulticks="30" fromvoc="1">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="2" name="Druid" description="a druid" needpremium="0" gaincap="25" gainhp="15" gainmana="75" gainhpticks="1" gainhpamount="10" gainmanaticks="1" gainmanaamount="10" manamultiplier="1.1" attackspeed="2000" soulmax="100" gainsoulticks="30" fromvoc="2">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="3" name="Paladin" description="a paladin" needpremium="0" gaincap="40" gainhp="35" gainmana="30" gainhpticks="1" gainhpamount="10" gainmanaticks="1" gainmanaamount="10" manamultiplier="1.4" attackspeed="2000" soulmax="100" gainsoulticks="30" fromvoc="3">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.2" club="1.2" sword="1.2" axe="1.2" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="4" name="Knight" description="a knight" needpremium="0" gaincap="50" gainhp="100" gainmana="15" gainhpticks="1" gainhpamount="10" gainmanaticks="1" gainmanaamount="10" manamultiplier="3.0" attackspeed="2000" soulmax="100" gainsoulticks="30" fromvoc="4">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="5" name="Master Sorcerer" description="a master sorcerer" needpremium="1" gaincap="40" gainhp="25" gainmana="75" gainhpticks="1" gainhpamount="200" gainmanaticks="1" gainmanaamount="200" manamultiplier="1.1" attackspeed="1666" soulmax="150" gainsoulticks="30" fromvoc="1" lessloss="30">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="6" name="Elder Druid" description="an elder druid" needpremium="1" gaincap="40" gainhp="25" gainmana="100" gainhpticks="1" gainhpamount="200" gainmanaticks="1" gainmanaamount="200" manamultiplier="1.1" attackspeed="1666" soulmax="150" gainsoulticks="30" fromvoc="2" lessloss="30">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="7" name="Royal Paladin" description="a royal paladin" needpremium="1" gaincap="75" gainhp="50" gainmana="50" gainhpticks="1" gainhpamount="200" gainmanaticks="1" gainmanaamount="200" manamultiplier="1.4" attackspeed="1666" soulmax="150" gainsoulticks="30" fromvoc="3" lessloss="30">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.2" club="1.2" sword="1.2" axe="1.2" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="8" name="Elite Knight" description="an elite knight" needpremium="1" gaincap="100" gainhp="150" gainmana="25" gainhpticks="1" gainhpamount="200" gainmanaticks="1" gainmanaamount="200" manamultiplier="3.0" attackspeed="1666" soulmax="150" gainsoulticks="30" fromvoc="4" lessloss="30">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="9" name="Enlightened Sorcerer" description="an enlightened sorcerer" needpremium="1" gaincap="40" gainhp="30" gainmana="100" gainhpticks="1" gainhpamount="500" gainmanaticks="1" gainmanaamount="500" manamultiplier="1.1" attackspeed="1333" soulmax="200" gainsoulticks="30" fromvoc="5" lessloss="50">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="10" name="Enlightened Druid" description="an enlightened druid" needpremium="1" gaincap="40" gainhp="30" gainmana="150" gainhpticks="1" gainhpamount="500" gainmanaticks="1" gainmanaamount="500" manamultiplier="1.1" attackspeed="1333" soulmax="200" gainsoulticks="30" fromvoc="6" lessloss="50">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="11" name="Enlightened Paladin" description="an enlightened paladin" needpremium="1" gaincap="75" gainhp="65" gainmana="65" gainhpticks="1" gainhpamount="500" gainmanaticks="1" gainmanaamount="500" manamultiplier="1.4" attackspeed="1333" soulmax="200" gainsoulticks="30" fromvoc="7" lessloss="50">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.2" club="1.2" sword="1.2" axe="1.2" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="12" name="Enlightened Knight" description="an enlightened knight" needpremium="1" gaincap="100" gainhp="200" gainmana="30" gainhpticks="1" gainhpamount="500" gainmanaticks="1" gainmanaamount="500" manamultiplier="3.0" attackspeed="1333" soulmax="200" gainsoulticks="30" fromvoc="8" lessloss="50">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="13" name="Warlock" description="a warlock" needpremium="1" gaincap="40" gainhp="100" gainmana="500" gainhpticks="1" gainhpamount="2000" gainmanaticks="1" gainmanaamount="2000" manamultiplier="1.1" attackspeed="1000" soulmax="200" gainsoulticks="30" fromvoc="13" lessloss="50">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.2" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="14" name="Arcanist" description="an arcanist" needpremium="1" gaincap="40" gainhp="50" gainmana="200" gainhpticks="1" gainhpamount="2000" gainmanaticks="1" gainmanaamount="2000" manamultiplier="1.1" attackspeed="1000" soulmax="200" gainsoulticks="30" fromvoc="14" lessloss="50">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.8" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="15" name="Shaman" description="a shaman" needpremium="1" gaincap="40" gainhp="50" gainmana="250" gainhpticks="1" gainhpamount="2000" gainmanaticks="1" gainmanaamount="2000" manamultiplier="1.1" attackspeed="1000" soulmax="200" gainsoulticks="30" fromvoc="15" lessloss="50">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.8" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="16" name="Cleric" description="a cleric" needpremium="1" gaincap="40" gainhp="100" gainmana="600" gainhpticks="1" gainhpamount="2000" gainmanaticks="1" gainmanaamount="2000" manamultiplier="1.1" attackspeed="1000" soulmax="200" gainsoulticks="30" fromvoc="16" lessloss="50">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.2" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="17" name="Sentinel" description="a sentinel" needpremium="1" gaincap="75" gainhp="350" gainmana="350" gainhpticks="1" gainhpamount="2000" gainmanaticks="1" gainmanaamount="2000" manamultiplier="1.4" attackspeed="1000" soulmax="200" gainsoulticks="30" fromvoc="17" lessloss="50">
        <formula meleeDamage="3.0" distDamage="3.2" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.2" club="1.2" sword="1.2" axe="1.2" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="18" name="Marksman" description="a marksman" needpremium="1" gaincap="75" gainhp="150" gainmana="150" gainhpticks="1" gainhpamount="2000" gainmanaticks="1" gainmanaamount="2000" manamultiplier="1.4" attackspeed="1000" soulmax="200" gainsoulticks="30" fromvoc="18" lessloss="50">
        <formula meleeDamage="3.0" distDamage="3.8" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.2" club="1.2" sword="1.2" axe="1.2" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="19" name="Warden" description="a warden" needpremium="1" gaincap="100" gainhp="1000" gainmana="100" gainhpticks="1" gainhpamount="2000" gainmanaticks="1" gainmanaamount="2000" manamultiplier="3.0" attackspeed="1000" soulmax="200" gainsoulticks="30" fromvoc="19" lessloss="50">
        <formula meleeDamage="3.2" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="20" name="Barbarian" description="a barbarian" needpremium="1" gaincap="100" gainhp="500" gainmana="100" gainhpticks="1" gainhpamount="2000" gainmanaticks="1" gainmanaamount="2000" manamultiplier="3.0" attackspeed="1000" soulmax="200" gainsoulticks="30" fromvoc="20" lessloss="50">
        <formula meleeDamage="3.8" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
</vocations>

If the enlightened vocations work then try removing duplicates;

XML:
    <vocation id="13" name="Warlock" description="a warlock" needpremium="1" gaincap="40" gainhp="100" gainmana="500" gainhpticks="1" gainhpamount="2000" gainmanaticks="1" gainmanaamount="2000" manamultiplier="1.1" attackspeed="1000" soulmax="200" gainsoulticks="30" fromvoc="9" lessloss="50">

    <vocation id="14" name="Arcanist" description="an arcanist" needpremium="1" gaincap="40" gainhp="50" gainmana="200" gainhpticks="1" gainhpamount="2000" gainmanaticks="1" gainmanaamount="2000" manamultiplier="1.1" attackspeed="1000" soulmax="200" gainsoulticks="30" fromvoc="13" lessloss="50">

instead of

XML:
    <vocation id="13" name="Warlock" description="a warlock" needpremium="1" gaincap="40" gainhp="100" gainmana="500" gainhpticks="1" gainhpamount="2000" gainmanaticks="1" gainmanaamount="2000" manamultiplier="1.1" attackspeed="1000" soulmax="200" gainsoulticks="30" fromvoc="9" lessloss="50">

    <vocation id="14" name="Arcanist" description="an arcanist" needpremium="1" gaincap="40" gainhp="50" gainmana="200" gainhpticks="1" gainhpamount="2000" gainmanaticks="1" gainmanaamount="2000" manamultiplier="1.1" attackspeed="1000" soulmax="200" gainsoulticks="30" fromvoc="9" lessloss="50">
 
This is reverting arcanist(14) to warlock(13) then to enlightened sorc(9) but then does not continue reverting downwards.
Could there be a file somwhere that needs to be looked at? it seems that way.

Edit:
just to add, the promotion stat in phpmyadmin stays at 2 (2 promotions from sorc to master sorc to enlightened sorc) but does not change when setting the new voc, although i have tried manually setting the promotion level to 3 and higher but with the same results.

Edit2:
If it's possible to remove the code or file that demotes vocations for whatever reason could you explain where it could be hiding? as i have a working script that demotes non premmy players to the first vocations already.
im using tfs 0.4 for 8.6
 
Last edited:
This is reverting arcanist(14) to warlock(13) then to enlightened sorc(9) but then does not continue reverting downwards.
Could there be a file somwhere that needs to be looked at? it seems that way.

Edit:
just to add, the promotion stat in phpmyadmin stays at 2 (2 promotions from sorc to master sorc to enlightened sorc) but does not change when setting the new voc, although i have tried manually setting the promotion level to 3 and higher but with the same results.

Edit2:
If it's possible to remove the code or file that demotes vocations for whatever reason could you explain where it could be hiding? as i have a working script that demotes non premmy players to the first vocations already.
im using tfs 0.4 for 8.6

Most likely onLogin or onLogout:
data/creaturescripts/others

I've just tested it and all works perfectly after re-log/server restart, the code used:

Lua:
local pos = {x = 2183, y = 1224, z = 7}

function onStepIn(cid, item, position, fromPosition)
    print(getPlayerVocation(cid))
    if getPlayerVocation(cid) == 2 then
    doPlayerSetVocation(cid, 9)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "YOU ARE Super Knight!")
    elseif getPlayerVocation(cid) == 9 then
    doPlayerSetVocation(cid, 10)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "YOU ARE Super Knight CHOICE ONE!")
    end
    print("refresh")
    print(getPlayerVocation(cid))
return true
end


XML:
    <vocation id="9" clientid="1" name="Super Knight" description="an super knight" gaincap="25" gainhp="15" gainmana="5" gainhpticks="2" gainhpamount="20" gainmanaticks="3" gainmanaamount="40" manamultiplier="3.0" attackspeed="1500" basespeed="220" soulmax="200" gainsoulticks="15" fromvoc="8">
       <formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/>
       <skill id="0" multiplier="1.1"/>
       <skill id="1" multiplier="1.1"/>
       <skill id="2" multiplier="1.1"/>
       <skill id="3" multiplier="1.1"/>
       <skill id="4" multiplier="1.4"/>
       <skill id="5" multiplier="1.1"/>
       <skill id="6" multiplier="1.1"/>
   </vocation>
   <vocation id="10" clientid="1" name="Super Knight Choice One" description="an Super Knight Choice One" gaincap="25" gainhp="15" gainmana="5" gainhpticks="2" gainhpamount="20" gainmanaticks="3" gainmanaamount="40" manamultiplier="3.0" attackspeed="1500" basespeed="220" soulmax="200" gainsoulticks="15" fromvoc="9">
       <formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/>
       <skill id="0" multiplier="1.1"/>
       <skill id="1" multiplier="1.1"/>
       <skill id="2" multiplier="1.1"/>
       <skill id="3" multiplier="1.1"/>
       <skill id="4" multiplier="1.4"/>
       <skill id="5" multiplier="1.1"/>
       <skill id="6" multiplier="1.1"/>
   </vocation>
       <vocation id="11" clientid="1" name="Super Knight Choice Two" description="an Super Knight Choice Two" gaincap="25" gainhp="15" gainmana="5" gainhpticks="2" gainhpamount="20" gainmanaticks="3" gainmanaamount="40" manamultiplier="3.0" attackspeed="1500" basespeed="220" soulmax="200" gainsoulticks="15" fromvoc="9">
       <formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/>
       <skill id="0" multiplier="1.1"/>
       <skill id="1" multiplier="1.1"/>
       <skill id="2" multiplier="1.1"/>
       <skill id="3" multiplier="1.1"/>
       <skill id="4" multiplier="1.4"/>
       <skill id="5" multiplier="1.1"/>
       <skill id="6" multiplier="1.1"/>
   </vocation>


C2ErOTx.png
 
Thank you for all your help, I have found that the problem was solved after i used the promotion npc to promote you which suggests that the problem was with the promotion level in phpmyadmin was not changed but i do not want to use the npc if possible, can someone post the string of code used to change the promotion level in phpmyadmin please?

Edit:
after testing all vocations at the npc, i have found that sorcerer and paladin can promote to their 3rd and 4th promotion and do not revert when logging in or out, but strangely the knight when promoting to its 3rd will revert to a druid after login and its 4th promotion turns it into a knight with no promotion, and the druid somehow reverts to an unpromoted paladin and then into a 4th promotion paladin after 2 log ins, this has me baffled so please take a look at the scripts i am now using and let me know what the problem is, thank you.

1. vocations.xml
Lua:
<?xml version="1.0" encoding="UTF-8"?>
<vocations>
    <vocation id="0" name="None" description="none" needpremium="0" gaincap="5" gainhp="5" gainmana="5" gainhpticks="6" gainhpamount="1" gainmanaticks="6" gainmanaamount="1" manamultiplier="4.0" attackspeed="2000" soulmax="100" gainsoulticks="30" fromvoc="0" attackable="no">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="1" name="Sorcerer" description="a sorcerer" needpremium="0" gaincap="25" gainhp="15" gainmana="50" gainhpticks="1" gainhpamount="10" gainmanaticks="1" gainmanaamount="10" manamultiplier="1.1" attackspeed="2000" soulmax="100" gainsoulticks="30" fromvoc="1">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="2" name="Druid" description="a druid" needpremium="0" gaincap="25" gainhp="15" gainmana="75" gainhpticks="1" gainhpamount="10" gainmanaticks="1" gainmanaamount="10" manamultiplier="1.1" attackspeed="2000" soulmax="100" gainsoulticks="30" fromvoc="2">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="3" name="Paladin" description="a paladin" needpremium="0" gaincap="40" gainhp="35" gainmana="30" gainhpticks="1" gainhpamount="10" gainmanaticks="1" gainmanaamount="10" manamultiplier="1.4" attackspeed="2000" soulmax="100" gainsoulticks="30" fromvoc="3">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.2" club="1.2" sword="1.2" axe="1.2" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="4" name="Knight" description="a knight" needpremium="0" gaincap="50" gainhp="100" gainmana="15" gainhpticks="1" gainhpamount="10" gainmanaticks="1" gainmanaamount="10" manamultiplier="3.0" attackspeed="2000" soulmax="100" gainsoulticks="30" fromvoc="4">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="5" name="Master Sorcerer" description="a master sorcerer" needpremium="1" gaincap="40" gainhp="25" gainmana="75" gainhpticks="1" gainhpamount="200" gainmanaticks="1" gainmanaamount="200" manamultiplier="1.1" attackspeed="1666" soulmax="150" gainsoulticks="30" fromvoc="1" lessloss="30">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="6" name="Elder Druid" description="an elder druid" needpremium="1" gaincap="40" gainhp="25" gainmana="100" gainhpticks="1" gainhpamount="200" gainmanaticks="1" gainmanaamount="200" manamultiplier="1.1" attackspeed="1666" soulmax="150" gainsoulticks="30" fromvoc="2" lessloss="30">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="7" name="Royal Paladin" description="a royal paladin" needpremium="1" gaincap="75" gainhp="50" gainmana="50" gainhpticks="1" gainhpamount="200" gainmanaticks="1" gainmanaamount="200" manamultiplier="1.4" attackspeed="1666" soulmax="150" gainsoulticks="30" fromvoc="3" lessloss="30">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.2" club="1.2" sword="1.2" axe="1.2" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="8" name="Elite Knight" description="an elite knight" needpremium="1" gaincap="100" gainhp="150" gainmana="25" gainhpticks="1" gainhpamount="200" gainmanaticks="1" gainmanaamount="200" manamultiplier="3.0" attackspeed="1666" soulmax="150" gainsoulticks="30" fromvoc="4" lessloss="30">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="9" name="Enlightened Sorcerer" description="an enlightened sorcerer" needpremium="1" gaincap="40" gainhp="30" gainmana="100" gainhpticks="1" gainhpamount="500" gainmanaticks="1" gainmanaamount="500" manamultiplier="1.1" attackspeed="1333" soulmax="200" gainsoulticks="30" fromvoc="5" lessloss="50">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="10" name="Enlightened Druid" description="an enlightened druid" needpremium="1" gaincap="40" gainhp="30" gainmana="150" gainhpticks="1" gainhpamount="500" gainmanaticks="1" gainmanaamount="500" manamultiplier="1.1" attackspeed="1333" soulmax="200" gainsoulticks="30" fromvoc="6" lessloss="50">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="11" name="Enlightened Paladin" description="an enlightened paladin" needpremium="1" gaincap="75" gainhp="65" gainmana="65" gainhpticks="1" gainhpamount="500" gainmanaticks="1" gainmanaamount="500" manamultiplier="1.4" attackspeed="1333" soulmax="200" gainsoulticks="30" fromvoc="7" lessloss="50">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.2" club="1.2" sword="1.2" axe="1.2" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="12" name="Enlightened Knight" description="an enlightened knight" needpremium="1" gaincap="100" gainhp="200" gainmana="30" gainhpticks="1" gainhpamount="500" gainmanaticks="1" gainmanaamount="500" manamultiplier="3.0" attackspeed="1333" soulmax="200" gainsoulticks="30" fromvoc="8" lessloss="50">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="13" name="Warlock" description="a warlock" needpremium="1" gaincap="40" gainhp="100" gainmana="500" gainhpticks="1" gainhpamount="2000" gainmanaticks="1" gainmanaamount="2000" manamultiplier="1.1" attackspeed="1000" soulmax="200" gainsoulticks="30" fromvoc="9" lessloss="50">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.2" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="17" name="Arcanist" description="an arcanist" needpremium="1" gaincap="40" gainhp="50" gainmana="200" gainhpticks="1" gainhpamount="2000" gainmanaticks="1" gainmanaamount="2000" manamultiplier="1.1" attackspeed="1000" soulmax="200" gainsoulticks="30" fromvoc="13" lessloss="50">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.8" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="14" name="Cleric" description="a cleric" needpremium="1" gaincap="40" gainhp="100" gainmana="600" gainhpticks="1" gainhpamount="2000" gainmanaticks="1" gainmanaamount="2000" manamultiplier="1.1" attackspeed="1000" soulmax="200" gainsoulticks="30" fromvoc="10" lessloss="50">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.2" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="18" name="Shaman" description="a shaman" needpremium="1" gaincap="40" gainhp="50" gainmana="250" gainhpticks="1" gainhpamount="2000" gainmanaticks="1" gainmanaamount="2000" manamultiplier="1.1" attackspeed="1000" soulmax="200" gainsoulticks="30" fromvoc="14" lessloss="50">
        <formula meleeDamage="3.0" distDamage="3.0" wandDamage="3.8" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="15" name="Sentinel" description="a sentinel" needpremium="1" gaincap="75" gainhp="350" gainmana="350" gainhpticks="1" gainhpamount="2000" gainmanaticks="1" gainmanaamount="2000" manamultiplier="1.4" attackspeed="1000" soulmax="200" gainsoulticks="30" fromvoc="11" lessloss="50">
        <formula meleeDamage="3.0" distDamage="3.2" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.2" club="1.2" sword="1.2" axe="1.2" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="19" name="Marksman" description="a marksman" needpremium="1" gaincap="75" gainhp="150" gainmana="150" gainhpticks="1" gainhpamount="2000" gainmanaticks="1" gainmanaamount="2000" manamultiplier="1.4" attackspeed="1000" soulmax="200" gainsoulticks="30" fromvoc="15" lessloss="50">
        <formula meleeDamage="3.0" distDamage="3.8" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.2" club="1.2" sword="1.2" axe="1.2" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="16" name="Warden" description="a warden" needpremium="1" gaincap="100" gainhp="1000" gainmana="100" gainhpticks="1" gainhpamount="2000" gainmanaticks="1" gainmanaamount="2000" manamultiplier="3.0" attackspeed="1000" soulmax="200" gainsoulticks="30" fromvoc="12" lessloss="50">
        <formula meleeDamage="3.2" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="20" name="Barbarian" description="a barbarian" needpremium="1" gaincap="100" gainhp="500" gainmana="100" gainhpticks="1" gainhpamount="2000" gainmanaticks="1" gainmanaamount="2000" manamultiplier="3.0" attackspeed="1000" soulmax="200" gainsoulticks="30" fromvoc="16" lessloss="50">
        <formula meleeDamage="3.8" distDamage="3.0" wandDamage="3.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
</vocations>

2. vocations.lua
Lua:
function isSorcerer(cid)
    return isInArray({1, 5, 9, 13, 17}, getPlayerVocation(cid))
end

function isDruid(cid)
    return isInArray({2, 6, 10, 14, 18}, getPlayerVocation(cid))
end

function isPaladin(cid)
    return isInArray({3, 7, 11, 15, 19}, getPlayerVocation(cid))
end

function isKnight(cid)
    return isInArray({4, 8, 12, 16, 20}, getPlayerVocation(cid))
end

function isRookie(cid)
    return isInArray({0}, getPlayerVocation(cid))
end

3. promotion.lua (npc)
Lua:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

function onCreatureAppear(cid)            npcHandler:onCreatureAppear(cid)            end
function onCreatureDisappear(cid)        npcHandler:onCreatureDisappear(cid)            end
function onCreatureSay(cid, type, msg)        npcHandler:onCreatureSay(cid, type, msg)        end
function onThink()                npcHandler:onThink()                    end

local node1 = keywordHandler:addKeyword({'promot'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can promote you at level 50 for 500k. Do you want me to promote you?'})
    node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 500000, level = 50, promotion = 1, text = 'Congratulations! You are now promoted.'})
    node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})

local node2 = keywordHandler:addKeyword({'enlight'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can enlighten you at level 200 for 30kk. Do you want me to enlighten you?'})
    node2:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 30000000, level = 200, promotion = 2, text = 'Congratulations! You are now enlightened.'})
    node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})

local node3 = keywordHandler:addKeyword({'defense'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can expert promote you at level 500 for 100kk. Do you want me to expert promote you?'})
    node3:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 100000000, level = 500, promotion = 3, text = 'Congratulations! You are now an expert.'})
    node3:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})

local node4 = keywordHandler:addKeyword({'offense'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can expert promote you at level 500 for 100kk. Do you want me to expert promote you?'})
    node4:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 100000000, level = 500, promotion = 4, text = 'Congratulations! You are now an expert.'})
    node4:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})

npcHandler:addModule(FocusModule:new())

Edit:
The npc turns them into their vocations perfectly, they just change after login/logout although as i said, the sorcerer and the paladins 3rd and 4th promotion stays after login/logout but the druid/knight change vocation :S

Edit2:
Strangely, the knights 3rd promotion (warden(16)) changes to druid(2) then sorcer(1) then warlock(13) then stays on warlock... and the druid goes from cleric(14) to paladin(3) to sorcerer(1) to warlock(13) and stays there, this is really scrambling my brain.

P.S.
The creaturescripts files have no vocation checks onlogin or logout
 
Last edited:
Back
Top