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

mismatch vocations with database

thomson9292

New Member
Joined
Feb 28, 2017
Messages
97
Solutions
1
Reaction score
2
When I set for player vocation id 1 (sorc) in database, player has id 5 (MS) when he log into the game. For other vocations there is the same problem. I change to id 4 (druid) and player has id 8 (ek).

What is causing the problem?

I'm using tfs 1.3

My vocations.xml in /data/XML
XML:
<?xml version="1.0" encoding="UTF-8"?>
<vocations>
    <vocation id="0" clientid="0" name="None" description="none" gaincap="10" gainhp="5" gainmana="5" gainhpticks="12" gainhpamount="1" gainmanaticks="6" gainmanaamount="2" manamultiplier="4.0" attackspeed="2000" basespeed="220" soulmax="100" gainsoulticks="120" fromvoc="0">
        <formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0" />
        <skill id="0" multiplier="1.5" />
        <skill id="1" multiplier="2.0" />
        <skill id="2" multiplier="2.0" />
        <skill id="3" multiplier="2.0" />
        <skill id="4" multiplier="2.0" />
        <skill id="5" multiplier="1.5" />
        <skill id="6" multiplier="1.1" />
    </vocation>
    <vocation id="1" clientid="3" name="Sorcerer" description="a sorcerer" gaincap="10" gainhp="5" gainmana="30" gainhpticks="12" gainhpamount="1" gainmanaticks="3" gainmanaamount="2" manamultiplier="1.1" attackspeed="2000" basespeed="220" soulmax="100" gainsoulticks="120" fromvoc="1">
        <formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0" />
        <skill id="0" multiplier="1.5" />
        <skill id="1" multiplier="2.0" />
        <skill id="2" multiplier="2.0" />
        <skill id="3" multiplier="2.0" />
        <skill id="4" multiplier="2.0" />
        <skill id="5" multiplier="1.5" />
        <skill id="6" multiplier="1.1" />
    </vocation>
    <vocation id="2" clientid="4" name="Druid" description="a druid" gaincap="10" gainhp="5" gainmana="30" gainhpticks="12" gainhpamount="1" gainmanaticks="3" gainmanaamount="2" manamultiplier="1.1" attackspeed="2000" basespeed="220" soulmax="100" gainsoulticks="120" fromvoc="2">
        <formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0" />
        <skill id="0" multiplier="1.5" />
        <skill id="1" multiplier="1.8" />
        <skill id="2" multiplier="1.8" />
        <skill id="3" multiplier="1.8" />
        <skill id="4" multiplier="1.8" />
        <skill id="5" multiplier="1.5" />
        <skill id="6" multiplier="1.1" />
    </vocation>
    <vocation id="3" clientid="2" name="Paladin" description="a paladin" gaincap="20" gainhp="10" gainmana="15" gainhpticks="8" gainhpamount="1" gainmanaticks="4" gainmanaamount="2" manamultiplier="1.4" attackspeed="2000" basespeed="220" soulmax="100" gainsoulticks="120" fromvoc="3">
        <formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0" />
        <skill id="0" multiplier="1.2" />
        <skill id="1" multiplier="1.2" />
        <skill id="2" multiplier="1.2" />
        <skill id="3" multiplier="1.2" />
        <skill id="4" multiplier="1.1" />
        <skill id="5" multiplier="1.1" />
        <skill id="6" multiplier="1.1" />
    </vocation>
    <vocation id="4" clientid="1" name="Knight" description="a knight" gaincap="25" gainhp="15" gainmana="5" gainhpticks="6" gainhpamount="1" gainmanaticks="6" gainmanaamount="2" manamultiplier="3.0" attackspeed="2000" basespeed="220" soulmax="100" gainsoulticks="120" fromvoc="4">
        <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="5" clientid="3" name="Master Sorcerer" description="a master sorcerer" gaincap="10" gainhp="5" gainmana="30" gainhpticks="12" gainhpamount="1" gainmanaticks="2" gainmanaamount="2" manamultiplier="1.1" attackspeed="2000" basespeed="220" soulmax="200" gainsoulticks="15" fromvoc="1">
        <formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0" />
        <skill id="0" multiplier="1.5" />
        <skill id="1" multiplier="2.0" />
        <skill id="2" multiplier="2.0" />
        <skill id="3" multiplier="2.0" />
        <skill id="4" multiplier="2.0" />
        <skill id="5" multiplier="1.5" />
        <skill id="6" multiplier="1.1" />
    </vocation>
    <vocation id="6" clientid="4" name="Elder Druid" description="an elder druid" gaincap="10" gainhp="5" gainmana="30" gainhpticks="12" gainhpamount="1" gainmanaticks="2" gainmanaamount="2" manamultiplier="1.1" attackspeed="2000" basespeed="220" soulmax="200" gainsoulticks="15" fromvoc="2">
        <formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0" />
        <skill id="0" multiplier="1.5" />
        <skill id="1" multiplier="1.8" />
        <skill id="2" multiplier="1.8" />
        <skill id="3" multiplier="1.8" />
        <skill id="4" multiplier="1.8" />
        <skill id="5" multiplier="1.5" />
        <skill id="6" multiplier="1.1" />
    </vocation>
    <vocation id="7" clientid="2" name="Royal Paladin" description="a royal paladin" gaincap="20" gainhp="10" gainmana="15" gainhpticks="6" gainhpamount="1" gainmanaticks="3" gainmanaamount="2" manamultiplier="1.4" attackspeed="2000" basespeed="220" soulmax="200" gainsoulticks="15" fromvoc="3">
        <formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0" />
        <skill id="0" multiplier="1.2" />
        <skill id="1" multiplier="1.2" />
        <skill id="2" multiplier="1.2" />
        <skill id="3" multiplier="1.2" />
        <skill id="4" multiplier="1.1" />
        <skill id="5" multiplier="1.1" />
        <skill id="6" multiplier="1.1" />
    </vocation>
    <vocation id="8" clientid="1" name="Elite Knight" description="an elite knight" gaincap="25" gainhp="15" gainmana="5" gainhpticks="4" gainhpamount="1" gainmanaticks="6" gainmanaamount="2" manamultiplier="3.0" attackspeed="2000" basespeed="220" soulmax="200" gainsoulticks="15" fromvoc="4">
        <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>
</vocations>
 
Last edited by a moderator:
Voc ID 2 = druid, 4 = knight. Do you have some autopromote creaturescript after level 20?

EDIT: Post creaturescripts.xml and creaturescripts/scripts/login.lua
 
XML:
<?xml version="1.0" encoding="UTF-8"?>
<creaturescripts>
    <!-- Rookgaard Cockroach -->
    <event type="kill" name="TutorialCockroach" script="rookgaard/killCockroach.lua" />
    <event type="advance" name="AdvanceRookgaard" script="rookgaard/advance.lua" />

    <!-- Elemental Spheres Quest -->
    <event type="kill" name="ElementalSpheresOverlords" script="quests/elemental spheres/OverlordsKill.lua" />

    <!-- Bigfoot Burden Quest -->
    <event type="kill" name="BigfootBurdenVersperoth" script="quests/bigfoot burden/VersperothKill.lua" />
    <event type="kill" name="BigfootBurdenWarzone" script="quests/bigfoot burden/WarzoneKill.lua" />
    <event type="kill" name="BigfootBurdenWeeper" script="quests/bigfoot burden/WeeperKill.lua" />
    <event type="kill" name="BigfootBurdenWiggler" script="quests/bigfoot burden/WigglerKill.lua" />

    <!-- Svargrond Arena: Killing a boss -->
    <event type="kill" name="SvargrondArenaKill" script="quests/svargrond arena/arena_kill.lua" />

    <!-- The New Frontier Quest -->
    <event type="kill" name="NewFrontierShardOfCorruption" script="quests/the new frontier/ShardOfCorruption.lua" />
    <event type="kill" name="NewFrontierTirecz" script="quests/the new frontier/TireczKill.lua" />

    <!-- In Service Of Yalahar Quest -->
    <event type="kill" name="ServiceOfYalaharAzerus" script="quests/in service of yalahar/AzerusKill.lua" />
    <event type="kill" name="ServiceOfYalaharDiseasedTrio" script="quests/in service of yalahar/DiseasedTrioKill.lua" />
    <event type="kill" name="ServiceOfYalaharQuaraLeaders" script="quests/in service of yalahar/QuaraLeadersKill.lua" />

    <!-- Inquisition Quest -->
    <event type="kill" name="InquisitionBosses" script="quests/inquisition/inquisitionQuestBosses.lua" />
    <event type="kill" name="InquisitionUngreez" script="quests/inquisition/inquisitionQuestUngreez.lua" />

    <!-- Killing In The Name Of Quest -->
    <event type="kill" name="KillingInTheNameOfKills" script="quests/killing in the name of/kills.lua" />

    <!-- The Masters Voice Quest -->
    <event type="kill" name="MastersVoiceServants" script="quests/their master's voice/ServantsKill.lua" />

    <!-- Thieves Guild Quest -->
    <event type="kill" name="ThievesGuildNomad" script="others/nomad.lua" />

    <!-- Secret Service Quest -->
    <event type="kill" name="SecretServiceBlackKnight" script="others/blackKnight.lua" />

    <!-- Wrath of the Emperor Quest -->
    <event type="kill" name="WotELizardMagistratus" script="quests/wrath of the emperor/lizardmagistratus.lua" />
    <event type="kill" name="WotELizardNoble" script="quests/wrath of the emperor/lizardnoble.lua" />
    <event type="kill" name="WotEKeeper" script="quests/wrath of the emperor/keeper.lua" />
    <event type="kill" name="WotEBosses" script="quests/wrath of the emperor/bosses.lua" />
    <event type="kill" name="WotEZalamon" script="quests/wrath of the emperor/zalamon.lua" />

    <!-- Pythius The Rotten (Firewalker Boots Quest) -->
    <event type="kill" name="PythiusTheRotten" script="others/PythiusTheRotten.lua" />

    <!-- Others -->
    <event type="login" name="PlayerLogin" script="others/login.lua" />
    <event type="login" name="FirstItems" script="others/firstitems.lua" />
    <event type="login" name="RegenerateStamina" script="others/regeneratestamina.lua" />
    <event type="login" name="OfflineTraining" script="others/offlinetraining.lua" />

    <event type="logout" name="PlayerLogout" script="others/logout.lua" />

    <event type="death" name="PlayerDeath" script="others/playerdeath.lua" />
    <event type="death" name="DropLoot" script="others/droploot.lua" />
    <event type="advance" name="AdvanceSave" script="others/advance_save.lua" />

    <event type="death" name="WhiteDeerDeath" script="others/whitedeer.lua" />
   <event type="death" name="WhiteDeerScoutsDeath" script="others/whitedeer_scouts.lua" />
   <event type="think" name="GazharagothHeal" script="others/gaz'haragoth_heal.lua" />
   <event type="preparedeath" name="MonsterHeal" script="others/monster_heal.lua" />
   <event type="preparedeath" name="MonsterHeal2" script="others/monster_heal2.lua" />
   <event type="death" name="NorthernPike" script="others/northern pike.lua" />
   <event type="think" name="OmrafirExplode" script="others/omrafir explode.lua" />
   <event type="think" name="ShlorgTp" script="others/shlorg tp.lua" />
   <event type="think" name="ThePaleCountTp" script="others/the pale count tp.lua" />
   <event type="think" name="WelterEgg" script="others/welter egg.lua" />
   <event type="death" name="Wyda" script="others/wyda.lua" />
   <event type="think" name="ZavarashHide" script="others/zavarash hide.lua" />
   <event type="death" name="RagingMage" script="others/raging mage.lua" />
   <event type="death" name="RagingMage2" script="others/raging mage2.lua" />
   <event type="death" name="Yielothax" script="others/yielothax.lua" />
   <event type="think" name="GreaterMinion" script="others/greater_minion.lua" />
   <event type="think" name="SuperiorMinion" script="others/superior_minion.lua" />
   <event type="think" name="NecromanticMinion" script="others/necromantic_minion.lua" />
   <event type="think" name="ShargonGrowthCheck" script="others/shargon growth check.lua" />
   <event type="think" name="TheRavagerHeal" script="others/the ravager heal.lua" />
   <event type="think" name="CanopicJar" script="others/canopic jar.lua" />
   <event type="death" name="GloothHorror" script="others/glooth horror.lua" />

</creaturescripts>

Lua:
-- ordered as in creaturescripts.xml
local events = {
    'TutorialCockroach',
    'ElementalSpheresOverlords',
    'BigfootBurdenVersperoth',
    'BigfootBurdenWarzone',
    'BigfootBurdenWeeper',
    'BigfootBurdenWiggler',
    'SvargrondArenaKill',
    'NewFrontierShardOfCorruption',
    'NewFrontierTirecz',
    'ServiceOfYalaharDiseasedTrio',
    'ServiceOfYalaharAzerus',
    'ServiceOfYalaharQuaraLeaders',
    'InquisitionBosses',
    'InquisitionUngreez',
    'KillingInTheNameOfKills',
    'MastersVoiceServants',
    'SecretServiceBlackKnight',
    'ThievesGuildNomad',
    'WotELizardMagistratus',
    'WotELizardNoble',
    'WotEKeeper',
    'WotEBosses',
    'WotEZalamon',
    'PlayerDeath',
    'AdvanceSave',
    'AdvanceRookgaard',
    'PythiusTheRotten',
    'DropLoot'
}

local function onMovementRemoveProtection(cid, oldPosition, time)
    local player = Player(cid)
    if not player then
        return true
    end

    local playerPosition = player:getPosition()
    if (playerPosition.x ~= oldPosition.x or playerPosition.y ~= oldPosition.y or playerPosition.z ~= oldPosition.z) or player:getTarget() or time <= 0 then
        player:setStorageValue(Storage.combatProtectionStorage, 0)
        return true
    end

    addEvent(onMovementRemoveProtection, 1000, cid, oldPosition, time - 1)
end

function onLogin(player)
    local loginStr = 'Welcome to ' .. configManager.getString(configKeys.SERVER_NAME) .. '!'
    if player:getLastLoginSaved() <= 0 then
        loginStr = loginStr .. ' Please choose your outfit.'
        player:sendTutorial(1)
    else
        if loginStr ~= '' then
            player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)
        end

        loginStr = string.format('Your last visit was on %s.', os.date('%a %b %d %X %Y', player:getLastLoginSaved()))
    end
    player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)

    local playerId = player:getId()

    -- Stamina
    nextUseStaminaTime[playerId] = 0

    -- Promotion
    local vocation = player:getVocation()
    local promotion = vocation:getPromotion()
    if player:isPremium() then
        local value = player:getStorageValue(Storage.Promotion)
        if not promotion and value ~= 1 then
            player:setStorageValue(Storage.Promotion, 1)
        elseif value == 1 then
            player:setVocation(promotion)
        end
    elseif not promotion then
        player:setVocation(vocation:getDemotion())
    end

    -- Events
    for i = 1, #events do
        player:registerEvent(events[i])
    end

    if player:getStorageValue(Storage.combatProtectionStorage) <= os.time() then
        player:setStorageValue(Storage.combatProtectionStorage, os.time() + 10)
        onMovementRemoveProtection(playerId, player:getPosition(), 10)
    end
    return true
end
 
Last edited by a moderator:
I'm sorry, I can't see anything wrong in any of those, might it be the rookgard script that promotes you when you exit rookgard?(Just a thought)
EDIT:
Just noticed you have something called
Lua:
clientid="x"
I have no idea about it nor if it interferes with vocationid.
I'm gonna have to pass on this unless rookgard script shows something, sorry!

EDIT2: Just one more thought, when you change vocID of a character in DB, is it a character that you have previously played on or used and gotten promotion with? Because the promotion is saved as a storage and everytime you login with premium you get promoted as long as you have had promotion once.
 
Last edited:
It happens to players who never had promotion and after relog sorc become MS. But as I said before maybe it is not only promotion issue cos when player is druid id 4 he become ek id 8. I will send my rookgaard script when I come back home.
 
It happens to players who never had promotion and after relog sorc become MS. But as I said before maybe it is not only promotion issue cos when player is druid id 4 he become ek id 8. I will send my rookgaard script when I come back home.
Usually druid vocID is 2 and knight is 4.
So does your vocations.xml say
XML:
vocation id="4"
for knight.
 
Back
Top