Acubens
Old Penguin
I wanna get exp from low level players, but i can't make it work, i change the formula one, two, alot times and sometimes i dont get exp from high level players, this the normal function without changes.
Distro used: OTHire 0.0.2
What changes is needed in the formula? i can't get work it >.< thanks in advance.
@Ezzz
Code:
uint64_t Player::getGainedExperience(Creature* attacker) const
{
if (g_game.getWorldType() == WORLD_TYPE_PVP_ENFORCED && g_config.getNumber(ConfigManager::RATE_EXPERIENCE_PVP) > 0)
{
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));
return result * g_config.getNumber(ConfigManager::RATE_EXPERIENCE_PVP);
}
}
return 0;
}
Distro used: OTHire 0.0.2
What changes is needed in the formula? i can't get work it >.< thanks in advance.
@Ezzz