Anonymous

Module:Skills/Summoning: Difference between revisions

From Melvor Idle
no edit summary
No edit summary
No edit summary
Line 21: Line 21:
local skillID = 'Summoning'
local skillID = 'Summoning'


local result = ''
local html = mw.html.create('table')
result = result..'{| class="wikitable sortable stickyHeader"'
:addClass('wikitable sortable stickyHeader')
result = result..'\r\n|- class="headerRow-0"'
result = result..'\r\n!colspan="2"|Mark!!Requirements'
html:tag('tr'):addClass('headerRow-0')
result = result..'!!Tier!!Discovered in'
:tag('th'):wikitext('Mark')
  :attr('colspan', 2)
:tag('th'):wikitext('Tier')
:tag('th'):wikitext(Icons._SkillRealmIcon(skillID, realm.id) .. '<br>Level')
:tag('th'):wikitext('DLC')
:tag('th'):wikitext('Discovered in')


local Familiars = GameData.getEntities(SkillData.Summoning.recipes,
local Familiars = GameData.getEntities(SkillData.Summoning.recipes,
Line 40: Line 45:
local item = Items.getItemByID(Fam.productID)
local item = Items.getItemByID(Fam.productID)
if item ~= nil then
if item ~= nil then
local rowText = '|-'
local row = html:tag('tr')
rowText = rowText..'\r\n|data-sort-value="'..item.name..'"|'..Icons.Icon({item.name, type='mark', notext=true})
row:tag('td'):wikitext(Icons.Icon({item.name, type='mark', notext=true}))
rowText = rowText..'||' .. Icons.getExpansionIcon(Fam.id) .. Icons.Icon({item.name, 'Mark of the ' .. item.name, type='mark', noicon=true})
:attr('data-sort-value', item.name)
rowText = rowText..'||style="text-align:right" data-sort-value="' .. level .. '"|' .. reqText
row:tag('td'):wikitext(Icons.Icon({item.name, 'Mark of the ' .. item.name, type='mark', noicon=true}))
rowText = rowText..'||style="text-align:right"|'..Fam.tier
row:tag('td'):wikitext(Fam.tier)
:css('text-align', 'center')
row:tag('td'):wikitext(level)
:css('text-align', 'center')
row:tag('td'):wikitext(Icons.getDLCColumnIcon(Fam.id))
:css('text-align', 'center')
:attr('data-sort-value', Icons.getExpansionID(Fam.id))
 
local discoveredArray = {}
local discoveredArray = {}
for j, SkillID in ipairs(Fam.skillIDs) do
for j, SkillID in ipairs(Fam.skillIDs) do
table.insert(discoveredArray, Icons.Icon({Constants.getSkillName(SkillID), type='skill'}))
table.insert(discoveredArray, Icons.Icon({Constants.getSkillName(SkillID), type='skill'}))
end
end
rowText = rowText..'||'..table.concat(discoveredArray, '<br/>')
table.insert(rowArray, rowText)
row:tag('td'):wikitext(table.concat(discoveredArray, '<br/>'))
end
end
end
end
 
result = result..'\r\n'..table.concat(rowArray, '\r\n')
return tostring(html)
result = result..'\r\n|}'
return result
end
end


2,875

edits