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

CreatureEvent Level protection

klekSu

Stroke my ego.
Joined
Nov 4, 2008
Messages
1,285
Reaction score
18
Hi, i've seen few threads about low level protection, and not lossing it (level) and items when lower than x level. But what about when players abuse it to block hunting spots or wars, when die come again and again and again still not loosing their exp and level. They will keep abusing it. So i decided to make something different when player won't lose his items but will lose some percent of experience. My idea comes from those threads:

http://otland.net/f82/players-quitting-because-early-death-46056/
http://otland.net/f82/low-level-death-protection-39020/

What it does?
Gives player blessings when level under 20. Remember, from 0.3.4 you won't lose items while having blessings. Also level is configurable.

levelprotection.lua
Lua:
function onLogin(cid)
local bless = {1, 2, 3, 4, 5}
local level = 20
	if(getPlayerLevel(cid) <= level) then
		for i = 1, table.maxn(bless) do
			if(getPlayerBlessing(cid, bless[i])) then
				return TRUE
			else
				doPlayerAddBlessing(cid, bless[i])
			end
		end
   	end
return true
end

login.lua
Code:
	registerCreatureEvent(cid, "LevelProtection")

creaturescripts.xml
Code:
	<event type="login" name="LevelProtection" event="script" value="levelprotection.lua"/>
__________________
klekSu.png

You are welcome on kleksoria.com!
Please visit new open tibia forum with it's own ots list. otservers.net!
 
Last edited:
Back
Top