4,683
edits
(getAncientRelicsTable: Change ordering logic for relics) |
(Added Lesser Relics Table) |
||
Line 550: | Line 550: | ||
return table.concat(resultPart) | return table.concat(resultPart) | ||
end | |||
function p.getLesserRelicsTable(frame) | |||
local lesserRelics = {} | |||
-- Iterate over each skill with a global rare drop then check | |||
-- if the skill has a Lesser Relic drop | |||
for skillLocalID, skill in pairs(SkillData) do | |||
if skill.rareDrops ~= nil then | |||
for i, drops in pairs(skill.rareDrops) do | |||
if string.match(drops.itemID, '_Lesser_Relic') then | |||
local item = Items.getItemByID(drops.itemID) | |||
table.insert(lesserRelics, item) | |||
end | |||
end | |||
end | |||
end | |||
table.sort(lesserRelics, function(a, b) return a.name < b.name end) | |||
-- Create the Table | |||
local resultTable = mw.html.create('table') | |||
resultTable:addClass('wikitable sortable') | |||
resultTable:tag('tr'):addClass('headerRow-0') | |||
:tag('th'):wikitext('Lesser Relic') | |||
:tag('th'):wikitext('Modifiers') | |||
for _, relic in ipairs(lesserRelics) do | |||
local tr = mw.html.create('tr') | |||
tr:tag('td'):wikitext(Icons.Icon({relic.name, type='item'})) | |||
tr:tag('td'):wikitext(Constants.getModifiersText(relic.modifiers)) | |||
resultTable:node(tr) | |||
end | |||
return resultTable | |||
end | end | ||
return p | return p |