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

Promotion and database

brunotuegostoso

New Member
Joined
Sep 27, 2019
Messages
14
Reaction score
1
hello, i'm getting promoted in the game but in the database it goes with vocations 1,2,3,4. I would like to know how to fix this;
because I am having problems with my website.
use tfs 0.4
 
I don't know where the database can be configured
Screenshot_2.png
Screenshot_3.pngScreenshot_4.png



the vocation of the database does not change to that of promotion
but in the game promotion works normally
 
queen eloise


LUA:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

local Topic = {}

function greetCallback(cid)
    Topic[cid] = 0
    return true
end

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
--keywordHandler:addKeyword({'uniform'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "The uniforms of our guards and soldiers are of unparraleled quality of course."})


function creatureSayCallback(cid, type, msg)
    if (msgcontains(msg, 'hail') or msgcontains(msg, 'hello') or msgcontains(msg, 'salutations')) and msgcontains(msg, 'queen') and (not npcHandler:isFocused(cid)) then
        npcHandler:say('I greet thee, my loyal subject.', cid)
        npcHandler:addFocus(cid)
        Topic[cid] = 0
    elseif(not npcHandler:isFocused(cid)) then
        return false
    elseif msgcontains(msg, 'bye') or msgcontains(msg, 'farewell') then
        npcHandler:say('Farewell, '..getCreatureName(cid)..'!', cid, TRUE)
        Topic[cid] = nil
        npcHandler:releaseFocus(cid)
    elseif msgcontains(msg, 'promotion') then
        npcHandler:say('Do you want to be promoted in your vocation for 20000 gold?', cid)
        Topic[cid] = 1
    elseif msgcontains(msg, 'yes') and Topic[cid] == 1 then
        if getPlayerPromotionLevel(cid) >= 1 then
            npcHandler:say('You are already promoted.', cid)
        elseif getPlayerLevel(cid) < 20 then
            npcHandler:say('You need to be at least level 20 in order to be promoted.', cid)
        elseif getPlayerMoney(cid) < 20000 then
            npcHandler:say('You do not have enough money.', cid)
        elseif isPremium(cid) then
            npcHandler:say('Congratulations! You are now promoted. Visit the sage Eremo for new spells.', cid)
            setPlayerPromotionLevel(cid, 1)
            doPlayerRemoveMoney(cid, 20000)
        else
            npcHandler:say('You need a premium account in order to promote.', cid)
        end
        Topic[cid] = 0
    elseif Topic[cid] == 1 then
        npcHandler:say('Ok, whatever.', cid)
        Topic[cid] = 0
    elseif (msgcontains(msg, 'uniforms') or msgcontains(msg, 'uniform')) then
    if (getPlayerStorageValue(cid, 100168) == 18) then
        npcHandler:say('I remember about those uniforms, they had a camouflage inlay so they could be worn the inside out too. I will send some color samples via mail to Mr. Postner.', cid)
        setPlayerStorageValue(cid, 100168, 19)
        setPlayerStorageValue(cid,100171,24)
    else
        npcHandler:say('The uniforms of our guards and soldiers are of unparraleled quality of course.', cid)   
    end
    end
    return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)


LUA:
<?xml version="1.0" encoding="UTF-8"?>
<vocations>
    <vocation id="0" clientId="0" name="None" description="none" needpremium="0" gaincap="10" gainhp="5" gainmana="5" gainhpticks="4" gainhpamount="4" gainmanaticks="6" gainmanaamount="3" manamultiplier="4.0" attackspeed="2000" soulmax="100" gainsoulticks="120" fromvoc="0" attackable="no" droploot="no">
        <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.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" clientId="3" name="Sorcerer" description="a sorcerer" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="8" gainhpamount="2" gainmanaticks="3" gainmanaamount="3" manamultiplier="1.1" attackspeed="2000" soulmax="100" gainsoulticks="120" fromvoc="1">
        <formula meleeDamage="0.7" distDamage="0.8" wandDamage="1.0" magDamage="0.9" 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" clientId="4" name="Druid" description="a druid" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="8" gainhpamount="2" gainmanaticks="3" gainmanaamount="3" manamultiplier="1.1" attackspeed="2000" soulmax="100" gainsoulticks="120" fromvoc="2">
        <formula meleeDamage="0.7" distDamage="0.8" wandDamage="1.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" clientId="2" name="Paladin" description="a paladin" needpremium="0" gaincap="20" gainhp="10" gainmana="15" gainhpticks="6" gainhpamount="3" gainmanaticks="4" gainmanaamount="4" manamultiplier="1.4" attackspeed="1800" soulmax="100" gainsoulticks="120" fromvoc="3">
        <formula meleeDamage="1.0" distDamage="1.2" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="0.8" 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" clientId="1" name="Knight" description="a knight" needpremium="0" gaincap="25" gainhp="15" gainmana="5" gainhpticks="4" gainhpamount="2" gainmanaticks="6" gainmanaamount="4" manamultiplier="3.0" attackspeed="1800" soulmax="100" gainsoulticks="120" fromvoc="4">
        <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.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" clientId="3" name="Master Sorcerer" description="a master sorcerer" needpremium="1" gaincap="10" gainhp="5" gainmana="30" gainhpticks="6" gainhpamount="2" gainmanaticks="2" gainmanaamount="4" manamultiplier="1.1" attackspeed="2000" soulmax="200" gainsoulticks="1" fromvoc="1" lessloss="30">
        <formula meleeDamage="0.7" distDamage="0.8" wandDamage="1.0" magDamage="0.9" 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" clientId="4" name="Elder Druid" description="an elder druid" needpremium="1" gaincap="10" gainhp="5" gainmana="30" gainhpticks="6" gainhpamount="2" gainmanaticks="2" gainmanaamount="4" manamultiplier="1.1" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="2" lessloss="30">
        <formula meleeDamage="0.7" distDamage="0.8" wandDamage="1.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" clientId="2" name="Royal Paladin" description="a royal paladin" needpremium="1" gaincap="20" gainhp="10" gainmana="15" gainhpticks="5" gainhpamount="4" gainmanaticks="3" gainmanaamount="4" manamultiplier="1.4" attackspeed="1800" soulmax="200" gainsoulticks="15" fromvoc="3" lessloss="30">
        <formula meleeDamage="1.0" distDamage="1.2" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="0.8" 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" clientId="1" name="Elite Knight" description="an elite knight" needpremium="1" gaincap="25" gainhp="15" gainmana="5" gainhpticks="4" gainhpamount="4" gainmanaticks="6" gainmanaamount="4" manamultiplier="3.0" attackspeed="1800" soulmax="200" gainsoulticks="15" fromvoc="4" lessloss="30">
        <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.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>
 
Try inserting this query
SQL:
INSERT INTO `players` (`id`, `name`, `world_id`, `group_id`, `account_id`, `level`, `vocation`, `health`, `healthmax`, `experience`, `lookbody`, `lookfeet`, `lookhead`, `looklegs`, `looktype`, `lookaddons`, `maglevel`, `mana`, `manamax`, `manaspent`, `soul`, `town_id`, `posx`, `posy`, `posz`, `conditions`, `cap`, `sex`, `lastlogin`, `lastip`, `save`, `skull`, `skulltime`, `rank_id`, `guildnick`, `lastlogout`, `blessings`, `balance`, `stamina`, `direction`, `loss_experience`, `loss_mana`, `loss_skills`, `loss_containers`, `loss_items`, `premend`, `online`, `marriage`, `promotion`, `deleted`, `description`, `created`, `nick_verify`, `old_name`, `hide_char`, `comment`) VALUES
            (NULL, "Sorcerer Sample", 0, 1, 1, 1, 1, 150, 150, 0, 0, 0, 0, 0, 110, 0, 0, 0, 0, 0, 0, 0, 50, 50, 7, "", 400, 0, 0, 0, 0, 0, 0, 0, "", 0, 0, 0, 201660000, 0, 100, 100, 100, 100, 100, 0, 0, 0, 0, 0, "", 0, 0, "", 0, "");
INSERT INTO `players` (`id`, `name`, `world_id`, `group_id`, `account_id`, `level`, `vocation`, `health`, `healthmax`, `experience`, `lookbody`, `lookfeet`, `lookhead`, `looklegs`, `looktype`, `lookaddons`, `maglevel`, `mana`, `manamax`, `manaspent`, `soul`, `town_id`, `posx`, `posy`, `posz`, `conditions`, `cap`, `sex`, `lastlogin`, `lastip`, `save`, `skull`, `skulltime`, `rank_id`, `guildnick`, `lastlogout`, `blessings`, `balance`, `stamina`, `direction`, `loss_experience`, `loss_mana`, `loss_skills`, `loss_containers`, `loss_items`, `premend`, `online`, `marriage`, `promotion`, `deleted`, `description`, `created`, `nick_verify`, `old_name`, `hide_char`, `comment`) VALUES
            (NULL, "Druid Sample", 0, 1, 1, 1, 2, 150, 150, 0, 0, 0, 0, 0, 110, 0, 0, 0, 0, 0, 0, 0, 50, 50, 7, "", 400, 0, 0, 0, 0, 0, 0, 0, "", 0, 0, 0, 201660000, 0, 100, 100, 100, 100, 100, 0, 0, 0, 0, 0, "", 0, 0, "", 0, "");
INSERT INTO `players` (`id`, `name`, `world_id`, `group_id`, `account_id`, `level`, `vocation`, `health`, `healthmax`, `experience`, `lookbody`, `lookfeet`, `lookhead`, `looklegs`, `looktype`, `lookaddons`, `maglevel`, `mana`, `manamax`, `manaspent`, `soul`, `town_id`, `posx`, `posy`, `posz`, `conditions`, `cap`, `sex`, `lastlogin`, `lastip`, `save`, `skull`, `skulltime`, `rank_id`, `guildnick`, `lastlogout`, `blessings`, `balance`, `stamina`, `direction`, `loss_experience`, `loss_mana`, `loss_skills`, `loss_containers`, `loss_items`, `premend`, `online`, `marriage`, `promotion`, `deleted`, `description`, `created`, `nick_verify`, `old_name`, `hide_char`, `comment`) VALUES
            (NULL, "Paladin Sample", 0, 1, 1, 1, 3, 150, 150, 0, 0, 0, 0, 0, 110, 0, 0, 0, 0, 0, 0, 0, 50, 50, 7, "", 400, 0, 0, 0, 0, 0, 0, 0, "", 0, 0, 0, 201660000, 0, 100, 100, 100, 100, 100, 0, 0, 0, 0, 0, "", 0, 0, "", 0, "");
INSERT INTO `players` (`id`, `name`, `world_id`, `group_id`, `account_id`, `level`, `vocation`, `health`, `healthmax`, `experience`, `lookbody`, `lookfeet`, `lookhead`, `looklegs`, `looktype`, `lookaddons`, `maglevel`, `mana`, `manamax`, `manaspent`, `soul`, `town_id`, `posx`, `posy`, `posz`, `conditions`, `cap`, `sex`, `lastlogin`, `lastip`, `save`, `skull`, `skulltime`, `rank_id`, `guildnick`, `lastlogout`, `blessings`, `balance`, `stamina`, `direction`, `loss_experience`, `loss_mana`, `loss_skills`, `loss_containers`, `loss_items`, `premend`, `online`, `marriage`, `promotion`, `deleted`, `description`, `created`, `nick_verify`, `old_name`, `hide_char`, `comment`) VALUES
            (NULL, "Knight Sample", 0, 1, 1, 1, 4, 150, 150, 0, 0, 0, 0, 0, 110, 0, 0, 0, 0, 0, 0, 0, 50, 50, 7, "", 400, 0, 0, 0, 0, 0, 0, 0, "", 0, 0, 0, 201660000, 0, 100, 100, 100, 100, 100, 0, 0, 0, 0, 0, "", 0, 0, "", 0, "");
 
I think it's because when a player gets promoted its base vocation doesn't change, what changes is the value of the column promotion, so you'll probably have to check there
say a player's vocation is 4 and promotion is 1, that means he's an elite knight

check out your db for your example character, it probably has promotion 1 now
 
Which answer here is the best answer? Because you marked a reply without information as Best answer.
Did the query work? or database update? so I can add "best answer" on the right place instead of just a reply.
 
Back
Top