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

LVL BUG! Paying 15 Dollars to the guy who fixxes it

Evil Mark

Active Member
Joined
Nov 23, 2008
Messages
1,707
Reaction score
32
Yo, I'm here to get some help ;/.

Players in My PvP-E Server aren't getting higher if they logg on a lvl 300 cause everyone else are lower, so i wanna stop this, lawl.. i Want them to still gain exp. Eventough it shouldn't be like that and they should only gain exp if the victime is higher.


i Saw a guy write this
uint64_t Player::getGainedExperience(Creature* attacker)
in another thread, he said you change it from sources, anyone got any idea?
 
Last edited:
Code:
uint64_t Player::getGainedExperience(Creature* attacker, bool useMultiplier/* = true*/)
{
	if(!g_config.getBool(ConfigManager::EXPERIENCE_FROM_PLAYERS))
		return 0;

	Player* attackerPlayer = attacker->getPlayer();
	if(attackerPlayer && attackerPlayer != this && skillLoss)
	{
		uint32_t a = (uint32_t)std::floor(attackerPlayer->getLevel() * 0.9);
		if(getLevel() >= a)
		{
			/*
				Formula
				a = attackers level * 0.9
				b = victims level
				c = victims experience

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

			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)
				result = uint64_t((double)result * attackerPlayer->experienceRate);

			return std::min((uint64_t)getLostExperience(), uint64_t(result * g_game.getExperienceStage(attackerPlayer->getLevel())));
		}
	}

	return 0;
}

Player.cpp.
Just change the formula.
 
Your code was looking fine, but when i copied it and pasted it in to my sources, it gave me alot of errors, if you want we can do it Using TeamViewer by and chatting by msn? Here's my Msn if ur interested..

[email protected]
 
Last edited:
Back
Top Bottom