• Congratulations to the OTLand January Mapping Competition Winner! The grand prize of Otland Premium goes to Andréew.
  • Sign up for February Mapping Competition! The prize includes Otland Premium time.
  • 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

New Member
Joined
Mar 28, 2017
Messages
93
Best answers
0
Reaction score
1
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:
OP
sucibob

sucibob

New Member
Joined
Mar 28, 2017
Messages
93
Best answers
0
Reaction score
1
anybody know?
 
Top