feat(editor): add WLOT JSON round-trip authoring workflow

Closes the WLOT open-format loop with --export-wlot-json /
--import-wlot-json, mirroring the WOL/WOW/WOMX/WSND/WSPN/WIT
JSON pairs. All 7 binary formats added since WOL now have
full JSON round-trip authoring.

Each loot table round-trips:
  • table-level: creatureId, flags (int + flagsList strings),
                  dropCount, money min/max (copper)
  • per-drop:    itemId, chancePercent (float),
                  minQty / maxQty, flags (int + flagsList)

Both flag fields emit dual int + named string-array forms.
A hand-author can write ["quest", "always"] instead of
having to remember that QuestRequired|AlwaysDrop = 5.

Verified byte-identical round-trip on the boss preset
(6 drops including the QuestRequired+AlwaysDrop combo on
the guaranteed quest item, group-only epic at 5%, mass-loot
trade goods at 90%).

Adds 2 flags (495 documented total now).
This commit is contained in:
Kelsi 2026-05-09 15:20:05 -07:00
parent b2b84139aa
commit 24bc52ab11
3 changed files with 174 additions and 0 deletions

View file

@ -891,6 +891,10 @@ void printUsage(const char* argv0) {
std::printf(" Print WLOT loot tables (creatureId / dropCount / money range / per-drop chance + qty + flags)\n");
std::printf(" --validate-wlot <wlot-base> [--json]\n");
std::printf(" Static checks: creatureId>0 + unique, chance in 0..100, minQty<=maxQty, money min<=max\n");
std::printf(" --export-wlot-json <wlot-base> [out.json]\n");
std::printf(" Export binary .wlot to a human-editable JSON sidecar (defaults to <base>.wlot.json)\n");
std::printf(" --import-wlot-json <json-path> [out-base]\n");
std::printf(" Import a .wlot.json sidecar back into binary .wlot (accepts flag int OR flagsList strings)\n");
std::printf(" --gen-creatures <wcrt-base> [name]\n");
std::printf(" Emit .wcrt starter creature template: 1 friendly innkeeper (vendor + repair flags)\n");
std::printf(" --gen-creatures-bandit <wcrt-base> [name]\n");