4,951
edits
m (_getItemUseTable: Replace hard-coded Summoning GP/SC cost value with in-game data) |
Falterfire (talk | contribs) (Fixed issue with upgradeable items not listing if they were costs for other things) |
||
Line 112: | Line 112: | ||
local canAgile = false | local canAgile = false | ||
local canSummon = false | local canSummon = false | ||
canUpgrade = true | |||
for i, item2 in pairs(ItemData.Items) do | |||
if item2.itemsRequired ~= nil then | |||
for j, req in pairs(item2.itemsRequired) do | |||
if req[1] == item.id then | |||
canUpgrade = true | |||
break | |||
end | end | ||
end | end | ||
end | |||
if item2.craftReq ~= nil then | |||
for j, req in pairs(item2.craftReq) do | |||
if req.id == item.id then | |||
canCraft = true | |||
break | |||
end | |||
end | |||
end | |||
if item2.fletchReq ~= nil then | |||
for j, req in pairs(item2.fletchReq) do | |||
if req.id == item.id then | |||
canFletch = true | |||
break | |||
end | end | ||
end | end | ||
end | |||
if item2.runecraftReq ~= nil then | |||
for j, req in pairs(item2.runecraftReq) do | |||
if req.id == item.id then | |||
canRunecraft = true | |||
break | |||
end | end | ||
end | end | ||
end | |||
if item2.herbloreReq ~= nil then | |||
for j, req in pairs(item2.herbloreReq) do | |||
if req.id == item.id then | |||
canHerblore = true | |||
break | |||
end | end | ||
end | end | ||
end | |||
if item2.summoningReq ~= nil then | |||
for j, reqSet in pairs(item2.summoningReq) do | |||
for k, req in pairs(reqSet) do | |||
if req.id == item.id then | if req.id == item.id then | ||
canSummon = true | |||
break | break | ||
end | end | ||
end | end | ||
Line 173: | Line 170: | ||
end | end | ||
end | end | ||
--Check if Agility applies here | --Check if Agility applies here | ||
canAgile = Shared.tableCount(Agility.getObstaclesForItem(item.id)) > 0 | canAgile = Shared.tableCount(Agility.getObstaclesForItem(item.id)) > 0 | ||
--Agility | --Agility | ||
Line 285: | Line 276: | ||
if Shared.tableCount(shopArray) > 0 then | if Shared.tableCount(shopArray) > 0 then | ||
table.insert(useArray, chr..Icons.Icon({'Shop'})) | table.insert(useArray, chr..Icons.Icon({'Shop'})) | ||
end | |||
if canUpgrade then | |||
if item.canUpgrade or (item.type == 'Armour' and item.canUpgrade == nil) then | |||
table.insert(categoryArray, '[[Category:Upgradeable Items]]') | |||
end | |||
table.insert(useArray, chr..'[[Upgrading Items]]') | |||
end | end | ||