Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 80 additions & 14 deletions src/Classes/Item.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ local catalystTags = {
{ "attribute" },
}

local minimumReqLevel = { }

local function getCatalystScalar(catalystId, tags, quality)
if not catalystId or type(catalystId) ~= "number" or not catalystTags[catalystId] or not tags or type(tags) ~= "table" or #tags == 0 then
return 1
Expand Down Expand Up @@ -358,6 +360,7 @@ function ItemClass:ParseRaw(raw, rarity, highQuality)
self.prefixes = { }
self.suffixes = { }
self.requirements = { }
self.requirements.runeLevel = 0
self.requirements.str = 0
self.requirements.dex = 0
self.requirements.int = 0
Expand Down Expand Up @@ -436,6 +439,16 @@ function ItemClass:ParseRaw(raw, rarity, highQuality)
self.itemSocketCount = #self.sockets
elseif specName == "Rune" then
t_insert(self.runes, specVal)
local runeLevel = 0
local runeData = data.itemMods.Runes[specVal]
if runeData then
for _, slotData in pairs(runeData) do
runeLevel = math.max(runeLevel, slotData.rank[1])
end
end
if runeLevel > 0 and (not self.requirements.runeLevel or runeLevel > self.requirements.runeLevel) then
self.requirements.runeLevel = runeLevel
end
elseif specName == "Radius" and self.type == "Jewel" then
self.jewelRadiusLabel = specVal:match("^[%a ]+")
if specVal:match("^%a+") == "Variable" then
Expand Down Expand Up @@ -484,6 +497,8 @@ function ItemClass:ParseRaw(raw, rarity, highQuality)
self.armourData[specName] = specToNumber(specVal)
elseif specName == "Requires Level" then
self.requirements.level = specToNumber(specVal)
minimumReqLevel = minimumReqLevel or {}
table.insert(minimumReqLevel, { name = self.name, level = specVal })
elseif specName == "Level" then
-- Requirements from imported items can't always be trusted
importedLevelReq = specToNumber(specVal)
Expand Down Expand Up @@ -975,6 +990,19 @@ function ItemClass:ParseRaw(raw, rarity, highQuality)
self.requirements.level = self.base.req.level
end
end
if self.base and not self.requirements.baseLevel then
-- Add only if not already present, to prevent overwriting original value.
local exists = false
for _, entry in ipairs(minimumReqLevel) do
if entry.name == self.title then
exists = true
break
end
end
if not exists then
self.requirements.baseLevel = self.base.req.level
end
end
self.affixLimit = 0
if self.crafted then
if not self.affixes then
Expand Down Expand Up @@ -1765,6 +1793,58 @@ function ItemClass:BuildModList()
for _, modLine in ipairs(self.explicitModLines) do
processModLine(modLine)
end
self.grantedSkills = { }
for _, skill in ipairs(baseList:List(nil, "ExtraSkill")) do
if skill.name ~= "Unknown" then
t_insert(self.grantedSkills, {
skillId = skill.skillId,
level = skill.level,
noSupports = skill.noSupports,
source = self.modSource,
triggered = skill.triggered,
triggerChance = skill.triggerChance,
})
end
end

local reqLevel = 0
local minReqLevel

for _, entry in ipairs(minimumReqLevel) do
if entry.name == self.title then
minReqLevel = entry.level
break
end
end

if #self.grantedSkills >= 1 then
local skillDef = data.skills[self.grantedSkills[1].skillId]
local gemId = data.gemForSkill[skillDef]
local gem = data.gems[gemId]

local skillLevel = self.grantedSkills[1].level or #skillDef.levels
local chosenLevel = skillDef.levels[skillLevel] or skillDef.levels[#skillDef.levels]
local gemLevelReq = chosenLevel.levelRequirement

reqLevel = m_max(gemLevelReq, minReqLevel or 0, self.requirements.runeLevel or 0, self.requirements.baseLevel or 0)

-- Rune level and unique base level don't scale attribute requirements. Example, Cursecarver has 33 minimum required level
-- but the intelligence requirement will be 21 at level 4 skill.
local attrLevel = m_max(gemLevelReq, self.requirements.baseLevel or 0)

if self.base.type == "Sceptre" or self.base.type == "Wand" or self.base.type == "Staff" then
self.requirements.int = calcLib.getGemStatRequirement(attrLevel, gem.reqInt)
self.requirements.dex = calcLib.getGemStatRequirement(attrLevel, gem.reqDex)
self.requirements.str = calcLib.getGemStatRequirement(attrLevel, gem.reqStr)
end
else
-- If no granted skills, we want to use the "Requires Level" from the unique instead of the base armour type level requirement.
-- Currently there are no Uniques that use a lower level than the base, but maybe in the future.
reqLevel = m_max(minReqLevel or 0, self.requirements.runeLevel or 0, self.requirements.baseLevel or 0)
end

self.requirements.level = reqLevel

if self.name == "Tabula Rasa, Simple Robe" or self.name == "Skin of the Loyal, Simple Robe" or self.name == "Skin of the Lords, Simple Robe" or self.name == "The Apostate, Cabalist Regalia" then
-- Hack to remove the energy shield and base int requirement
baseList:NewMod("ArmourData", "LIST", { key = "EnergyShield", value = 0 })
Expand All @@ -1789,20 +1869,6 @@ function ItemClass:BuildModList()
self.requirements.dexMod = m_floor((self.requirements.dex + calcLocal(baseList, "DexRequirement", "BASE", 0)) * (1 + calcLocal(baseList, "DexRequirement", "INC", 0) / 100))
self.requirements.intMod = m_floor((self.requirements.int + calcLocal(baseList, "IntRequirement", "BASE", 0)) * (1 + calcLocal(baseList, "IntRequirement", "INC", 0) / 100))
end
self.grantedSkills = { }
for _, skill in ipairs(baseList:List(nil, "ExtraSkill")) do
if skill.name ~= "Unknown" then
t_insert(self.grantedSkills, {
skillId = skill.skillId,
level = skill.level,
noSupports = skill.noSupports,
source = self.modSource,
triggered = skill.triggered,
triggerChance = skill.triggerChance,
})
end
end

if self.itemSocketCount > 0 then
-- Ensure that there are the correct number of abyssal sockets present
local newSockets = { }
Expand Down
56 changes: 42 additions & 14 deletions src/Data/Bases/soulcore.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ itemBases["Atmohua's Soul Core of Retreat"] = {
type = "SoulCore",
tags = { soul_core = true, soul_core_tier3 = true, default = true, },
implicitModTypes = { },
implicit = "Body Armour: 30% faster start of Energy Shield Recharge",
implicit = "Body Armour: 30% faster start of Energy Shield Recharge\nFocus: 30% faster start of Energy Shield Recharge",
req = { level = 65, },
}
itemBases["Quipolatl's Soul Core of Flow"] = {
Expand Down Expand Up @@ -76,7 +76,7 @@ itemBases["Estazunti's Soul Core of Convalescence"] = {
type = "SoulCore",
tags = { soul_core = true, soul_core_tier3 = true, default = true, },
implicitModTypes = { },
implicit = "Boots: 10% increased speed of Recoup Effects",
implicit = "Boots: 10% increased speed of Recoup Effects\nHelmet: 6% of Damage taken Recouped as Life",
req = { level = 65, },
}
itemBases["Tacati's Soul Core of Affliction"] = {
Expand Down Expand Up @@ -188,7 +188,7 @@ itemBases["Soul Core of Ticaba"] = {
type = "SoulCore",
tags = { soul_core = true, soul_core_tier2 = true, default = true, },
implicitModTypes = { },
implicit = "Martial Weapons: +5% to Critical Damage Bonus\nBody Armour: Hits against you have 20% reduced Critical Damage Bonus",
implicit = "Martial Weapons: +5% to Critical Damage Bonus\nBody Armour: Hits against you have 20% reduced Critical Damage Bonus\nShield: Hits against you have 20% reduced Critical Damage Bonus",
req = { level = 35, },
}
itemBases["Soul Core of Atmohua"] = {
Expand All @@ -212,6 +212,34 @@ itemBases["Soul Core of Zantipi"] = {
implicit = "Martial Weapons: Convert 20% of Requirements to Intelligence\nArmour: Convert 20% of Requirements to Intelligence",
req = { level = 35, },
}
itemBases["Amanamu's Gaze"] = {
type = "SoulCore",
tags = { default = true, },
implicitModTypes = { },
implicit = "Helmet: Remove a Damaging Ailment when you use a Command Skill\nBody Armour: +2 to Armour per 1 Spirit\nBoots: 1% increased Movement Speed per 15 Spirit, up to a maximum of 40%\nOther Modifiers to Movement Speed do not apply",
req = { level = 65, },
}
itemBases["Kurgal's Gaze"] = {
type = "SoulCore",
tags = { default = true, },
implicitModTypes = { },
implicit = "Helmet: Increases and Reductions to Life Regeneration Rate also apply to Mana Regeneration Rate\nGloves: 40% increased effect of Arcane Surge on you\nBoots: 15% increased Mana Cost Efficiency if you haven't Dodge Rolled Recently",
req = { level = 65, },
}
itemBases["Tecrod's Gaze"] = {
type = "SoulCore",
tags = { default = true, },
implicitModTypes = { },
implicit = "Body Armour: Regenerate 1.5% of maximum Life per second\nGloves: 25% increased Life Cost Efficiency\nBoots: 10% increased Movement Speed when on Low Life",
req = { level = 65, },
}
itemBases["Ulaman's Gaze"] = {
type = "SoulCore",
tags = { default = true, },
implicitModTypes = { },
implicit = "Helmet: +1 to Accuracy Rating per 1 Item Evasion Rating on Equipped Helmet\nGloves: Critical Hit chance is Lucky against Parried enemies\nBody Armour: Prevent +3% of Damage from Deflected Hits",
req = { level = 65, },
}

itemBases["Desert Rune"] = {
type = "Rune",
Expand Down Expand Up @@ -736,76 +764,76 @@ itemBases["Serpent Talisman"] = {
type = "Talisman",
tags = { primal_talisman = true, talisman = true, default = true, },
implicitModTypes = { },
implicit = "Gloves: 5% increased Curse Magnitudes",
implicit = "Gloves: 5% increased Curse Magnitudes\nSceptre: Allies in your Presence have 8% increased Attack Speed",
req = { },
}
itemBases["Primate Talisman"] = {
type = "Talisman",
tags = { primal_talisman = true, talisman = true, default = true, },
implicitModTypes = { },
implicit = "Helmet: Minions have 12% increased maximum Life",
implicit = "Helmet: Minions have 12% increased maximum Life\nSceptre: Allies in your Presence deal 30% increased Damage",
req = { },
}
itemBases["Owl Talisman"] = {
type = "Talisman",
tags = { primal_talisman = true, talisman = true, default = true, },
implicitModTypes = { },
implicit = "Focus: 10% increased Cooldown Recovery Rate",
implicit = "Focus: 10% increased Cooldown Recovery Rate\nSceptre: Allies in your Presence have 8% increased Cast Speed",
req = { },
}
itemBases["Cat Talisman"] = {
type = "Talisman",
tags = { vivid_talisman = true, talisman = true, default = true, },
implicitModTypes = { },
implicit = "Gloves: 15% increased Accuracy Rating",
implicit = "Gloves: 15% increased Accuracy Rating\nSceptre: Allies in your Presence have 14% increased Critical Hit Chance",
req = { },
}
itemBases["Wolf Talisman"] = {
type = "Talisman",
tags = { vivid_talisman = true, talisman = true, default = true, },
implicitModTypes = { },
implicit = "Gloves: 10% increased Magnitude of Bleeding you inflict",
implicit = "Gloves: 10% increased Magnitude of Bleeding you inflict\nSceptre: Allies in your Presence have 14% increased Critical Damage Bonus",
req = { },
}
itemBases["Stag Talisman"] = {
type = "Talisman",
tags = { vivid_talisman = true, talisman = true, default = true, },
implicitModTypes = { },
implicit = "Helmet: 50% increased Thorns Critical Hit Chance",
implicit = "Helmet: 50% increased Thorns Critical Hit Chance\nSceptre: Allies in your Presence deal 1 to 40 added Attack Lightning Damage",
req = { },
}
itemBases["Boar Talisman"] = {
type = "Talisman",
tags = { wild_talisman = true, talisman = true, default = true, },
implicitModTypes = { },
implicit = "Gloves: Gain 1 Rage on Melee Hit",
implicit = "Gloves: Gain 1 Rage on Melee Hit\nSceptre: Allies in your Presence Regenerate 8 Life per second",
req = { },
}
itemBases["Bear Talisman"] = {
type = "Talisman",
tags = { wild_talisman = true, talisman = true, default = true, },
implicitModTypes = { },
implicit = "Helmet: 8% increased Area of Effect",
implicit = "Helmet: 8% increased Area of Effect\nSceptre: Allies in your Presence deal 12 to 18 added Attack Physical Damage",
req = { },
}
itemBases["Ox Talisman"] = {
type = "Talisman",
tags = { wild_talisman = true, talisman = true, default = true, },
implicitModTypes = { },
implicit = "Shield: 10% increased Block chance",
implicit = "Shield: 10% increased Block chance\nSceptre: Allies in your Presence have +8% to all Elemental Resistances",
req = { },
}
itemBases["Rabbit Talisman"] = {
type = "Talisman",
tags = { sacred_talisman = true, talisman = true, default = true, },
implicitModTypes = { },
implicit = "Body Armour: 8% increased Rarity of Items found",
implicit = "Body Armour: 8% increased Rarity of Items found\nSceptre: 10% increased Spirit",
req = { },
}
itemBases["Fox Talisman"] = {
type = "Talisman",
tags = { sacred_talisman = true, talisman = true, default = true, },
implicitModTypes = { },
implicit = "Body Armour: +2% to Quality of all Skills",
implicit = "Body Armour: +2% to Quality of all Skills\nSceptre: 30% increased Presence Area of Effect",
req = { },
}
Loading