Skip to content
Open
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
29 changes: 27 additions & 2 deletions src/Classes/Item.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1545,7 +1545,7 @@ end
-- Rebuild rune modifiers using the item's runes
function ItemClass:UpdateRunes()
wipeTable(self.runeModLines)
local getModRunesForTypes = function(runeName, baseType, specificType)
local getModRunesForTypes = function(runeName, baseType, specificType, alsoAsSoulCoreTypes)
local rune = data.itemMods.Runes[runeName]
local gatheredRuneMods = { }
if rune then
Expand All @@ -1559,10 +1559,35 @@ function ItemClass:UpdateRunes()
t_insert(gatheredRuneMods, rune[specificType])
-- end
end
for alsoAsType, _ in pairs(alsoAsSoulCoreTypes) do
if rune[alsoAsType] and rune[alsoAsType].type == "SoulCore" then
-- for _, mod in pairs(rune[alsoAsType]) do
t_insert(gatheredRuneMods, rune[alsoAsType])
-- end
end
end
end
return gatheredRuneMods
end

-- baseModList may not be populated at the time this function is called
local alsoAsSoulCoreTypes = { }
for _, modLines in ipairs({ self.enchantModLines, self.implicitModLines, self.explicitModLines }) do
for _, effectModLine in ipairs(modLines) do
for _, mod in ipairs(effectModLine.modList or { }) do
if mod.name == "SocketSoulCoresAlsoAsBoots" and mod.type == "FLAG" and mod.value then
alsoAsSoulCoreTypes["boots"] = true
elseif mod.name == "SocketSoulCoresAlsoAsGloves" and mod.type == "FLAG" and mod.value then
alsoAsSoulCoreTypes["gloves"] = true
elseif mod.name == "SocketSoulCoresAlsoAsHelmet" and mod.type == "FLAG" and mod.value then
alsoAsSoulCoreTypes["helmet"] = true
elseif mod.name == "SocketSoulCoresAlsoAsShield" and mod.type == "FLAG" and mod.value then
alsoAsSoulCoreTypes["shield"] = true
end
end
end
end

local statOrder = {}
for i = 1, self.itemSocketCount do
local name = self.runes[i]
Expand All @@ -1574,7 +1599,7 @@ function ItemClass:UpdateRunes()
(subType == "warstaff" and "quarterstaff") or
(itemType == "shield" and subType == "evasion" and "buckler") or
itemType
local gatheredMods = getModRunesForTypes(name, baseType, specificType)
local gatheredMods = getModRunesForTypes(name, baseType, specificType, alsoAsSoulCoreTypes)
for _, mod in ipairs(gatheredMods) do
for i, modLine in ipairs(mod) do
local order = mod.statOrder[i]
Expand Down
18 changes: 13 additions & 5 deletions src/Classes/ItemsTab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ holding Shift will put it in the second.]])
self.displayItem:BuildAndParseRaw()
self:UpdateDisplayItemTooltip()
self:UpdateDisplayItemRangeLines()
self:UpdateRuneControls()
end)
self.controls.displayItemVariant.maxDroppedWidth = 1000
self.controls.displayItemVariant.shown = function()
Expand Down Expand Up @@ -1929,17 +1930,24 @@ end)
function ItemsTabClass:GetValidRunesForItem(item)
local runes = { }
local socketedItemType
local subType = item.base.subType and item.base.subType:lower()
local itemType = item.base.type:lower()
local alsoAsSoulCoreTypes = { }
if item.baseModList then
if item.baseModList:Flag(nil, "SocketedSoulCoresOnly") then
socketedItemType = "SoulCore"
elseif item.baseModList:Flag(nil, "SocketedRunesOnly") then
socketedItemType = "Rune"
end
alsoAsSoulCoreTypes["boots"] = item.baseModList:Flag(nil, "SocketSoulCoresAlsoAsBoots")
alsoAsSoulCoreTypes["gloves"] = item.baseModList:Flag(nil, "SocketSoulCoresAlsoAsGloves")
alsoAsSoulCoreTypes["helmet"] = item.baseModList:Flag(nil, "SocketSoulCoresAlsoAsHelmet")
alsoAsSoulCoreTypes["shield"] = item.baseModList:Flag(nil, "SocketSoulCoresAlsoAsShield")
end
for _, rune in pairs(runeModLines) do
local subType = item.base.subType and item.base.subType:lower()
local itemType = item.base.type:lower()
local function isRuneValidForSlot(runeSlot)
local function isRuneValidForSlot(rune)
local runeSlot = rune.slot
local runeType = rune.type
if runeSlot == "None" then
return true
elseif runeSlot == "quarterstaff" then
Expand All @@ -1953,10 +1961,10 @@ function ItemsTabClass:GetValidRunesForItem(item)
elseif runeSlot == "caster" then
return item.base.tags.wand or item.base.tags.staff or item.base.tags.sceptre
else
return itemType == runeSlot and not (subType == "warstaff")
return (itemType == runeSlot and not (subType == "warstaff")) or (alsoAsSoulCoreTypes[runeSlot] and runeType == "SoulCore")
end
end
if isRuneValidForSlot(rune.slot) then
if isRuneValidForSlot(rune) then
if rune.slot == "None" or not socketedItemType or rune.type == socketedItemType then
table.insert(runes, rune)
end
Expand Down
12 changes: 4 additions & 8 deletions src/Data/ModCache.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6804,14 +6804,10 @@ c["This item gains bonuses from Socketed Items as though it was a Body Armour Th
c["This item gains bonuses from Socketed Items as though it was a Helmet"]={nil,"This item gains bonuses from Socketed Items as though it was a Helmet "}
c["This item gains bonuses from Socketed Items as though it was a Helmet This item gains bonuses from Socketed Items as though it was a Shield"]={nil,"This item gains bonuses from Socketed Items as though it was a Helmet This item gains bonuses from Socketed Items as though it was a Shield "}
c["This item gains bonuses from Socketed Items as though it was a Shield"]={nil,"This item gains bonuses from Socketed Items as though it was a Shield "}
c["This item gains bonuses from Socketed Soul Cores as though it was also Boots"]={nil,"This item gains bonuses from Socketed Soul Cores as though it was also Boots "}
c["This item gains bonuses from Socketed Soul Cores as though it was also Boots This item gains bonuses from Socketed Soul Cores as though it was also Gloves"]={nil,"This item gains bonuses from Socketed Soul Cores as though it was also Boots This item gains bonuses from Socketed Soul Cores as though it was also Gloves "}
c["This item gains bonuses from Socketed Soul Cores as though it was also Gloves"]={nil,"This item gains bonuses from Socketed Soul Cores as though it was also Gloves "}
c["This item gains bonuses from Socketed Soul Cores as though it was also Gloves This item gains bonuses from Socketed Soul Cores as though it was also a Helmet"]={nil,"This item gains bonuses from Socketed Soul Cores as though it was also Gloves This item gains bonuses from Socketed Soul Cores as though it was also a Helmet "}
c["This item gains bonuses from Socketed Soul Cores as though it was also a Helmet"]={nil,"This item gains bonuses from Socketed Soul Cores as though it was also a Helmet "}
c["This item gains bonuses from Socketed Soul Cores as though it was also a Helmet This item gains bonuses from Socketed Soul Cores as though it was also a Shield"]={nil,"This item gains bonuses from Socketed Soul Cores as though it was also a Helmet This item gains bonuses from Socketed Soul Cores as though it was also a Shield "}
c["This item gains bonuses from Socketed Soul Cores as though it was also a Shield"]={nil,"This item gains bonuses from Socketed Soul Cores as though it was also a Shield "}
c["This item gains bonuses from Socketed Soul Cores as though it was also a Shield Has no Attribute Requirements"]={nil,"This item gains bonuses from Socketed Soul Cores as though it was also a Shield Has no Attribute Requirements "}
c["This item gains bonuses from Socketed Soul Cores as though it was also Boots"]={{[1]={flags=0,keywordFlags=0,name="SocketSoulCoresAlsoAsBoots",type="FLAG",value=true}},nil}
c["This item gains bonuses from Socketed Soul Cores as though it was also Gloves"]={{[1]={flags=0,keywordFlags=0,name="SocketSoulCoresAlsoAsGloves",type="FLAG",value=true}},nil}
c["This item gains bonuses from Socketed Soul Cores as though it was also a Helmet"]={{[1]={flags=0,keywordFlags=0,name="SocketSoulCoresAlsoAsHelmet",type="FLAG",value=true}},nil}
c["This item gains bonuses from Socketed Soul Cores as though it was also a Shield"]={{[1]={flags=0,keywordFlags=0,name="SocketSoulCoresAlsoAsShield",type="FLAG",value=true}},nil}
c["Thorns Damage has 25% chance to ignore Enemy Armour"]={{[1]={flags=32,keywordFlags=0,name="ChanceToIgnoreEnemyArmour",type="BASE",value=25}},nil}
c["Thorns Damage has 50% chance to ignore Enemy Armour"]={{[1]={flags=32,keywordFlags=0,name="ChanceToIgnoreEnemyArmour",type="BASE",value=50}},nil}
c["Thorns can Retaliate against all Hits"]={nil,"Thorns can Retaliate against all Hits "}
Expand Down
4 changes: 4 additions & 0 deletions src/Modules/ModParser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3436,6 +3436,10 @@ local specialModList = {
-- Handled in Item.lua
} end,
["only soul cores can be socketed in this item"] = { flag("SocketedSoulCoresOnly") },
["this item gains bonuses from socketed soul cores as though it was also boots"] = { flag("SocketSoulCoresAlsoAsBoots") },
["this item gains bonuses from socketed soul cores as though it was also gloves"] = { flag("SocketSoulCoresAlsoAsGloves") },
["this item gains bonuses from socketed soul cores as though it was also a helmet"] = { flag("SocketSoulCoresAlsoAsHelmet") },
["this item gains bonuses from socketed soul cores as though it was also a shield"] = { flag("SocketSoulCoresAlsoAsShield") },
["only runes can be socketed in this item"] = { flag("SocketedRunesOnly") },
["has (%d+) sockets?"] = function(num) return { mod("SocketCount", "BASE", num) } end,
["no physical damage"] = { mod("WeaponData", "LIST", { key = "PhysicalMin" }), mod("WeaponData", "LIST", { key = "PhysicalMax" }), mod("WeaponData", "LIST", { key = "PhysicalDPS" }) },
Expand Down