Anonymous

Module:CombatAreas/AreaTables: Difference between revisions

From Melvor Idle
getDungeonTable: Add Requirements column; getSlayerAreaTable: Additional formatting for Requirements & area effects columns
(getCombatAreaTable: Add Requirements column)
(getDungeonTable: Add Requirements column; getSlayerAreaTable: Additional formatting for Requirements & area effects columns)
Line 63: Line 63:
local lowLvl, highLvl = p.getLowHighLevels(area.monsterIDs)
local lowLvl, highLvl = p.getLowHighLevels(area.monsterIDs)
result = result..'||data-sort-value="' .. highLvl .. '"| ' .. Shared.formatnum(highLvl)
result = result..'||data-sort-value="' .. highLvl .. '"| ' .. Shared.formatnum(highLvl)
result = result..'||'..Areas._getAreaRequirements(area)
local reqText = Areas._getAreaRequirements(area)
result = result..'|| '..Areas._getAreaStat(area, 'areaEffectDesc')
if reqText == nil or reqText == '' then
result = result .. '||class="table-na"| None'
else
result = result .. '||' .. reqText
end
local effectText = Areas._getAreaStat(area, 'areaEffectDesc')
local classText = ((effectText == nil or effectText == 'None') and 'class="table-na"|') or ''
result = result..'||' .. classText .. ' ' .. effectText
end
end


Line 142: Line 149:
local result = '{| class="wikitable sortable stickyHeader"'
local result = '{| class="wikitable sortable stickyHeader"'
result = result..'\r\n|-class="headerRow-0"'
result = result..'\r\n|-class="headerRow-0"'
result = result..'\r\n!colspan="2"|Dungeon!!Difficulty!!Monsters!!Boss Level!!Reward(s)!!Boss Pet'
result = result..'\r\n!colspan="2"|Dungeon!!Difficulty!!Monsters!!Boss Level!!Requirements!!Rewards!!Boss Pet'


local areas = GameData.sortByOrderTable(GameData.rawData.dungeons, GameData.rawData.dungeonDisplayOrder)
local areas = GameData.sortByOrderTable(GameData.rawData.dungeons, GameData.rawData.dungeonDisplayOrder)
Line 155: Line 162:
result = result..'||'..monsterCount
result = result..'||'..monsterCount
result = result..'||'..Shared.formatnum(Monsters._getMonsterCombatLevel(boss))
result = result..'||'..Shared.formatnum(Monsters._getMonsterCombatLevel(boss))
local reqText = Areas._getAreaRequirements(dung)
if reqText == nil or reqText == '' then
result = result .. '||class="table-na"| None'
else
result = result .. '||' .. reqText
end
result = result..'||'..p._getDungeonRewards(dung, false)
result = result..'||'..p._getDungeonRewards(dung, false)
local petAdded = false
if dung.pet ~= nil then
if dung.pet ~= nil then
local pet = GameData.getEntityByID('pets', dung.pet.petID)
local pet = GameData.getEntityByID('pets', dung.pet.petID)
Line 164: Line 178:
result = result..'<br/>'..petDrop
result = result..'<br/>'..petDrop
end
end
petAdded = true
end
end
else
end
result = result..'|| '
if not petAdded then
result = result..'||class="table-na"| None'
end
end
end
end