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

Compiling How make % hp/mana high exp and reborn x1000+

stanczyk

Scripter
Joined
Nov 24, 2009
Messages
293
Reaction score
2
Code:
void ProtocolGame::AddPlayerStats(NetworkMessage_ptr msg)
{
    msg->put<char>(0xA0);

    uint16_t hp = (uint16_t) floor((player->getHealth()*100 + 1)/(player->getPlayerInfo(PLAYERINFO_MAXHEALTH) + 1));
    msg->put<uint16_t>(player->getHealth() > 0 ? (hp < 100 ? hp + 1 : 100) : 0);
    msg->put<uint16_t>(100);

    msg->put<uint32_t>(uint32_t(player->getFreeCapacity() * 100));
    msg->put<uint32_t>(uint32_t(player->getCapacity() * 100));

    msg->put<uint64_t>(player->getExperience());

    msg->put<uint16_t>(player->getPlayerInfo(PLAYERINFO_LEVEL));
    msg->put<char>(player->getPlayerInfo(PLAYERINFO_LEVELPERCENT));

    uint16_t mana = (uint16_t) floor((player->getPlayerInfo(PLAYERINFO_MANA)*100 + 1)/(player->getPlayerInfo(PLAYERINFO_MAXMANA) + 1));
    msg->put<uint16_t>(player->getPlayerInfo(PLAYERINFO_MANA) > 0 ? (mana < 100 ? mana + 1 : 100) : 0);
    msg->put<uint16_t>(100);

    msg->put<char>(player->getMagicLevel());
    msg->put<char>(player->getBaseMagicLevel());
    msg->put<char>(player->getPlayerInfo(PLAYERINFO_MAGICLEVELPERCENT));

    msg->put<char>(player->getPlayerInfo(PLAYERINFO_SOUL));

    msg->put<uint16_t>(player->getStaminaMinutes());

    msg->put<uint16_t>(player->getSpeed() / 2);

    Condition* condition = player->getCondition(CONDITION_REGENERATION, CONDITIONID_DEFAULT);
    msg->put<uint16_t>(condition ? condition->getTicks() / 1000 : 0x00);

    msg->put<uint16_t>(player->getOfflineTrainingTime() / 60 / 1000);
}


All is ok here but max 400k lvl and have 0 % mana/hp, my server have 712k lvl max and can reborn x1000 times. Pls help
 
Back
Top