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

Feature No exp from same IP when killing another player (PVP - Enforced/Hardcore).

Yeah, a configurable amount using a float for % in config would be nice.
example would be
1.00 == full
0.66 == two thirds
0.15 == only fifteen percent
 
Im using Avesta so obviously I had to change some. But its still not working. Anybody knows why?

[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->getIP() == getIP() && !g_config.getNumber(ConfigManager::GAIN_EXP_FROM_SAME_IP))
return 0;
else
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 ) );
double res = (double)result;

if(useMultiplier)
return result * g_config.getNumber(ConfigManager::RATE_EXPERIENCE);
else
return uint64_t((result * g_config.getNumber(ConfigManager::RATE_EXPERIENCE)) * double(attackerPlayer->exp_multiplier));
}
}

return 0;
}[/cpp]
 
There is a script for this in simplewarOT1.51PL check that out its more simple to add (Copy/paste)
but on that script you dont get 0 exp, you can configure a punishment also to take exp from the player. im not to sure if it has the same network play bug ul have to tet it

When I downloaded my server it was Simplewar 8.54 a friend maked 8.60 now I have the same problem but that codes at the top of the topic where I can find them
In which folder? o.o reply fast plxx it´s a big problem
 
doesn't work..
see on your profile. i leave a mensage.
 
Lua:
	if(getIP() == attackerPlayer->getIP())
		return 0;

Does somebody know how to fix this for TFS 0.3? I tried that with a friend and he didn't get any experience but he does not have the same IP as me.
 
Somebody can fix that script for 0.4/0.3.6???

Please i need that for a war server ;s
 
Back
Top