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

C++ TFS 1.5 772 - Max level but with % hp mana

dewral

Veteran OT User
Joined
Dec 4, 2019
Messages
343
Solutions
10
Reaction score
351
Hello im struggling with making max level to atleast 1 mln
Im getting reseted after reaching 65k+
I already tried like here and compiled it but getting so much bugs.
Compiling - Max level edit, client crashes. (https://otland.net/threads/max-level-edit-client-crashes.275492/#post-2652334)
Can someone explain how to do it here?
TFS 1.5 772


C++:
void ProtocolGame::AddPlayerStats(NetworkMessage& msg)
{
    msg.addByte(0xA0);

    if (player->getMaxHealth() > 0)
    {
        msg.add<uint16_t>(player->getHealth() * 100 / player->getMaxHealth());
        msg.add<uint16_t>(100);
    }
    else
    {
        msg.add<uint16_t>(0);
        msg.add<uint16_t>(0);
    }


    //msg.add<uint32_t>(player->getFreeCapacity());
    //msg.add<uint32_t>(player->getCapacity());
    msg.add<uint16_t>(player->getFreeCapacity() / 100);

    //msg.add<uint64_t>(player->getExperience());
    msg.add<uint32_t>(std::min<uint32_t>(player->getExperience(), 0x7FFFFFFF)); // tibia client debugs if value is higher than 0x7FFFFFFF

    msg.add<uint16_t>(player->getLevel());
    msg.addByte(player->getLevelPercent());

    /*msg.add<uint16_t>(100); // base xp gain rate
    msg.add<uint16_t>(0); // xp voucher
    msg.add<uint16_t>(0); // low level bonus
    msg.add<uint16_t>(0); // xp boost
    msg.add<uint16_t>(100); // stamina multiplier (100 = x1.0)
    */

    if (player->getMaxMana() > 0)
    {
        msg.add<uint16_t>(player->getMana() * 100 / player->getMaxMana());
        msg.add<uint16_t>(100);
    }
    else
    {
        msg.add<uint16_t>(0);
        msg.add<uint16_t>(0);
    }

    msg.addByte(std::min<uint32_t>(player->getMagicLevel(), std::numeric_limits<uint8_t>::max()));
    //msg.addByte(std::min<uint32_t>(player->getBaseMagicLevel(), std::numeric_limits<uint8_t>::max()));
    msg.addByte(player->getMagicLevelPercent());

    msg.addByte(player->getSoul());

    /*msg.add<uint16_t>(player->getStaminaMinutes());

    msg.add<uint16_t>(player->getBaseSpeed() / 2);

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

    msg.add<uint16_t>(player->getOfflineTrainingTime() / 60 / 1000);

    msg.add<uint16_t>(0); // xp boost time (seconds)
    msg.addByte(0); // enables exp boost in the store
    */
}
 
Last edited:
Solution
Even with otc?
Post automatically merged:

As i remember in old times 7.6 servers after reaching some level it was swaping with experience and level value was 0.
It is possible?
OTC: It's possible with OTC, but you will have to modify OTC, to make it accept higher values. It will crash players that try to play with normal client!

Show level in 'exp': It should be easier and it will work in OTC and normal client.

In Nekiro 1.5 7.72 code ( TFS-1.5-Downgrades/protocolgame.cpp at 7.72 · nekiro/TFS-1.5-Downgrades (https://github.com/nekiro/TFS-1.5-Downgrades/blob/7.72/src/protocolgame.cpp#L3131-L3134) ) replace:
C++:
    msg.add<uint32_t>(std::min<uint32_t>(player->getExperience(), 0x7FFFFFFF)); // tibia client debugs if...
Even with otc?
Post automatically merged:

As i remember in old times 7.6 servers after reaching some level it was swaping with experience and level value was 0.
It is possible?
 
Last edited:
Even with otc?
Post automatically merged:

As i remember in old times 7.6 servers after reaching some level it was swaping with experience and level value was 0.
It is possible?
OTC: It's possible with OTC, but you will have to modify OTC, to make it accept higher values. It will crash players that try to play with normal client!

Show level in 'exp': It should be easier and it will work in OTC and normal client.

In Nekiro 1.5 7.72 code ( TFS-1.5-Downgrades/protocolgame.cpp at 7.72 · nekiro/TFS-1.5-Downgrades (https://github.com/nekiro/TFS-1.5-Downgrades/blob/7.72/src/protocolgame.cpp#L3131-L3134) ) replace:
C++:
    msg.add<uint32_t>(std::min<uint32_t>(player->getExperience(), 0x7FFFFFFF)); // tibia client debugs if value is higher than 0x7FFFFFFF

    msg.add<uint16_t>(player->getLevel());
    msg.addByte(player->getLevelPercent());
with:
C++:
if (player->getLevel() > 1000) {
    msg.add<uint32_t>(std::min<uint32_t>(player->getLevel(), 0x7FFFFFFF)); // tibia client debugs if value is higher than 0x7FFFFFFF

    msg.add<uint16_t>(1000);
    msg.addByte(player->getLevelPercent());
} else {
    msg.add<uint32_t>(std::min<uint32_t>(player->getExperience(), 0x7FFFFFFF)); // tibia client debugs if value is higher than 0x7FFFFFFF

    msg.add<uint16_t>(player->getLevel());
    msg.addByte(player->getLevelPercent());
}
For players with level above 1000, it will always show level 1000 and real level will be in experience.
 
Solution
you can do as retrocores did, for example (the server is 2x) the monsters have 1x experience but in the xp table it goes up to level 8 with 2,200 exp and in the global it would be 4,400 exp.
 
OTC: It's possible with OTC, but you will have to modify OTC, to make it accept higher values. It will crash players that try to play with normal client!

Show level in 'exp': It should be easier and it will work in OTC and normal client.

In Nekiro 1.5 7.72 code ( TFS-1.5-Downgrades/protocolgame.cpp at 7.72 · nekiro/TFS-1.5-Downgrades (https://github.com/nekiro/TFS-1.5-Downgrades/blob/7.72/src/protocolgame.cpp#L3131-L3134) ) replace:
C++:
    msg.add<uint32_t>(std::min<uint32_t>(player->getExperience(), 0x7FFFFFFF)); // tibia client debugs if value is higher than 0x7FFFFFFF

    msg.add<uint16_t>(player->getLevel());
    msg.addByte(player->getLevelPercent());
with:
C++:
if (player->getLevel() > 1000) {
    msg.add<uint32_t>(std::min<uint32_t>(player->getLevel(), 0x7FFFFFFF)); // tibia client debugs if value is higher than 0x7FFFFFFF

    msg.add<uint16_t>(1000);
    msg.addByte(player->getLevelPercent());
} else {
    msg.add<uint32_t>(std::min<uint32_t>(player->getExperience(), 0x7FFFFFFF)); // tibia client debugs if value is higher than 0x7FFFFFFF

    msg.add<uint16_t>(player->getLevel());
    msg.addByte(player->getLevelPercent());
}
For players with level above 1000, it will always show level 1000 and real level will be in experience.
Well im using otcv8 so i think it's probably not doable withut sources or maybe im wrong.
It worked 100% perfectly!
I just changed the part when reaching 1000lvl for this
C++:
msg.add<uint16_t>(0);
Thank you very much!
 
Back
Top