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

Changing xp necessary to level up

RealRolePlayer

New Member
Joined
Oct 28, 2015
Messages
19
Reaction score
0
I want to edit the exp needed for a player to level up but I have no clue on where to start this kind of edition. I dont want to change the skill multiplier, this is no good for me, so if you guys can point the way out for me, I'd be gratefull.
I am currently working on tsf 1.2 if not mistaken, I run with client 10.98
 
I dont want to change the skill multiplier, this is no good for me, so if you guys can point the way out for me, I'd be gratefull.
Skills and exp multipliers you can find in config.lua
I want to edit the exp needed for a player to level up but I have no clue on where to start this kind of edition.
you can find a file for such configuration at data/XML/stages.xml
 
That's not what I want... I can change stages and world exp rate without a problem, I want to change the amount of exp a player has to gain to level up.
Example: To advance from level 0 to level 1 I'd need (let's say) 80 experience points. I want to change this value "80" to (let's say) "10" and this is not done by editing exp rate on config.lua nor on stages.xml
 
player.h
Code:
        static uint64_t getExpForLevel(int32_t lv) {
            lv--;
            return ((50ULL * lv * lv * lv) - (150ULL * lv * lv) + (400ULL * lv)) / 3ULL;
        }

function that returns amount of exp for specific lvl
 
player.h
Code:
        static uint64_t getExpForLevel(int32_t lv) {
            lv--;
            return ((50ULL * lv * lv * lv) - (150ULL * lv * lv) + (400ULL * lv)) / 3ULL;
        }

function that returns amount of exp for specific lvl

Ok, so how do I use it? can you explain me or link a tutorial for me?
 
Ok, so how do I use it? can you explain me or link a tutorial for me?

So thats the default formula
Code:
((50ULL * lv * lv * lv) - (150ULL * lv * lv) + (400ULL * lv)) / 3ULL

The cleaner form is : next_level_exp = ((currentLVL^3 * 50) - (currentLevel^2 * 150) + (currentLevel * 400)) / 3

for example

exp needed to reach 2 lvl =( (1^3 * 50) - (1^2 * 150) + (1 * 400) ) / 3 = (50-150+400)/3 = 300/3 = 200
exp needed to reach 100 lvl =( (99^3 * 50) - (99^2 * 150) + (99 * 400) ) / 3 = (48514950 - 1470150 + 39600) / 3 = 15694800
(You can compare results with exp table http://tibia.wikia.com/wiki/Experience_Table , that they are correct)

If you want to set custom exp formula, you need to paste yours there (in that cpp function) and recompile the server engine.
 
Back
Top