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

Avesta 7.6 - pvp enforced formula, how to change?

Ekhart

New Member
Joined
Sep 23, 2010
Messages
6
Reaction score
0
its not changeable in .lua, how to change it?

I need it really really lower, and if higher level kills lower level, he doesnt get exp. can anybody help me?

what should i do exactly to make exp from killing people lower on avesta?
 
Give us a link to the source code, or upload it.

no uhm, it's in player.cpp:

[cpp]uint64_t Player::getGainedExperience(Creature* attacker, bool useMultiplier /*= true*/) const
{
if(g_game.getWorldType() == WORLD_TYPE_PVP_ENFORCED){
Player* attackerPlayer = attacker->getPlayer();
if(attackerPlayer && attackerPlayer != this && skillLoss){
/*Formula
a = attackers level * 0.9
b = victims level
c = victims experience

y = (1 - (a / b)) * 0.05 * c
*/

uint32_t a = (int32_t)std::floor(attackerPlayer->getLevel() * 0.9);
uint32_t b = getLevel();
uint64_t c = getExperience();

uint64_t result = std::max((uint64_t)0, (uint64_t)std::floor( getDamageRatio(attacker) * std::max((double)0, ((double)(1 - (((double)a / b))))) * 0.05 * c ));
if(!useMultiplier)
return result * g_config.getNumber(ConfigManager::RATE_EXPERIENCE);
else
return uint64_t((result * g_config.getNumber(ConfigManager::RATE_EXPERIENCE)) * attackerPlayer->getRateValue(LEVEL_EXPERIENCE));
}
}

return 0;
}[/cpp]
 
nop, you must compile. that's why hardcoding stuff like this is bad. :D
but it would(could?) be an issue for devs to implement getDamageRatio in Lua and completely useless since it would only serve 1 purpose.

hardcoding is even worse with distributions which require "special" lib versions in order to be compiled.
 
Back
Top