Hello, I have been trying to solve a problem with unique items getting looted by every participant that join the fight.
I found out that the code is not finished to avoid multiple people getting the unique item.
I am using otservbr-global.
And this is the part of the code that is unfinished.
What i was trying to do is print the lootblock and try to get the items properties but with no success and i could not get any reference of what properties does the object contain.
lootBlock.unique is a nil value for every single item.
If anyone knows how i could fix this problem it would be appreciated
Thanks in advance.
I found out that the code is not finished to avoid multiple people getting the unique item.
I am using otservbr-global.
And this is the part of the code that is unfinished.
Code:
function MonsterType.getBossReward(self, lootFactor, topScore)
local result = {}
if getConfigInfo("rateLoot") > 0 then
local loot = self:getLoot() or {}
for i = #loot, 0, -1 do
local lootBlock = loot[i]
if lootBlock then
if lootBlock.unique and not topScore then
--continue
else
self:createLootItem(lootBlock, lootFactor, result)
end
end
end
end
return result
end
lootBlock.unique is a nil value for every single item.
If anyone knows how i could fix this problem it would be appreciated
Thanks in advance.
Last edited: