Anonymous

Module:Items/SourceTables: Difference between revisions

From Melvor Idle
_getItemLootSourceTable: Resolve lootChance being applied to bones
(_getItemSourceTables: Exclude loot tables of dungeon exclusive non-boss monsters)
(_getItemLootSourceTable: Resolve lootChance being applied to bones)
Line 604: Line 604:
       end
       end
     end
     end
     local lootChance = monster.lootChance ~= nil and monster.lootChance or 100
     local lootChance = monster.lootChance ~= nil and monster.bones ~= item.id and monster.lootChance or 100


     if wt > 0 and lootChance > 0 and not Shared.contains(item.name, 'Shard') then
     if wt > 0 and lootChance > 0 and not Shared.contains(item.name, 'Shard') then
Line 611: Line 611:
       local rollForLoot = false
       local rollForLoot = false
       for k, area in pairs(Areas.getMonsterAreas(i - 1)) do
       for k, area in pairs(Areas.getMonsterAreas(i - 1)) do
         if not (area.type == 'dungeon') or (area.type == 'dungeon' and area.monsters[Shared.tableCount(area.monsters)] == i - 1) then
         if area.type ~= 'dungeon' or (area.type == 'dungeon' and area.monsters[Shared.tableCount(area.monsters)] == i - 1) then
           -- Either monster isn't dungeon exclusive, or is the boss/last enemy of a dungeon
           -- Either monster isn't dungeon exclusive, or is the boss/last enemy of a dungeon
           rollForLoot = true
           rollForLoot = true