Skip to content

Commit ff5eb7e

Browse files
EtherealCarnivoreWires77PJacekLocalIdentity
authored
Port unique updater scripts from PoB2 (#9480)
* Port unique updater scripts from PoB2 Port the unique item updater scripts from PathOfBuilding-PoE2 (PRs #54, #65, #175) and fix multiple bugs for PoE1 compatibility. Scripts added: - uTextToMods.lua: converts unique item text to mod IDs (run when adding new uniques) - uModsToText.lua: converts mod IDs back to text with fresh GGPK data (run when game data updates) Changes to existing files: - mods.lua: add ModItemExclusive.lua and ModTextMap.lua generation - statdesc.lua: handle '!' negation limits and ranges starting at 0 Bug fixes over the original PoE2 scripts: - Fix uModsToText.lua not flushing mods for last item in each file - Fix mod ID regex misidentifying base type names containing hyphens (e.g. "Two-Point Arrow Quiver") as legacy mod ranges - Fix unresolved text lines losing position among ordered mods - Fix nil access on statOrder when processing legacy-only mods - Fix uTextToMods.lua greedy tag stripping pattern and mod selection - Make usedMods local and move modTextMap load outside loop - Enable all 20 PoE1 item types (original only had axe enabled) Bug fix in Item.lua: - Fix excluded/exclude variable name mismatch creating accidental global - Fix wrong Lua pattern ^%[a ]+ to correct ^[%a ]+ in jewel radius - Fix space indentation to tabs in jewel radius block * Add generated mod data and intermediate export files - ModItemExclusive.lua: unique/exclusive mod data generated by mods.lua - Export/Uniques/ModTextMap.lua: mod text to mod ID mapping - Export/Uniques/*.lua: intermediate mod ID format for all item types * Update unique item data from GGPK export Re-export all unique item text files using the updater scripts with current game data. Updates stat ordering, mod wording, and adds catalyst tags to amulets and rings. * Rename minz/maxz to minZ/maxZ for spellchecking * Make scripts more robust and fix tags for PoE1 * Revert "Update unique item data from GGPK export" This reverts commit b01d5f3. * Update uTextToMods to be much more robust This script now handles sorting mods on preference to remove as much manual mod entry as possible. There are still many caveats with using it, so item types have been commented out for now with the intent to tackle each type one at a time until we are confident in its data. * Small script improvements + axe uniques * Exclude all itemTypes from uTextToMods to prevent accidents * bows * Missed some axe mods * Fix numerical errors after export * Claws * Daggers * Fishing rods, maces * Hopefully final bugfix and rewrite * Staves * Swords * Wands * Body armour, boots, gloves * Jewels * Re-export body, boots, gloves, jewel via uTextToMods + uModsToText * Re-export belt via uTextToMods + uModsToText * Fix spelling for linesBackward * Revert "Re-export belt via uTextToMods + uModsToText" This reverts commit 49ac1b8. * Fix decimal range parsing in uModsToText Pattern was missing dots so mods with values like 0.2 (leech rates etc) would fail to parse and crash describeStats with nil comparison. * Re-export belt via uTextToMods + uModsToText COPIUM * Forgot to commit the staff export * Skip continuation lines after resolving multi-line mods When a mod ID resolves to N lines of text, the export file also has N-1 plain text continuation lines after it. Without skipping those, they'd get output twice (once from the mod resolution, once as unresolved text). * Helmets * Manually fix enemy aura mods for now * Fix multi-line mod handling in export round-trip Rewrote io.linesBackward to read the whole file into memory instead of the old chunk-based approach - the 4KB-chunk reader broke on Windows because text-mode \r\n conversion threw off the seek math, producing garbled lines at chunk boundaries. After resolving a multi-line mod to its ID, strip stale continuation lines from the output. Also handles sibling mods that share the same first line (Dream/Nightmare jewels have 4 mods starting with the same text but different continuations). Reverted the skipLines workaround in uModsToText - it was eating legitimate variant override lines (e.g. GrantShaperSkill_1 variants). Fixed a few ModItemExclusive wording mismatches (Violent Dead recovery rate/speed, unarmed attack/attacks pluralization, DNT tag). * Revert ModItemExclusive.lua changes - generated file, fix in unique files instead * Add ConvertMod to ModStore/ModList/ModDB Like ReplaceMod but matches by oldName instead of the new mod's name, so it can change a mod's identity (e.g. FireMin -> ColdMin) rather than just updating its value. ModDB moves the mod between name buckets. * Revert "Add ConvertMod to ModStore/ModList/ModDB" This reverts commit c1228ca. * Rings * Update export script to support multi-line implicit mods * Tinctures * Flasks * Fix rings * Add missing implicit line on Grattus Signet * Update exporter * Regenerate mods * Jewels * Amulets, haven't checked over the text changes yet * Amulet mod value updates * Export amulets after fix * Belts * Quivers * Update export to handle spaces in mod names * Shields * Body * Boots * Gloves, text to mod * Export gloves text * New Rings * New items, mod ordering and small fixes for weapons * New armor items * Final fixes and updates for jewels, jewellery, and consumables * Fix typo * Re-export exclusive mods * Export ModCache * Fix Seething Fury export The stat description for the mod was rounding it when it should not have been * Fix export of aura mods Mods that grant effects like `Nearby Enemies have 50% increased Fire and Cold Resistances` contain stats that are used in the BuffTemplate for it to apply to enemies We have to remove these stats as they aren't needed on the items * Remove old code for removing BuffTemplate stats The block used to handle the stat removal for the mods that gained an extra stat for the purpose of being using in the buff template * Update ModCache --------- Co-authored-by: Wires77 <Wires77@users.noreply.github.com> Co-authored-by: PJacek <PJacek@users.noreply.github.com> Co-authored-by: LocalIdentity <localidentity2@gmail.com>
1 parent d0e74dd commit ff5eb7e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+39699
-3269
lines changed

src/Classes/Item.lua

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,12 @@ local function getTagBasedModifiers(tagName, itemSlotName)
104104
if data.itemTagSpecial[tagName] and data.itemTagSpecial[tagName][itemSlotName] then
105105
for _, specialMod in ipairs(data.itemTagSpecial[tagName][itemSlotName]) do
106106
if dv:lower():find(specialMod:lower()) then
107-
exclude = true
107+
excluded = true
108108
break
109109
end
110110
end
111111
end
112-
if exclude then
112+
if excluded then
113113
found = true
114114
break
115115
end
@@ -131,12 +131,12 @@ local function getTagBasedModifiers(tagName, itemSlotName)
131131
if data.itemTagSpecial[tagName] and data.itemTagSpecial[tagName][itemSlotName] then
132132
for _, specialMod in ipairs(data.itemTagSpecial[tagName][itemSlotName]) do
133133
if dv:lower():find(specialMod:lower()) then
134-
exclude = true
134+
excluded = true
135135
break
136136
end
137137
end
138138
end
139-
if exclude then
139+
if excluded then
140140
found = true
141141
break
142142
end
@@ -444,16 +444,16 @@ function ItemClass:ParseRaw(raw, rarity, highQuality)
444444
end
445445
end
446446
elseif specName == "Radius" and self.type == "Jewel" then
447-
self.jewelRadiusLabel = specVal:match("^%a+")
448-
if specVal:match("^%a+") == "Variable" then
449-
-- Jewel radius is variable and must be read from it's mods instead after they are parsed
450-
deferJewelRadiusIndexAssignment = true
451-
else
452-
for index, data in pairs(data.jewelRadius) do
453-
if specVal:match("^%a+") == data.label then
454-
self.jewelRadiusIndex = index
455-
break
456-
end
447+
self.jewelRadiusLabel = specVal:match("^[%a ]+")
448+
if specVal:match("^[%a ]+") == "Variable" then
449+
-- Jewel radius is variable and must be read from it's mods instead after they are parsed
450+
deferJewelRadiusIndexAssignment = true
451+
else
452+
for index, data in pairs(data.jewelRadius) do
453+
if specVal:match("^[%a ]+") == data.label then
454+
self.jewelRadiusIndex = index
455+
break
456+
end
457457
end
458458
end
459459
elseif specName == "Limited to" and self.type == "Jewel" then

src/Data/Bases/helmet.lua

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -552,8 +552,8 @@ itemBases["Sorrow Mask"] = {
552552
socketLimit = 4,
553553
tags = { armour = true, default = true, helmet = true, not_for_sale = true, str_dex_armour = true, },
554554
influenceTags = { shaper = "helmet_shaper", elder = "helmet_elder", adjudicator = "helmet_adjudicator", basilisk = "helmet_basilisk", crusader = "helmet_crusader", eyrie = "helmet_eyrie", cleansing = "helmet_cleansing", tangle = "helmet_tangle" },
555-
implicit = "+2% to maximum Chaos Resistance\n-15% additional Physical Damage Reduction\nYou are Crushed",
556-
implicitModTypes = { { }, { }, { }, },
555+
implicit = "+2% to maximum Chaos Resistance\nYou are Crushed",
556+
implicitModTypes = { { }, { }, },
557557
armour = { ArmourBaseMin = 42, ArmourBaseMax = 49, EvasionBaseMin = 42, EvasionBaseMax = 49, },
558558
req = { level = 15, str = 20, dex = 20, },
559559
}
@@ -563,8 +563,8 @@ itemBases["Atonement Mask"] = {
563563
socketLimit = 4,
564564
tags = { armour = true, default = true, helmet = true, not_for_sale = true, str_dex_armour = true, },
565565
influenceTags = { shaper = "helmet_shaper", elder = "helmet_elder", adjudicator = "helmet_adjudicator", basilisk = "helmet_basilisk", crusader = "helmet_crusader", eyrie = "helmet_eyrie", cleansing = "helmet_cleansing", tangle = "helmet_tangle" },
566-
implicit = "+3% to maximum Chaos Resistance\n-15% additional Physical Damage Reduction\nYou are Crushed",
567-
implicitModTypes = { { }, { }, { }, },
566+
implicit = "+3% to maximum Chaos Resistance\nYou are Crushed",
567+
implicitModTypes = { { }, { }, },
568568
armour = { ArmourBaseMin = 122, ArmourBaseMax = 140, EvasionBaseMin = 122, EvasionBaseMax = 140, },
569569
req = { level = 45, str = 51, dex = 51, },
570570
}
@@ -574,8 +574,8 @@ itemBases["Penitent Mask"] = {
574574
socketLimit = 4,
575575
tags = { armour = true, default = true, helmet = true, not_for_sale = true, str_dex_armour = true, },
576576
influenceTags = { shaper = "helmet_shaper", elder = "helmet_elder", adjudicator = "helmet_adjudicator", basilisk = "helmet_basilisk", crusader = "helmet_crusader", eyrie = "helmet_eyrie", cleansing = "helmet_cleansing", tangle = "helmet_tangle" },
577-
implicit = "+4% to maximum Chaos Resistance\n-15% additional Physical Damage Reduction\nYou are Crushed",
578-
implicitModTypes = { { }, { }, { }, },
577+
implicit = "+4% to maximum Chaos Resistance\nYou are Crushed",
578+
implicitModTypes = { { }, { }, },
579579
armour = { ArmourBaseMin = 185, ArmourBaseMax = 212, EvasionBaseMin = 185, EvasionBaseMax = 212, },
580580
req = { level = 75, str = 79, dex = 79, },
581581
}

src/Data/Crucible.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1104,7 +1104,7 @@ return {
11041104
["WeaponTreeSpellCriticalStrikeChance2h2"] = { type = "Spawn", tier = 2, "+0.9% to Spell Critical Strike Chance", statOrder = { 10125 }, level = 30, group = "WeaponTreeAdditionalCriticalStrikeChanceWithSpells", nodeType = "Regular", nodeLocation = { 2 }, weightKey = { "one_hand_weapon", "caster_unique_weapon", "attack_staff", "staff", "default", }, weightVal = { 0, 1000, 0, 1000, 0 }, modTags = { }, },
11051105
["WeaponTreeSpellCriticalStrikeChance2h3"] = { type = "Spawn", tier = 3, "+1% to Spell Critical Strike Chance", statOrder = { 10125 }, level = 60, group = "WeaponTreeAdditionalCriticalStrikeChanceWithSpells", nodeType = "Regular", nodeLocation = { 2 }, weightKey = { "one_hand_weapon", "caster_unique_weapon", "attack_staff", "staff", "default", }, weightVal = { 0, 1000, 0, 1000, 0 }, modTags = { }, },
11061106
["WeaponTreeSpellCriticalStrikeChanceReducedSpellCriticalStrikeMultiplier1"] = { type = "Spawn", tier = 1, "-30% to Critical Strike Multiplier for Spell Damage", "+1% to Spell Critical Strike Chance", statOrder = { 1492, 10125 }, level = 1, group = "WeaponTreeAdditionalCriticalStrikeChanceWithSpellsAndSpellCriticalStrikeMultiplier", nodeType = "Regular", nodeLocation = { 2 }, weightKey = { "two_hand_weapon", "caster_unique_weapon", "attack_dagger", "wand", "sceptre", "dagger", "default", }, weightVal = { 0, 500, 0, 500, 500, 500, 0 }, modTags = { }, },
1107-
["WeaponTreeSpellCriticalStrikeChanceReducedSpellCriticalStrikeMultiplier2"] = { type = "Spawn", tier = 2, "-30% to Critical Strike Multiplier for Spell Damage", "+1.3% to Spell Critical Strike Chance", statOrder = { 1492, 10125 }, level = 30, group = "WeaponTreeAdditionalCriticalStrikeChanceWithSpellsAndSpellCriticalStrikeMultiplier", nodeType = "Regular", nodeLocation = { 2 }, weightKey = { "two_hand_weapon", "caster_unique_weapon", "attack_dagger", "wand", "sceptre", "dagger", "default", }, weightVal = { 0, 500, 0, 500, 500, 500, 0 }, modTags = { }, },
1107+
["WeaponTreeSpellCriticalStrikeChanceReducedSpellCriticalStrikeMultiplier2"] = { type = "Spawn", tier = 2, "-30% to Critical Strike Multiplier for Spell Damage", "+1.25% to Spell Critical Strike Chance", statOrder = { 1492, 10125 }, level = 30, group = "WeaponTreeAdditionalCriticalStrikeChanceWithSpellsAndSpellCriticalStrikeMultiplier", nodeType = "Regular", nodeLocation = { 2 }, weightKey = { "two_hand_weapon", "caster_unique_weapon", "attack_dagger", "wand", "sceptre", "dagger", "default", }, weightVal = { 0, 500, 0, 500, 500, 500, 0 }, modTags = { }, },
11081108
["WeaponTreeSpellCriticalStrikeChanceReducedSpellCriticalStrikeMultiplier3"] = { type = "Spawn", tier = 3, "-30% to Critical Strike Multiplier for Spell Damage", "+1.5% to Spell Critical Strike Chance", statOrder = { 1492, 10125 }, level = 60, group = "WeaponTreeAdditionalCriticalStrikeChanceWithSpellsAndSpellCriticalStrikeMultiplier", nodeType = "Regular", nodeLocation = { 2 }, weightKey = { "two_hand_weapon", "caster_unique_weapon", "attack_dagger", "wand", "sceptre", "dagger", "default", }, weightVal = { 0, 500, 0, 500, 500, 500, 0 }, modTags = { }, },
11091109
["WeaponTreeSpellCriticalStrikeChance2hReducedSpellCriticalStrikeMultiplier1"] = { type = "Spawn", tier = 1, "-60% to Critical Strike Multiplier for Spell Damage", "+1.8% to Spell Critical Strike Chance", statOrder = { 1492, 10125 }, level = 1, group = "WeaponTreeAdditionalCriticalStrikeChanceWithSpellsAndSpellCriticalStrikeMultiplier", nodeType = "Regular", nodeLocation = { 2 }, weightKey = { "one_hand_weapon", "caster_unique_weapon", "attack_staff", "staff", "default", }, weightVal = { 0, 500, 0, 500, 0 }, modTags = { }, },
11101110
["WeaponTreeSpellCriticalStrikeChance2hReducedSpellCriticalStrikeMultiplier2"] = { type = "Spawn", tier = 2, "-60% to Critical Strike Multiplier for Spell Damage", "+2.2% to Spell Critical Strike Chance", statOrder = { 1492, 10125 }, level = 30, group = "WeaponTreeAdditionalCriticalStrikeChanceWithSpellsAndSpellCriticalStrikeMultiplier", nodeType = "Regular", nodeLocation = { 2 }, weightKey = { "one_hand_weapon", "caster_unique_weapon", "attack_staff", "staff", "default", }, weightVal = { 0, 500, 0, 500, 0 }, modTags = { }, },

0 commit comments

Comments
 (0)