Module:Skills/Artisan: Difference between revisions

From Melvor Idle
(getPotionTable: Move from Module:Items)
(Try distinguish between TotH and base content in a lazy way)
Line 222: Line 222:
return 'ERROR: The ' .. skillName .. ' skill is not supported by this function'
return 'ERROR: The ' .. skillName .. ' skill is not supported by this function'
end
end
local categoryMap = {
 
["Runecrafting"] = {
["Runes"] = 0,
["ComboRunes"] = 1,
["Weapons"] = 2,
["AirGear"] = 3,
["WaterGear"] = 4,
["EarthGear"] = 5,
["FireGear"] = 6
},
["Fletching"] = {
["Arrows"] = 0,
["Shortbows"] = 1,
["Longbows"] = 2,
["Bolts"] = 3,
["Crossbows"] = 4,
["Javelins"] = 5
},
["Crafting"] = {
["Leather"] = 0,
["Dragonhide"] = 1,
["Rings"] = 2,
["Necklaces"] = 3,
["Bags"] = 4
}
}
local actionIntervals = {
["Runecrafting"] = 2,
["Fletching"]  = 2,
["Crafting"] = 2
}
-- Validation: Category
-- Validation: Category
local category = GameData.getEntityByName(SkillData[skillName].categories, categoryName)
local category = GameData.getEntityByName(SkillData[skillName].categories, categoryName)
Line 305: Line 275:
-- Build rows based on recipes
-- Build rows based on recipes
for i, recipe in ipairs(recipeList) do
for i, recipe in ipairs(recipeList) do
local ns, _ = GameData.getLocalID(recipe.id)
local item = Items.getItemByID(recipe.productID)
local item = Items.getItemByID(recipe.productID)
if item ~= nil then
if item ~= nil then
Line 331: Line 302:
namePrefix = namePrefix .. 'data-sort-value="' .. item.name .. '"'
namePrefix = namePrefix .. 'data-sort-value="' .. item.name .. '"'
end
end
table.insert(resultPart, '\r\n|' .. spanStr .. 'style="text-align:center;min-width:25px"| ' .. Icons.Icon({item.name, type='item', size='50', notext=true}))
local suf = (ns == 'melvorTotH' and '<sup>*</sup>' or '')
table.insert(resultPart, '\r\n|' .. spanStr .. 'style="text-align:center;min-width:25px"| ' .. Icons.Icon({item.name, type='item', size='50', notext=true}) .. suf)
table.insert(resultPart, '\r\n|'.. (namePrefix ~= '' and namePrefix .. '| ' or ' ') .. (qty > 1 and '<b>' .. qty .. 'x</b> ' or '') .. Icons.Icon({item.name, type='item', noicon=true}))
table.insert(resultPart, '\r\n|'.. (namePrefix ~= '' and namePrefix .. '| ' or ' ') .. (qty > 1 and '<b>' .. qty .. 'x</b> ' or '') .. Icons.Icon({item.name, type='item', noicon=true}))
elseif colID == 'SkillLevel' then
elseif colID == 'SkillLevel' then