2,875
edits
No edit summary |
No edit summary |
||
Line 72: | Line 72: | ||
local args = frame.args ~= nil and frame.args or frame | local args = frame.args ~= nil and frame.args or frame | ||
local realmName = args.realm | local realmName = args.realm | ||
local category = args.category | |||
local realm = Skills.getRealmFromName(realmName) | local realm = Skills.getRealmFromName(realmName) | ||
if realm == nil then | if realm == nil then | ||
Line 77: | Line 78: | ||
end | end | ||
local skillID = 'Summoning' | local skillID = 'Summoning' | ||
local | local html = mw.html.create('table') | ||
:addClass('wikitable sortable stickyHeader') | |||
local header = html:tag('tr'):addClass('headerRow-0') | |||
header:tag('th'):wikitext('Name') | |||
:attr('colspan', 2) | |||
header:tag('th'):wikitext('DLC') | |||
header:tag('th'):wikitext(Icons.SkillRealmIcon(skillID, realm.id) .. '<br>Level') | |||
header:tag('th'):wikitext('Tier') | |||
header:tag('th'):wikitext('Creation<br>XP') | |||
header:tag('th'):wikitext('Shards') | |||
header:tag('th'):wikitext('Cost of shards') | |||
if category == 'Combat' then | |||
header:tag('th'):wikitext(Icons.Icon({'Melee', notext=true, nolink=true}) .. ' Max Hit') | |||
end | |||
function isCombatFamiliar(fam) | |||
local item = Items.getItemByID(fam.productID) | |||
local maxHit = Items._getItemStat(item, 'summoningMaxhit') | |||
return maxHit ~= nil | |||
end | |||
local Familiars = GameData.getEntities(SkillData.Summoning.recipes, | local Familiars = GameData.getEntities(SkillData.Summoning.recipes, | ||
function(recipe) | function(recipe) | ||
return Skills.getRecipeRealm(recipe) == realm.id and | |||
((category == 'Combat' and isCombatFamiliar(recipe)) or | |||
(category ~= 'Combat' and not isCombatFamiliar(recipe))) | |||
end | end | ||
) | ) | ||
Line 98: | Line 118: | ||
local item = Items.getItemByID(Fam.productID) | local item = Items.getItemByID(Fam.productID) | ||
if item ~= nil then | if item ~= nil then | ||
local | local effectDesc = Modifiers.getModifiersText(item.modifiers, false, false, 10) | ||
local row = html:tag('tr') | |||
row:tag('td'):wikitext(Icons.Icon({item.name, type='item', notext=true})) | |||
:attr('data-sort-value', item.name) | |||
row:tag('td'):wikitext('[[' .. item.name .. ']]') | |||
row:tag('td'):wikitext(Icons.getDLCColumnIcon(Fam.id)) | |||
:css('text-align', 'center') | |||
:attr('data-sort-value', Icons.getExpansionID(Fam.id)) | |||
row:tag('td'):wikitext(level) | |||
:css('text-align', 'center') | |||
row:tag('td'):wikitext(Fam.tier) | |||
:css('text-align', 'center') | |||
row:tag('td'):wikitext(Num.formatnum(baseXP)) | |||
:css('text-align', 'right') | |||
:attr('data-sort-value', baseXP) | |||
local shardCell = row:tag('td') | |||
row:tag('td'):wikitext('0 GP') | |||
if category == 'Combat' then | |||
local maxHit = Items._getItemStat(item, 'summoningMaxhit') * 10 | |||
row:tag('td'):wikitext(Num.formatnum(maxHit)) | |||
:css('text-align', 'right') | |||
:attr('data-sort-value', maxHit) | |||
end | end | ||
-- Shards required | |||
-- Shards | |||
for j, cost in ipairs(Fam.itemCosts) do | for j, cost in ipairs(Fam.itemCosts) do | ||
local shard = Items.getItemByID(cost.id) | local shard = Items.getItemByID(cost.id) | ||
if shard ~= nil then | if shard ~= nil then | ||
local sub = mw.html.create('sub') | |||
:wikitext(cost.quantity):addClass('item-qty'):done() | |||
shardCell:node(sub) | |||
shardCell:wikitext(Icons.Icon({shard.name, type='item', notext=true})) | |||
end | end | ||
end | end | ||
end | end | ||
end | end | ||
return tostring(html) | |||
end | end | ||
edits