4,951
edits
Falterfire (talk | contribs) (added Weapon to the DR table) |
Falterfire (talk | contribs) (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 = {' | SlotNames = {'Helmet', 'Platelegs', 'Boots', 'Gloves', 'Weapon', 'Shield', 'Cape', 'Amulet', 'Ring'} | ||
else | else | ||
SlotNames = {'Helmet', 'Platebody', 'Platelegs', 'Boots', 'Gloves', 'Weapon', 'Shield'} | SlotNames = {'Helmet', 'Platebody', 'Platelegs', 'Boots', 'Gloves', 'Weapon', 'Shield'} | ||
end | |||
ItemList = Items.getItems(function(item) | |||
local isMatch = true | |||
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 | |||
--Using the same checks for Melee/Ranged/Magic that the Equipment Tables use | |||
if style == 'Melee' then | |||
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 == 'Ranged' 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 | |||
elseif style == 'Magic' then | |||
if | 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 | ||
end | |||
end | if isMatch and not Shared.contains(SlotNames, Items._getItemEquipSlot(item)) then | ||
isMatch = false | |||
end | |||
return isMatch | |||
end) | |||
return p._getDRTable(SlotNames, ItemList) | return p._getDRTable(SlotNames, ItemList) |