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

Linux How i can modificate tfs sources for upgrade tfs protocol to 10.90 to 10.94

TibiaLand

New Member
Joined
Oct 20, 2013
Messages
45
Reaction score
0
Location
spain
Hello, im Runing a 10.90 absolute global with tfs 1.2 on ubuntu and i can only login in game with protocol 10.90

How i can modificate tfs sources for upgrade tfs protocol to 10.90 to 10.94 and players can login multiple protocols 10.90 to 10.94

thanks
 
You can play on Cip serrvers with otclient so there are not big protocol changes. I just saw differences in opcode 0xA1. I am in university now so I will probably got it working till tommorow. Maybe items needs to be updated too cuz they can cause some debugs
 
10.94 have new bytes

Code:
enum skillsStats_t : uint8_t {
   SKILL_FIGHTFIST = 0,
   SKILL_CRITICAL_HIT_CHANCE = 1,
   SKILL_CRITICAL_HIT_DAMAGE = 2,
   SKILL_LIFE_LEECH_CHANCE = 3,
   SKILL_LIFE_LEECH_AMOUNT = 4,
   SKILL_MANA_LEECH_CHANCE = 5,
   SKILL_MANA_LEECH_AMOUNT = 6,

   SKILL_STATS_FIRST = SKILL_FIGHTFIST,
   SKILL_STATS_LAST = SKILL_MANA_LEECH_AMOUNT
};

Code:
void ProtocolGame::AddPlayerSkills(NetworkMessage& msg)
{
msg.addByte(0xA1);
for (uint8_t i = SKILL_FIRST; i <= SKILL_LAST; ++i) {
msg.add<uint16_t>(std::min<int32_t>(player->getSkillLevel(i), std::numeric_limits<uint16_t>::max()));
msg.add<uint16_t>(player->getBaseSkill(i));
msg.addByte(player->getSkillPercent(i));
}

for (uint8_t i = SKILL_STATS_FIRST; i <= SKILL_STATS_LAST; ++i) {
msg.add<uint16_t>(i);
}
}

something is wrong, because It seems to be giving conflict with another function or is in the wrong place...

I think this may bytes missing elsewhere.

Debug on addSkill.
Good I will trying here, if I make it, I post here.
2ib11zo.jpg
 
Last edited:
qucik fix:
in protocolgame.cpp function ProtocolGame::AddPlayerSkills


At the end of the function add this
Code:
        if (version >= 1094) {
                for (int i = 0; i < 24; i++) {
                        msg.AddByte(0x00);
                }
        }

Screen_Shot_2016_06_01_at_21_45_26.png


However, they've changed something in store code too since I am getting debugs.
 
Empty room works well.
I have tried to login with GM near temple (thais) getting a debug:
Code:
assertion failed (AmbienteActualBrightness = 1), reason: AmbienteActualBrightness>=0

PvOr.png
Only change your
Code:
void ProtocolGame::AddPlayerSkills(NetworkMessage& msg)

Code:
void ProtocolGame::AddPlayerSkills(NetworkMessage& msg)
{
   msg.addByte(0xA1);
   for (uint8_t i = SKILL_FIRST; i <= SKILL_LAST; ++i) {
     msg.add<uint16_t>(std::min<int32_t>(player->getSkillLevel(i), std::numeric_limits<uint16_t>::max()));
     msg.add<uint16_t>(player->getBaseSkill(i));
     msg.addByte(player->getSkillPercent(i));
   }

   if (version >= 1094) {
     for (int i = 0; i < 24; i++) {
       msg.addByte(0x00);
     }
   }
}
 
Only change your void ProtocolGame::AddPlayerSkills(NetworkMessage& msg)

Code:
void ProtocolGame::AddPlayerSkills(NetworkMessage& msg)
{
   msg.addByte(0xA1);
   for (uint8_t i = SKILL_FIRST; i <= SKILL_LAST; ++i) {
     msg.add<uint16_t>(std::min<int32_t>(player->getSkillLevel(i), std::numeric_limits<uint16_t>::max()));
     msg.add<uint16_t>(player->getBaseSkill(i));
     msg.addByte(player->getSkillPercent(i));
   }

   if (version >= 1094) {
     for (int i = 0; i < 24; i++) {
       msg.addByte(0x00);
     }
   }
}

Thanks, works.
Wondering the stats do not show % anymore, is there more to fix?
 
Thanks, works.
Wondering the stats do not show % anymore, is there more to fix?

Well this only works for what I've been seeing, Food and Speed, also shows when you have an item giving skills, but the critical system I still does not know how it works.
 
Last edited:
I think the new stats consists of 6x uint16_t.

@alissonfgp

Don't you know guys why the connection get dropped when I select some other category in store ?

EDIT: Fixed, wrong byte.
 
Last edited:
@gunz where did you paste this player add skill cause in my protocolgame.cpp cant find that line i found it in protocolgamebase.cpp but when i compile i get an error about this addskill i paste there that is not specified
 
@gunz where did you paste this player add skill cause in my protocolgame.cpp cant find that line i found it in protocolgamebase.cpp but when i compile i get an error about this addskill i paste there that is not specified

If you are using source of djarek (cast) is in protocolgamebase.cpp

Code:
void ProtocolGameBase::AddPlayerSkills(NetworkMessage& msg)
{
   msg.addByte(0xA1);
   for (uint8_t i = SKILL_FIRST; i <= SKILL_LAST; ++i) {
     msg.add<uint16_t>(std::min<int32_t>(player->getSkillLevel(i), std::numeric_limits<uint16_t>::max()));
     msg.add<uint16_t>(player->getBaseSkill(i));
     msg.addByte(player->getSkillPercent(i));
   }

  if (version >= 1094) {
     for (int i = 0; i < 24; i++) {
       msg.addByte(0x00);
     }
   }
}
 
Why do you send from 0 to 24 ?

Tibia only parses from 19 to 24. and it actually accepts 2 bytes not 1.

That's how it calculates it...
 
hello my friends we can help me with attributes item? how can i insert new attributes in 10.94? for exemple:

Mana Leech
Hit points leech...

Thanks
 
Do them like absorbs.

And for critical you can modify drainhealth/mana or effeciency you can modify combating functions.
 
Proper code with e

Example values and description:
Code:
    if (version >= 1094) {
        for (int i = 10; i < 16; i++) {
            msg.add<uint16_t>(i); // this is value to display
            msg.add<uint16_t>(15); // this is 'base' value,
// if lower then skill then text color is green
// if equal to skill then text color is gray [default for skills]
// if higher then skill then text color is red
        }
    }
There are 6 new skills, so enum should be:
Code:
enum skillsStats_t : uint8_t {
   SKILL_CRITICAL_HIT_CHANCE = 0,
   SKILL_CRITICAL_HIT_DAMAGE = 1,
   SKILL_LIFE_LEECH_CHANCE = 2,
   SKILL_LIFE_LEECH_AMOUNT = 3,
   SKILL_MANA_LEECH_CHANCE = 4,
   SKILL_MANA_LEECH_AMOUNT = 5,

   SKILL_STATS_FIRST = SKILL_CRITICAL_HIT_CHANCE,
   SKILL_STATS_LAST = SKILL_MANA_LEECH_AMOUNT
};
Of course you should use enum that is already in engine.. 'stats_t', so it will work fine with movements equip/deequip without many modifications.
EDIT
I wrote 'leech and crit' [mana/hp, messages, animations] for TFS 1.1... 120 lines of code, modified only 6 files. I wrote it for someone, so sorry.. I cannot share code.

EDIT 2
I fixed all bugs in my 'leech and crit' [proper messages, item description] for TFS 1.1... 310 lines of code, modified 16 files.
 
Last edited:
Proper code with e

Example values and description:
Code:
    if (version >= 1094) {
        for (int i = 10; i < 16; i++) {
            msg.add<uint16_t>(i); // this is value to display
            msg.add<uint16_t>(15); // this is 'base' value,
// if lower then skill then text color is green
// if equal to skill then text color is gray [default for skills]
// if higher then skill then text color is red
        }
    }
There are 6 new skills, so enum should be:
Code:
enum skillsStats_t : uint8_t {
   SKILL_CRITICAL_HIT_CHANCE = 0,
   SKILL_CRITICAL_HIT_DAMAGE = 1,
   SKILL_LIFE_LEECH_CHANCE = 2,
   SKILL_LIFE_LEECH_AMOUNT = 3,
   SKILL_MANA_LEECH_CHANCE = 4,
   SKILL_MANA_LEECH_AMOUNT = 5,

   SKILL_STATS_FIRST = SKILL_CRITICAL_HIT_CHANCE,
   SKILL_STATS_LAST = SKILL_MANA_LEECH_AMOUNT
};
Of course you should use enum that is already in engine.. 'stats_t', so it will work fine with movements equip/deequip without many modifications.
EDIT
I wrote 'leech and crit' [mana/hp, messages, animations] for TFS 1.1... 120 lines of code, modified only 6 files. I wrote it for someone, so sorry.. I cannot share code.

EDIT 2
I fixed all bugs in my 'leech and crit' [proper messages, item description] for TFS 1.1... 310 lines of code, modified 16 files.
Why all of those lines? I have done it in like 40 lines ( everything of 1094 ~ )
 
Back
Top