-
Notifications
You must be signed in to change notification settings - Fork 0
Update terror zone configuration to support new expansion JSON format #63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
c1661fb
bc68775
95f666a
e13b96a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,42 +1,89 @@ | ||
| /** | ||
| * Mapping of terror zone IDs to human-readable names. | ||
| * Based on the desecratedzones.json structure from Diablo II: Resurrected. | ||
| * Based on the desecratedzones.json structure from Diablo II: Resurrected (Reign of the Warlock expansion). | ||
| */ | ||
| export const TERROR_ZONE_NAMES: Record<number, string> = { | ||
| 1: 'Burial Grounds, Crypt, and Mausoleum', | ||
| 2: 'Cathedral and Catacombs', | ||
| 3: 'Cold Plains and Cave', | ||
| 4: 'Dark Wood and Underground Passage', | ||
| 5: 'Blood Moor and Den of Evil', | ||
| 6: 'Jail and Barracks', | ||
| 7: 'Moo Moo Farm', | ||
| 8: 'Stony Field', | ||
| 9: 'Black Marsh and the Hole', | ||
| 10: 'Forgotten Tower', | ||
| 11: 'Pit', | ||
| 12: 'Tristram', | ||
| 13: 'Lut Gholein Sewers', | ||
| 14: 'Stony Tomb and Rocky Waste', | ||
| 15: 'Dry Hills and Halls of the Dead', | ||
| 16: 'Far Oasis', | ||
| 17: 'Lost City, Valley of Snakes, and Claw Viper temple', | ||
| 18: 'Ancient Tunnels', | ||
| 19: "Tal Rasha's Tombs", | ||
| 20: 'Arcane Sanctuary', | ||
| 21: 'Spider Forest and Spider Cavern', | ||
| 22: 'Great Marsh', | ||
| 23: 'Flayer Jungle and Flayer Dungeon', | ||
| 24: 'Kurast Bazaar and Temples', | ||
| 25: 'Travincal', | ||
| 26: 'Durance of Hate', | ||
| 27: 'Outer Steppes and Plains of Despair', | ||
| 28: 'City of the Damned and River of Flame', | ||
| 29: 'Chaos Sanctuary', | ||
| 30: 'Bloody Foothills, Frigid Highlands, and Abbadon', | ||
| 31: 'Arreat Plateau and Pit of Acheron', | ||
| 32: 'Crystalline Passage and Frozen River', | ||
| 33: "Nihlathak's Temple and Halls", | ||
| 34: 'Glacial Trail and Drifter Cavern', | ||
| 35: "Ancient's Way and Icy Cellar", | ||
| 36: 'Worldstone Keep, Throne of Destruction, and Worldstone Chamber', | ||
| export const TERROR_ZONE_NAMES: Record<string, string> = { | ||
| 'Act1-BurialGrounds': 'Burial Grounds, Crypt, and Mausoleum', | ||
| 'Act1-Catacombs': 'Cathedral and Catacombs', | ||
| 'Act1-ColdPlains': 'Cold Plains and Cave', | ||
| 'Act1-DarkWood': 'Dark Wood and Underground Passage', | ||
| 'Act1-BloodMoor': 'Blood Moor and Den of Evil', | ||
| 'Act1-Jail': 'Jail and Barracks', | ||
| 'Act1-MooMooFarm': 'Moo Moo Farm', | ||
| 'Act1-StonyField': 'Stony Field', | ||
| 'Act1-BlackMarsh': 'Black Marsh and the Hole', | ||
| 'Act1-Tower': 'Forgotten Tower', | ||
| 'Act1-Pit': 'Pit', | ||
| 'Act1-Tristram': 'Tristram', | ||
| 'Act1-Monastery': 'Monastery', | ||
| 'Act2-Sewers': 'Lut Gholein Sewers', | ||
| 'Act2-RockyWaste': 'Rocky Waste', | ||
| 'Act2-DryHills': 'Dry Hills and Halls of the Dead', | ||
| 'Act2-FarOasis': 'Far Oasis', | ||
| 'Act2-LostCity': 'Lost City', | ||
| 'Act2-TalRashas': "Tal Rasha's Tombs", | ||
| 'Act2-ArcaneSanctuary': 'Arcane Sanctuary', | ||
| 'Act3-SpiderForest': 'Spider Forest', | ||
| 'Act3-GreatMarsh': 'Great Marsh', | ||
| 'Act3-FlayerJungle': 'Flayer Jungle', | ||
| 'Act3-Kurast': 'Kurast', | ||
| 'Act3-Travincal': 'Travincal', | ||
| 'Act3-DuranceOfHate': 'Durance of Hate', | ||
| Act4_OuterSteppes: 'Outer Steppes', | ||
| 'Act4-RiverOfFlame': 'River of Flame', | ||
| 'Act4-ChaosSanctuary': 'Chaos Sanctuary', | ||
| 'Act5-BloodyFoothils': 'Bloody Foothills', | ||
| 'Act5-ArreatPlateau': 'Arreat Plateau', | ||
| 'Act5-CrystallinePassage': 'Crystalline Passage', | ||
| 'Act5-Halls': "Nihlathak's Temple and Halls", | ||
| 'Act5-GlacialTrail': 'Glacial Trail', | ||
| 'Act5-AncientsWay': "Ancient's Way", | ||
| 'Act5-FrozenTundra': 'Frozen Tundra', | ||
| 'Act5-WorldstoneKeep': 'Worldstone Keep', | ||
| }; | ||
|
|
||
| /** | ||
| * Mapping from numeric zone indices to string zone IDs. | ||
| * Uses 1-based indexing following the order of zones in desecratedzones.json. | ||
| * Used for converting legacy numeric IDs (1-34) to current string IDs. | ||
| * | ||
| * The game file has 34 zones in its zones array (zones_0 through zones_33, with gaps). | ||
| * Old user configurations used 1-based numbering (Zone 1, Zone 2, ... Zone 34). | ||
| * This mapping preserves that 1-based convention for backward compatibility. | ||
| */ | ||
| export const NUMERIC_TO_STRING_ZONE_ID: Record<number, string> = { | ||
| 1: 'Act1-BurialGrounds', | ||
| 2: 'Act1-Catacombs', | ||
| 3: 'Act1-ColdPlains', | ||
| 4: 'Act1-DarkWood', | ||
| 5: 'Act1-BloodMoor', | ||
| 6: 'Act1-Jail', | ||
| 7: 'Act1-MooMooFarm', | ||
| 8: 'Act1-Tristram', | ||
| 9: 'Act1-Tower', | ||
| 10: 'Act1-Monastery', | ||
| 11: 'Act2-Sewers', | ||
| 12: 'Act2-RockyWaste', | ||
| 13: 'Act2-DryHills', | ||
| 14: 'Act2-FarOasis', | ||
| 15: 'Act2-LostCity', | ||
| 16: 'Act2-TalRashas', | ||
| 17: 'Act2-ArcaneSanctuary', | ||
| 18: 'Act3-SpiderForest', | ||
| 19: 'Act3-GreatMarsh', | ||
| 20: 'Act3-FlayerJungle', | ||
| 21: 'Act3-Kurast', | ||
| 22: 'Act3-Travincal', | ||
| 23: 'Act3-DuranceOfHate', | ||
| 24: 'Act4_OuterSteppes', | ||
| 25: 'Act4-RiverOfFlame', | ||
| 26: 'Act4-ChaosSanctuary', | ||
| 27: 'Act5-BloodyFoothils', | ||
| 28: 'Act5-ArreatPlateau', | ||
| 29: 'Act5-CrystallinePassage', | ||
| 30: 'Act5-Halls', | ||
| 31: 'Act5-GlacialTrail', | ||
| 32: 'Act5-AncientsWay', | ||
| 33: 'Act5-FrozenTundra', | ||
| 34: 'Act5-WorldstoneKeep', | ||
| }; | ||
|
Comment on lines
+86
to
89
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The migration map ends at Useful? React with 👍 / 👎. |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
migrateTerrorZoneConfiginelectron/database/settings.tsdepends onNUMERIC_TO_STRING_ZONE_ID, but this table reassigns legacy ID8toAct1-Tristrameven though prior numeric IDs in this codebase used8for Stony Field (and12for Tristram). That means upgrades with existing numericterrorZoneConfigwill silently disable/enable the wrong zones after migration. The conversion table needs to preserve the old numeric ID semantics, not the new array position.Useful? React with 👍 / 👎.