4,951
edits
mNo edit summary |
Falterfire (talk | contribs) (Removed do-nothing function) |
||
(13 intermediate revisions by 2 users not shown) | |||
Line 7: | Line 7: | ||
local Icons = require('Module:Icons') | local Icons = require('Module:Icons') | ||
local Items = require('Module:AuronTest') | local Items = require('Module:AuronTest') | ||
local weaponTypes = {'Magic Staff', 'Magic Wand', 'Ranged Weapon', 'Weapon'} | local weaponTypes = {'Magic Staff', 'Magic Wand', 'Ranged Weapon', 'Weapon'} | ||
Line 37: | Line 35: | ||
local ndx = 1 | local ndx = 1 | ||
while Shared.tableCount(ignoreColumns) >= ndx do | while Shared.tableCount(ignoreColumns) >= ndx do | ||
if | if Items._getItemStat(item, ignoreColumns[ndx], true) ~= 0 then | ||
table.remove(ignoreColumns, ndx) | table.remove(ignoreColumns, ndx) | ||
else | else | ||
Line 92: | Line 90: | ||
end | end | ||
if includeModifiers and includeDescription then | if includeModifiers and includeDescription then | ||
table.insert(resultPart, '\r\n!colspan=" | table.insert(resultPart, '\r\n!colspan="2"|') | ||
elseif includeModifiers or includeDescription then | elseif includeModifiers or includeDescription then | ||
table.insert(resultPart, '\r\n!colspan="1"|') | table.insert(resultPart, '\r\n!colspan="1"|') | ||
end | end | ||
Line 167: | Line 163: | ||
table.insert(resultPart, '\r\n!style="padding:0 1em 0 0.5em;"|Description') | table.insert(resultPart, '\r\n!style="padding:0 1em 0 0.5em;"|Description') | ||
end | end | ||
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 178: | Line 171: | ||
table.insert(resultPart, '\r\n|style ="text-align: left;padding: 0 0 0 0;"|'..Icons.Icon({item.name, type='item', size=50, notext=true})) | table.insert(resultPart, '\r\n|style ="text-align: left;padding: 0 0 0 0;"|'..Icons.Icon({item.name, type='item', size=50, notext=true})) | ||
table.insert(resultPart, '\r\n|style ="text-align: left;padding: 0 0.5em 0 0.5em;"|[['..item.name..']]') | table.insert(resultPart, '\r\n|style ="text-align: left;padding: 0 0.5em 0 0.5em;"|[['..item.name..']]') | ||
table.insert(resultPart, '\r\n| style ="text-align: right;padding: 0 0.5em 0 0;" |'..Shared.formatnum( | table.insert(resultPart, '\r\n| style ="text-align: right;padding: 0 0.5em 0 0;" |'..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;"|') | ||
table.insert(resultPart, | table.insert(resultPart, Items._getItemStat(item, 'isTwoHanded') and 'Yes' or 'No') | ||
for j, statName in pairs(statColumns) do | for j, statName in pairs(statColumns) do | ||
local statValue = | local statValue = Items._getItemStat(item, statName, true) | ||
table.insert(resultPart, '\r\n| style ="text-align: right;padding: 0 0.5em 0 0;') | table.insert(resultPart, '\r\n| style ="text-align: right;padding: 0 0.5em 0 0;') | ||
if string.find(statName, '^(.+)LevelRequired$') == nil then | if string.find(statName, '^(.+)LevelRequired$') == nil then | ||
Line 205: | Line 198: | ||
table.insert(resultPart, item.description ~= nil and item.description or '') | table.insert(resultPart, item.description ~= nil and item.description or '') | ||
end | end | ||
else | else | ||
--Building rows for armour | --Building rows for armour | ||
Line 214: | Line 204: | ||
table.insert(resultPart, '\r\n|style ="text-align: left;padding: 0 0.5em 0 0.5em;"|[['..item.name..']]') | table.insert(resultPart, '\r\n|style ="text-align: left;padding: 0 0.5em 0 0.5em;"|[['..item.name..']]') | ||
for j, statName in pairs(statColumns) do | for j, statName in pairs(statColumns) do | ||
local statValue = | local statValue = Items._getItemStat(item, statName, true) | ||
table.insert(resultPart, '\r\n| style ="text-align: right;padding: 0 0.5em 0 0;') | table.insert(resultPart, '\r\n| style ="text-align: right;padding: 0 0.5em 0 0;') | ||
if statValue > 0 then | if statValue > 0 then | ||
Line 234: | Line 224: | ||
table.insert(resultPart, item.description ~= nil and item.description or '') | table.insert(resultPart, item.description ~= nil and item.description or '') | ||
end | end | ||
end | end | ||
end | end | ||
table.insert(resultPart, '\r\n|}') | table.insert(resultPart, '\r\n|}') | ||
return table.concat(resultPart) | return table.concat(resultPart) | ||
end | end | ||
Line 296: | Line 284: | ||
end | end | ||
local result = p._getEquipmentTable(itemList).."[[Category:getEquipmentTable]]" | |||
return result | |||
end | end | ||
Line 305: | Line 295: | ||
local itemList = Items.getItems(function(item) | local itemList = Items.getItems(function(item) | ||
local isMatch = | local isMatch = true | ||
if style == 'Melee' then | |||
if (Items._getItemStat(item, 'defenceLevelRequired') == nil and Items._getItemStat(item, 'attackLevelRequired') == nil) and not Shared.contains(styleOverrides.Melee, item.name) then isMatch = false end | |||
elseif style == 'Ranged' then | |||
if Items._getItemStat(item, 'rangedLevelRequired') == nil and not Shared.contains(styleOverrides.Ranged, item.name) then isMatch = false end | |||
elseif style == 'Magic' then | |||
if Items._getItemStat(item, 'magicLevelRequired') == nil and not Shared.contains(styleOverrides.Magic, item.name) then isMatch = false end | |||
elseif style == 'None' then | |||
if (Items._getItemStat(item, 'defenceLevelRequired') ~= nil or Items._getItemStat(item, 'rangedLevelRequired') ~= nil or Items._getItemStat(item, 'magicLevelRequired') ~= nil or | |||
Shared.contains(styleOverrides.Melee, item.name) or Shared.contains(styleOverrides.Ranged, item.name) or Shared.contains(styleOverrides.Magic, item.name)) and | |||
not Shared.contains(styleOverrides.None, item.name) then | |||
isMatch = false | |||
end | end | ||
end | |||
if slot == nil or not Shared.contains(item.validSlots, slot) then isMatch = false end | |||
if isMatch and other ~= nil then | |||
if slot == 'Weapon' then --For quiver slot or weapon slot, 'other' is the ammo type | |||
if other == 'Arrows' then | |||
if item.ammoTypeRequired ~= 0 then isMatch = false end | |||
elseif other == 'Bolts' then | |||
if item.ammoTypeRequired ~= 1 then isMatch = false end | |||
end | |||
elseif slot == 'Quiver' then | |||
if other == 'Arrows' then | |||
if item.ammoType ~= 0 then isMatch = false end | |||
elseif other == 'Bolts' then | |||
if item.ammoType ~= 1 then isMatch = false end | |||
elseif other == 'Javelins' then | |||
if item.ammoType ~= 2 then isMatch = false end | |||
elseif other == 'Throwing Knives' then | |||
if item.ammoType ~= 3 then isMatch = false end | |||
elseif other == 'Thrown' then | |||
if item.ammoType ~= 2 and item.ammoType ~= 3 then isMatch = false end | |||
end | end | ||
end | end | ||
Line 348: | Line 336: | ||
end) | end) | ||
local result = p._getEquipmentTable(itemList, includeModifiers, includeDescription) | |||
return result | |||
end | end | ||
Line 389: | Line 379: | ||
return p._getEquipmentTable(itemList, includeModifiers) | return p._getEquipmentTable(itemList, includeModifiers) | ||
end | end | ||
end | end | ||
Line 475: | Line 396: | ||
--Unfortunately just gonna have to manually check all the changes I think... | --Unfortunately just gonna have to manually check all the changes I think... | ||
local statList = { | |||
-- {'statName', 'statDescription'} | |||
{'stabAttackBonus', '{V} '..Icons.Icon({'Melee', notext=true})..' Stab Bonus'}, | |||
{'slashAttackBonus', '{V} '..Icons.Icon({'Melee', notext=true})..' Slash Bonus'}, | |||
{'blockAttackBonus', '{V} '..Icons.Icon({'Melee', notext=true})..' Block Bonus'}, | |||
{'meleeStrengthBonus', '{V} '..Icons.Icon({'Strength', type='skill', notext=true})..' Strength Bonus'}, | |||
{'rangedStrengthBonus', '{V} '..Icons.Icon({'Ranged', type='skill', notext=true})..' Strength Bonus'}, | |||
{'magicStrengthBonus', '{V}% '..Icons.Icon({'Magic', type='skill', notext=true})..' Damage Bonus'}, | |||
{'meleeDefenceBonus', '{V} '..Icons.Icon({'Defence', type='skill', notext=true})..' Defence Bonus'}, | |||
{'rangedDefenceBonus', '{V} '..Icons.Icon({'Ranged', type='skill', notext=true})..' Defence Bonus'}, | |||
{'magicDefenceBonus', '{V} '..Icons.Icon({'Magic', type='skill', notext=true})..' Defence Bonus'}, | |||
{'damageReduction', '{V}% Damage Reduction'}, | |||
{'increasedSlayerXP', '{V}% '..Icons.Icon({'Slayer', type='skill', notext=true})..' Bonus XP'}, | |||
{'attackLevelRequired', '{V} '..Icons.Icon({'Attack', type='skill', notext=true})..' Level Required'}, | |||
{'defenceLevelRequired', '{V} '..Icons.Icon({'Defence', type='skill', notext=true})..' Level Required'}, | |||
{'rangedLevelRequired', '{V} '..Icons.Icon({'Ranged', type='skill', notext=true})..' Level Required'}, | |||
{'magicLevelRequired', '{V} '..Icons.Icon({'Magic', type='skill', notext=true})..' Level Required'}, | |||
} | |||
for i, stat in ipairs(statList) do | |||
if stat[1] == 'increasedSlayerXP' then | |||
getSpecificStatString(Items._getItemModifier(item1, stat[1], 'Slayer'), Items._getItemModifier(item2, stat[1], 'Slayer'), stat[2]) | |||
else | |||
getSpecificStatString(Items._getItemStat(item1, stat[1]), Items._getItemStat(item2, stat[1]), stat[2]) | |||
end | |||
end | |||
return table.concat(changeArray, '<br/>') | return table.concat(changeArray, '<br/>') |