Anonymous

Module:Monsters: Difference between revisions

From Melvor Idle
Added getDungeonRewards
(Making sure bosses get counted. Also still fuck spiders.)
(Added getDungeonRewards)
Line 632: Line 632:
   else
   else
     return p._getAreaMonsterList(area)
     return p._getAreaMonsterList(area)
  end
end
function p._getDungeonRewards(area)
  local bossMonster = p.getMonsterByID(area[Shared.tableCount(area.monsters)])
  local gpMin = bossMonster.dropCoins[1]
  local gpMax = bossMonster.dropCoins[2]
  local chestID = bossMonster.lootTable[1][1]
  local chestQty = bossMonster.lootTable[1][3]
  local theChest = Items.getItemByID(chestID)
  local result = '* '..Icons.GP(gpMin, gpMax)
  result = result..'\r\n* '..Icons.Icon({theChest.name, type='item', qty=chestQty})
  if area.name == 'Volcanic Cave' then
    result = result..'\r\n* '..Icons.Icon({'Fire Cape', type='item', qty=1})
  elseif area.name == 'Infernal Stronghold' then
    result = result..'\r\n* '..Icons.Icon({'Infernal Cape', type='item', qty=1})
  end
  return result
end
function p.getDungeonRewards(frame)
  local areaName = frame.args ~= nil and frame.args[1] or frame
  local area = Areas.getArea(areaName)
  if area == nil then
    return "ERROR: Could not find an area named "..areaName
  end
  if area.type == 'dungeon' then
    return p._getDungeonMonsterList(area)
  else
    return "ERROR: "..areaName.." is not a dungeon"
   end
   end
end
end


return p
return p