Anonymous

Module:LevelUpTable/Data: Difference between revisions

From Melvor Idle
Remove deprecated code
(Use FunList module)
(Remove deprecated code)
 
Line 32: Line 32:
return 'melvorD:Melvor'
return 'melvorD:Melvor'
end
end
end
function getDataSet(skillData, realm)
return GameData.getEntities(skillData, function(x) return Skills.getRecipeRealm(x) == realm.id end)
end
function getDataSetId(skillData, realm)
return GameData.getEntities(skillData, function(x) return getRealmFromID(x) == realm.id end)
end
end


Line 199: Line 191:
function getHerbloreData(realm)
function getHerbloreData(realm)
local skillID = 'Herblore'
local skillID = 'Herblore'
local data = getDataSet(SkillData.Herblore.recipes, realm)
 
function getLastPotion(potion)
local lastID = FL.new(potion.potionIDs):last()
return Items.getItemByID(lastID)
end
return FL.new(SkillData.Herblore.recipes)
return FL.new(SkillData.Herblore.recipes)
:where(function(x) return Skills.getRecipeRealm(x) == realm.id end)
:where(function(x) return Skills.getRecipeRealm(x) == realm.id end)
:select(function(x)
:select(function(x)
local lastPot = getLastPotion(x)
local lastPotID = FL.new(x.potionIDs):last()
local lastPot = Items.getItemByID(lastPotID)
return UnlockData.new(lastPot.id, lastPot.name, Skills.getRecipeLevel(skillID, x), skillID)
return UnlockData.new(lastPot.id, lastPot.name, Skills.getRecipeLevel(skillID, x), skillID)
end):toTable()
end):toTable()
2,873

edits