2,869
edits
(Re-introduce supported column definitions) |
No edit summary |
||
Line 45: | Line 45: | ||
table.sort(recipeArray, function(a, b) return Skills.standardRecipeSort(skillID, a, b) end) | table.sort(recipeArray, function(a, b) return Skills.standardRecipeSort(skillID, a, b) end) | ||
local cookIcon = Icons._SkillRealmIcon('Cooking', realm.id) | |||
local | local perfectIcon = Icons.Icon({'Perfect', type='bonus', ext='png', notext=true, nolink=true}) | ||
local healIcon = Icons.Icon({"Hitpoints", type="skill", notext=true, nolink=true}) | |||
local html = mw.html.create('table') | |||
:addClass('sortable stickyHeader') | |||
html:tag('tr'):addClass("headerRow-0") | |||
:tag('th'):wikitext('Cooked Item') | |||
:attr('colspan', 3) | |||
:attr('rowspan', 2) | |||
:tag('th'):wikitext(cookIcon .. '<br>Level') | |||
:attr('rowspan', 2) | |||
:tag('th'):wikitext('[[DLC]]') | |||
:attr('rowspan', 2) | |||
:tag('th'):wikitext('Cook<br>Time (s)') | |||
:attr('rowspan', 2) | |||
:tag('th'):wikitext(cookIcon .. '<br>XP') | |||
:attr('rowspan', 2) | |||
:tag('th'):wikitext('XP/s') | |||
:attr('rowspan', 2) | |||
:tag('th'):wikitext('Total Healing') | |||
:attr('colspan', 2) | |||
:tag('th'):wikitext('Ingredients') | |||
:attr('rowspan', 2) | |||
html:tag('tr'):addClass("headerRow-1") | |||
:tag('th'):wikitext('Normal') | |||
:tag('th'):wikitext(perfectIcon) | |||
for i, recipe in ipairs(recipeArray) do | for i, recipe in ipairs(recipeArray) do | ||
Line 74: | Line 79: | ||
local baseXP = recipe.baseAbyssalExperience or recipe.baseExperience | local baseXP = recipe.baseAbyssalExperience or recipe.baseExperience | ||
local baseInt = recipe.baseInterval / 1000 | local baseInt = recipe.baseInterval / 1000 | ||
local xpRate = baseXP / baseInt | local xpRate = baseXP / baseInt | ||
local item = Items.getItemByID(recipe.productID) | local item = Items.getItemByID(recipe.productID) | ||
Line 82: | Line 86: | ||
end | end | ||
local qty = recipe.baseQuantity or 1 | local qty = recipe.baseQuantity or 1 | ||
local normalHeal = math.floor(item.healsFor * 10) * qty | |||
local perfectHeal = math.floor(perfectItem.healsFor * 10) * qty | |||
local row = html:tag('tr') | |||
row:tag('td'):wikitext(Icons.Icon({item.name, type='item', notext=true})) | |||
:addClass("table-img") | |||
if perfectItem ~= nil then | if perfectItem ~= nil then | ||
row:tag('td'):wikitext(Icons.Icon({perfectItem.name, type='item', notext=true})) | |||
:addClass("table-img") | |||
end | end | ||
local nameCell = row:tag('td') | |||
if qty > 1 then | if qty > 1 then | ||
nameCell:wikitext(qty .. 'x ') | |||
end | end | ||
nameCell:wikitext('[[' .. item.name .. ']]') | |||
row:tag('td'):wikitext(level) | |||
:css('text-align', 'center') | |||
row:tag('td'):wikitext(Icons.getDLCColumnIcon(item.id)) | |||
:css('text-align', 'center') | |||
:attr('data-sort-value', Icons.getExpansionID(item.id)) | |||
row:tag('td'):wikitext(Num.round(baseInt, 2, 0)) | |||
:css('text-align', 'right') | |||
:attr('data-sort-value', baseInt) | |||
row:tag('td'):wikitext(Num.formatnum(baseXP)) | |||
:css('text-align', 'right') | |||
:attr('data-sort-value', baseXP) | |||
row:tag('td'):wikitext(Num.formatnum(Num.round(xpRate, 2, 0))) | |||
:css('text-align', 'right') | |||
:attr('data-sort-value', xpRate) | |||
row:tag('td'):wikitext(healIcon) | |||
:wikitext(Num.formatnum(normalHeal)) | |||
:attr('data-sort-value', normalHeal) | |||
row:tag('td'):wikitext(perfectIcon) | |||
:wikitext(Num.formatnum(perfectHeal)) | |||
:attr('data-sort-value', perfectHeal) | |||
local matArray = {} | local matArray = {} | ||
for j, mat in ipairs(recipe.itemCosts) do | for j, mat in ipairs(recipe.itemCosts) do | ||
Line 108: | Line 131: | ||
end | end | ||
end | end | ||
row:tag('td'):wikitext(table.concat(matArray, ' ')) | |||
end | end | ||
return tostring(html) | |||
return | |||
end | end | ||
edits