Anonymous

Module:Items/UseTables: Difference between revisions

From Melvor Idle
_getItemUseTable: Support GP & SC in various artisan skills
(_getItemUses: Check for Magic spell uses; add a few overrides)
(_getItemUseTable: Support GP & SC in various artisan skills)
(One intermediate revision by the same user not shown)
Line 342: Line 342:
local useArray = {}
local useArray = {}
local prefix, delim = asList and '* ' or '', asList and '\r\n' or '<br/>'
local prefix, delim = asList and '* ' or '', asList and '\r\n' or '<br/>'
for skillID, skillName in Shared.spairs(skillUses, function(t, a, b) return t[a] < t[b] end) do
table.insert(useArray, prefix .. Icons.Icon({skillName, type='skill'}))
end
for use, _ in Shared.skpairs(otherUses) do
for use, _ in Shared.skpairs(otherUses) do
table.insert(useArray, prefix .. (otherUseText[use] or use))
table.insert(useArray, prefix .. (otherUseText[use] or use))
end
for skillID, skillName in Shared.spairs(skillUses, function(t, a, b) return t[a] < t[b] end) do
table.insert(useArray, prefix .. Icons.Icon({skillName, type='skill'}))
end
end


Line 434: Line 434:
end
end
end
end
table.insert(useArray, {item = itemDef, qty = qty, mats = costDef.itemCosts, skill = skillName, reqVal = reqVal, req = rowReq, xp = recipe.baseXP})
table.insert(useArray, {item = itemDef, qty = qty, mats = costDef.itemCosts, gp = recipe.gpCost, sc = recipe.scCost, skill = skillName, reqVal = reqVal, req = rowReq, xp = recipe.baseXP})
end
end
end
end
Line 703: Line 703:
'Mysterious Stone',
'Mysterious Stone',
'Mastery Token (Cooking)',
'Mastery Token (Cooking)',
'Gem Gloves'
'Gem Gloves',
'Basic Bag'
}
}
local checkFuncs = {
local checkFuncs = {