@@ -850,8 +850,8 @@ function ItemClass:ParseRaw(raw, rarity, highQuality)
850850 gameModeStage = " IMPLICIT"
851851 end
852852 local catalystScalar = 1
853- if line :match (" %- Unscalable Value$" ) then
854- line = line :gsub (" %- Unscalable Value$" , " " )
853+ if line :match (" %- Unscalable Value$" ) or line : match ( " — Unscalable Value$ " ) then
854+ line = line :gsub (" %- Unscalable Value$" , " " ): gsub ( " — Unscalable Value$ " , " " )
855855 modLine .unscalable = true
856856 else
857857 catalystScalar = getCatalystScalar (self .catalyst , modLine , self .catalystQuality )
@@ -1138,19 +1138,45 @@ function ItemClass:ParseRaw(raw, rarity, highQuality)
11381138 table.sort (runes , function (a , b ) return compareRuneValueSets (a .values , b .values ) end )
11391139 end
11401140
1141+ local gameSocketedRuneEffectModifier = 0
1142+ if mode == " GAME" and shouldFixRunesOnItem then
1143+ for _ , modLines in ipairs ({ self .enchantModLines , self .implicitModLines , self .explicitModLines }) do
1144+ for _ , effectModLine in ipairs (modLines ) do
1145+ for _ , mod in ipairs (effectModLine .modList or { }) do
1146+ if mod .name == " SocketedRuneEffect" and mod .type == " INC" then
1147+ gameSocketedRuneEffectModifier = gameSocketedRuneEffectModifier + mod .value / 100
1148+ end
1149+ end
1150+ end
1151+ end
1152+ end
1153+
11411154 local remainingRunes = self .itemSocketCount
11421155 for i , modLine in ipairs (self .runeModLines ) do
11431156 local strippedModLine , targetValues = getRuneLineParts (modLine .line )
11441157 local groupedRunes = statGroupedRunes [strippedModLine ]
11451158 if groupedRunes and not modLine .bonded then -- found the rune category with the relevant stat.
1146- local result , numRunes = findRuneCombination (groupedRunes , targetValues , remainingRunes )
1159+ local result , numRunes
1160+ local socketedRuneEffectAlreadyApplied
1161+ if gameSocketedRuneEffectModifier ~= 0 then
1162+ local unscaledTargetValues = { }
1163+ for valueIndex , value in ipairs (targetValues ) do
1164+ unscaledTargetValues [valueIndex ] = value / (1 + gameSocketedRuneEffectModifier )
1165+ end
1166+ result , numRunes = findRuneCombination (groupedRunes , unscaledTargetValues , remainingRunes )
1167+ socketedRuneEffectAlreadyApplied = result ~= nil
1168+ end
1169+ if not result then
1170+ result , numRunes = findRuneCombination (groupedRunes , targetValues , remainingRunes )
1171+ end
11471172
11481173 if result then -- we have found a valid combo for that rune category
11491174 remainingRunes = remainingRunes - numRunes
11501175 -- this code should probably be refactored to based off stored self.runes rather than the recomputed amounts off the runeModLines this
11511176 -- is too avoid having to run the relatively expensive recomputation every time the item is parsed even if we know the runes on the item already.
11521177 modLine .augmentType = groupedRunes [1 ].type
11531178 modLine .runeCount = numRunes
1179+ modLine .socketedRuneEffectAlreadyApplied = socketedRuneEffectAlreadyApplied
11541180
11551181 if shouldFixRunesOnItem then
11561182 for index , rune in ipairs (groupedRunes ) do
@@ -2041,7 +2067,7 @@ function ItemClass:BuildModList()
20412067 for _ , modLine in ipairs (self .runeModLines ) do
20422068 local effectModifier = modLine .augmentType == " SoulCore" and self .socketedSoulCoreEffectModifier
20432069 or modLine .augmentType == " Rune" and self .socketedRuneEffectModifier
2044- if effectModifier and effectModifier ~= 0 and self :CheckModLineVariant (modLine ) and not modLine .extra then
2070+ if effectModifier and effectModifier ~= 0 and self :CheckModLineVariant (modLine ) and not modLine .extra and not modLine . socketedRuneEffectAlreadyApplied then
20452071 for _ , mod in ipairs (modLine .modList ) do
20462072 baseList :ScaleAddMod (mod , effectModifier )
20472073 end
0 commit comments