beenii
Well-Known Member
- Joined
- Jul 26, 2010
- Messages
- 586
- Solutions
- 1
- Reaction score
- 58
Hello, does anyone have any idea how to remove certain items from the loot that the monsters give?
An example, I want leather set to be obtained in Quests.
Leather Helmet, Leather Armor, Leather Legs, Leather Boots
as we all know, they are very common items, which are get with many creatures.
and it would take me a long time to remove every piece of the set from monster.xml from all the monsters
I was thinking of something like this in code:
(The code is misspelled, it's just an idea, in case anyone knows how to write it properly)
An example, I want leather set to be obtained in Quests.
Leather Helmet, Leather Armor, Leather Legs, Leather Boots
as we all know, they are very common items, which are get with many creatures.
and it would take me a long time to remove every piece of the set from monster.xml from all the monsters
I was thinking of something like this in code:
(The code is misspelled, it's just an idea, in case anyone knows how to write it properly)
Code:
local remove_bloked_loot = {
{items = {
{id = 2365},
{id = 2392}
}},
}
function Container:removeLootBlocked(c, t)
for i = 1, #t.items do
if t.items[i] then
item:remove()
end
end
end
function onDeath(creature, corpse, killer, mostDamage, unjustified, mostDamage_unjustified)
if not creature:isMonster() then return true end
if corpse and corpse:isContainer() then
for i = 1, #remove_bloked_loot do
corpse:removeLootBlocked(creature, remove_bloked_loot[i])
end
end
return true
end