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

Max level script

Status
Not open for further replies.

Vendeliko

Banned User
Joined
Dec 3, 2011
Messages
3,087
Reaction score
90
Location
Beside that guy with that thing but without that t
Hey guys,could anyone please make me a script that will not allow players to get a higher level than 150?
I have found this when searching:
Find function like this in player.h:
[cpp]static uint64_t getExpForLevel(uint32_t lv)
{[/cpp]

and after that add:
[cpp]if(lv > 2000)
return 0;[/cpp]

But for some reason it does not work,I keep getting level after I reached 150.

Also not sure if it makes any difference but I need it to work with PK exp and not monster exp :p
Im using rev 4269.






Thanks in advance,
Vendeliko.
 
Last edited:
I don't clearly understand what you're asking for.

You want it so players can only get up to level 150 from player experience, not monster experience?
 
[cpp]
if(lv >= 150)
return 9999999999999999999999999999999999999999999999999999999999999999999999999;
[/cpp]
 
maybe:
[cpp]double Creature::getGainedExperience(Creature* attacker) const
{
if (Player* player = attacker->getPlayer())
{
if (player->getPlayerInfo(PLAYERINFO_LEVEL) >= 150)
return 0;
}
return getDamageRatio(attacker) * (double)getLostExperience();
}[/cpp]
 
put this after Creature::eek:nGainExperience
[cpp]if (Player* player = this->getPlayer())
{
if (player->getPlayerInfo(PLAYERINFO_LEVEL) >= 150)
return;
} [/cpp]
 
put this after Creature::eek:nGainExperience
[cpp]if (Player* player = this->getPlayer())
{
if (player->getPlayerInfo(PLAYERINFO_LEVEL) >= 150)
return;
} [/cpp]

after this ?
Code:
	Creature::onGainExperience(gainExp, target, true);

like this ?
Code:
	if(gainExperience(gainExp, target))
		Creature::onGainExperience(gainExp, target, true);
		if (Player* player = this->getPlayer()) 
	{
		if (player->getPlayerInfo(PLAYERINFO_LEVEL) >= 150)
			return;
	}
 
Status
Not open for further replies.
Back
Top