Module:Monsters: Difference between revisions

no edit summary
(_getDungeonMonsterList: Fix)
No edit summary
Line 939: Line 939:
--For Dungeons, go through and count how many of each monster are in the dungeon first
--For Dungeons, go through and count how many of each monster are in the dungeon first
local monsterCounts = {}
local monsterCounts = {}
for i, monsterID in pairs(area.monsterIDs) do
for i, monsterID in ipairs(area.monsterIDs) do
if monsterCounts[monsterID] == nil then
if monsterCounts[monsterID] == nil then
monsterCounts[monsterID] = 1
monsterCounts[monsterID] = 1
Line 1,030: Line 1,030:
--  table.insert(returnPart, buildRow(152, 4))
--  table.insert(returnPart, buildRow(152, 4))
--end
--end
for i, monsterID in pairs(area.monsterIDs) do
for i, monsterID in ipairs(area.monsterIDs) do
if not Shared.contains(usedMonsters, monsterID) then
if not Shared.contains(usedMonsters, monsterID) then
if monsterID == 'melvorF:RandomITM' then
if monsterID == 'melvorF:RandomITM' then
Line 1,064: Line 1,064:
function p._getAreaMonsterList(area)
function p._getAreaMonsterList(area)
local monsterList = {}
local monsterList = {}
for i, monsterID in pairs(area.monsterIDs) do
for i, monsterID in ipairs(area.monsterIDs) do
local monster = p.getMonsterByID(monsterID)
local monster = p.getMonsterByID(monsterID)
table.insert(monsterList, Icons.Icon({monster.name, type='monster'}))
table.insert(monsterList, Icons.Icon({monster.name, type='monster'}))