Module:Skills/Summoning: Difference between revisions

Ceil Summoning recipes and fixed max abyssal recipe costs
(Update for v1.3)
(Ceil Summoning recipes and fixed max abyssal recipe costs)
Line 82: Line 82:
local rowArray = {}
local rowArray = {}
for i, Fam in ipairs(Familiars) do
for i, Fam in ipairs(Familiars) do
local level = Skills.getRecipeLevel(skillID, Fam)
local level, isAbyssal = Skills.getRecipeLevelRealm(skillID, Fam)
local baseXP = Fam.baseAbyssalExperience or Fam.baseExperience
local baseXP = Fam.baseAbyssalExperience or Fam.baseExperience
local reqText = Skills.getRecipeRequirementText(SkillData.Summoning.name, Fam)
local reqText = Skills.getRecipeRequirementText(SkillData.Summoning.name, Fam)
Line 114: Line 114:


-- Other costs
-- Other costs
local recipeGPCost = SkillData.Summoning.recipeGPCost
local recipeCost = 0
if isAbyssal == true then
recipeCost = SkillData.Summoning.recipeAPCost
else
recipeCost = SkillData.Summoning.recipeGPCost
end
local currencyCostText = Common.getCostString({ ["items"] = {}, ["currencies"] = Fam.currencyCosts})
local currencyCostText = Common.getCostString({ ["items"] = {}, ["currencies"] = Fam.currencyCosts})
if currencyCostText ~= nil then
if currencyCostText ~= nil then
Line 123: Line 128:
if nonShard ~= nil then
if nonShard ~= nil then
local itemValue = math.max(nonShard.sellsFor, 20)
local itemValue = math.max(nonShard.sellsFor, 20)
local nonShardQty = math.max(1, math.floor(recipeGPCost / itemValue))
local nonShardQty = math.max(1, math.ceil(recipeCost / itemValue))
table.insert(OtherCostArray, Icons.Icon({nonShard.name, type='item', notext=true, qty=nonShardQty}))
table.insert(OtherCostArray, Icons.Icon({nonShard.name, type='item', notext=true, qty=nonShardQty}))
end
end