Anonymous

Module:Monsters: Difference between revisions

From Melvor Idle
Making sure bosses get counted. Also still fuck spiders.
(fuckin' spiders man)
(Making sure bosses get counted. Also still fuck spiders.)
Line 599: Line 599:
   for i, monsterID in pairs(area.monsters) do
   for i, monsterID in pairs(area.monsters) do
     local monster = p.getMonsterByID(monsterID)
     local monster = p.getMonsterByID(monsterID)
     if monster.id ~= lastID or i == Shared.tableCount(monsterList) then
     if monster.id ~= lastID then
       if lastMonster ~= nil then
       if lastMonster ~= nil then
         local name = lastMonster.name
         local name = lastMonster.name
         if lastMonster.id == 51 then name = 'Spider2' end
         if lastMonster.id == 51 then name = 'Spider2' end
         table.insert(monsterList, Icons.Icon({lastMonster.name, type='monster'})..' x'..count)
         table.insert(monsterList, Icons.Icon({name, type='monster'})..' x'..count)
       end
       end
       lastMonster = monster
       lastMonster = monster
       lastID = monster.id
       lastID = monster.id
       count = 1
       count = 1
      --Make sure the final monster in the dungeon gets counted
      if i == Shared.tableCount(monsterList) then
        local name = lastMonster.name
        if lastMonster.id == 51 then name = 'Spider2' end
        table.insert(monsterList, Icons.Icon({lastMonster.name, type='monster'})..' x'..count)
      end
     else
     else
       count = count + 1
       count = count + 1