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

If vip = 50% extra exp | rep++

try
XML:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="extravip" authors="C+C" enabled="yes">   
    <config name="settings">
        <![CDATA[
            skillsRate = 0.20 --% of extra rate for skills
            lootRate = 7 -- loot rate for premium players
        ]]>
    </config>
    <event type="login" name="scroll" event="script">
        <![CDATA[
            domodlib('settings')
            function onLogin(cid)
                registerCreatureEvent(cid, 'plr')
                if getPlayerVipDays(cid) >= 1 then
                    for i = 0, 8 do
                        doPlayerSetRate(cid, i, 1+skillsRate)
                    end
                end
                return true
            end
        ]]>
    </event>
    <event type="kill" name="plr" event="script">
        <![CDATA[
            domodlib('settings')
            local rate = getConfigInfo('rateLoot') -- the normal rate, don't change
     
            function getContentDescription(uid, comma)
                local ret, i, containers = '', 0, {}
                while i < getContainerSize(uid) do
                    local v, s = getContainerItem(uid, i), ''
                    local k = getItemInfo(v.itemid)
                    if k.name ~= '' then
                        if v.type > 1 and k.stackable and k.showCount then
                            s = v.type .. ' ' .. getItemInfo(v.itemid).plural
                        else
                            local article = k.article
                            s = (article == '' and '' or article .. ' ') .. k.name
                        end
                        ret = ret .. (i == 0 and not comma and '' or ', ') .. s
                        if isContainer(v.uid) and getContainerSize(v.uid) > 0 then
                            table.insert(containers, v.uid)
                        end
                    else
                        ret = ret .. (i == 0 and not comma and '' or ', ') .. 'an item of type ' .. v.itemid .. ', please report it to gamemaster'
                    end
                    i = i + 1
                end
                for i = 1, #containers do
                    ret = ret .. getContentDescription(containers[i], true)
                end
                return ret
            end
     
            local function send(cid, pos, corpseid, monster, party)
                local corpse = getTileItemById(pos, corpseid).uid
                local ret = isContainer(corpse) and getContentDescription(corpse)
                doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Loot of ' .. monster .. ': ' .. (ret ~= '' and ret or 'nothing'))
                if party then
                    for _, pid in ipairs(getPartyMembers(party)) do
                        doPlayerSendChannelMessage(pid, '', 'Loot of ' .. monster .. ': ' .. (ret ~= '' and ret or 'nothing'), TALKTYPE_CHANNEL_W, CHANNEL_PARTY)
                    end
                end
            end
     
            local function createLoot(i, ext)
                local item = type(i.id) == 'table' and i.id[math.random(#i.id)] or i.id
                local random = math.ceil(math.random(100000) / (ext and lootRate or rate))
                local tmpItem
            
                if random < i.chance then
                    tmpItem = doCreateItemEx(item, getItemInfo(item).stackable and random % i.count + 1 or 1)
                end
         
                if not tmpItem then
                    return
                end
         
                if i.subType ~= -1 then
                    doItemSetAttribute(tmpItem, 'subType', i.subType)
                end
         
                if i.actionId ~= -1 then
                    doItemSetAttribute(tmpItem, 'aid', i.actionId)
                end
         
                if i.uniqueId ~= -1 then
                    doItemSetAttribute(tmpItem, 'uid', i.uniqueId)
                end
         
                if i.text ~= '' then
                    doItemSetAttribute(tmpItem, 'text', i.text)
                end
                return tmpItem
            end
     
            local function createChildLoot(parent, i, ext)
                if #i == 0 then
                    return true
                end
             
                local size, cap = 0, getContainerCap(parent)
                for k = 1, #i do
                    if size == cap then
                        break
                    end
                    local tmp = createLoot(i[k], ext)
                    if tmp then
                        if isContainer(tmp) then
                            if createChildLoot(tmp, i[k].child, ext) then
                                doAddContainerItemEx(parent, tmp)
                                size = size + 1
                            else
                                doRemoveItem(tmp)
                            end
                        else
                            doAddContainerItemEx(parent, tmp)
                            size = size + 1
                        end
                    end
                end
             
                return size > 0
            end
     
            local function dropLoot(pos, v, ext)
                local corpse = getTileItemById(pos, v.lookCorpse).uid
                if isContainer(corpse) then
                    for i = 1, getContainerSize(corpse) do
                        doRemoveItem(getContainerItem(corpse, 0).uid)
                    end
                    local size, cap = 0, getContainerCap(corpse)
                    for i = 1, #v.loot do
                        if size == cap then
                            break
                        end
                        local tmp = createLoot(v.loot[i], ext)
                        if tmp then
                            if isContainer(tmp) then
                                if createChildLoot(tmp, v.loot[i].child, ext) then
                                    doAddContainerItemEx(corpse, tmp)
                                    size = size + 1
                                else
                                    doRemoveItem(tmp)
                                end
                            else
                                doAddContainerItemEx(corpse, tmp)
                                size = size + 1
                            end
                        end
                    end
                end
            end
     
            function onKill(cid, target, damage, flags)
                local result = getPlayerVipDays(cid) >= 1 and true or false
                if isInArray({1,3}, flags) and isMonster(target) then
                    local v = getMonsterInfo(getCreatureName(target))
                    if v.lookCorpse > 0 then
                        local master = getCreatureMaster(target)
                        if not master or master == target then
                            addEvent(dropLoot, 0, getThingPos(target), v, result)
                        end
                        addEvent(send, 100, cid, getThingPos(target), v.lookCorpse, v.description, getPlayerParty(cid))
                    end
                end
                return true
            end
        ]]>
    </event>
</mod>
 
No, hehe thanks repped ;) rep++!

can you take a loot at this!

Why this dont work??

PHP:
<label>Character name</label>
						<div id="characters" class="ui-helper-clearfix">
						<input id="search" name="name" type="text" onblur="fill();">&nbsp &nbsp &nbsp <button type="submit" name="Submit" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" role="button" aria-disabled="false"><span class="ui-button-text">&nbsp Search &nbsp</span></button>
						</form>

and this another!
http://otland.net/f16/inquisition-quest-help-please-fast-108156/
 
Dude, your scripts its 4ever?, or when vip system end exp back to normal?
And, skillsRate = 0.20 --% of extra rate for skills Up 20% more, right? and work with exp too?

@edit: Tested, And works fine, When vip loss Skills/loot back to normal, very nice Script. Thank you again :)
Rep++

@edit2: You must spread some Reputation around before giving it to CyberM again. :S whY?
 
Last edited:
first, try this fix:
XML:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="extravip" authors="C+C" enabled="yes">   
    <config name="settings">
        <![CDATA[
            skillsRate = 0.20 --% of extra rate for skills
            lootRate = 7 -- loot rate for premium players
        ]]>
    </config>
    <event type="login" name="scroll" event="script">
        <![CDATA[
            domodlib('settings')
            function onLogin(cid)
                registerCreatureEvent(cid, 'plr')
                if getPlayerVipDays(cid) >= 1 then
                    for i = 0, 8 do
                        doPlayerSetRate(cid, i, 1+skillsRate)
                    end
                end
                return true
            end
        ]]>
    </event>
    <event type="kill" name="plr" event="script">
        <![CDATA[
            domodlib('settings')
            local rate = getConfigInfo('rateLoot') -- the normal rate, don't change
 
            function getContentDescription(uid, comma)
                local ret, i, containers = '', 0, {}
                while i < getContainerSize(uid) do
                    local v, s = getContainerItem(uid, i), ''
                    local k = getItemInfo(v.itemid)
                    if k.name ~= '' then
                        if v.type > 1 and k.stackable and k.showCount then
                            s = v.type .. ' ' .. getItemInfo(v.itemid).plural
                        else
                            local article = k.article
                            s = (article == '' and '' or article .. ' ') .. k.name
                        end
                        ret = ret .. (i == 0 and not comma and '' or ', ') .. s
                        if isContainer(v.uid) and getContainerSize(v.uid) > 0 then
                            table.insert(containers, v.uid)
                        end
                    else
                        ret = ret .. (i == 0 and not comma and '' or ', ') .. 'an item of type ' .. v.itemid .. ', please report it to gamemaster'
                    end
                    i = i + 1
                end
                for i = 1, #containers do
                    ret = ret .. getContentDescription(containers[i], true)
                end
                return ret
            end
 
            local function send(cid, pos, corpseid, monster, party)
                local corpse = getTileItemById(pos, corpseid).uid
                local ret = isContainer(corpse) and getContentDescription(corpse)
                doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Loot of ' .. monster .. ': ' .. (ret ~= '' and ret or 'nothing'))
                if party then
                    for _, pid in ipairs(getPartyMembers(party)) do
                        doPlayerSendChannelMessage(pid, '', 'Loot of ' .. monster .. ': ' .. (ret ~= '' and ret or 'nothing'), TALKTYPE_CHANNEL_W, CHANNEL_PARTY)
                    end
                end
            end
 
            local function createLoot(i, ext)
                local item = type(i.id) == 'table' and i.id[math.random(#i.id)] or i.id
                local random = math.ceil(math.random(100000) / (ext and lootRate or rate))
                local tmpItem
 
                if random < i.chance then
                    tmpItem = doCreateItemEx(item, getItemInfo(item).stackable and random % i.count + 1 or 1)
                end
 
                if not tmpItem then
                    return
                end
 
                if i.subType ~= -1 then
                    doItemSetAttribute(tmpItem, 'subType', i.subType)
                end
 
                if i.actionId ~= -1 then
                    doItemSetAttribute(tmpItem, 'aid', i.actionId)
                end
 
                if i.uniqueId ~= -1 then
                    doItemSetAttribute(tmpItem, 'uid', i.uniqueId)
                end
 
                if i.text ~= '' then
                    doItemSetAttribute(tmpItem, 'text', i.text)
                end
                return tmpItem
            end
 
            local function createChildLoot(parent, i, ext)
                if #i == 0 then
                    return true
                end
 
                local size, cap = 0, getContainerCap(parent)
                for k = 1, #i do
                    if size == cap then
                        break
                    end
                    local tmp = createLoot(i[k], ext)
                    if tmp then
                        if isContainer(tmp) then
                            if createChildLoot(tmp, i[k].child, ext) then
                                doAddContainerItemEx(parent, tmp)
                                size = size + 1
                            else
                                doRemoveItem(tmp)
                            end
                        else
                            doAddContainerItemEx(parent, tmp)
                            size = size + 1
                        end
                    end
                end
 
                return size > 0
            end
 
            local function dropLoot(pos, v, ext)
                local corpse = getTileItemById(pos, v.lookCorpse).uid
                if isContainer(corpse) then
                    for i = 1, getContainerSize(corpse) do
                        doRemoveItem(getContainerItem(corpse, 0).uid)
                    end
                    local size, cap = 0, getContainerCap(corpse)
                    for i = 1, #v.loot do
                        if size == cap then
                            break
                        end
                        local tmp = createLoot(v.loot[i], ext)
                        if tmp then
                            if isContainer(tmp) then
                                if createChildLoot(tmp, v.loot[i].child, ext) then
                                    doAddContainerItemEx(corpse, tmp)
                                    size = size + 1
                                else
                                    doRemoveItem(tmp)
                                end
                            else
                                doAddContainerItemEx(corpse, tmp)
                                size = size + 1
                            end
                        end
                    end
                end
            end
 
            function onKill(cid, target, damage, flags)
                if not isPlayer(cid) or not isMonster(target) then
                    return true
                end
                local result = getPlayerVipDays(cid) >= 1 and true or false
                if isInArray({1,3}, flags) and isMonster(target) then
                    local v = getMonsterInfo(getCreatureName(target))
                    if v.lookCorpse > 0 then
                        local master = getCreatureMaster(target)
                        if not master or master == target then
                            addEvent(dropLoot, 0, getThingPos(target), v, result)
                        end
                        addEvent(send, 100, cid, getThingPos(target), v.lookCorpse, v.description, getPlayerParty(cid))
                    end
                end
                return true
            end
        ]]>
    </event>
</mod>
or else try noob script without extra loot:
XML:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="extravip" authors="C+C" enabled="yes">   
    <config name="settings">
        <![CDATA[
            skillsRate = 0.20 --% of extra rate for skills
        ]]>
    </config>
    <event type="login" name="scroll" event="script">
        <![CDATA[
            domodlib('settings')
            function onLogin(cid)
                if getPlayerVipDays(cid) >= 1 then
                    for i = 0, 8 do
                        doPlayerSetRate(cid, i, 1+skillsRate)
                    end
                end
                return true
            end
        ]]>
    </event>
</mod>
 
if i want x2 exp for all who buys vip is it 20% or 50%?

and does it work with 0.3.6?
 
Last edited:
Okey CyberM, I test your "Fix" script but getting same error on WoE... About a Party or something...

Img:
errory.png


Know about fix that? its really nice players VIP can get more loot than normal players ;)

Hope you help me again.
Thanks :)
 
:ninja: i dont see that it displays the error there, just the mod script
maybe the error is at the top or bottom? :o
 
Hello again CyberM.

Its possible that on your MOD to get Extra Exp/Skills can only get 50% EXP? Not skills/magic...

Or Script like example:

Extra Exp 100% - a demon give 2000 when vip 4000
Skill Rate/magic 50%: - 1 hour - 1 magic level , when vip 1.5 magic.
 
hello again cyberm.

Its possible that on your mod to get extra exp/skills can only get 50% exp? Not skills/magic...

Or script like example:

Extra exp 100% - a demon give 2000 when vip 4000
skill rate/magic 50%: - 1 hour - 1 magic level , when vip 1.5 magic.
bump
 
Back
Top