• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Compiling HP/MANA BAR %

Tyroness

New Member
Joined
Oct 20, 2015
Messages
60
Reaction score
4
Hello,

How can I edit the source to allow my players to see their mana/hp in percentage in the tibia client.

It bugs out and resets to 0 etc.

I am using TFS .0.3.6 V8

Thanks
 
As i said, it was a sample... Maybe a way to get to the solution...

Btw, why 0.3.6? '-' TFS 1.x works good enough.... Anyway, that's what i can help you with... :oops:
 
Most sources are different....

msg->AddByte(0xA0);
msg->AddU16(player->getHealth());
msg->AddU16(player->getPlayerInfo(PLAYERINFO_MAXHEALTH));


Thats mine ..
 
Most sources are different....

msg->AddByte(0xA0);
msg->AddU16(player->getHealth());
msg->AddU16(player->getPlayerInfo(PLAYERINFO_MAXHEALTH));


Thats mine ..

No idea if this'll work but you can try changing:
msg->AddU16(player->getHealth());
msg->AddU16(player->getPlayerInfo(PLAYERINFO_MAXHEALTH));

to:
msg->AddU16(player->getHealth() / player->getPlayerInfo(PLAYERINFO_MAXHEALTH) * 100);
msg->AddU16(100);

Not sure if this'll work though, worth a shot though!
 
Last edited:
@Aleada

void ProtocolGame::AddPlayerStats(NetworkMessage_ptr msg)
{
msg->AddByte(0xA0);
msg->AddU16(player->getHealth());
msg->AddU16(player->getPlayerInfo(PLAYERINFO_MAXHEALTH));
msg->AddU32(uint32_t(player->getFreeCapacity() * 100));
uint64_t experience = player->getExperience();
if(experience > 0x7FFFFFFF) // client debugs after 2,147,483,647 exp
msg->AddU32(0x7FFFFFFF);
else
msg->AddU32(experience);

msg->AddU16(player->getPlayerInfo(PLAYERINFO_LEVEL));
msg->AddByte(player->getPlayerInfo(PLAYERINFO_LEVELPERCENT));
msg->AddU16(player->getPlayerInfo(PLAYERINFO_MANA));
msg->AddU16(player->getPlayerInfo(PLAYERINFO_MAXMANA));
msg->AddByte(player->getPlayerInfo(PLAYERINFO_MAGICLEVEL));
msg->AddByte(player->getPlayerInfo(PLAYERINFO_MAGICLEVELPERCENT));
msg->AddByte(player->getPlayerInfo(PLAYERINFO_SOUL));
msg->AddU16(player->getStaminaMinutes());


This is my code, can you help me ?
 
Back
Top