Module:Skills/Builds

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

function p.List( frame ) local args = frame.args local fieldstable = { "SkillIcon", "SkillName", "SkillDescription", "SkillType", "ManaCost", "Cooldown", "LevelUnlock", "SkillClass", "SkillDamageTypes", "OtherTags", "BaseDamage", "AttackTime", "Statuses", "Attribute", "AttributeEffect", "Attribute2", "Attribute2Effect", "Statuses", "_pageName", }   local tables = 'Skills' local fields = table.concat(fieldstable,",") -- optional parameters are grouped in one table -- you can omit any or all of them, except joinOn if you use more than one table local cargoquery = { where = args.where, orderBy= args.orderby } local result = mw.ext.cargo.query( tables, fields, cargoquery ) local preskillstable = mw.text.split( args.skillslist, ";" ) local skillstable = { } for i,v in ipairs(preskillstable) do     table.insert( skillstable, mw.text.split( v, "$@")) end

if result[1] == nil then return args.default

elseif result[1] ~= nil then --Start the table local tbl = mw.html.create('table') tbl:addClass('wikitable sortable mw-datatable') tbl:tag("th"):wikitext("Skill"):done tbl:tag("th"):wikitext("Skill Details and Nodes"):done tbl:done --Construct the rows in the table for i,v in ipairs(skillstable) do	 for _,row in ipairs(result) do            if (row._pageName == v[1]) then tr = tbl:tag("tr") tr:tag("td"):attr("rowspan", "2"):css("text-align", "center"):wikitext("" .. row.SkillName .. " "):done tr:tag("td"):wikitext(' ' .. row.SkillClass .. " " .. row.SkillType .. " Skills - Costs " .. row.ManaCost .. " Mana" .. (row.Cooldown ~= '' and ' and ' .. row.Cooldown .. 's CD' or '') .. " " .. row.SkillDescription):done end if (row._pageName == v[1]) then tr = tbl:tag("tr") tr:tag("td"):wikitext(v[2]):done end end end return tbl end -- . . . end return p