2,875
edits
No edit summary |
No edit summary |
||
Line 21: | Line 21: | ||
} | } | ||
local slotOverrides = { | |||
['2hWeapons'] = 'melvorD:2hWeapons', | |||
['Enhancement'] = 'melvorD:Enhancement' | |||
} | |||
local function getSlotID(slot) | local function getSlotID(slot) | ||
Line 29: | Line 31: | ||
if slotData == nil then | if slotData == nil then | ||
if slotOverrides[slot] ~= nil then | |||
if slot = | return slotOverrides[slot] | ||
return | |||
end | end | ||
-- slotID invalid, check if user provided a slot name | -- slotID invalid, check if user provided a slot name | ||
slotData = GameData.getEntityByProperty('equipmentSlots', 'emptyName', slot) | slotData = GameData.getEntityByProperty('equipmentSlots', 'emptyName', slot) | ||
Line 73: | Line 74: | ||
return false | return false | ||
end | end | ||
if item.name == 'Gods Enhancement (Superior)' then | |||
mw.logObject(item) | |||
end | |||
if not Shared.contains(item.validSlots, slotLocalID) then | if not Shared.contains(item.validSlots, slotLocalID) then | ||
-- Special case for when the slot is Weapon but the data slot is Quiver (throwables) | -- Special case for when the slot is Weapon but the data slot is Quiver (throwables) | ||
Line 81: | Line 85: | ||
-- Special case when the slot ID is for two handed weapons (this ID doesn't actually exist in game) | -- Special case when the slot ID is for two handed weapons (this ID doesn't actually exist in game) | ||
if slotLocalID == | if slotLocalID == '2hWeapons' then | ||
return Items._getItemStat(item, 'isTwoHanded') | return Items._getItemStat(item, 'isTwoHanded') | ||
end | |||
return | |||
if slotLocalID == 'Enhancement' then | |||
return Shared.contains(item.validSlots, 'Enhancement1') or | |||
Shared.contains(item.validSlots, 'Enhancement2') or | |||
Shared.contains(item.validSlots, 'Enhancement3') | |||
end | end | ||
end | end |
edits