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

[MOD] Not lose anything under x level

slaw

Software Developer
Joined
Aug 27, 2007
Messages
3,663
Solutions
125
Reaction score
1,109
Location
Germany
GitHub
slawkens
Simple, you won't lose anything if you're under x level.

Installation, paste in mods/not-lose-level.xml
Lua:
<?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>

Configuration: edit levelToNotLose.
 
Hi!

Awesome work! Does it work in 0.3.7pl1? Is it tested?
 
Back
Top