4,687
edits
(Added soul points to ItemBox) |
(Support Abyssal Damage and Abyssal Resistance in Auto Weapon/Armor Tables) |
||
Line 684: | Line 684: | ||
end | end | ||
return result | return result | ||
end | |||
function p._getItemResistance(item) | |||
if item.sellsForCurrency == 'melvorItA:AbyssalPieces' then | |||
return p._getItemStat(item, 'resistance', true), 'Abyssal Resistance' | |||
else | |||
return p._getItemStat(item, 'damageReduction', true), 'Damage Reduction' | |||
end | |||
end | end | ||
Line 692: | Line 700: | ||
return Shared.printError('No item named "' .. itemName .. '" exists in the data module') | return Shared.printError('No item named "' .. itemName .. '" exists in the data module') | ||
end | end | ||
local resistance, resistanceText = p._getItemResistance(item) | |||
local ico = { | local ico = { | ||
Line 700: | Line 710: | ||
["Ranged"] = Icons.Icon({'Ranged', type='skill', notext=true}), | ["Ranged"] = Icons.Icon({'Ranged', type='skill', notext=true}), | ||
["Strength"] = Icons.Icon({'Strength', type='skill', notext=true}), | ["Strength"] = Icons.Icon({'Strength', type='skill', notext=true}), | ||
["Slayer"] = Icons.Icon({'Slayer', type='skill', notext=true}) | ["Slayer"] = Icons.Icon({'Slayer', type='skill', notext=true}), | ||
["Resistance"] = Icons.Icon({resistanceText, notext=true}) | |||
} | } | ||
local reqCount = item.equipRequirements ~= nil and Shared.tableCount(item.equipRequirements) or 0 | local reqCount = item.equipRequirements ~= nil and Shared.tableCount(item.equipRequirements) or 0 | ||
local emptyRow = '\r\n!colspan="2"|' | local emptyRow = '\r\n!colspan="2"|' | ||
local damageType = p._getItemStat(item, 'damageType') == 'melvorItA:Abyssal' and 'Abyssal' or 'Normal' | |||
local resultPart = {} | local resultPart = {} | ||
Line 715: | Line 727: | ||
table.insert(resultPart, '\r\n!style="text-align:right;"| ' .. ico['Defence'] .. ' Defence Bonus') | table.insert(resultPart, '\r\n!style="text-align:right;"| ' .. ico['Defence'] .. ' Defence Bonus') | ||
table.insert(resultPart, '\r\n|style="text-align:right;"| ' .. p._getItemStat(item, 'meleeDefenceBonus', true)) | table.insert(resultPart, '\r\n|style="text-align:right;"| ' .. p._getItemStat(item, 'meleeDefenceBonus', true)) | ||
table.insert(resultPart, '\r\n|-\r\n!style="text-align:right;"| Damage Type') | |||
table.insert(resultPart, '\r\n|style="text-align:right;"| ' .. ico['Resistance'] .. damageType) | |||
table.insert(resultPart, '\r\n!style="text-align:right;"| ' .. ico['Resistance'] .. resistanceText) | |||
table.insert(resultPart, '\r\n|style="text-align:right;"| ' .. resistance .. '%') | |||
table.insert(resultPart, '\r\n|-\r\n!style="text-align:right;"| Attack Type') | table.insert(resultPart, '\r\n|-\r\n!style="text-align:right;"| Attack Type') | ||
table.insert(resultPart, '\r\n|style="text-align:right;"| ' .. p._getItemStat(item, 'attackType')) | table.insert(resultPart, '\r\n|style="text-align:right;"| ' .. p._getItemStat(item, 'attackType')) | ||
table.insert(resultPart, '\r\n!style="text-align:right;"| ' .. ico[' | table.insert(resultPart, '\r\n!style="text-align:right;"| ' .. ico['Ranged'] .. ' Defence Bonus') | ||
table.insert(resultPart, '\r\n|style="text-align:right;"| ' .. p._getItemStat(item, ' | table.insert(resultPart, '\r\n|style="text-align:right;"| ' .. p._getItemStat(item, 'rangedDefenceBonus', true)) | ||
table.insert(resultPart, '\r\n|-\r\n!style="text-align:right;"| ' .. ico['Strength'] .. ' Strength Bonus') | table.insert(resultPart, '\r\n|-\r\n!style="text-align:right;"| ' .. ico['Strength'] .. ' Strength Bonus') | ||
table.insert(resultPart, '\r\n|style="text-align:right;"| ' .. p._getItemStat(item, 'meleeStrengthBonus', true)) | table.insert(resultPart, '\r\n|style="text-align:right;"| ' .. p._getItemStat(item, 'meleeStrengthBonus', true)) | ||
table.insert(resultPart, '\r\n!style="text-align:right;"| ' .. ico[' | table.insert(resultPart, '\r\n!style="text-align:right;border-bottom:solid thin black;"| ' .. ico['Magic'] .. ' Defence Bonus') | ||
table.insert(resultPart, '\r\n|style="text-align:right;"| ' .. p._getItemStat(item, ' | table.insert(resultPart, '\r\n|style="text-align:right;border-bottom:solid thin black;"| ' .. p._getItemStat(item, 'magicDefenceBonus', true)) | ||
table.insert(resultPart, '\r\n|-\r\n!style="text-align:right;"| ' .. ico['Combat'] .. ' Stab Bonus') | table.insert(resultPart, '\r\n|-\r\n!style="text-align:right;"| ' .. ico['Combat'] .. ' Stab Bonus') | ||
table.insert(resultPart, '\r\n|style="text-align:right;"| ' .. p._getItemStat(item, 'stabAttackBonus', true)) | table.insert(resultPart, '\r\n|style="text-align:right;"| ' .. p._getItemStat(item, 'stabAttackBonus', true)) | ||
table.insert(resultPart, '\r\n! | table.insert(resultPart, '\r\n!colspan="2" style="border-bottom:solid thin black;"| Equip Requirements') | ||
table.insert(resultPart, '\r\n|-\r\n!style="text-align:right;"| ' .. ico['Combat'] .. ' Slash Bonus') | table.insert(resultPart, '\r\n|-\r\n!style="text-align:right;"| ' .. ico['Combat'] .. ' Slash Bonus') | ||
table.insert(resultPart, '\r\n|style="text-align:right;"| ' .. p._getItemStat(item, 'slashAttackBonus', true)) | table.insert(resultPart, '\r\n|style="text-align:right;"| ' .. p._getItemStat(item, 'slashAttackBonus', true)) | ||
table.insert(resultPart, '\r\n | if reqCount > 0 then | ||
table.insert(resultPart, p.getEquipRequirementRow(item.equipRequirements[1])) | |||
else | |||
table.insert(resultPart, '\r\n|colspan=2 style="text-align:right"|None') | |||
end | |||
table.insert(resultPart, '\r\n|-\r\n!style="text-align:right;"| ' .. ico['Combat'] .. ' Block Bonus') | table.insert(resultPart, '\r\n|-\r\n!style="text-align:right;"| ' .. ico['Combat'] .. ' Block Bonus') | ||
table.insert(resultPart, '\r\n|style="text-align:right;"| ' .. p._getItemStat(item, 'blockAttackBonus', true)) | table.insert(resultPart, '\r\n|style="text-align:right;"| ' .. p._getItemStat(item, 'blockAttackBonus', true)) | ||
if reqCount > | if reqCount > 1 then | ||
table.insert(resultPart, p.getEquipRequirementRow(item.equipRequirements[ | table.insert(resultPart, p.getEquipRequirementRow(item.equipRequirements[2])) | ||
else | else | ||
table.insert(resultPart, | table.insert(resultPart, emptyRow) | ||
end | end | ||
table.insert(resultPart, '\r\n|-\r\n!style="text-align:right;"| ' .. ico['Ranged'] .. ' Attack Bonus') | table.insert(resultPart, '\r\n|-\r\n!style="text-align:right;"| ' .. ico['Ranged'] .. ' Attack Bonus') | ||
table.insert(resultPart, '\r\n|style="text-align:right;"| ' .. p._getItemStat(item, 'rangedAttackBonus', true)) | table.insert(resultPart, '\r\n|style="text-align:right;"| ' .. p._getItemStat(item, 'rangedAttackBonus', true)) | ||
if reqCount > | if reqCount > 2 then | ||
table.insert(resultPart, p.getEquipRequirementRow(item.equipRequirements[ | table.insert(resultPart, p.getEquipRequirementRow(item.equipRequirements[3])) | ||
else | else | ||
table.insert(resultPart, emptyRow) | table.insert(resultPart, emptyRow) | ||
Line 753: | Line 773: | ||
table.insert(resultPart, '\r\n|-\r\n!style="text-align:right;"| ' .. ico['Ranged'] .. ' Strength Bonus') | table.insert(resultPart, '\r\n|-\r\n!style="text-align:right;"| ' .. ico['Ranged'] .. ' Strength Bonus') | ||
table.insert(resultPart, '\r\n|style="text-align:right;"| ' .. p._getItemStat(item, 'rangedStrengthBonus', true)) | table.insert(resultPart, '\r\n|style="text-align:right;"| ' .. p._getItemStat(item, 'rangedStrengthBonus', true)) | ||
if reqCount > | if reqCount > 3 then | ||
table.insert(resultPart, p.getEquipRequirementRow(item.equipRequirements[ | table.insert(resultPart, p.getEquipRequirementRow(item.equipRequirements[4])) | ||
else | else | ||
table.insert(resultPart, emptyRow) | table.insert(resultPart, emptyRow) | ||
Line 761: | Line 781: | ||
table.insert(resultPart, '\r\n|-\r\n!style="text-align:right;"| ' .. ico['Magic'] .. ' Attack Bonus') | table.insert(resultPart, '\r\n|-\r\n!style="text-align:right;"| ' .. ico['Magic'] .. ' Attack Bonus') | ||
table.insert(resultPart, '\r\n|style="text-align:right;"| ' .. p._getItemStat(item, 'magicAttackBonus', true)) | table.insert(resultPart, '\r\n|style="text-align:right;"| ' .. p._getItemStat(item, 'magicAttackBonus', true)) | ||
if reqCount > | if reqCount > 4 then | ||
table.insert(resultPart, p.getEquipRequirementRow(item.equipRequirements[ | table.insert(resultPart, p.getEquipRequirementRow(item.equipRequirements[5])) | ||
else | else | ||
table.insert(resultPart, emptyRow) | table.insert(resultPart, emptyRow) | ||
Line 769: | Line 789: | ||
table.insert(resultPart, '\r\n|-\r\n!style="text-align:right;"| ' .. ico['Magic'] .. ' % Damage Bonus') | table.insert(resultPart, '\r\n|-\r\n!style="text-align:right;"| ' .. ico['Magic'] .. ' % Damage Bonus') | ||
table.insert(resultPart, '\r\n|style="text-align:right;"| ' .. p._getItemStat(item, 'magicDamageBonus', true) .. '%') | table.insert(resultPart, '\r\n|style="text-align:right;"| ' .. p._getItemStat(item, 'magicDamageBonus', true) .. '%') | ||
if reqCount > | if reqCount > 5 then | ||
table.insert(resultPart, p.getEquipRequirementRow(item.equipRequirements[ | table.insert(resultPart, p.getEquipRequirementRow(item.equipRequirements[6])) | ||
else | else | ||
table.insert(resultPart, emptyRow) | table.insert(resultPart, emptyRow) | ||
Line 777: | Line 797: | ||
table.insert(resultPart, '\r\n|-\r\n!style="text-align:right;"| Two Handed?') | table.insert(resultPart, '\r\n|-\r\n!style="text-align:right;"| Two Handed?') | ||
table.insert(resultPart, '\r\n|style="text-align:right;"| ' .. (p._getItemStat(item, 'isTwoHanded') and 'Yes' or 'No')) | table.insert(resultPart, '\r\n|style="text-align:right;"| ' .. (p._getItemStat(item, 'isTwoHanded') and 'Yes' or 'No')) | ||
if reqCount > | if reqCount > 6 then | ||
table.insert(resultPart, p.getEquipRequirementRow(item.equipRequirements[6])) | table.insert(resultPart, p.getEquipRequirementRow(item.equipRequirements[6])) | ||
else | else | ||
table.insert(resultPart, emptyRow) | table.insert(resultPart, emptyRow) | ||
end | end | ||
--Add extra rows at the end for items that have more than 3 different requirements | --Add extra rows at the end for items that have more than 3 different requirements | ||
if reqCount > | if reqCount > 7 then | ||
for i = | for i = 8, reqCount, 1 do | ||
table.insert(resultPart,"\r\n|-") | table.insert(resultPart,"\r\n|-") | ||
table.insert(resultPart, emptyRow) | table.insert(resultPart, emptyRow) | ||
Line 802: | Line 822: | ||
return Shared.printError('No item named "' .. itemName .. '" exists in the data module') | return Shared.printError('No item named "' .. itemName .. '" exists in the data module') | ||
end | end | ||
local resistance, resistanceText = p._getItemResistance(item) | |||
local ico = { | local ico = { | ||
Line 810: | Line 832: | ||
["Ranged"] = Icons.Icon({'Ranged', type='skill', notext=true}), | ["Ranged"] = Icons.Icon({'Ranged', type='skill', notext=true}), | ||
["Strength"] = Icons.Icon({'Strength', type='skill', notext=true}), | ["Strength"] = Icons.Icon({'Strength', type='skill', notext=true}), | ||
["Slayer"] = Icons.Icon({'Slayer', type='skill', notext=true}) | ["Slayer"] = Icons.Icon({'Slayer', type='skill', notext=true}), | ||
["Resistance"] = Icons.Icon({resistanceText, notext=true}), | |||
} | } | ||
Line 828: | Line 851: | ||
table.insert(resultPart, '\r\n|-\r\n!style="text-align:right;"| ' .. ico['Combat'] .. ' Stab Bonus') | table.insert(resultPart, '\r\n|-\r\n!style="text-align:right;"| ' .. ico['Combat'] .. ' Stab Bonus') | ||
table.insert(resultPart, '\r\n|style="text-align:right;"| ' .. p._getItemStat(item, 'stabAttackBonus', 0)) | table.insert(resultPart, '\r\n|style="text-align:right;"| ' .. p._getItemStat(item, 'stabAttackBonus', 0)) | ||
table.insert(resultPart, '\r\n!style="text-align:right;"| ' .. ico[' | table.insert(resultPart, '\r\n!style="text-align:right;"| ' .. ico['Resistance'] .. resistanceText) | ||
table.insert(resultPart, '\r\n|style="text-align:right;"| ' .. | table.insert(resultPart, '\r\n|style="text-align:right;"| ' .. resistance .. '%') | ||
table.insert(resultPart, '\r\n|-\r\n!style="text-align:right;"| ' .. ico['Combat'] .. ' Slash Bonus') | table.insert(resultPart, '\r\n|-\r\n!style="text-align:right;"| ' .. ico['Combat'] .. ' Slash Bonus') |