Module:Items/ComparisonTables: Difference between revisions

Added more columns to the Other table of the getDRTable table
(added Weapon to the DR table)
(Added more columns to the Other table of the getDRTable table)
Line 601: Line 601:
local ItemList = {}
local ItemList = {}
if style == 'Other' then
if style == 'Other' then
SlotNames = {'Cape', 'Amulet', 'Ring'}
SlotNames = {'Helmet', 'Platelegs', 'Boots', 'Gloves', 'Weapon', 'Shield', 'Cape', 'Amulet', 'Ring'}
ItemList =  Items.getItems(function(item)
if Items._getItemStat(item, 'damageReduction', true) <= 0 then
return false
end
-- Exclude Golbin raid exclusives for now, such that they don't
-- pollute various equipment tables
if item.golbinRaidExclusive ~= nil and item.golbinRaidExclusive then
return false
end
return Shared.contains(SlotNames, Items._getItemEquipSlot(item))
end)
else
else
SlotNames = {'Helmet', 'Platebody', 'Platelegs', 'Boots', 'Gloves', 'Weapon', 'Shield'}
SlotNames = {'Helmet', 'Platebody', 'Platelegs', 'Boots', 'Gloves', 'Weapon', 'Shield'}
ItemList =  Items.getItems(function(item)
end
local isMatch = true
if Items._getItemStat(item, 'damageReduction', true) <= 0 then
ItemList =  Items.getItems(function(item)
return false
local isMatch = true
end
if Items._getItemStat(item, 'damageReduction', true) <= 0 then
-- Exclude Golbin raid exclusives for now, such that they don't
return false
-- pollute various equipment tables
end
if item.golbinRaidExclusive ~= nil and item.golbinRaidExclusive then
-- Exclude Golbin raid exclusives for now, such that they don't
return false
-- pollute various equipment tables
end
if item.golbinRaidExclusive ~= nil and item.golbinRaidExclusive then
--Using the same checks for Melee/Ranged/Magic that the Equipment Tables use
return false
if style == 'Melee' then
end
if ((Items._getItemStat(item, 'defenceLevelRequired') == nil and Items._getItemStat(item, 'attackLevelRequired') == nil) and not Shared.contains(styleOverrides.Melee, item.name)) or Shared.contains(styleOverrides.NotMelee, item.name) then isMatch = false end
--Using the same checks for Melee/Ranged/Magic that the Equipment Tables use
elseif style == 'Ranged' then
if style == 'Melee' then
if (Items._getItemStat(item, 'rangedLevelRequired') == nil and not Shared.contains(styleOverrides.Ranged, item.name)) or Shared.contains(styleOverrides.NotRanged, item.name)  then isMatch = false end
if ((Items._getItemStat(item, 'defenceLevelRequired') == nil and Items._getItemStat(item, 'attackLevelRequired') == nil) and not Shared.contains(styleOverrides.Melee, item.name)) or Shared.contains(styleOverrides.NotMelee, item.name) then isMatch = false end
elseif style == 'Magic' then
elseif style == 'Ranged' then
if (Items._getItemStat(item, 'magicLevelRequired') == nil and not Shared.contains(styleOverrides.Magic, item.name)) or Shared.contains(styleOverrides.NotMagic, item.name) then isMatch = false end
if (Items._getItemStat(item, 'rangedLevelRequired') == nil and not Shared.contains(styleOverrides.Ranged, item.name)) or Shared.contains(styleOverrides.NotRanged, item.name)  then isMatch = false end
end
elseif style == 'Magic' then
if isMatch and not Shared.contains(SlotNames, Items._getItemEquipSlot(item)) then
if (Items._getItemStat(item, 'magicLevelRequired') == nil and not Shared.contains(styleOverrides.Magic, item.name)) or Shared.contains(styleOverrides.NotMagic, item.name) then isMatch = false end
else
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
isMatch = false
end
end
return isMatch
end
end)
if isMatch and not Shared.contains(SlotNames, Items._getItemEquipSlot(item)) then
end
isMatch = false
end
return isMatch
end)
return p._getDRTable(SlotNames, ItemList)
return p._getDRTable(SlotNames, ItemList)