Module:SkillArkList

local cargo = mw.ext.cargo local p = {}

local escp = function (str) return (mw.ustring.gsub(str == nil and '' or tostring(str), "'", "\\'")) end

function p.skillArks(frame) local skill = frame.args[1]

local arks = cargo.query(		'Arks,ArkSkills',		Arks._pageName=page,Arks.Name=name,Arks.Icon=icon,Arks.Rarity=rarity,ArkSkills.AP=ap,		ArkSkills.APTotal=apTotal,ArkSkills.LevelUnlocked=level,		{			join = 'ArkSkills._pageName=Arks._pageName',			where = ("ArkSkills.SkillName='%s'"):format(escp(skill)),		}	)

if #arks == 0 then return "This skill is currently not available in any Ark." end

-- Creates HTML Table local tbl = mw.html.create('table') :addClass('wikitable striped sortable') :css('text-align','center')

-- Table Headers tbl:tag('th'):wikitext('Ark') tbl:tag('th'):wikitext('Rarity') tbl:tag('th'):wikitext('Level Unlocked') tbl:tag('th'):wikitext('AP') tbl:tag('th'):wikitext('AP Total') for _, ark in ipairs(arks) do		local rarity = frame:expandTemplate{title='ArkRarityIcon', args = {ark.rarity, 'x24px'}} local icon = (''):format(ark.icon, ark.page)

tbl:tag('tr') :tag('td') -- Ark Icon + Name :tag('div') :wikitext(icon) :css('margin-top','10px') :done :tag('div') :wikitext( .. ark.name .. ) :tag('td') -- Rarity :wikitext(rarity) :tag('td') -- Level Unlocked :wikitext('Level ' .. ark.level) :tag('td') -- AP :wikitext('⨉ ' .. ark.ap) :tag('td') -- AP Total :wikitext(ark.apTotal) end

return tostring(tbl) end

return p