2,875
edits
(Amended for gameData changes around resistance stats) |
No edit summary |
||
Line 13: | Line 13: | ||
local weaponTypes = {'Magic Staff', 'Magic Wand', 'Ranged Weapon', 'Weapon'} | local weaponTypes = {'Magic Staff', 'Magic Wand', 'Ranged Weapon', 'Weapon'} | ||
local twoHandedWeaponID = '2hWeapons' | |||
local function getAttackSpeed(item) | local function getAttackSpeed(item) | ||
Line 22: | Line 23: | ||
local function getSlotID(slot) | local function getSlotID(slot) | ||
local slotID = Shared.getNamespacedID('melvorD', slot) | local slotID = Shared.getNamespacedID('melvorD', slot) | ||
local slotData = GameData.getEntityByID('equipmentSlots', slotID) | local slotData = GameData.getEntityByID('equipmentSlots', slotID) | ||
if slotData == nil then | if slotData == nil then | ||
-- Special case for 2h weapons. Assume 1h weapons otherwise. | |||
if slot == twoHandedWeaponID then | |||
return 'melvorD:' .. twoHandedWeaponID | |||
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 38: | Line 43: | ||
local function getItems(slotID) | local function getItems(slotID) | ||
local | local _, slotLocalID = Shared.getLocalID(slotID) | ||
local sortFunc = function(item) | local sortFunc = function(item) | ||
Line 48: | Line 53: | ||
if item.golbinRaidExclusive ~= nil and item.golbinRaidExclusive then | if item.golbinRaidExclusive ~= nil and item.golbinRaidExclusive then | ||
return false | return false | ||
end | |||
if not Shared.contains(item.validSlots, slotLocalID) or slotLocalID ~= twoHandedWeaponID then | |||
return false | |||
end | end | ||
if slotLocalID == twoHandedWeaponID then | |||
return Items._getItemStat(item, 'isTwoHanded') | |||
end | end | ||
if slotLocalID == 'Weapon' then --For quiver slot or weapon slot, 'other' is the ammo type | |||
return other == item.ammoTypeRequired | |||
elseif slotLocalID == 'Quiver' then | |||
if other == 'Thrown' and Shared.contains({'Javelins', 'ThrowingKnives'}, item.ammoType) then | |||
return true | |||
else | |||
return other == item.ammoType | |||
end | end | ||
end | end | ||
return | |||
return false | |||
end | end | ||
Line 210: | Line 207: | ||
header0:tag('th'):attr('colspan', 3) | header0:tag('th'):attr('colspan', 3) | ||
:wikitext("Defence Bonus") | :wikitext("Defence Bonus") | ||
header0:tag('th'):wikitext("DR/AR") | header0:tag('th'):wikitext("DR/AR") | ||
local header1 = html:tag('tr'):addClass('headerRow-1') | local header1 = html:tag('tr'):addClass('headerRow-1') |
edits