Anonymous

Module:LevelUpTable/Data: Difference between revisions

From Melvor Idle
Add smithing data
(Add cooking data)
(Add smithing data)
Line 13: Line 13:
UnlockData.__index = UnlockData
UnlockData.__index = UnlockData


function UnlockData.new(id, name, level, skill)
function UnlockData.new(id, name, level, skill, category)
     local self = setmetatable({}, UnlockData)
     local self = setmetatable({}, UnlockData)
     self.name = name
     self.name = name
     self.level = level
     self.level = level
     self.skill = skill
     self.skill = skill
    self.category = category or skill
     self.id = id
     self.id = id
     self.otherRequirements = nil
     self.otherRequirements = nil
Line 134: Line 135:
local plotData = getDataSetId(SkillData.Farming.plots, realm)
local plotData = getDataSetId(SkillData.Farming.plots, realm)
local plots = Select(plotData, function(x)
local plots = Select(plotData, function(x)
return UnlockData.new(x.id, plotLookup[x.categoryID], Skills.getRecipeLevel(skillID, x), "Farming Plot")
return UnlockData.new(x.id, plotLookup[x.categoryID], Skills.getRecipeLevel(skillID, x), skillID, "Farming Plot")
end)
end)


Line 169: Line 170:
return Select(data, function(x)  
return Select(data, function(x)  
local foodItem = Items.getItemByID(x.productID)
local foodItem = Items.getItemByID(x.productID)
return UnlockData.new(foodItem.id, foodItem.name, Skills.getRecipeLevel(skillID, x), x.categoryID)
return UnlockData.new(foodItem.id, foodItem.name, Skills.getRecipeLevel(skillID, x), skillID, x.categoryID)
end)
end
 
function getSmithingData(realm)
local skillID = 'Smithing'
local data = getDataSet(SkillData.Smithing.recipes, realm)
return Select(data, function(x)
local product = Items.getItemByID(x.productID)
return UnlockData.new(product.id, product.name, Skills.getRecipeLevel(skillID, x), skillID, x.categoryID)
end)
end)
end
end
Line 267: Line 278:


function p.test()
function p.test()
local realmName = 'Abyssal Realm'
--local realmName = 'Abyssal Realm'
local realm = Skills.getRealmFromName(realmName)
local realm = Skills.getRealmFromName(realmName)
Debug.log(getCookingData(realm))
Debug.log(getSmithingData(realm))
end
end


p.UnlockData = UnlockData
p.UnlockData = UnlockData
return p
return p
2,869

edits