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

Feature [TFS 1.3] Adding New Skills

Is it any way to apply a new skill on a database with previously writen characters?
I tried to apply the new skill, but my players are causing debug.
You could most likely write a query to add whats neccessary to the database. Can't tell you exactly how should the query would look like because I also dont know, but I know it is possible.

If you dont want to wait for someone to tell you exactly how, just look for how to use SQL Queries.

TLDR: Use SQL Queries An Introductory SQL Tutorial: How to Write Simple Queries (https://blog.hubspot.com/marketing/sql-tutorial-introduction)
 
@demon088 sry for the late reply, this should do the trick to alter an existing db:

SQL:
ALTER TABLE players
ADD COLUMN skill_runecraft int(10) unsigned NOT NULL DEFAULT 10,
ADD COLUMN skill_runecraft_tries bigint(20) unsigned NOT NULL DEFAULT 0;
 
How can I make this code work for version 12.72? I place everything correctly in each section and when compiling it it does not give an error but when I enter the client it is still only until the fishing
 
How do you make it so that if you make runes (for runecraft) or if you add a mining skill that everything you use the weapon/tool (pick) that it raises that skill? i followed the tutorial but i dont see it getting the tries, im trying for two handed weapons for example
 
How can I make this code work for version 12.72? I place everything correctly in each section and when compiling it it does not give an error but when I enter the client it is still only until the fishing
Not sure if something was modified in the otclient source. I encourage you to ask in the support board as I'm clueless about any changes.
How do you make it so that if you make runes (for runecraft) or if you add a mining skill that everything you use the weapon/tool (pick) that it raises that skill? i followed the tutorial but i dont see it getting the tries, im trying for two handed weapons for example
You can find for example the rune you're casting and add:
Lua:
player:addSkillTries(Runecraft, 1)
This will add 1 experience tick to that skill. Adjust the experience accordingly, the same goes for the mining tool that you use on different rocks I assume. Just add it in the mining script whenever the player tries to mine something.

For the two handed weapons variation of it, I don't actually have the answer. I'm sure it could be done in lua but it's been so long since I've coded anything ot related I can't guide you on that one. You always have the support or request boards for these type of things.
 
Thank you for the answer Ramirow! I got what you mean and I will try it out. Now i want to add another weapon and that is where im stuck because its not a melee weapon lol but i will keep trying and search if i cant. thanks
 
Thank you for the answer Ramirow! I got what you mean and I will try it out. Now i want to add another weapon and that is where im stuck because its not a melee weapon lol but i will keep trying and search if i cant. thanks
well there is the onGainSkillTries event...
 
Hey, thanks for the useful enhancement!!!

But, unfortunately, I couldnt make it work on my souce. I changed all the files, as instructed, the server compiles fine, and the server runs without any bugs. But, once I log in with my character, the following error occurs:

3bf801654ddb4b03928763a93f77bfd1.png


By the way, i'm currently running TFS 1.4.1 (10.98). Any help?
Post automatically merged:

@demon088 sry for the late reply, this should do the trick to alter an existing db:

SQL:
ALTER TABLE players
ADD COLUMN skill_runecraft int(10) unsigned NOT NULL DEFAULT 10,
ADD COLUMN skill_runecraft_tries bigint(20) unsigned NOT NULL DEFAULT 0;

Okay, nevermind! Tried this and now it works! :D
 
Last edited:
can you edit the installation post? or maybe there is another post with the addition of skills on TFS 1.4.2?
 
View attachment 73846
what to add where? what symbol? will you help me?
C++:
query << "`skill_runecraft` = " << player->skills[SKILL_RUNECRAFT].level << ',';
query << "`skill_runecraft_tries` = " << player->skills[SKILL_RUNECRAFT].tries << ',';

Those are the correct symbols, I have used ' instead of ` at the time I wrote the post as I couldn't make the forum show the correct one because reasons (I don't really remember why it didn't appear at the time)
So, whenever im saying something about the "correct" symbol is basically to replace:
This one
C++:
'
For
C++:
`

Feel free to share if all ended up working smoothly for your tfs version.
 
C++:
query << "`skill_runecraft` = " << player->skills[SKILL_RUNECRAFT].level << ',';
query << "`skill_runecraft_tries` = " << player->skills[SKILL_RUNECRAFT].tries << ',';

Those are the correct symbols, I have used ' instead of ` at the time I wrote the post as I couldn't make the forum show the correct one because reasons (I don't really remember why it didn't appear at the time)
So, whenever im saying something about the "correct" symbol is basically to replace:
This one
C++:
'
For
C++:
`

Feel free to share if all ended up working smoothly for your tfs version.
while struggling with this
C++:
Knight Sample has logged in.
Knight Sample has logged out.
[Error - mysql_real_query] Query: UPDATE `players` SET `level` = 3,`group_id` = 1,`vocation` = 4,`health` = 55,`healthmax` = 185,`experience` = 300,`lookbody` = 118,`lookfeet` = 114,`lookhead` = 38,`looklegs` = 57,`looktype` = 131,`lookaddons` = 0,`maglevel` = 0,`mana` = 90,`manamax` = 90,
Message: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''skill_runecraft' = 10,'skill_runecraft_tries' = 0,`direction` = 3,`onlinetim...' at line 1
[Error - mysql_real_query] Query: UPDATE `players` SET `level` = 3,`group_id` = 1,`vocation` = 4,`health` = 55,`healthmax` = 185,`experience` = 300,`lookbody` = 118,`lookfeet` = 114,`lookhead` = 38,`looklegs` = 57,`looktype` = 131,`lookaddons` = 0,`maglevel` = 0,`mana` = 90,`manamax` = 90,
Message: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''skill_runecraft' = 10,'skill_runecraft_tries' = 0,`direction` = 3,`onlinetim...' at line 1
[Error - mysql_real_query] Query: UPDATE `players` SET `level` = 3,`group_id` = 1,`vocation` = 4,`health` = 55,`healthmax` = 185,`experience` = 300,`lookbody` = 118,`lookfeet` = 114,`lookhead` = 38,`looklegs` = 57,`looktype` = 131,`lookaddons` = 0,`maglevel` = 0,`mana` = 90,`manamax` = 90,
Message: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''skill_runecraft' = 10,'skill_runecraft_tries' = 0,`direction` = 3,`onlinetim...' at line 1
Error while saving player: Knight Sample
GM Gubailovo has logged in.

added to the database but does not help((
PHP:
ADD COLUMN skill_runecraft int(10) unsigned NOT NULL DEFAULT 10,
ADD COLUMN skill_runecraft_tries bigint(20) unsigned NOT NULL DEFAULT 0;
 
while struggling with this
Knight Sample has logged in.
Knight Sample has logged out.
[Error - mysql_real_query] Query: UPDATE players SET level = 3,group_id = 1,vocation = 4,health = 55,healthmax = 185,experience = 300,lookbody = 118,lookfeet = 114,lookhead = 38,looklegs = 57,looktype = 131,lookaddons = 0,maglevel = 0,mana = 90,manamax = 90,
Message: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''skill_runecraft' = 10,'skill_runecraft_tries' = 0,direction = 3,`onlinetim...' at line 1
[Error - mysql_real_query] Query: UPDATE players SET level = 3,group_id = 1,vocation = 4,health = 55,healthmax = 185,experience = 300,lookbody = 118,lookfeet = 114,lookhead = 38,looklegs = 57,looktype = 131,lookaddons = 0,maglevel = 0,mana = 90,manamax = 90,
Message: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''skill_runecraft' = 10,'skill_runecraft_tries' = 0,direction = 3,`onlinetim...' at line 1
[Error - mysql_real_query] Query: UPDATE players SET level = 3,group_id = 1,vocation = 4,health = 55,healthmax = 185,experience = 300,lookbody = 118,lookfeet = 114,lookhead = 38,looklegs = 57,looktype = 131,lookaddons = 0,maglevel = 0,mana = 90,manamax = 90,
Message: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''skill_runecraft' = 10,'skill_runecraft_tries' = 0,direction = 3,`onlinetim...' at line 1
Error while saving player: Knight Sample
GM Gubailovo has logged in.[/CODE]

added to the database but does not help((
ADD COLUMN skill_runecraft int(10) unsigned NOT NULL DEFAULT 10,
ADD COLUMN skill_runecraft_tries bigint(20) unsigned NOT NULL DEFAULT 0;
May I ask if, when you did the source changes, you used the exact messages I posted? As in those errors, you have for example:
'skill_runecraft_tries'
Instead of
C++:
`skill_runecraft_tries`

Go trough the source steps and check, as I wrote, remember to alter this symbol ( ' ) for ( ` )
Post automatically merged:

As I see the issue arises from iologindata.cpp mostly, I will paste here the same instructions with the correct syntax.

STEP 1
Search for:
C++:
bool IOLoginData::loadPlayerById(Player* player, uint32_t id)

Replace whole function below with:
C++:
{
    Database& db = Database::getInstance();
    return loadPlayer(
        player,
        db.storeQuery(fmt::format(
            "SELECT `id`, `name`, `account_id`, `group_id`, `sex`, `vocation`, `experience`, `level`, `maglevel`, `health`, `healthmax`, `blessings`, `mana`, `manamax`, `manaspent`, `soul`, `lookbody`, `lookfeet`, `lookhead`, `looklegs`, `looktype`, `lookaddons`, `lookmount`, `lookmounthead`, `lookmountbody`, `lookmountlegs`, `lookmountfeet`, `randomizemount`, `posx`, `posy`, `posz`, `cap`, `lastlogin`, `lastlogout`, `lastip`, `conditions`, `skulltime`, `skull`, `town_id`, `balance`, `offlinetraining_time`, `offlinetraining_skill`, `stamina`, `skill_fist`, `skill_fist_tries`, `skill_club`, `skill_club_tries`, `skill_sword`, `skill_sword_tries`, `skill_axe`, `skill_axe_tries`, `skill_dist`, `skill_dist_tries`, `skill_shielding`, `skill_shielding_tries`, `skill_fishing`, `skill_fishing_tries`, `skill_runecraft`, `skill_runecraft_tries`, `direction` FROM `players` WHERE `id` = {:d}",
            id)));
}

STEP 2
Search for:
C++:
bool IOLoginData::loadPlayerByName(Player* player, const std::string& name)

And the same as before, replace the whole function below with:
C++:
{
    Database& db = Database::getInstance();
    return loadPlayer(
        player,
        db.storeQuery(fmt::format(
            "SELECT `id`, `name`, `account_id`, `group_id`, `sex`, `vocation`, `experience`, `level`, `maglevel`, `health`, `healthmax`, `blessings`, `mana`, `manamax`, `manaspent`, `soul`, `lookbody`, `lookfeet`, `lookhead`, `looklegs`, `looktype`, `lookaddons`, `lookmount`, `lookmounthead`, `lookmountbody`, `lookmountlegs`, `lookmountfeet`, `randomizemount`, `posx`, `posy`, `posz`, `cap`, `lastlogin`, `lastlogout`, `lastip`, `conditions`, `skulltime`, `skull`, `town_id`, `balance`, `offlinetraining_time`, `offlinetraining_skill`, `stamina`, `skill_fist`, `skill_fist_tries`, `skill_club`, `skill_club_tries`, `skill_sword`, `skill_sword_tries`, `skill_axe`, `skill_axe_tries`, `skill_dist`, `skill_dist_tries`, `skill_shielding`, `skill_shielding_tries`, `skill_fishing`, `skill_fishing_tries`, `skill_runecraft`, `skill_runecraft_tries`,`direction` FROM `players` WHERE `name` = {:s}",
            db.escapeString(name))));
}

STEP 3

Search for this line:
C++:
static const std::string skillNames[]
You will find two static consts, the one you searched and skillNameTries just below it.
Replace them with these two new consts:
C++:
static const std::string skillNames[] = {"skill_fist", "skill_club",      "skill_sword",  "skill_axe",
                                             "skill_dist", "skill_shielding", "skill_fishing", "skill_runecraft"};
static const std::string skillNameTries[] = {"skill_fist_tries",   "skill_club_tries", "skill_sword_tries",
                                                 "skill_axe_tries",    "skill_dist_tries", "skill_shielding_tries",
                                                 "skill_fishing_tries", "skill_runecraft_tries"};

STEP 4
For our last step, search for:
C++:
query << "`skill_fishing_tries` = " << player->skills[SKILL_FISHING].tries << ',';
And under it paste the following querys:
C++:
query << "`skill_runecraft` = " << player->skills[SKILL_RUNECRAFT].level << ',';
query << "`skill_runecraft_tries` = " << player->skills[SKILL_RUNECRAFT].tries << ',';
 
Last edited:
May I ask if, when you did the source changes, you used the exact messages I posted? As in those errors, you have for example:

Instead of
C++:
`skill_runecraft_tries`

Go trough the source steps and check, as I wrote, remember to alter this symbol ( ' ) for ( ` )
Post automatically merged:

As I see the issue arises from iologindata.cpp mostly, I will paste here the same instructions with the correct syntax.

STEP 1
Search for:
C++:
bool IOLoginData::loadPlayerById(Player* player, uint32_t id)

Replace whole function below with:
C++:
{
    Database& db = Database::getInstance();
    return loadPlayer(
        player,
        db.storeQuery(fmt::format(
            "SELECT `id`, `name`, `account_id`, `group_id`, `sex`, `vocation`, `experience`, `level`, `maglevel`, `health`, `healthmax`, `blessings`, `mana`, `manamax`, `manaspent`, `soul`, `lookbody`, `lookfeet`, `lookhead`, `looklegs`, `looktype`, `lookaddons`, `lookmount`, `lookmounthead`, `lookmountbody`, `lookmountlegs`, `lookmountfeet`, `randomizemount`, `posx`, `posy`, `posz`, `cap`, `lastlogin`, `lastlogout`, `lastip`, `conditions`, `skulltime`, `skull`, `town_id`, `balance`, `offlinetraining_time`, `offlinetraining_skill`, `stamina`, `skill_fist`, `skill_fist_tries`, `skill_club`, `skill_club_tries`, `skill_sword`, `skill_sword_tries`, `skill_axe`, `skill_axe_tries`, `skill_dist`, `skill_dist_tries`, `skill_shielding`, `skill_shielding_tries`, `skill_fishing`, `skill_fishing_tries`, `skill_runecraft`, `skill_runecraft_tries`, `direction` FROM `players` WHERE `id` = {:d}",
            id)));
}

STEP 2
Search for:
C++:
bool IOLoginData::loadPlayerByName(Player* player, const std::string& name)

And the same as before, replace the whole function below with:
C++:
{
    Database& db = Database::getInstance();
    return loadPlayer(
        player,
        db.storeQuery(fmt::format(
            "SELECT `id`, `name`, `account_id`, `group_id`, `sex`, `vocation`, `experience`, `level`, `maglevel`, `health`, `healthmax`, `blessings`, `mana`, `manamax`, `manaspent`, `soul`, `lookbody`, `lookfeet`, `lookhead`, `looklegs`, `looktype`, `lookaddons`, `lookmount`, `lookmounthead`, `lookmountbody`, `lookmountlegs`, `lookmountfeet`, `randomizemount`, `posx`, `posy`, `posz`, `cap`, `lastlogin`, `lastlogout`, `lastip`, `conditions`, `skulltime`, `skull`, `town_id`, `balance`, `offlinetraining_time`, `offlinetraining_skill`, `stamina`, `skill_fist`, `skill_fist_tries`, `skill_club`, `skill_club_tries`, `skill_sword`, `skill_sword_tries`, `skill_axe`, `skill_axe_tries`, `skill_dist`, `skill_dist_tries`, `skill_shielding`, `skill_shielding_tries`, `skill_fishing`, `skill_fishing_tries`, `skill_runecraft`, `skill_runecraft_tries`,`direction` FROM `players` WHERE `name` = {:s}",
            db.escapeString(name))));
}

STEP 3
Search for this line:
C++:
static const std::string skillNames[]
You will find two static consts, the one you searched and skillNameTries just below it.
Replace them with these two new consts:
C++:
static const std::string skillNames[] = {"skill_fist", "skill_club",      "skill_sword",  "skill_axe",
                                             "skill_dist", "skill_shielding", "skill_fishing", "skill_runecraft"};
static const std::string skillNameTries[] = {"skill_fist_tries",   "skill_club_tries", "skill_sword_tries",
                                                 "skill_axe_tries",    "skill_dist_tries", "skill_shielding_tries",
                                                 "skill_fishing_tries", "skill_runecraft_tries"};

STEP 4
For our last step, search for:
C++:
query << "`skill_fishing_tries` = " << player->skills[SKILL_FISHING].tries << ',';
And under it paste the following querys:
C++:
query << "`skill_runecraft` = " << player->skills[SKILL_RUNECRAFT].level << ',';
query << "`skill_runecraft_tries` = " << player->skills[SKILL_RUNECRAFT].tries << ',';
thanks for the help, I really missed a couple( `) at the beginning. it works for me, but there is a small problem.
ezgif.com-video-to-gif.gif
Life leech
enums.h
C++:
enum ConditionParam_t {
    CONDITION_PARAM_OWNER = 1,
    CONDITION_PARAM_TICKS = 2,
    //CONDITION_PARAM_OUTFIT = 3,
    CONDITION_PARAM_HEALTHGAIN = 4,
    CONDITION_PARAM_HEALTHTICKS = 5,
    CONDITION_PARAM_MANAGAIN = 6,
    CONDITION_PARAM_MANATICKS = 7,
    CONDITION_PARAM_DELAYED = 8,
    CONDITION_PARAM_SPEED = 9,
    CONDITION_PARAM_LIGHT_LEVEL = 10,
    CONDITION_PARAM_LIGHT_COLOR = 11,
    CONDITION_PARAM_SOULGAIN = 12,
    CONDITION_PARAM_SOULTICKS = 13,
    CONDITION_PARAM_MINVALUE = 14,
    CONDITION_PARAM_MAXVALUE = 15,
    CONDITION_PARAM_STARTVALUE = 16,
    CONDITION_PARAM_TICKINTERVAL = 17,
    CONDITION_PARAM_FORCEUPDATE = 18,
    CONDITION_PARAM_SKILL_MELEE = 19,
    CONDITION_PARAM_SKILL_FIST = 20,
    CONDITION_PARAM_SKILL_CLUB = 21,
    CONDITION_PARAM_SKILL_SWORD = 22,
    CONDITION_PARAM_SKILL_AXE = 23,
    CONDITION_PARAM_SKILL_DISTANCE = 24,
    CONDITION_PARAM_SKILL_SHIELD = 25,
    CONDITION_PARAM_SKILL_FISHING = 26,
    CONDITION_PARAM_STAT_MAXHITPOINTS = 27,
    CONDITION_PARAM_STAT_MAXMANAPOINTS = 28,
    // CONDITION_PARAM_STAT_SOULPOINTS = 29,
    CONDITION_PARAM_STAT_MAGICPOINTS = 30,
    CONDITION_PARAM_STAT_MAXHITPOINTSPERCENT = 31,
    CONDITION_PARAM_STAT_MAXMANAPOINTSPERCENT = 32,
    // CONDITION_PARAM_STAT_SOULPOINTSPERCENT = 33,
    CONDITION_PARAM_STAT_MAGICPOINTSPERCENT = 34,
    CONDITION_PARAM_PERIODICDAMAGE = 35,
    CONDITION_PARAM_SKILL_MELEEPERCENT = 36,
    CONDITION_PARAM_SKILL_FISTPERCENT = 37,
    CONDITION_PARAM_SKILL_CLUBPERCENT = 38,
    CONDITION_PARAM_SKILL_SWORDPERCENT = 39,
    CONDITION_PARAM_SKILL_AXEPERCENT = 40,
    CONDITION_PARAM_SKILL_DISTANCEPERCENT = 41,
    CONDITION_PARAM_SKILL_SHIELDPERCENT = 42,
    CONDITION_PARAM_SKILL_FISHINGPERCENT = 43,
    CONDITION_PARAM_BUFF_SPELL = 44,
    CONDITION_PARAM_SUBID = 45,
    CONDITION_PARAM_FIELD = 46,
    CONDITION_PARAM_DISABLE_DEFENSE = 47,
    CONDITION_PARAM_SKILL_RUNECRAFT = 48,
    CONDITION_PARAM_SKILL_RUNECRAFTPERCENT = 49,
    CONDITION_PARAM_SPECIALSKILL_CRITICALHITCHANCE = 50,
    CONDITION_PARAM_SPECIALSKILL_CRITICALHITAMOUNT = 51,
    CONDITION_PARAM_SPECIALSKILL_LIFELEECHCHANCE = 52,
    CONDITION_PARAM_SPECIALSKILL_LIFELEECHAMOUNT = 53,
    CONDITION_PARAM_SPECIALSKILL_MANALEECHCHANCE = 54,
    CONDITION_PARAM_SPECIALSKILL_MANALEECHAMOUNT = 55,
    CONDITION_PARAM_AGGRESSIVE = 56,
    CONDITION_PARAM_DRUNKENNESS = 57,

};

enum BlockType_t : uint8_t {
    BLOCK_NONE,
    BLOCK_DEFENSE,
    BLOCK_ARMOR,
    BLOCK_IMMUNITY
};

enum skills_t : uint8_t {
    SKILL_FIST = 0,
    SKILL_CLUB = 1,
    SKILL_SWORD = 2,
    SKILL_AXE = 3,
    SKILL_DISTANCE = 4,
    SKILL_SHIELD = 5,
    SKILL_FISHING = 6,
    SKILL_RUNECRAFT = 7,
    SKILL_MAGLEVEL = 8,
    SKILL_LEVEL = 9,

    SKILL_FIRST = SKILL_FIST,
    SKILL_LAST = SKILL_RUNECRAFT
};


from the client's side, does it really have to look like this?
protocolgameparse.cpp

C++:
        // Critical, Life Leech and Mana Leech have no level percent
        if (skill <= Otc::Runecraft) {
            if (g_game.getFeature(Otc::GameTibia12Protocol))
                msg->getU16(); // unknown

            if (g_game.getFeature(Otc::GameTibia12Protocol))
                levelPercent = msg->getU16();
            else
                levelPercent = msg->getU8();
        }

thanks for earlier
 
thanks for the help, I really missed a couple( `) at the beginning. it works for me, but there is a small problem.
View attachment 73916
Life leech
enums.h
C++:
enum ConditionParam_t {
    CONDITION_PARAM_OWNER = 1,
    CONDITION_PARAM_TICKS = 2,
    //CONDITION_PARAM_OUTFIT = 3,
    CONDITION_PARAM_HEALTHGAIN = 4,
    CONDITION_PARAM_HEALTHTICKS = 5,
    CONDITION_PARAM_MANAGAIN = 6,
    CONDITION_PARAM_MANATICKS = 7,
    CONDITION_PARAM_DELAYED = 8,
    CONDITION_PARAM_SPEED = 9,
    CONDITION_PARAM_LIGHT_LEVEL = 10,
    CONDITION_PARAM_LIGHT_COLOR = 11,
    CONDITION_PARAM_SOULGAIN = 12,
    CONDITION_PARAM_SOULTICKS = 13,
    CONDITION_PARAM_MINVALUE = 14,
    CONDITION_PARAM_MAXVALUE = 15,
    CONDITION_PARAM_STARTVALUE = 16,
    CONDITION_PARAM_TICKINTERVAL = 17,
    CONDITION_PARAM_FORCEUPDATE = 18,
    CONDITION_PARAM_SKILL_MELEE = 19,
    CONDITION_PARAM_SKILL_FIST = 20,
    CONDITION_PARAM_SKILL_CLUB = 21,
    CONDITION_PARAM_SKILL_SWORD = 22,
    CONDITION_PARAM_SKILL_AXE = 23,
    CONDITION_PARAM_SKILL_DISTANCE = 24,
    CONDITION_PARAM_SKILL_SHIELD = 25,
    CONDITION_PARAM_SKILL_FISHING = 26,
    CONDITION_PARAM_STAT_MAXHITPOINTS = 27,
    CONDITION_PARAM_STAT_MAXMANAPOINTS = 28,
    // CONDITION_PARAM_STAT_SOULPOINTS = 29,
    CONDITION_PARAM_STAT_MAGICPOINTS = 30,
    CONDITION_PARAM_STAT_MAXHITPOINTSPERCENT = 31,
    CONDITION_PARAM_STAT_MAXMANAPOINTSPERCENT = 32,
    // CONDITION_PARAM_STAT_SOULPOINTSPERCENT = 33,
    CONDITION_PARAM_STAT_MAGICPOINTSPERCENT = 34,
    CONDITION_PARAM_PERIODICDAMAGE = 35,
    CONDITION_PARAM_SKILL_MELEEPERCENT = 36,
    CONDITION_PARAM_SKILL_FISTPERCENT = 37,
    CONDITION_PARAM_SKILL_CLUBPERCENT = 38,
    CONDITION_PARAM_SKILL_SWORDPERCENT = 39,
    CONDITION_PARAM_SKILL_AXEPERCENT = 40,
    CONDITION_PARAM_SKILL_DISTANCEPERCENT = 41,
    CONDITION_PARAM_SKILL_SHIELDPERCENT = 42,
    CONDITION_PARAM_SKILL_FISHINGPERCENT = 43,
    CONDITION_PARAM_BUFF_SPELL = 44,
    CONDITION_PARAM_SUBID = 45,
    CONDITION_PARAM_FIELD = 46,
    CONDITION_PARAM_DISABLE_DEFENSE = 47,
    CONDITION_PARAM_SKILL_RUNECRAFT = 48,
    CONDITION_PARAM_SKILL_RUNECRAFTPERCENT = 49,
    CONDITION_PARAM_SPECIALSKILL_CRITICALHITCHANCE = 50,
    CONDITION_PARAM_SPECIALSKILL_CRITICALHITAMOUNT = 51,
    CONDITION_PARAM_SPECIALSKILL_LIFELEECHCHANCE = 52,
    CONDITION_PARAM_SPECIALSKILL_LIFELEECHAMOUNT = 53,
    CONDITION_PARAM_SPECIALSKILL_MANALEECHCHANCE = 54,
    CONDITION_PARAM_SPECIALSKILL_MANALEECHAMOUNT = 55,
    CONDITION_PARAM_AGGRESSIVE = 56,
    CONDITION_PARAM_DRUNKENNESS = 57,

};

enum BlockType_t : uint8_t {
    BLOCK_NONE,
    BLOCK_DEFENSE,
    BLOCK_ARMOR,
    BLOCK_IMMUNITY
};

enum skills_t : uint8_t {
    SKILL_FIST = 0,
    SKILL_CLUB = 1,
    SKILL_SWORD = 2,
    SKILL_AXE = 3,
    SKILL_DISTANCE = 4,
    SKILL_SHIELD = 5,
    SKILL_FISHING = 6,
    SKILL_RUNECRAFT = 7,
    SKILL_MAGLEVEL = 8,
    SKILL_LEVEL = 9,

    SKILL_FIRST = SKILL_FIST,
    SKILL_LAST = SKILL_RUNECRAFT
};


from the client's side, does it really have to look like this?
protocolgameparse.cpp

C++:
        // Critical, Life Leech and Mana Leech have no level percent
        if (skill <= Otc::Runecraft) {
            if (g_game.getFeature(Otc::GameTibia12Protocol))
                msg->getU16(); // unknown

            if (g_game.getFeature(Otc::GameTibia12Protocol))
                levelPercent = msg->getU16();
            else
                levelPercent = msg->getU8();
        }

thanks for earlier
That's actually a good question, does equipping something with life leech works and/or shows the correct value in the client?
If not, might have something to do with the skill ids change on otclient. Reverting life leech ids to their original values solves that weird skill description?
 
That's actually a good question, does equipping something with life leech works and/or shows the correct value in the client?
If not, might have something to do with the skill ids change on otclient. Reverting life leech ids to their original values solves that weird skill description?
no


1 more question. if I don't want to use interest. how to do it (level 1 needs 20 uses, level 2 needs 40, level 3 needs 80, and so on)
 
no


1 more question. if I don't want to use interest. how to do it (level 1 needs 20 uses, level 2 needs 40, level 3 needs 80, and so on)
Idk what you mean by interest but experience on the skills are following the formulas the original skills do (tries), not a fixated % per action.
If there's an specific task the player has to do x times in orden for them to advance you might want to consider using a counter (as an storage value for example) and then trigger a full skill advance when they reach your chosen milestones.
 
Back
Top