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

OTClient Skill Level bug

Pifafa

Member
Joined
Nov 9, 2010
Messages
48
Reaction score
5
Hello everyone, when we reach level 638 to 639 we have the problem.
1709768331992.png

So it looks like this:
1709768370141.png

I don't know what to do, my client otclient, I tried a solution already made here but it didn't work.
The problem is just passing the 4294967296 of experience that nothing else is a maximum of 32 bits.
 
 
In-game progress remains normal. Just the client that no longer works properly.
Lua:
        static uint64_t getExpForLevel(int32_t lv) {
            lv--;
            return ((50ULL * lv * lv * lv) - (150ULL * lv * lv) + (400ULL * lv)) / 3ULL;
        }

That's what I use.
Post automatically merged:

I changed this to 64 and it works, I go from 639, however the exp number is bugged, but it is counting the level.

Lua:
    if (player->getExperience() >= std::numeric_limits<uint64_t>::max()) {
        msg.add<uint64_t>(0);
    } else {
        msg.add<uint32_t>(static_cast<uint32_t>(player->getExperience()));
    }
 
Last edited:
I helped a guy where we managed to get a limit of up to 100k here to substitute into your source code. After that, you'll need to control the stage.xml to know which limit you want per level. If it's a limit of 1000, then make the stages correctly. It should be resolved by now.

C++:
static uint64_t getExpForLevel(const uint64_t lv)
{
return ((1ULL * lv * lv * lv) - (50ULL * lv * lv) + (1200ULL * lv)) / 3ULL;
}
 
I changed this to 64 and it works, I go from 639, however the exp number is bugged, but it is counting the level.

Lua:
    if (player->getExperience() >= std::numeric_limits<uint64_t>::max()) {
        msg.add<uint64_t>(0);
    } else {
        msg.add<uint32_t>(static_cast<uint32_t>(player->getExperience()));
    }

It's not bugged, you guys are just coming up with really bad game design and giving people insane levels which it wasn't designed to have.

You need to change it to uint64_t in the else block not just check if the double (experience in this case) is bigger than 18446744073709551615
C++:
msg.add<uint64_t>(static_cast<uint64_t>(player->getExperience()));
 
It's not bugged, you guys are just coming up with really bad game design and giving people insane levels which it wasn't designed to have.

You need to change it to uint64_t in the else block not just check if the double (experience in this case) is bigger than 18446744073709551615
C++:
msg.add<uint64_t>(static_cast<uint64_t>(player->getExperience()));
It doesn't work.

But doing it the way I did before is looking like this after level 638...

1709835025133.jpeg
Post automatically merged:

I helped a guy where we managed to get a limit of up to 100k here to substitute into your source code. After that, you'll need to control the stage.xml to know which limit you want per level. If it's a limit of 1000, then make the stages correctly. It should be resolved by now.

C++:
static uint64_t getExpForLevel(const uint64_t lv)
{
return ((1ULL * lv * lv * lv) - (50ULL * lv * lv) + (1200ULL * lv)) / 3ULL;
}
With this change, would the client be able to read normally?
 
Last edited:
Back
Top