73
edits
No edit summary |
No edit summary |
||
Line 1,449: | Line 1,449: | ||
end | end | ||
function p._getSkillUnlockTable(skillName) | function p._getSkillUnlockTable(skillName, args) | ||
local itemsOnly = args.itemsOnly ~= nil and args.itemsOnly or false | |||
-- TODO: Pass these min/max level params along to filter by them | |||
local minLevel = args.minLevel ~= nil and args.minLevel or 0 | |||
local maxLevel = args.maxLevel ~= nil and args.maxLevel or 999 | |||
-- What do we need to check for this skill? Avoid checking everything for | -- What do we need to check for this skill? Avoid checking everything for | ||
-- every skill to save time, except for a few broad things | -- every skill to save time, except for a few broad things | ||
local entityList = {} | local entityList = {} | ||
entityList = p._addItemsWithSkillRequirement(entityList, skillName) | entityList = p._addItemsWithSkillRequirement(entityList, skillName) | ||
-- Now loop through the stuff relevant to this skill | if not itemsOnly then | ||
entityList = p._addShopPurchasesWithSkillRequirements(entityList, skillName) | |||
entityList = p._addTraderItemsWithSkillRequirements(entityList, skillName) | |||
entityList = p._addAgilityObstaclesWithSkillRequirements(entityList, skillName) | |||
-- Now loop through the stuff relevant to this skill | |||
for i, dataSource in ipairs(SKILL_CHECK_MAP[skillName]) do | |||
entityList = SOURCE_FUNCS[dataSource](entityList, skillName) | |||
end | |||
end | end | ||
Line 1,548: | Line 1,556: | ||
function p.getSkillUnlockTable(frame) | function p.getSkillUnlockTable(frame) | ||
local | local args = frame.args ~= nil and frame.args or frame | ||
return p._getSkillUnlockTable(skillName | local skillName = args[1] | ||
return p._getSkillUnlockTable(skillName, args) | |||
end | end | ||
return p | return p |
edits