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

Solved How to set a level cap?

Xrobi

New Member
Joined
Mar 13, 2013
Messages
5
Reaction score
0
Hello people,

I'm just wondering how to set a level cap on my open tibia server. Does anyone know where is the code line that is responsible for this feature? i would like to set it for lvl 100

Thanks
 
Yeah, I am working at a pretty nice project and it requires the cap level. Some wow like as the guy motioned above.

Btw. I would also like to stop the skill growing (magic level, shield, axe)
 
Last edited:
If monsters are the only way to obtain experience, it wouldn't even require a source edit. Your stages.xml could look like this:

XML:
<?xml version="1.0" encoding="UTF-8"?>
<stages>
	<config enabled="1"/>
	<stage minlevel="1" maxlevel="99" multiplier="1"/>
	<stage minlevel="100" multiplier="0"/>
</stages>

Obviously this wouldn't help if you had quests that yielded experience or PvP experience.
Red
 
Creaturescripts.xml
XML:
<event type="login" name="levelCap" event="script" value="levelcap.lua"/>
<event type="advance" name="advanceSave" event="script" value="advancesave.lua"/>
creaturescripts>scripts>levelcap.lua
LUA:
function onLogin(cid)
             if getPlayerLevel(cid) >= 100 then
				doPlayerAddLevel(cid, -(getPlayerLevel(cid)-100))
				doPlayerSetExperienceRate(cid, 0)
        		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are maximum level")
			end
end
creaturescripts>scripts>advancesave.lua
LUA:
function onAdvance(cid, skill, oldLevel, newLevel)
       if getPlayerLevel(cid) > 100 then
		doPlayerAddLevel(cid, -(getPlayerLevel(cid)-100))
		doPlayerSetExperienceRate(cid, 0)
		doCreatureSay(cid, "You have reached maximum level", 19)
		doPlayerSave(cid, true)
	elseif getPlayerLevel(cid) == 100 then
		doPlayerSetExperienceRate(cid, 0)
		doCreatureSay(cid, "You have reached maximum level", 19)
		doPlayerSave(cid, true)
	end
end
 

Similar threads

  • Question Question
Replies
4
Views
319
Xikini
X
Back
Top