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

TFS 0.X Total experience buggy

potinho

Advanced OT User
Joined
Oct 11, 2009
Messages
1,402
Solutions
17
Reaction score
150
Location
Brazil
Hello everyone, everything good?

On my server, after players reach a certain level (600+) the experience shown on the OTClient is not the total EXP that the player has, how to fix it?
1634823583900.png
 
Solution
C++:
    uint64_t experience = player->getExperience();
    msg->put<uint64_t>(experience);

What otclient are you using? If it is OTCv8 then you can write this
Lua:
g_game.enableFeature(GameDoubleExperience)
just after
Lua:
function updateFeatures(version)
    g_game.resetFeatures()
    if version <= 0 then
      return
    end
in modules->game_features->features.lua
There's a way to fix it @4Nathu4 ?

In client side i can see an true exp:

View attachment 63083

in database exp is correct:

View attachment 63084
You are using oldschool protocol correct? It's to prevent cip client from debug, you can probably fix it with otc, but i'm not sure how.
protocolgame.cpp msg.add<uint32_t>(std::min<uint32_t>(player->getExperience(), 0x7FFFFFFF)); // tibia client debugs if value is higher than 0x7FFFFFFF
 
You are using oldschool protocol correct? It's to prevent cip client from debug, you can probably fix it with otc, but i'm not sure how.
protocolgame.cpp msg.add<uint32_t>(std::min<uint32_t>(player->getExperience(), 0x7FFFFFFF)); // tibia client debugs if value is higher than 0x7FFFFFFF
Im already using OTClient, in 7.72 version, there is a way to change this @Silba ? Mine protocolgame.cpp:

C++:
void ProtocolGame::AddPlayerStats(NetworkMessage_ptr msg)
{
    msg->put<char>(0xA0);
    msg->put<uint16_t>(player->getHealth());
    msg->put<uint16_t>(player->getPlayerInfo(PLAYERINFO_MAXHEALTH));
    msg->put<uint16_t>(int32_t(player->getFreeCapacity()));

    uint32_t experience = player->getExperience();
    msg->put<uint32_t>(experience);

    #ifdef _MULTIPLATFORM76
    msg->put<uint16_t>(player->getPlayerInfo(PLAYERINFO_LEVEL));
    #else
    msg->put<char>(player->getPlayerInfo(PLAYERINFO_LEVEL));
    #endif
    msg->put<char>(player->getPlayerInfo(PLAYERINFO_LEVELPERCENT));
    msg->put<uint16_t>(player->getPlayerInfo(PLAYERINFO_MANA));
    msg->put<uint16_t>(player->getPlayerInfo(PLAYERINFO_MAXMANA));
    msg->put<char>(player->getPlayerInfo(PLAYERINFO_MAGICLEVEL));
    msg->put<char>(player->getPlayerInfo(PLAYERINFO_MAGICLEVELPERCENT));
    #ifdef _MULTIPLATFORM76
    msg->put<char>(player->getPlayerInfo(PLAYERINFO_SOUL));
    #endif
}
 
Last edited:
uint32_t experience = player->getExperience(); msg->put<uint32_t>(experience);
Oh okay, i missed your 0.x tag sorry, i assumed you used a nekiro downgrade.

I think these lines are responsible, they are sending 32 bit integer(which maxes out at around lvl 600 as you see). Maybe it's as easy as switching them to 64 bit, i'm not experienced enough in this area to give an answer sorry but this is definitely where you should be looking. As far as i know otc doesn't limit this, so it is server sided.
 
Last edited:
Oh okay, i missed your 0.x tag sorry, i assumed you used a nekiro downgrade.

I think these lines are responsible, they are sending 32 bit integer. Maybe it's as easy as switching them to 64 bit, i'm not experienced enough in this area to give an answer sorry but this is definitely where you should be looking. As far as i know otc doesn't limit this, so it is server sided.
i have tried to start use nekiro downgrade, but have a lot of problems with map, so i gave up :/, i'will try change to 64
Post automatically merged:

i have tried to start use nekiro downgrade, but have a lot of problems with map, so i gave up :/, i'will try change to 64
now bugged level changed lines:

C++:
    uint64_t experience = player->getExperience();
    msg->put<uint64_t>(experience);
 
Last edited:
i have tried to start use nekiro downgrade, but have a lot of problems with map, so i gave up :/, i'will try change to 64
Post automatically merged:


now bugged level changed lines:

C++:
    uint64_t experience = player->getExperience();
    msg->put<uint64_t>(experience);
This is what i was afraid of and why i said im not experienced enough to answer, i hope you can figure it out. Hopefully someone who knows can give the appropriate help.
 
C++:
    uint64_t experience = player->getExperience();
    msg->put<uint64_t>(experience);

What otclient are you using? If it is OTCv8 then you can write this
Lua:
g_game.enableFeature(GameDoubleExperience)
just after
Lua:
function updateFeatures(version)
    g_game.resetFeatures()
    if version <= 0 then
      return
    end
in modules->game_features->features.lua
 
Solution
i have tried to start use nekiro downgrade, but have a lot of problems with map, so i gave up :/, i'will try change to 64
Post automatically merged:


now bugged level changed lines:

C++:
    uint64_t experience = player->getExperience();
    msg->put<uint64_t>(experience);
If you make the server send uint64, then you also need to read uint64 on the client side. Try executing g_game.enableFeature(GameDoubleExperience) in the OTC terminal before logging in and see if that helps
 
@Alpha and @jacqen works, thank you so very much. Just another doubt, i have auto updater with encrypted files, how i change in otclient? xD (its v8)

1635360702150.png
Post automatically merged:

@Alpha and @jacqen works, thank you so very much. Just another doubt, i have auto updater with encrypted files, how i change in otclient? xD (its v8)

1635360702150.png
just paste a decrypted file, thank you guys!
 
Last edited:
Back
Top