• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

A boss automatic loot distribution?

Werewolf

Forbidden Ascension
Joined
Jul 15, 2012
Messages
886
Reaction score
123
Does anyone have or is able to make this*

When players are in a team* and the team kills the boss, all players in the team Get the bosses loot, distributed equally to all the players.

So basically... Boss drops say. 100-1000 Gold, Plate armor, Plate legs, Steel boots, and an iron helmet, with rares of Ring of the skys, black skull, and golden armor,

All the players in the party, get all the loot that they would get as if they killed the boss themselves,

So... Its so everyone gets the same loot from the boss, so people are not left with no loot from killing the boss.

:D i hope someone can help me with this please!
 
Last edited:
it is Totaly able to make. Basicly you use onDeath event.
(I guess its most comfortable)
Then you parse items that are in monster container and send it to all players from deathList of this kind of monster, maybe I will write it for you, but no promises.
 
Sounds to complicated and annoying, Just kill a boss with friends you know will share well with you And deal with it that way.
 
The problem you will have with this is that it could easily be abused.

So i would recommend implementing something like "The 10 people with most dmg too the boss gets the loot" But there you run into a problems that healers do not get any loot. And that is harder to get in a script.

So it would almost be impossible to make a fair script with loot distrutbution.
 
LUA:
local config = {
	["Dwarf"] = true
}

local function getAllItemsByContainer(uid, id)
	local containers = {uid}
	local items = {}
 
	while #containers > 0 do
		for k = (getContainerSize(containers[1]) - 1), 0, -1 do
			local tmp = getContainerItem(containers[1], k)
			if isContainer(tmp.uid) then
				table.insert(containers, tmp.uid)
			elseif not(id) or id == tmp.itemid then
				table.insert(items, tmp)
			end
		end
		table.remove(containers, 1)
	end
 
	return items
end

function divideLoot(corpseID, pos, deathList)
    local c = getTileItemById(pos, corpseID)
    if c.itemid == corpseID then
        local items = getAllItemsByContainer(c.uid)
        for i = 1, #items do
            for j = 1, #deathList do
                doPlayerAddItem(deathList[j], items[i].itemid, items[i].type)
            end
        end
    end
end

function onDeath(cid, corpse, deathList)
    local pos = getThingPos(cid)
    local cname = getCreatureName(cid)
    addEvent(divideLoot, 50, getMonsterInfo(cname).lookCorpse, pos, deathList)
	return true
end

Something like that. Not fully tested.
On monster file add:
XML:
    <script>
		<event name="BossDeath"/>
	</script>
 
Back
Top