adric21
Banned User
- Joined
- Apr 26, 2016
- Messages
- 296
- Solutions
- 1
- Reaction score
- 84
We need to search our sources:
protocolgame.cpp
After change all for it:
100% Withut Bugs
protocolgame.cpp
Code:
void ProtocolGame::AddPlayerStats(NetworkMessage_ptr msg)
After change all for it:
Code:
void ProtocolGame::AddPlayerStats(NetworkMessage_ptr msg)
{
msg->put<char>(0xA0);
if (player->getPlayerInfo(PLAYERINFO_MAXHEALTH) > 0)
{
float f_h_percent = (float) player->getHealth() / player->getPlayerInfo(PLAYERINFO_MAXHEALTH);
uint16_t h_percent = f_h_percent * 100;
msg->put<uint16_t>(h_percent);
msg->put<uint16_t>(100);
}
else
{
msg->put<uint16_t>(0);
msg->put<uint16_t>(0);
}
msg->put<uint32_t>(uint32_t(player->getFreeCapacity() * 100));
uint64_t experience = player->getExperience();
if(experience > 0x7FFFFFFF) // client debugs after 2,147,483,647 exp
msg->put<uint32_t>(0x7FFFFFFF);
else
msg->put<uint32_t>(experience);
msg->put<uint16_t>(player->getPlayerInfo(PLAYERINFO_LEVEL));
msg->put<char>(player->getPlayerInfo(PLAYERINFO_LEVELPERCENT));
if (player->getPlayerInfo(PLAYERINFO_MAXMANA) > 0)
{
float f_m_percent = (float) player->getPlayerInfo(PLAYERINFO_MANA) / (float) player->getPlayerInfo(PLAYERINFO_MAXMANA);
uint16_t m_percent = f_m_percent * 100;
msg->put<uint16_t>(m_percent);
msg->put<uint16_t>(100);
}
else
{
msg->put<uint16_t>(0);
msg->put<uint16_t>(0);
}
msg->put<char>(player->getPlayerInfo(PLAYERINFO_MAGICLEVEL));
msg->put<char>(player->getPlayerInfo(PLAYERINFO_MAGICLEVELPERCENT));
msg->put<char>(player->getPlayerInfo(PLAYERINFO_SOUL));
msg->put<uint16_t>(player->getStaminaMinutes());
}
100% Withut Bugs