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

I need this script so fast possible! Rep+++ Please somebody help me!!!!!!!!

Status
Not open for further replies.

Printer

if Printer then print("LUA") end
Senator
Premium User
Joined
Dec 27, 2009
Messages
5,780
Solutions
31
Reaction score
2,299
Location
Sweden?
i have a war server i are level 9 and kill a level 8 dont get exprience please help me!


Rep+++
 
Last edited:
We will keep on trying!

Set protectionLevel = 1

also try to write worldType="pvpe" instead of pvp-enforced.

Log into your server with your Admin/God Char and write
/mode 3 (I hope pvp-enforced is 3 otherwise try from 1-4)

When it shows "World Type set to PVP-Enforced" try to kill the lvl 8 again.

Set the minThreshold = 0.5 and maxTreshold = 1.5

I won't leave this topic until it works :peace:
 
Set max and min Threshold to 10

minLevelThresholdForKilledPlayer = 10
maxLevelThresholdForKilledPlayer = 10

regarding the thread in the post above this should work that
every player gets exp never mind the level
 
Ok let us summarize this:

worldType = "pvpe"

minThreshold = 0.9
maxThreshold = 1.1

rateExperience = 1.0
rateExperienceFromPlayers = 6.0

try it like this, maybe rateExperience must be enable
to get any kind of exp.

And shutdown restart your server everytime you edit the config.lua! xD
 
there is reload config option, but I didnt tested it yet ;d

I tried to understand it, but today my thinking process is bad...
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;
}

maybe Zyntax can understand it?
 
Last edited:
i dont reload i restart the server everytime to test something
 
Im not sure what the problem is then. Are you running 0.3.6pl1, and are you getting experience when killing a higher level player? eg lvl 8 killing lvl 9.
 
0.3.6pl1: yes
when i kill a level 9 i get exprience when i are level 8 but when a level 9 killing a level 8 he doesnt get exprience :/
 
its the same doesnt work should i have a script or doesnt conifg help :/
 
Weird:

min = 0.9
max = 1.1
level = 8
attackerLevel = 9

if((0.9 > 0 && level < (uint32_t)std::floor(attackerLevel * 0.9))

both results are TRUE so the expgain = false!

continue ||
(1.1 > 0 && level > (uint32_t)std::floor(attackerLevel * max)))

one result = TRUE other = FALSE, endresulst = FALSE

But the function returns 0; because our first result above is TRUE.

Set minThreshold to 0.5

Continueing the investagation, otherwise source edit your .exe
and erease the whole section :$

EDIT: If you set min to 0.5 and max to 1.1 this should happen,

min = 0.5
max = 1.1
level = 8
attackerLevel= 9

if((0.5 > 0 && level < (attackerLevel * min)) || (1.1 > 0 && level > (attackerLevel * max)))

The function shouldn't return 0; now (player don't gain exp)
and you should get EXP.

2ndEDIT: and rateExperience = 1.0 (or 10.0)
 
Last edited:
It HAS TO work...

Level both chars to 10 and 11.
Make sure both chars have some exp.
Don't use MultiClient, otherwise the attackingPlayer will be
the same as the attackedPlayer.

worldType = pvp-enforced
(or set it to /mode 3 with your GM char)
minThreshold = 0.4
maxThreshold = 1.5

rateExpFromPlayer = 10.0
rateExperience = 10.0

Level the chars 1-2 lvl ... it has to work according to the source :$
 
i dont use MultiClient and get zero exprience from a level 8 :/
 
Level the characters.
Kill some normal monsters (map some if neccessary)

Then try it again, otherwise I'm out of ideas soon... :$

make sure to have

rateExperience = 10 in your config.lua, otherwise you won't get exp
 
Status
Not open for further replies.
Back
Top