17,418
edits
(_getItemUses: Ensure 'All skills' is displayed before any skills) |
(_getItemUseTable: Add cooking utility (fire/furnace/pot) as a requirement for cooking uses) |
||
Line 499: | Line 499: | ||
local reqVal = nil | local reqVal = nil | ||
local xp = recipe.baseAbyssalExperience or recipe.baseExperience | local xp = recipe.baseAbyssalExperience or recipe.baseExperience | ||
if recipeSkillID == 'melvorD:Herblore' then | if recipeSkillID == 'melvorD:Cooking' then | ||
-- Cooking includes the required utility (fire, furnace, pot) as a special requirement | |||
local cookingCatIcon = { | |||
["melvorD:Fire"] = 'Normal Cooking Fire', | |||
["melvorD:Furnace"] = 'Basic Furnace', | |||
["melvorD:Pot"] = 'Basic Pot' | |||
} | |||
local categoryIconName, categoryName = cookingCatIcon[recipe.categoryID], nil | |||
local recipeCategory = GameData.getEntityByID(SkillData.Cooking.categories, recipe.categoryID) | |||
if recipeCategory ~= nil then | |||
categoryName = recipeCategory.modifierName or recipeCategory.name | |||
end | |||
if categoryIconName ~= nil and categoryName ~= nil then | |||
local utilReq = Icons.Icon({'Cooking', categoryName, section = 'Cooking Upgrades', img = categoryIconName, type = 'upgrade'}) | |||
rowReq = Icons._SkillReq(skillName, rowReq, false, (isAbyssal and "melvorItA:Abyssal" or nil)) .. '<br>' .. utilReq | |||
end | |||
elseif recipeSkillID == 'melvorD:Herblore' then | |||
-- Herblore may also have a mastery requirement | -- Herblore may also have a mastery requirement | ||
local levelUnlock = GameData.getEntityByProperty(SkillData.Herblore.masteryLevelUnlocks, 'descriptionID', recipeItem.tier + 1) | local levelUnlock = GameData.getEntityByProperty(SkillData.Herblore.masteryLevelUnlocks, 'descriptionID', recipeItem.tier + 1) | ||
Line 505: | Line 521: | ||
local masteryReq = Icons._MasteryReq(recipeItem.name, levelUnlock.level) | local masteryReq = Icons._MasteryReq(recipeItem.name, levelUnlock.level) | ||
reqVal = rowReq + levelUnlock.level * 0.01 | reqVal = rowReq + levelUnlock.level * 0.01 | ||
rowReq = Icons._SkillReq(skillName, rowReq, false, (isAbyssal and "melvorItA:Abyssal" or nil)) .. '<br | rowReq = Icons._SkillReq(skillName, rowReq, false, (isAbyssal and "melvorItA:Abyssal" or nil)) .. '<br>' .. masteryReq | ||
end | end | ||
end | end |