Anonymous

Module:Items/UseTables: Difference between revisions

From Melvor Idle
Fixed XP and Levels for Abyssal recipes in UseTables
(Update for v1.3)
(Fixed XP and Levels for Abyssal recipes in UseTables)
Line 5: Line 5:
local GameData = require('Module:GameData')
local GameData = require('Module:GameData')
local SkillData = GameData.skillData
local SkillData = GameData.skillData
local Skills = require('Module:Skills')
local Magic = require('Module:Magic')
local Magic = require('Module:Magic')
local Areas = require('Module:CombatAreas')
local Areas = require('Module:CombatAreas')
Line 432: Line 433:
local itemDef = {id = recipe.itemID, name = recipeItem.name}
local itemDef = {id = recipe.itemID, name = recipeItem.name}
local qty = (recipe.baseQuantity or 1) * (costDef.quantityMultiplier or 1)
local qty = (recipe.baseQuantity or 1) * (costDef.quantityMultiplier or 1)
local rowReq = recipe.level
local rowReq = Skills.getRecipeLevel(recipeSkillID, recipe)
local reqVal = nil
local reqVal = nil
local xp = recipe.baseAbyssalExperience or recipe.baseExperience
if recipeSkillID == 'melvorD:Herblore' then
if recipeSkillID == 'melvorD:Herblore' then
-- Herblore may also have a mastery requirement
-- Herblore may also have a mastery requirement
Line 443: Line 445:
end
end
end
end
table.insert(useArray, {item = itemDef, qty = qty, mats = costDef.itemCosts, gp = recipe.gpCost, sc = recipe.scCost, skill = skillName, reqVal = reqVal, req = rowReq, xp = recipe.baseExperience})
table.insert(useArray, {item = itemDef, qty = qty, mats = costDef.itemCosts, gp = recipe.gpCost, sc = recipe.scCost, skill = skillName, reqVal = reqVal, req = rowReq, xp = xp})
end
end
end
end
Line 459: Line 461:
local product = Items.getItemByID(recipe.productId)
local product = Items.getItemByID(recipe.productId)
local mat = {{id = recipe.seedCost.id, quantity = recipe.seedCost.quantity}}
local mat = {{id = recipe.seedCost.id, quantity = recipe.seedCost.quantity}}
local rowReq = recipe.level
local rowReq = Skills.getRecipeLevel('melvorD:Farming', recipe)
local category = GameData.getEntityByID(SkillData.Farming.categories, recipe.categoryID)
local category = GameData.getEntityByID(SkillData.Farming.categories, recipe.categoryID)
local qty = 5 * category.harvestMultiplier
local qty = 5 * category.harvestMultiplier
local xp = recipe.baseExperience
local xp = recipe.baseAbyssalExperience or recipe.baseExperience
table.insert(useArray, {item = {id = product.id, name = product.name}, qty = qty, mats = mat, skill = 'Farming', req = rowReq, xp = xp})
table.insert(useArray, {item = {id = product.id, name = product.name}, qty = qty, mats = mat, skill = 'Farming', req = rowReq, xp = xp})
end
end
Line 503: Line 505:
local nonShardItem = Items.getItemByID(nonShardItemID)
local nonShardItem = Items.getItemByID(nonShardItemID)
local recipeCosts = Shared.clone(recipe.itemCosts)
local recipeCosts = Shared.clone(recipe.itemCosts)
local xp = recipe.baseAbyssalExperience or recipe.baseExperience
local req = Skills.getRecipeLevel('melvorD:Summoning', recipe)
local recipeCosts = {}
local recipeCosts = {}
for k, itemCost in ipairs(recipe.itemCosts) do
for k, itemCost in ipairs(recipe.itemCosts) do
Line 513: Line 517:
table.insert(recipeCosts, {id = nonShardItemID, quantity = nonShardQty})
table.insert(recipeCosts, {id = nonShardItemID, quantity = nonShardQty})
end
end
table.insert(useArray, {item = {id = recipeItem.id, name = recipeItem.name}, qty = recipe.baseQuantity, mats = recipeCosts, gp = recipe.gpCost, sc = recipe.scCost, skill = 'Summoning', req = recipe.level, xp = recipe.baseExperience})
table.insert(useArray, {item = {id = recipeItem.id, name = recipeItem.name}, qty = recipe.baseQuantity, mats = recipeCosts, gp = recipe.gpCost, sc = recipe.scCost, skill = 'Summoning', req = req, xp = xp})
end
end
end
end
Line 701: Line 705:
table.insert(rowPart, Icons.Icon({spell.name, type=iconType, notext=true, size=50}))
table.insert(rowPart, Icons.Icon({spell.name, type=iconType, notext=true, size=50}))
table.insert(rowPart, '||'..Icons.Icon({spell.name, type=iconType, noicon=true}))
table.insert(rowPart, '||'..Icons.Icon({spell.name, type=iconType, noicon=true}))
table.insert(rowPart, '||data-sort-value="'..spell.level..'"|'..Magic._getSpellRequirements(spell))
table.insert(rowPart, '||data-sort-value="'..Skills.getRecipeLevel('melvorD:Summoning', spell)..'"|'..Magic._getSpellRequirements(spell))
table.insert(rowPart, '||data-sort-value="'.. spellBook.id ..'"|')
table.insert(rowPart, '||data-sort-value="'.. spellBook.id ..'"|')
table.insert(rowPart, Magic.getSpellTypeLink(spellBook.id))
table.insert(rowPart, Magic.getSpellTypeLink(spellBook.id))
Line 763: Line 767:
'Gem Gloves',
'Gem Gloves',
'Basic Bag',
'Basic Bag',
'Bird Nest'
'Bird Nest',
'Abyssal Stone',
'Withered Ash',
'Wrath Rune'
}
}
local checkFuncs = {
local checkFuncs = {