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

TFS 1.0 bless loose 0 exp change

@Config.lua:
deathLosePercent = -1
If that is what you have you got some corrupted script.

I do have deathLosePercent = 1 because when im using -1 players loose
lvl 250 (bless) : +/- 2 lvls
lvl 250 (no bless): +/- 3 lvls
lvl 400 (bless) : +/- 3 lvls
lvl 400 (no bless) : +/- 4 lvls

so that is probably the problem but how can I reduce those exp loses by 50% then?
 
If im not mistaken you have to change your source code in that case, since -1 is the lowest variable we use.
The function is: Player::getLostPercent()
 
The player.cpp file.
So I should change
PHP:
    const int32_t deathLosePercent = g_config.getNumber(ConfigManager::DEATH_LOSE_PERCENT);
    if (deathLosePercent != -1) {
        int32_t lossPercent = deathLosePercent;

        if (isPromoted()) {
            lossPercent -= 3;
        }

to

PHP:
    const int32_t deathLosePercent = g_config.getNumber(ConfigManager::DEATH_LOSE_PERCENT);
    if (deathLosePercent != -1) {
        int32_t lossPercent = deathLosePercent;

        if (isPromoted()) {
            lossPercent -= 1.5;
        }
 
So I should change
PHP:
    const int32_t deathLosePercent = g_config.getNumber(ConfigManager::DEATH_LOSE_PERCENT);
    if (deathLosePercent != -1) {
        int32_t lossPercent = deathLosePercent;

        if (isPromoted()) {
            lossPercent -= 3;
        }

to

PHP:
    const int32_t deathLosePercent = g_config.getNumber(ConfigManager::DEATH_LOSE_PERCENT);
    if (deathLosePercent != -1) {
        int32_t lossPercent = deathLosePercent;

        if (isPromoted()) {
            lossPercent -= 1.5;
        }

Im not sure, someone who knows more about those values can probably help you out.
 
player.cpp
search:
Code:
uint64_t expLoss = (uint64_t)(experience * deathLossPercent);
replace with:
Code:
uint64_t expLoss = (uint64_t)(experience * deathLossPercent / 2);

this will half the exploss then
 
changed it but it doesn't seem to work
before the change
lvl 373 (3% to 374) after he died lvl 369 (31% to 370)

after the change
lvl 369 (31% to 370) after he died lvl 365 (54% to 366)

so lost +/- 4 lvls both times
 
let's test it another way, because I'm pretty sure it's the right place
change it to:
Code:
uint64_t expLoss = 0;

if you still loose exp then there is something wrong on your end.
 
whenever you make changes in your source code you have to compile it to a new executable, else editing those files will have no effect at all.
 
Back
Top