@@ -425,16 +425,30 @@ function ItemClass:ParseRaw(raw, rarity, highQuality)
425425 fullModName = line :match (" ^{ (.-) }$" )
426426 end
427427 local modName = fullModName :match (" ^.*Modifier \" (.*)\" " )
428- if modName and modName ~= " " then
428+ if modName and modName ~= " " then
429+ self .pendingAffixList = { }
430+ local backupAffixList = { }
429431 for modId , modData in pairs (self .affixes ) do
430- if modData .affix == modName and self :CanHaveMod (modData ) then
431- if modData .type == " Prefix" then
432- self .pendingAffix = { modId = modId , table = self .prefixes }
433- elseif modData .type == " Suffix" then
434- self .pendingAffix = { modId = modId , table = self .suffixes }
432+ if modData .affix == modName then
433+ if self :CanHaveMod (modData ) then
434+ if modData .type == " Prefix" then
435+ t_insert (self .pendingAffixList , { modId = modId , table = self .prefixes })
436+ elseif modData .type == " Suffix" then
437+ t_insert (self .pendingAffixList , { modId = modId , table = self .suffixes })
438+ end
439+ else
440+ -- Conqueror mods can't natively spawn on items, so we'll use those if we don't find a match otherwise
441+ if modData .type == " Prefix" then
442+ t_insert (backupAffixList , { modId = modId , table = self .prefixes })
443+ elseif modData .type == " Suffix" then
444+ t_insert (backupAffixList , { modId = modId , table = self .suffixes })
445+ end
435446 end
436447 end
437448 end
449+ if # self .pendingAffixList == 0 and # backupAffixList > 0 then
450+ self .pendingAffixList = backupAffixList
451+ end
438452 end
439453 local possibleLineFlags = fullModName :match (" (.*)Modifier.*" )
440454 if possibleLineFlags then
@@ -796,7 +810,21 @@ function ItemClass:ParseRaw(raw, rarity, highQuality)
796810 else
797811 catalystScalar = getCatalystScalar (self .catalyst , modLine , self .catalystQuality )
798812 end
799- if self .pendingAffix then
813+ if self .pendingAffixList and # self .pendingAffixList > 0 then
814+ if # self .pendingAffixList > 1 then
815+ -- Probably a conqueror mod since the mod name is the same for all of them
816+ -- Try to match the line against one of the mods there
817+ local valueStrippedLine = line :gsub (" %-?%d+%.?%d*%(" , " (" ):gsub (" %-?%d+%.?%d*" , " #" )
818+ for _ , pendingAffix in ipairs (self .pendingAffixList ) do
819+ local modData = self .affixes [pendingAffix .modId ]
820+ for _ , modDataLine in ipairs (modData ) do
821+ if valueStrippedLine == modDataLine :gsub (" %-?%d+%.?%d*" , " #" ) then
822+ self .pendingAffixList = { pendingAffix }
823+ break
824+ end
825+ end
826+ end
827+ end
800828 local bestPrecisionDelta = 0
801829 local bestPrecisionRange = 0
802830 for value , range in line :gmatch (" (%-?%d+%.?%d*)%((%-?%d+%.?%d*%-%-?%d+%.?%d*)%)" ) do
@@ -809,11 +837,11 @@ function ItemClass:ParseRaw(raw, rarity, highQuality)
809837 bestPrecisionDelta = delta
810838 end
811839 end
812- t_insert (self .pendingAffix .table , {
813- modId = self .pendingAffix .modId ,
840+ t_insert (self .pendingAffixList [ 1 ] .table , {
841+ modId = self .pendingAffixList [ 1 ] .modId ,
814842 range = tonumber (bestPrecisionRange ),
815843 })
816- self .pendingAffix = nil
844+ self .pendingAffixList = {}
817845 else
818846 local bestPrecisionDelta = 0
819847 local bestPrecisionRange = 0
0 commit comments