Anonymous

Module:Monsters: Difference between revisions

From Melvor Idle
Add support for Strongholds
(Fix for areas using random pools of monsters)
(Add support for Strongholds)
Line 979: Line 979:


local areaList = Areas._getMonsterAreas(monster)
local areaList = Areas._getMonsterAreas(monster)
local counts = {combatArea = 0, slayerArea = 0, dungeon = 0, abyssDepth = 0}
local counts = {combatArea = 0, slayerArea = 0, dungeon = 0, abyssDepth = 0, stronghold = 0}
for i, area in ipairs(areaList) do
for i, area in ipairs(areaList) do
counts[area.type] = (counts[area.type] or 0) + 1
counts[area.type] = (counts[area.type] or 0) + 1
Line 987: Line 987:
if counts.slayerArea > 0 then table.insert(monsterTypes, 'Slayer Area') end
if counts.slayerArea > 0 then table.insert(monsterTypes, 'Slayer Area') end
if counts.dungeon > 0 then table.insert(monsterTypes, 'Dungeon') end
if counts.dungeon > 0 then table.insert(monsterTypes, 'Dungeon') end
if counts.abyssDepth > 0 then table.insert(monsterTypes, 'The Abyss') end
if counts.stronghold > 0 then table.insert(monsterTypes, 'Stronghold') end


result = result.."\r\n|-\r\n|'''Monster Types:''' "..table.concat(monsterTypes, ", ")
result = result.."\r\n|-\r\n|'''Monster Types:''' "..table.concat(monsterTypes, ", ")
Line 1,351: Line 1,353:
end
end


if area.type == 'dungeon' or area.type == 'abyssDepth' then
if area.type == 'dungeon' or area.type == 'abyssDepth' or area.type == 'stronghold' then
return p.getDungeonMonsterTable(frame)
return p.getDungeonMonsterTable(frame)
end
end
Line 1,624: Line 1,626:
end
end


if area.type == 'dungeon' or area.type == 'abyssDepth' then
if area.type == 'dungeon' or area.type == 'abyssDepth' or area.type == 'stronghold' then
return p._getDungeonMonsterList(area)
return p._getDungeonMonsterList(area)
else
else