Aurolio
New Member
- Joined
- Aug 26, 2018
- Messages
- 45
- Reaction score
- 3
Hi All, this is the system that I am using on my server.
CreatureEvent - Best Rebirth System Mysql By mlody.1039 With Gesior Script (https://otland.net/threads/best-rebirth-system-mysql-by-mlody-1039-with-gesior-script.186274/)
What I am trying to do is make Experience display my current level, and Level display number of rebirths I've done.
Max lvl on my server is 717217 lvl, but that's fine, the problem is with displaying it. As you may know, Level will only display up to 65,535 as this is the maximum value for uint_16t, that's why I need to display it as Experience as it can go to much higher numbers than 65,535.
Another thing is displaying my current Rebirth as the Level.
I know it has to be changed in the source, protocolgame.cpp, but I don't know how to change it. Here is what I have at the moment:
Thanks.
CreatureEvent - Best Rebirth System Mysql By mlody.1039 With Gesior Script (https://otland.net/threads/best-rebirth-system-mysql-by-mlody-1039-with-gesior-script.186274/)
What I am trying to do is make Experience display my current level, and Level display number of rebirths I've done.
Max lvl on my server is 717217 lvl, but that's fine, the problem is with displaying it. As you may know, Level will only display up to 65,535 as this is the maximum value for uint_16t, that's why I need to display it as Experience as it can go to much higher numbers than 65,535.
Another thing is displaying my current Rebirth as the Level.
I know it has to be changed in the source, protocolgame.cpp, but I don't know how to change it. Here is what I have at the moment:
Code:
void ProtocolGame::AddPlayerStats(NetworkMessage_ptr msg)
{
msg->put<char>(0xA0);
if (player->getPlayerInfo(PLAYERINFO_MAXHEALTH) > 0)
{
msg->put<uint16_t>(uint16_t(player->getHealth() * 100 / player->getPlayerInfo(PLAYERINFO_MAXHEALTH)));
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)
{
msg->put<uint16_t>(player->getPlayerInfo(PLAYERINFO_MANA) * 100 / player->getPlayerInfo(PLAYERINFO_MAXMANA));
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());
}
Thanks.