• 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-
 
Use this https://github.com/calccrypto/uint128_t
Replace std::map<uint32_t, uint64_t) to std::map<uint32_t, uint128_t) also change the return value of this function to uint128_t, change players exerience type to uint128_t. Actually, change every uint64_t experience types to uint128_t. Cast the experience in protocolgame (when sending to player) as uint64_t type.
 
Use this https://github.com/calccrypto/uint128_t
Replace std::map<uint32_t, uint64_t) to std::map<uint32_t, uint128_t) also change the return value of this function to uint128_t, change players exerience type to uint128_t. Actually, change every uint64_t experience types to uint128_t. Cast the experience in protocolgame (when sending to player) as uint64_t type.
Wow dude, i'll check this out it's been a while since ive been getting a serious answer..
 
Use this https://github.com/calccrypto/uint128_t
Replace std::map<uint32_t, uint64_t) to std::map<uint32_t, uint128_t) also change the return value of this function to uint128_t, change players exerience type to uint128_t. Actually, change every uint64_t experience types to uint128_t. Cast the experience in protocolgame (when sending to player) as uint64_t type.
But like, i didnt understand a single word what you just told me :/
 
Download the uint128_t from github, include it in your project and files that require it, then simply change uint64_t's at experiences to uint128_t, except for protocolgame, where changing uint64_t to uint128_t would debug the client.
 
Download the uint128_t from github, include it in your project and files that require it, then simply change uint64_t's at experiences to uint128_t, except for protocolgame, where changing uint64_t to uint128_t would debug the client.
So i've downloaded the unit128_t.h and unit128_t.cpp i've added it in my trunk.r3884 So here's the kicker Do i have to change the value in unit128_t.h and unit128_t.cpp and everywhere it says "unit64_t" I will replace it with "unit128_t" then i mean everywhere!, Or do i have to change it in everysingle category of like "server.cpp" Etc Etc That was only an example.. I'm actually pretty new and i might not be worth this help..
 
No, only the ones that concern experience value, mostly player.cpp/h and probably some others to make it compatible.
 
No, only the ones that concern experience value, mostly player.cpp/h and probably some others to make it compatible.
Like this is so confusing for me.. I'm so bad at this that im not even worthy any help it feels like that :/ I starded this thread Apr 16, 2014 2 month from now and have more than 1k views, almost 50 replys, 90% of them are me and you're being a great guy EvulMastah for just replying this thread... Just tell me what to do (wich you're doing but i dont understand the c++ language) I can give you screenshots etc etc.. Please don't leave me upon this spell! :/ I'd give you credit for your help..
 
No, only the ones that concern experience value, mostly player.cpp/h and probably some others to make it compatible.
Wait, i might have been solving this, I've changed the value just like this.. Now i just have to wait for you to respond. Btw that's Player.h


static uint128_t getExpForLevel(uint32_t lv)
{
static std::map<uint64_t, uint128_t> cache;
lv--;

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

uint128_t exp = ((50ULL * (lv + 1ULL) / 3ULL - 100ULL) * (lv + 1ULL) + 850ULL / 3ULL) * (lv + 1ULL) - 200ULL;
cache[lv] = exp;
return exp;
}
 
Remember to also change it in player.h, include the uint128_t header and edit experience type to uint128_t in player.h also
 
Like this is so confusing for me.. I'm so bad at this that im not even worthy any help it feels like that :/ I starded this thread Apr 16, 2014 2 month from now and have more than 1k views, almost 50 replys, 90% of them are me and you're being a great guy EvulMastah for just replying this thread... Just tell me what to do (wich you're doing but i dont understand the c++ language) I can give you screenshots etc etc.. Please don't leave me upon this spell! :/ I'd give you credit for your help..

In two months you could have learn something.
@esfomeado and @EvulMastah they gave you the code and told you how to do but you don't wanna learn nothing by yourself...
 
Back
Top Bottom