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

Compiling Unfair Fight 8.60 0.4

bezina

New Member
Joined
Nov 11, 2016
Messages
18
Reaction score
3
I miss it on 8.60, it's a really good thing the cipsoft implemented on tibia
Should be wounderfull if someone know how to put it in 0.4 sources for OTs 8.60
I think all servers should use it


How could work?
Code:
if killer lvl is 5x player killed lvl - deathreductionloss = 80%
elseif killer lvl is 3x player killed lvl - deathreductionloss = 70%
elseif killer lvl is 2x player killed lvl - deathreductionloss = 60%
elseif killer lvl is 1.5 player killed lvl - deathreductionloss = 50%
else -  deathreductionloss = 0%
 
Solution
I didn't know cipsoft have this feature...
It's really good to block power abuse, all servers should have it

But i don't like your config, using your config a fight 45 vs 30 have reduction, and 45 vs 30 is a fair combat...
I would change to:

PHP:
if        killerLVL is 5x killedLVL :: deathreductionloss = 80%
else if   killerLVL is 4x killedLVL :: deathreductionloss = 70%
else if   killerLVL is 3x killedLVL :: deathreductionloss = 60%
else if   killerLVL is 2x killedLVL :: deathreductionloss = 50%
else                                :: deathreductionloss = 0%

Anyways i don't know much about C++ to edit 0.4 sources, not much people know
It will be hard to find someone who know

The only one guy that know a lot about it i know is...
I'm still here on forum.


In player.cpp:
Change:
Code:
    if(skillLoss)
    {
        uint64_t lossExperience = getLostExperience();
        removeExperience(lossExperience, false);

To:
Code:
    if(skillLoss)
    {
        uint64_t lossExperience = getLostExperience();
        uint8_t unfairFightReduction = 0;
        Player* lastHitPlayer = g_game.getPlayerByID(lastHitCreature);
        if (lastHitPlayer) {
            double levelPercentage = lastHitPlayer->getLevel() / getLevel();
            if (levelPercentage >= 5) {
                unfairFightReduction = 80;
            } else if (levelPercentage >= 3) {
                unfairFightReduction = 70;
            } else if (levelPercentage >= 2) {
                unfairFightReduction = 60;
            } else if (levelPercentage >= 1.5) {
                unfairFightReduction = 50;
            }
        }
        removeExperience(lossExperience * (1 - (unfairFightReduction / 100.)), false);

This will only affect experience loss, if you wanna affect loss of skills etc you have to do:
Code:
        lossExperience = lossExperience * (1 - (unfairFightReduction / 100.));
        removeExperience(lossExperience, false);

Obs: This is not how unfair fight reduction works in Tibia. Just did it like this because it was asked.
http://tibia.wikia.com/wiki/Death#Unfair_Fight

Solved, thank you!
 
Back
Top