Anonymous

Module:Items/SourceTables: Difference between revisions

From Melvor Idle
_getItemSources: Resolve missing skill sources for Herblore, Mining
m (Fix Summoning non-shard item cost quantity)
(_getItemSources: Resolve missing skill sources for Herblore, Mining)
Line 471: Line 471:
local keyData = {
local keyData = {
[SkillEnum.Fishing] = { ["recipe"] = 'Fish' },
[SkillEnum.Fishing] = { ["recipe"] = 'Fish' },
[SkillEnum.Mining] = { ["recipe"] = 'Rocks', ["level"] = 'levelRequired' },
[SkillEnum.Mining] = { ["recipe"] = 'Rocks', ["level"] = 'levelRequired', ["item"] = 'oreID' },
[SkillEnum.Smithing] = {},
[SkillEnum.Smithing] = {},
[SkillEnum.Fletching] = {},
[SkillEnum.Fletching] = {},
[SkillEnum.Crafting] = {},
[SkillEnum.Crafting] = {},
[SkillEnum.Runecrafting] = {},
[SkillEnum.Runecrafting] = {},
[SkillEnum.Herblore] = { ["recipe"] = 'Potions' },
[SkillEnum.Herblore] = { ["recipe"] = 'Potions', ["item"] = 'potionIDs', ["isItemList"] = true },
[SkillEnum.Summoning] = { ["recipe"] = 'Marks' }
[SkillEnum.Summoning] = { ["recipe"] = 'Marks' }
}
}
Line 486: Line 486:
if keys.level == nil then
if keys.level == nil then
keys.level = 'level'
keys.level = 'level'
end
if keys.item == nil then
keys.item = 'itemID'
end
if keys.isItemList == nil then
keys.isItemList = false
end
end


local recipe = SkillData[skill][keys.recipe][masteryID + 1]
local recipe = SkillData[skill][keys.recipe][masteryID + 1]
if recipe ~= nil and recipe.itemID == item.id then
if recipe ~= nil and (
(not keys.isItemList and recipe[keys.item] == item.id) or
(keys.isItemList and Shared.contains(recipe[keys.item], item.id))) then
local levelReq = recipe[keys.level]
local levelReq = recipe[keys.level]
if levelReq ~= nil then
if levelReq ~= nil then