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

Remove Skill, Level, and Magic level cap

Itutorial

Excellent OT User
Joined
Dec 23, 2014
Messages
2,325
Solutions
68
Reaction score
999
Note: These changes can break your server, think twice before installing this!

TFS 1.x

This guide will show you how to break max skill,level,magic level in the sources.

open player.cpp

find
Code:
void Player::addExperience(Creature* source, uint64_t exp, bool sendText/* = false*/)

remove
Code:
if (currLevelExp >= nextLevelExp) {
        //player has reached max level
        levelPercent = 0;
        sendStats();
        return;
    }

find and remove
Code:
if (currLevelExp >= nextLevelExp) {
            //player has reached max level
            break;
        }

find
Code:
void Player::addSkillAdvance(skills_t skill, uint64_t count)

remove
Code:
if (currReqMana >= nextReqMana) {
        //player has reached max magic level
        return;
    }

remove
Code:
if (currReqTries >= nextReqTries) {
        //player has reached max skill
        return;
    }

find
Code:
void Player::addManaSpent(uint64_t amount)

That's it your done.
 
Last edited by a moderator:
just a tip to make it more noob friendly:

add to what engine version these code are
 
It would break once the required level tries exceed the size of uint64_t
 
Never get why people like to operate with high numbers :D
If you need to have more skill levels, just change formula of required tries instead of breaking, deleting etc.
TFS already using powers to calculate tries, thats after specific line start returning sick numbers of tries.
 
to fix limit i probably change this
C++:
 uint64_t currReqTries = vocation->getReqSkillTries(skill, skills[skill].level); 
 uint64_t nextReqTries = vocation->getReqSkillTries(skill, skills[skill].level + 1);
 if (currReqTries >= nextReqTries) {
        //player has reached max skill
        return;
    }
to some like this
C++:
 uint64_t currReqTries = vocation->getReqSkillTries(skill, skills[skill].level); 
 uint64_t nextReqTries = vocation->getReqSkillTries(skill, skills[skill].level + 1);
 uint64_t maxLevelCanBeReached = 140; /*probaby maximum mlvl without breaking integer overflow*/
 if (skills[skill].level > 140 || currReqTries >= nextReqTries) {
        currReqTries = vocation->getReqSkillTries(skill, maxLevelCanBeReached-1);
        nextReqTries = vocation->getReqSkillTries(skill, maxLevelCanBeReached);
    }
duo integer oveflow my solution will always repeat last level mlvl manaspend step ( 187mlvl->188mlvl will be like 139mlvl->140mlvl assuming that 140lvl is the maximum possible without overflow of the variable )
there may be errors in the code, written from memory :)
 
^ look at your signature and practice what you preach. I didn't say this is the best way its is just a way, and it shows where the caps are at. What people do with the information is up to them. If they needed it. Go flame another post guys.
 
My signature has nothing to do with my post, nor was it a flame.
If i was flaming, I'd be all like "LUL U IZ TEH SUX WHEY DID U BREK DA SURVER Br0.", but then again i'm not 12 years old.

I was being legit with the seriousness of the post, the comment was because it literally breaks the server if you go over the limit.
Why would anyone in their right mind post that on their server? Its a bad piece of a code anyone who didn't know what they was doing would use this and break their servers, limits are set for a reason.
Now if you had provided a way to bypass the limit and not break the server, I'd have high fived you with a like to the post.
 
So it's not possible disable level and experience in game/server?
If you want to disable getting the experience from monsters I believe It's enough to set rateExp to 0 in config.lua
 
Back
Top