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

Solved Config.lua Question

War-Ots

New Member
Joined
Feb 17, 2016
Messages
29
Reaction score
2
Hey, I'm working on a PvP-Enforced server and I'm having an issue with config.lua, I enabled experienceByKillingPlayers but I can't find the place where I can controll the pvp experience rates, like lvl 100 kills other lvl 100 and gets 10 levels, I want to nerf to 5 levels, where do I find the code?

Is it placed in a source file or in a lua script?

Thanks!
 
Give us more information, War-Ots. it's pretty hard to know if you already have a parameter controlling this setting or not if we don't know what you're using.

It feels like giving you a 9mm bullet for you to use with a bb gun, which make no sense. If you want to know how your weapon works, be sure to specify what weapon you're using :)

Kindest Regards,
Okke
 
Last edited:
Ok I have found this piece of code in sources

It is probably near line 3349 in your player.cpp file


Code:
uint64_t Player::getGainedExperience(Creature* attacker) const
{
    if (g_config.getBoolean(ConfigManager::EXPERIENCE_FROM_PLAYERS)) {
       Player* attackerPlayer = attacker->getPlayer();
        if (attackerPlayer && attackerPlayer != this && skillLoss && std::abs(static_cast<int32_t>(attackerPlayer->getLevel() - level)) <= g_config.getNumber(ConfigManager::EXP_FROM_PLAYERS_LEVEL_RANGE)) {
       
          
       return std::max<uint64_t>(0, std::floor(getLostExperience() * getDamageRatio(attacker) *0,75));

                    }


        }
    }
    return 0;
}
What I did to do "exp stages" on my pvp server was something like: if (attackerPlayer->getLevel()<=160) in the return line I will return 0,8 instead of the 0,75 defined, and for example if (attackerPlayer->getLevel()>=400) my multiplier is 0.2 so the higher levels recive less experience, this solved partially what I wanted.


I hope it was clear this time ! ( :
 
Back
Top