-
Notifications
You must be signed in to change notification settings - Fork 9
/
not-lose-level.xml
30 lines (27 loc) · 1.03 KB
/
not-lose-level.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?xml version="1.0" encoding="UTF-8"?>
<mod name="not-lose-level" version="1.0" author="slawkens" contact="[email protected]" enabled="yes">
<config name="not-lose-level-config"><![CDATA[
levelToNotLose = 50 -- under this level you wont lose anything (items, exp, mlevel)
]]></config>
<event type="login" name="not-lose-level-login" event="script"><![CDATA[
function onLogin(cid)
registerCreatureEvent(cid, "not-lose-level-death")
return true
end
]]></event>
<event type="preparedeath" name="not-lose-level-death" event="script"><![CDATA[
domodlib('not-lose-level-config')
local config = {
levelToNotLose = levelToNotLose
}
function onPrepareDeath(cid, deathList, lastHitKiller, mostDamageKiller)
if isPlayer(cid) == true and getPlayerLevel(cid) <= config.levelToNotLose then
doCreatureSetDropLoot(cid, 0)
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 0)
doPlayerSetLossPercent(cid, PLAYERLOSS_MANA, 0)
doPlayerSetLossPercent(cid, PLAYERLOSS_SKILLS, 0)
end
return true
end
]]></event>
</mod>