17,105
edits
mNo edit summary |
mNo edit summary |
||
Line 322: | Line 322: | ||
local itemList = Items.getItems(function(item) | local itemList = Items.getItems(function(item) | ||
local isMatch = | local isMatch = item.isEquipment | ||
local levelReqs = Items._processEquipmentLevelReqs(item.equipRequirements) | if isMatch then | ||
local levelReqs = Items._processEquipmentLevelReqs(item.equipRequirements) | |||
if style == 'Melee' then | |||
if (levelReqs['Defence'] == nil and levelReqs['Attack'] == nil) and not Shared.contains(styleOverrides.Melee, item.name) then isMatch = false end | |||
elseif style == 'Ranged' then | |||
if levelReqs['Ranged'] == nil and not Shared.contains(styleOverrides.Ranged, item.name) then isMatch = false end | |||
elseif style == 'Magic' then | |||
if levelReqs['Magic'] == nil and not Shared.contains(styleOverrides.Magic, item.name) then isMatch = false end | |||
elseif style == 'None' then | |||
if (levelReqs['Defence'] ~= nil or levelReqs['Ranged'] ~= nil or levelReqs['Magic'] ~= 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 | end |