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

[Avesta] Dont drop levelsl below 50

Raotiz

High Five
Joined
Apr 11, 2010
Messages
693
Reaction score
49
Location
Sweden
Code:
local exp = 1847300
  if getPlayerExperience(cid) < exp then
  doPlayerAddExp(cid,exp-getPlayerExperience(uid))   
  end
This script ain''t working.. Any thoughts about what can be wrong?
 
Code:
if getPlayerLevel(cid) <= 49 then
	doPlayerAddExp(cid, 92365) 

end
i dont think to get exakt level you will need code setLevel /exp but avesta miss that funktion i think¨.
 
You mean level 50? I putted this in creaturescripts/scripts/login.lua
Code:
function onLogin(cid)
if getPlayerLevel(cid) <= 49 then
	doPlayerAddExp(cid, 92365) 

end

	return TRUE
end
And this in creaturescripts.xml
Code:
<event type="login" name="PlayerLogin" script="login.lua" />
I tried it, nothing happening, you keep losing level upon dying in lvl 50.

Another script I found, but is still not working

Code:
function onLogin(cid)
	if getPlayerLevel(cid) < 50 then
		doPlayerAddExp(cid, addExperience(50) - getPlayerExperience(cid))
	end
	return true
end
 
Last edited:
in void Player :: Die()

Above:
Code:
for(ConditionList::iterator it = conditions.begin(); it != conditions.end();){

Add:

Code:
uint32_t LossLevel=g_config.getNumber(ConfigManager::LOSSLEVEL);

Under:
Code:
loginPosition = masterPos;

Add:

Code:
bool orshabaal=false;
if(level<=LossLevel)
{
this->skillLoss=false;
}

And under:
Code:
			std::stringstream lvMsg;
			lvMsg << "You were downgraded from level " << oldLevel << " to level " << newLevel << ".";
			sendTextMessage(MSG_EVENT_ADVANCE, lvMsg.str());
		}
	}

Add:

Code:
if(orshabaal==true){this->skillLoss=true;}

In configmanager.cpp:

Under:
Code:
m_confInteger[MAX_IDLE_TIME] = getGlobalNumber(L, "MaxIdleTime", 15);

Add:

Code:
m_confInteger[LOSSLEVEL] = getGlobalNumber(L, "LossLevel", 0);

And under: (configmanager.h)
Code:
FIGHTEXHAUSTED,

Add:

Code:
LOSSLEVEL,

In config add:
Lua:
LossLevel = 50
 
It should be like this:

if getPlayerLevel(cid) < LEVEL then
doPlayerAddExp(cid, LEVELEXPERIENCE - getPlayerExperience(cid))
end
 
It's more effecient through creaturescripts, I don't see why people should do such an easy task through the source.
 
I just want the fastest possible way that could help me out, now I can just change it config file which level I wanna choose to not drop below.
 
Back
Top