17,105
edits
mNo edit summary |
mNo edit summary |
||
Line 74: | Line 74: | ||
end | end | ||
if attBonusCols > 0 then | if attBonusCols > 0 then | ||
table.insert(resultPart, '\r\n!colspan="'..attBonusCols..' | table.insert(resultPart, '\r\n!colspan="'..attBonusCols..'"|Attack Bonus') | ||
end | end | ||
if strBonusCols > 0 then | if strBonusCols > 0 then | ||
table.insert(resultPart, '\r\n!colspan="'..strBonusCols..' | table.insert(resultPart, '\r\n!colspan="'..strBonusCols..'"|Str. Bonus') | ||
end | end | ||
if Shared.contains(statColumns, 'magicDamageBonus') then | if Shared.contains(statColumns, 'magicDamageBonus') then | ||
table.insert(resultPart, '\r\n!colspan="1 | table.insert(resultPart, '\r\n!colspan="1"|% Dmg Bonus') | ||
end | end | ||
if defBonusCols > 0 then | if defBonusCols > 0 then | ||
table.insert(resultPart, '\r\n!colspan="'..defBonusCols..' | table.insert(resultPart, '\r\n!colspan="'..defBonusCols..'"|Defence Bonus') | ||
end | end | ||
if Shared.contains(statColumns, 'damageReduction') then | if Shared.contains(statColumns, 'damageReduction') then | ||
table.insert(resultPart, '\r\n!colspan="1 | table.insert(resultPart, '\r\n!colspan="1"|DR') | ||
end | end | ||
if lvlReqCols > 0 then | if lvlReqCols > 0 then | ||
table.insert(resultPart, '\r\n!colspan="'..lvlReqCols..' | table.insert(resultPart, '\r\n!colspan="'..lvlReqCols..'|Lvl Req') | ||
end | end | ||
if includeModifiers and includeDescription then | if includeModifiers and includeDescription then | ||
Line 100: | Line 100: | ||
--One header row down, one to go | --One header row down, one to go | ||
table.insert(resultPart, '\r\n|-class="headerRow-1"') | table.insert(resultPart, '\r\n|-class="headerRow-1"') | ||
table.insert(resultPart, '\r\n! | table.insert(resultPart, '\r\n!Item') | ||
table.insert(resultPart, '\r\n! | table.insert(resultPart, '\r\n!Name') | ||
--Weapons have Attack Speed here | --Weapons have Attack Speed here | ||
if isWeaponType then | if isWeaponType then | ||
table.insert(resultPart, '\r\n! | table.insert(resultPart, '\r\n!Attack Speed') | ||
table.insert(resultPart, '\r\n! | table.insert(resultPart, '\r\n!Two Handed?') | ||
end | end | ||
--Attack bonuses | --Attack bonuses | ||
if Shared.contains(statColumns, 'slashAttackBonus') then | if Shared.contains(statColumns, 'slashAttackBonus') then | ||
table.insert(resultPart, '\r\n! | table.insert(resultPart, '\r\n!'..Icons.Icon({'Attack', type='skill', notext='true'})) | ||
end | end | ||
if Shared.contains(statColumns, 'stabAttackBonus') then | if Shared.contains(statColumns, 'stabAttackBonus') then | ||
table.insert(resultPart, '\r\n! | table.insert(resultPart, '\r\n!'..Icons.Icon({'Strength', type='skill', notext='true'})) | ||
end | end | ||
if Shared.contains(statColumns, 'blockAttackBonus') then | if Shared.contains(statColumns, 'blockAttackBonus') then | ||
table.insert(resultPart, '\r\n! | table.insert(resultPart, '\r\n!'..Icons.Icon({'Defence', type='skill', notext='true'})) | ||
end | end | ||
if Shared.contains(statColumns, 'rangedAttackBonus') then | if Shared.contains(statColumns, 'rangedAttackBonus') then | ||
table.insert(resultPart, '\r\n! | table.insert(resultPart, '\r\n!'..Icons.Icon({'Ranged', type='skill', notext='true'})) | ||
end | end | ||
if Shared.contains(statColumns, 'magicAttackBonus') then | if Shared.contains(statColumns, 'magicAttackBonus') then | ||
table.insert(resultPart, '\r\n! | table.insert(resultPart, '\r\n!'..Icons.Icon({'Magic', type='skill', notext='true'})) | ||
end | end | ||
--Strength bonuses | --Strength bonuses | ||
if Shared.contains(statColumns, 'strengthBonus') then | if Shared.contains(statColumns, 'strengthBonus') then | ||
table.insert(resultPart, '\r\n! | table.insert(resultPart, '\r\n!'..Icons.Icon({'Strength', type='skill', notext='true'})) | ||
end | end | ||
if Shared.contains(statColumns, 'rangedStrengthBonus') then | if Shared.contains(statColumns, 'rangedStrengthBonus') then | ||
table.insert(resultPart, '\r\n! | table.insert(resultPart, '\r\n!'..Icons.Icon({'Ranged', type='skill', notext='true'})) | ||
end | end | ||
if Shared.contains(statColumns, 'magicDamageBonus') then | if Shared.contains(statColumns, 'magicDamageBonus') then | ||
table.insert(resultPart, '\r\n! | table.insert(resultPart, '\r\n!'..Icons.Icon({'Magic', type='skill', notext='true'})) | ||
end | end | ||
--Defence bonuses | --Defence bonuses | ||
if Shared.contains(statColumns, 'defenceBonus') then | if Shared.contains(statColumns, 'defenceBonus') then | ||
table.insert(resultPart, '\r\n! | table.insert(resultPart, '\r\n!'..Icons.Icon({'Defence', type='skill', notext='true'})) | ||
end | end | ||
if Shared.contains(statColumns, 'rangedDefenceBonus') then | if Shared.contains(statColumns, 'rangedDefenceBonus') then | ||
table.insert(resultPart, '\r\n! | table.insert(resultPart, '\r\n!'..Icons.Icon({'Ranged', type='skill', notext='true'})) | ||
end | end | ||
if Shared.contains(statColumns, 'magicDefenceBonus') then | if Shared.contains(statColumns, 'magicDefenceBonus') then | ||
table.insert(resultPart, '\r\n! | table.insert(resultPart, '\r\n!'..Icons.Icon({'Magic', type='skill', notext='true'})) | ||
end | end | ||
if Shared.contains(statColumns, 'damageReduction') then | if Shared.contains(statColumns, 'damageReduction') then | ||
table.insert(resultPart, '\r\n! | table.insert(resultPart, '\r\n!'..Icons.Icon({'Defence', type='skill', notext='true'})) | ||
end | end | ||
--Level requirements | --Level requirements | ||
if Shared.contains(statColumns, 'attackLevelRequired') then | if Shared.contains(statColumns, 'attackLevelRequired') then | ||
table.insert(resultPart, '\r\n! | table.insert(resultPart, '\r\n!'..Icons.Icon({'Attack', type='skill', notext='true'})) | ||
end | end | ||
if Shared.contains(statColumns, 'defenceLevelRequired') then | if Shared.contains(statColumns, 'defenceLevelRequired') then | ||
table.insert(resultPart, '\r\n! | table.insert(resultPart, '\r\n!'..Icons.Icon({'Defence', type='skill', notext='true'})) | ||
end | end | ||
if Shared.contains(statColumns, 'rangedLevelRequired') then | if Shared.contains(statColumns, 'rangedLevelRequired') then | ||
table.insert(resultPart, '\r\n! | table.insert(resultPart, '\r\n!'..Icons.Icon({'Ranged', type='skill', notext='true'})) | ||
end | end | ||
if Shared.contains(statColumns, 'magicLevelRequired') then | if Shared.contains(statColumns, 'magicLevelRequired') then | ||
table.insert(resultPart, '\r\n! | table.insert(resultPart, '\r\n!'..Icons.Icon({'Magic', type='skill', notext='true'})) | ||
end | end | ||
--If includeModifiers is set to 'true', add the Modifiers column | --If includeModifiers is set to 'true', add the Modifiers column | ||
if includeModifiers then | if includeModifiers then | ||
table.insert(resultPart, '\r\n! | table.insert(resultPart, '\r\n!Modifiers') | ||
end | end | ||
--If includeDescription is set to 'true', add the Description column | --If includeDescription is set to 'true', add the Description column | ||
if includeDescription then | if includeDescription then | ||
table.insert(resultPart, '\r\n! | table.insert(resultPart, '\r\n!Description') | ||
end | end | ||
--And finally Sources | --And finally Sources | ||
table.insert(resultPart, '\r\n! | table.insert(resultPart, '\r\n!Sources') | ||
table.sort(itemList, function(a, b) return a.id < b.id end) | table.sort(itemList, function(a, b) return a.id < b.id end) | ||
Line 176: | Line 176: | ||
--Building rows for weapons | --Building rows for weapons | ||
table.insert(resultPart, '\r\n|-') | table.insert(resultPart, '\r\n|-') | ||
table.insert(resultPart, '\r\n|style ="text-align: left | table.insert(resultPart, '\r\n|style ="text-align: left;"|'..Icons.Icon({item.name, type='item', size=50, notext=true})) | ||
table.insert(resultPart, '\r\n|style ="text-align: left | table.insert(resultPart, '\r\n|style ="text-align: left;"|[['..item.name..']]') | ||
table.insert(resultPart, '\r\n| style ="text-align: right | table.insert(resultPart, '\r\n| style ="text-align: right;" |'..Shared.formatnum(Items._getItemStat(item, 'attackSpeed', true))) | ||
--That's the first list out of the way, now for 2-Handed | --That's the first list out of the way, now for 2-Handed | ||
table.insert(resultPart, '\r\n| style ="text-align: right;"|') | table.insert(resultPart, '\r\n| style ="text-align: right;"|') | ||
Line 184: | Line 184: | ||
for j, statName in pairs(statColumns) do | for j, statName in pairs(statColumns) do | ||
local statValue = Items._getItemStat(item, statName, true) | local statValue = Items._getItemStat(item, statName, true) | ||
table.insert(resultPart, '\r\n| style ="text-align: right | table.insert(resultPart, '\r\n| style ="text-align: right;') | ||
if string.find(statName, '^(.+)LevelRequired$') == nil then | if string.find(statName, '^(.+)LevelRequired$') == nil then | ||
if statValue > 0 then | if statValue > 0 then | ||
Line 197: | Line 197: | ||
--If requested, add the item Modifiers | --If requested, add the item Modifiers | ||
if includeModifiers then | if includeModifiers then | ||
table.insert(resultPart, '\r\n|style="text-align:left;white-space:nowrap | table.insert(resultPart, '\r\n|style="text-align:left;white-space:nowrap;"|') | ||
table.insert(resultPart, Constants.getModifiersText(item.modifiers, true)) | table.insert(resultPart, Constants.getModifiersText(item.modifiers, true)) | ||
end | end | ||
--If requested, add description | --If requested, add description | ||
if includeDescription then | if includeDescription then | ||
table.insert(resultPart, '\r\n|style="text-align:left | table.insert(resultPart, '\r\n|style="text-align:left;"|') | ||
table.insert(resultPart, item.description ~= nil and item.description or '') | table.insert(resultPart, item.description ~= nil and item.description or '') | ||
end | end | ||
--Finally, the Sources | --Finally, the Sources | ||
table.insert(resultPart, '\r\n| style ="text-align: right | table.insert(resultPart, '\r\n| style ="text-align: right;" |') | ||
table.insert(resultPart, ItemSourceTables._getItemSources(item)) | table.insert(resultPart, ItemSourceTables._getItemSources(item)) | ||
else | else | ||
--Building rows for armour | --Building rows for armour | ||
table.insert(resultPart, '\r\n|-') | table.insert(resultPart, '\r\n|-') | ||
table.insert(resultPart, '\r\n|style ="text-align: left | table.insert(resultPart, '\r\n|style ="text-align: left;"|'..Icons.Icon({item.name, type='item', size=50, notext=true})) | ||
table.insert(resultPart, '\r\n|style ="text-align: left | table.insert(resultPart, '\r\n|style ="text-align: left;"|[['..item.name..']]') | ||
for j, statName in pairs(statColumns) do | for j, statName in pairs(statColumns) do | ||
local statValue = Items._getItemStat(item, statName, true) | local statValue = Items._getItemStat(item, statName, true) | ||
table.insert(resultPart, '\r\n| style ="text-align: right | table.insert(resultPart, '\r\n| style ="text-align: right;') | ||
if statValue > 0 then | if statValue > 0 then | ||
table.insert(resultPart, 'background-color:lightgreen;') | table.insert(resultPart, 'background-color:lightgreen;') | ||
Line 226: | Line 226: | ||
--If requested, add the item Modifiers | --If requested, add the item Modifiers | ||
if includeModifiers then | if includeModifiers then | ||
table.insert(resultPart, '\r\n|style="text-align:left;white-space:nowrap | table.insert(resultPart, '\r\n|style="text-align:left;white-space:nowrap;"|') | ||
table.insert(resultPart, Constants.getModifiersText(item.modifiers, true)) | table.insert(resultPart, Constants.getModifiersText(item.modifiers, true)) | ||
end | end | ||
--If requested, add description | --If requested, add description | ||
if includeDescription then | if includeDescription then | ||
table.insert(resultPart, '\r\n|style="text-align:left | table.insert(resultPart, '\r\n|style="text-align:left;"|') | ||
table.insert(resultPart, item.description ~= nil and item.description or '') | table.insert(resultPart, item.description ~= nil and item.description or '') | ||
end | end | ||
--Finally, the Sources | --Finally, the Sources | ||
table.insert(resultPart, '\r\n| style ="text-align: right | table.insert(resultPart, '\r\n| style ="text-align: right;" |') | ||
table.insert(resultPart, ItemSourceTables._getItemSources(item)) | table.insert(resultPart, ItemSourceTables._getItemSources(item)) | ||
end | end |