Commit graph

2 commits

Author SHA1 Message Date
Kelsi
3f65e63ca1 feat(editor): add WHLD JSON round-trip (--export/--import-whld-json)
Closes the editing loop on the instance-lockout catalog: dump a
.whld to JSON, hand-edit raidLockoutKind / resetIntervalMs /
maxBossKillsPerLockout / raidGroupSize / bonusRolls (e.g. switch
ICC 25-Heroic from Weekly to SemiWeekly for a faster server,
raise Wintergrasp's reset from 2.5h to 3h, mark a custom
heroic+ tier with bonus rolls), re-import to a byte-identical
binary.

raidLockoutKind dual-encoded: int 0..3 OR human-readable name
("daily" / "weekly" / "semi-weekly" / "custom"). All other
fields are scalar uint32/uint8 so no dual encoding needed.

Verified byte-identical round-trip on all three presets
(raid / dungeon / event). The event preset's mixed kinds (2
Daily + 1 Custom 2.5h) round-trip exactly, confirming that the
Custom kind's arbitrary intervalMs preserves through the JSON
serialization. CLI flag count 1067 -> 1069.
2026-05-09 23:54:26 -07:00
Kelsi
321c2610d0 feat(editor): add WHLD (Instance Lockout Schedule) open catalog format
Open replacement for the engine-side instance reset timer logic
plus the per-map InstanceTemplate.dbc reset fields. Defines how
often each (map × difficulty) combination resets its lockout,
how many boss kills each character can claim per lockout window,
and the number of bonus rolls available (Cataclysm+ stub for
forward compatibility).

One entry per (map × difficulty × group size). Icecrown Citadel
10-Normal weekly, ICC 25-Normal weekly, ICC 10-Heroic weekly,
and ICC 25-Heroic weekly are four separate entries with the same
mapId but different difficultyId and resetIntervalMs.

Cross-references back to WMS (mapId), WCDF (difficultyId), and
forward to WBOS — the encounters bound to one lockout are the
WBOS entries whose (mapId, difficultyId) pair matches.

Four lockout kinds capture the canonical reset cadences:
  - Daily (24h, 86400000ms) — heroic dungeons, daily quests
  - Weekly (7d, 604800000ms) — raid lockouts
  - SemiWeekly (3.5d, 302400000ms) — Cata+ split lockouts
  - Custom (arbitrary intervalMs) — Wintergrasp 2.5h, holiday
    events with non-standard cadence

nextResetMs(lockoutId, currentMs) is the engine helper that
returns the next reset wall-clock millis after a given current
time, rounded up to the nearest interval boundary. The engine
overrides the epoch with its configured server reset time
(typically Tuesday 8:00am server-local), but the catalog
provides the interval shape.

The info renderer pretty-prints intervals: 86400000ms reads as
"1d", 9000000ms as "150m", which matches how server admins
think about reset cadences.

Three preset emitters: --gen-hld (4 ICC raid weekly lockouts),
--gen-hld-dungeon (4 5-man heroic daily lockouts),
--gen-hld-event (3 world-event lockouts including Wintergrasp's
canonical Custom 2.5h interval).

Validation enforces id+name+kind+resetIntervalMs presence, no
duplicate ids; warns on non-standard raidGroupSize, kind/interval
mismatches (Daily kind without 24h interval, Weekly kind without
7d interval), and 0 boss kill cap (instance grants no
lockout-bound progress, every visit is fresh).

Wired through the cross-format table; WHLD appears in all 18
cross-format utilities. Format count 91 -> 92; CLI flag count
1062 -> 1067.
2026-05-09 23:51:49 -07:00