feat(editor): add WSPR JSON round-trip (--export/--import-wspr-json)

Closes the editing loop on the spell-reagent catalog: dump a
.wspr to JSON, hand-edit reagentKind / spellId / per-slot
itemId+count pairs (e.g. swap a Mage Portal's reagent from Rune
of Portals to a server-custom item, change a Warlock summon to
need 2 Soul Shards instead of 1, add Tier-3 Catalyst entries
for upgraded spell variants), re-import to a byte-identical
binary.

Reagent slot arrays (8 itemIds, 8 counts) are exported as JSON
arrays — easier to read and edit than 16 individual numbered
fields. Importer pads arrays shorter than 8 with zeros and
silently truncates longer arrays, so hand-edited sidecars don't
need to spell out every empty slot.

The exporter emits both reagentKind (int 0..4) and the human-
readable reagentKindName ("standard" / "soul-shard" /
"focused-item" / "catalyst" / "tradeable"); the importer accepts
either form.

Verified byte-identical round-trip on all three presets
(mage / warlock / rez). CLI flag count 979 -> 981.
This commit is contained in:
Kelsi 2026-05-09 22:40:12 -07:00
parent d97f4bf5db
commit 8e85278d89
3 changed files with 171 additions and 0 deletions

View file

@ -1875,6 +1875,10 @@ void printUsage(const char* argv0) {
std::printf(" Print WSPR entries (id / spellId / kind / used slot count / item x count list / name)\n");
std::printf(" --validate-wspr <wspr-base> [--json]\n");
std::printf(" Static checks: id+name+spellId required, reagentKind 0..4, no duplicate ids; warns on slot id/count mismatch, SoulShard kind with non-canonical reagent, FocusedItem kind with no slots, duplicate spellId\n");
std::printf(" --export-wspr-json <wspr-base> [out.json]\n");
std::printf(" Export binary .wspr to a human-editable JSON sidecar (defaults to <base>.wspr.json). Reagent slot arrays exported as JSON arrays\n");
std::printf(" --import-wspr-json <json-path> [out-base]\n");
std::printf(" Import a .wspr.json sidecar back into binary .wspr (accepts reagentKind int OR reagentKindName string; reagent arrays pad with zeros if shorter than 8)\n");
std::printf(" --gen-weather-temperate <wow-base> [zoneName]\n");
std::printf(" Emit .wow weather schedule: clear-dominant + occasional rain + fog (forest / grassland)\n");
std::printf(" --gen-weather-arctic <wow-base> [zoneName]\n");