Feature 100% Heal & Mana Tfs 0.4

adric21

Member
Joined
Apr 26, 2016
Messages
200
Reaction score
15
We need to search our sources:
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
 
OP
adric21

adric21

Member
Joined
Apr 26, 2016
Messages
200
Reaction score
15
Make your health BY 100% or % i test it in Pl Ot
 

elnelson

Lunaria World Dev
Joined
Jun 20, 2009
Messages
456
Reaction score
23
Location
México
i do not really understand this feature, would it mae players get 100% more hp/mana, which cases would u use it?
 
Top