Module:Monsters: Difference between revisions

Fixed Into the Mist special handling
(Changed handling on Into the Mist (hopefully this works))
(Fixed Into the Mist special handling)
Line 756: Line 756:
   for i, monsterID in pairs(area.monsters) do
   for i, monsterID in pairs(area.monsters) do
     if not Shared.contains(usedMonsters, monsterID) then
     if not Shared.contains(usedMonsters, monsterID) then
      local monster = p.getMonsterByID(monsterID)
      local name = monster.name
      if monsterID == 51 then name = 'Spider2' end
       if monsterID >= 0 then
       if monsterID >= 0 then
        local monster = p.getMonsterByID(monsterID)
        local name = monster.name
        if monsterID == 51 then name = 'Spider2' end
         tableTxt = tableTxt..'\r\n|-\r\n|'..Icons.Icon({name, type='monster'})
         tableTxt = tableTxt..'\r\n|-\r\n|'..Icons.Icon({name, type='monster'})
         tableTxt = tableTxt..'||'..p._getMonsterCombatLevel(monster)
         tableTxt = tableTxt..'||'..p._getMonsterCombatLevel(monster)
Line 794: Line 794:
   local monsterList = {}
   local monsterList = {}
   local lastMonster = nil
   local lastMonster = nil
   local lastID = -1
   local lastID = -2
   local count = 0
   local count = 0
   for i, monsterID in Shared.skpairs(area.monsters) do
   for i, monsterID in Shared.skpairs(area.monsters) do
     if monsterID ~= lastID then
     if monsterID ~= lastID then
       local monster = p.getMonsterByID(monsterID)
       local monster = nil
       if lastMonster ~= nil then
      if monsterID ~= -1 then monster = p.getMonsterByID(monsterID) end
       if lastID ~= -2 then
         if lastID == -1 then
         if lastID == -1 then
           --Special handling for Afflicted Monsters
           --Special handling for Afflicted Monsters
Line 810: Line 811:
       end
       end
       lastMonster = monster
       lastMonster = monster
       lastID = monster.id
       lastID = monsterID
       count = 1
       count = 1
     else
     else