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

Struggle with c++

Niioxce

Otland lurker
Joined
Jun 22, 2012
Messages
324
Reaction score
4
Location
Sweden
Hello, So here's the thing, I've tried a script from tetra20 it's a c++ script that allows the players to reach the level 1million instead of 717171. So my question is HOW can i make it possible for my players to reach MORE than 1million? It's a real STRUGGLE beacuse im a real newbie on c++ codes ^^
Code:
23:37 You are level : ----> 1025743 <----
Here's the script.

(in Player.h)
Code:
static uint64_t getExpForLevel(uint32_t lv)
{
static std::map<uint32_t, uint64_t> cache;
lv--;

std::map<uint32_t, uint64_t>::iterator it = cache.find(lv);
if(it != cache.end())
return it->second;

uint64_t exp = ((50ULL * (lv+1ULL) / 3ULL - 100ULL) * (lv+1ULL) + 850ULL / 3ULL) * (lv+1ULL) - 200ULL;
cache[lv] = exp;
return exp;
}

(in protocolegame.cpp )

Code:
if(experience > 2147483647) // client debugs after 2,147,483,647 exp
msg->put<uint32_t>(2147483647);

Thank you so much for reading and please repond me here or in PM. Thanks-

-Sharing is caring-
 
Yea, what do you mean like? if i higher that can i level higher then? Lol.. It's so akward D:

it means that the client can't handle bigger numbers above your exp bar.
therefor you must make so the game doesn't send bigger numbers than that to the client.

Everything you can see in the client, all numbers and stuffs (not graphical stuffs), are information that the game.exe sends to it.
you can modify the output of those messages but still keep the real ones within the game.

So in your case, you must edit the output for the exp, so that it doesn't debug the client, but you can still exp and get levels, it's just that you can't see your actual exp-count after X levels :)
 
it means that the client can't handle bigger numbers above your exp bar.
therefor you must make so the game doesn't send bigger numbers than that to the client.

Everything you can see in the client, all numbers and stuffs (not graphical stuffs), are information that the game.exe sends to it.
you can modify the output of those messages but still keep the real ones within the game.

So in your case, you must edit the output for the exp, so that it doesn't debug the client, but you can still exp and get levels, it's just that you can't see your actual exp-count after X levels :)

Well do you know how? Like dirrections? Game.cpp? Protocole.ch? Etc? You're awesome beacause it's like my second time getting help with this and i seem it hard to find help about c++
 
The max value of uint64_t is the max level that you reach right now and you can't just change to uint128_t to allow more levels because that don't exist by default so you have to code that.
You can check here that code already done and you have do add to your server:

http://www.codef00.com/code/uint128.h

Then you just need to change the type to uint128_t
 
Back
Top