Module:Skills

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 } local result = mw.ext.cargo.query( tables, fields, cargoquery )

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') if args.SkillIcon ~= "hide" then tbl:tag("th"):wikitext("Icon"):done end if args.SkillName ~= "hide" then tbl:tag("th"):wikitext("Skill Name"):done end if args.SkillDescription ~= "hide" then tbl:tag("th"):wikitext("Skill Description"):done end if args.SkillType ~= "hide" then tbl:tag("th"):wikitext("Skill Type"):done end if args.ManaCost ~= "hide" then tbl:tag("th"):wikitext("Mana Cost"):done end if args.Cooldown ~= "hide" then tbl:tag("th"):wikitext("Cooldown"):done end if args.LevelUnlock ~= "hide" then tbl:tag("th"):wikitext("Level Unlocked"):done end if args.SkillClass == "show" then tbl:tag("th"):wikitext("Class"):done end if args.SkillDamageTypes == "show" then tbl:tag("th"):wikitext("Damage Type"):done end if args.OtherTags == "show" then tbl:tag("th"):wikitext("Skill Tags"):done end if args.BaseDamage == "show" then tbl:tag("th"):wikitext("Base Damage"):done end if args.AttackTime == "show" then tbl:tag("th"):wikitext("Attack Time"):done end tbl:done --Construct the rows in the table for _,row in ipairs(result) do		tr = tbl:tag("tr") if args.SkillIcon ~= "hide" then tr:tag("td"):wikitext(""):done end if args.SkillName ~= "hide" then tr:tag("td"):wikitext("" .. row.SkillName .. ""):done end if args.SkillDescription ~= "hide" then tr:tag("td"):wikitext(row.SkillDescription):done end if args.SkillType ~= "hide" then tr:tag("td"):wikitext(row.SkillType):done end if args.ManaCost ~= "hide" then tr:tag("td"):wikitext(row.ManaCost):done end if args.Cooldown ~= "hide" then tr:tag("td"):wikitext(row.Cooldown):done end if args.LevelUnlock ~= "hide" then tr:tag("td"):wikitext(row.LevelUnlock):done end if args.SkillClass == "show" then tr:tag("td"):wikitext(row.SkillClass):done end if args.SkillDamageTypes == "show" then tr:tag("td"):wikitext(row.SkillDamageTypes):done end if args.OtherTags == "show" then tr:tag("td"):wikitext(row.OtherTags):done end if args.BaseDamage == "show" then tr:tag("td"):wikitext(row.BaseDamage):done end if args.AttackTime == "show" then tr:tag("td"):wikitext(row.AttackTime):done end end return tbl end -- . . . end return p