Nevalopo
Demigod
I am going to quote my old thread but since its long time ago and outdated the awnser i got there is not working anymore..
Ok so im wondering how do i change this? Currently this is what i want:
I want player 1 (10) to gain 5000 exp from player 2 (2)
I want no matter what level, they should allways gain the same experience. A level 1 killing a level 23476237 should gain 5000 exp.
A level 23426354235423 killing a level 1 should gain 5000 exp.
Where do i change this?
I found this in players.cpp on line 3312 (tfs 0.3.5pl 1):
Code:double Player::getGainedExperience(Creature* attacker) const { if(!skillLoss) return 0; double rate = g_config.getDouble(ConfigManager::RATE_PVP_EXPERIENCE); if(rate <= 0) return 0; Player* attackerPlayer = attacker->getPlayer(); if(!attackerPlayer || attackerPlayer == this) return 0; double attackerLevel = (double)attackerPlayer->getLevel(), min = g_config.getDouble( ConfigManager::EFP_MIN_THRESHOLD), max = g_config.getDouble(ConfigManager::EFP_MAX_THRESHOLD); if((min > 0 && level < (uint32_t)std::floor(attackerLevel * min)) || (max > 0 && level > (uint32_t)std::floor(attackerLevel * max))) return 0; /* Formula a = attackers level * 0.9 b = victims level c = victims experience result = (1 - (a / b)) * 0.05 * c Not affected by special multipliers(!) */ uint32_t a = (uint32_t)std::floor(attackerLevel * 0.9), b = level; uint64_t c = getExperience(); return (double)std::max((uint64_t)0, (uint64_t)std::floor(getDamageRatio(attacker) * std::max((double)0, ((double)(1 - (((double)a / b))))) * 0.05 * c)) * rate; }
It has to be somewhere there right?? I need it to allways give 5000 exp from pvp experience.