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

Lua How this loot bonus script works?

sucibob

Member
Joined
Mar 28, 2017
Messages
128
Reaction score
13
I found this script who give a loot bonus when u kill some monster:

Lua:
function onDeath(cid, corpse, deathList)

    local master = getCreatureMaster(cid)
    if (master and master ~= cid) then
        return true
    end

    print("monster killed prey system")

    for i = 1, #deathList do
        -- loot bonus
        local lootList = getMonsterLootList(getCreatureName(cid))
        for i, _ in pairs(lootList) do
            if lootList[i].count > 1 then
                local numb = math.random(1, lootList[i].count)
                doAddContainerItem(corpse.uid, lootList[i].id, numb)
            elseif math.random(1,100000) <= lootList[i].chance then
                doAddContainerItem(corpse.uid, lootList[i].id, 1)
            end
        end
    end


    return true
end

But how the bonus actually works?

I would like to understand how it work to increase or decries the bonus, or even play with it
 
Last edited by a moderator:
Back
Top