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

Compiling Simple Script Translation Please! ^_^

Nekhron09

New Member
Joined
Jun 28, 2009
Messages
45
Reaction score
0
Code:
uint64_t Player::getGainedExperience(Creature* attacker) const
{
	if(g_game.getWorldType() == WORLD_TYPE_PVP_ENFORCED){
		Player* attackerPlayer = attacker->getPlayer();
		if(attackerPlayer && attackerPlayer != this){
				/*Formula
				a = attackers level * 0.9
				b = victims level
				c = victims experience

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

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

				int32_t result = std::max((int32_t)0, (int32_t)std::floor( getDamageRatio(attacker) * ((double)(1 - (((double)a / b)))) * 0.05 * c ) );
				return result * g_config.getNumber(ConfigManager::RATE_EXPERIENCE);
		}
	}


	return 0;



SORRY IDK HOW TO PUT THE CODE BOX THING IN =/
 
Last edited:
Next time just use [ code ] and [ /code ] (Without the spaces) or click the little code button.

And what are you asking us to do? Are you asking us to simplify that script? Could you inform us on what the script should do and what its purpose is?
 
this script is for my pvp-e system. I just want explained what would happen if someone pked another? I dont knwo what would happen by reading the script.
 
Back
Top