Anonymous

Module:Sandbox/PhantomCaleb: Difference between revisions

From Zelda Wiki, the Zelda encyclopedia
no edit summary
No edit summary
No edit summary
Line 10: Line 10:
local game = args[1]
local game = args[1]


local data = utilsCargo.query("Armor2", "armor, armorSet, slot, level, materials, defense, sellPrice, description", {
local data = utilsCargo.query("Armor2", "armor, armorSet, slot, level, defense, sellPrice, description", {
where = string.format("game = '%s' AND armor IS NOT NULL AND (level IS NULL OR level = '★★★★')", game),
where = string.format("game = '%s' AND armor IS NOT NULL AND (level IS NULL OR level = '★★★★')", game),
limit = 1000,
limit = 1000,
Line 42: Line 42:
armor.sellPrice or "N/A",
armor.sellPrice or "N/A",
armor.effects or "N/A",
armor.effects or "N/A",
}
}
end)
local dataTable = DataTable.printTable(rows, {
game = game,
columns = columns,
})
return dataTable
end
function p.ArmorUpgradeTable(frame)
local args = frame.args
local game = args[1]
local data = utilsCargo.query("Armor2", "armor, armorSet, slot, level, materials, defense, sellPrice, description", {
where = string.format("game = '%s' AND armor IS NOT NULL AND level IS NOT NULL", game),
limit = 1000,
sortBy = "armor",
})
local columns = {
"Armor [Image:Icon:128x128px][Term][Rowspan]",
"Level",
"Materials [Amounts]",
"Defense [Defense:BotW:-]",
string.format("Sell Price [Rupees:%s:-]", game),
"Description [Transcript]",
}
local rows = utilsTable.map(data, function(armor)
return {
cells = {
armor.armor or "",
armor.level or "",
armor.materials or "",
armor.defense or "",
armor.sellPrice or "N/A",
armor.description or "",
}
}
}
}