Commit graph

2 commits

Author SHA1 Message Date
Kelsi
75c254925f feat(editor): add WCDF JSON round-trip (--export/--import-wcdf-json)
Closes the editing loop on the creature-difficulty routing
catalog: dump a .wcdf to JSON, hand-edit baseCreatureId / 4
variant ids / spawnGroupKind (e.g. swap a Lich King variant from
heroic25Id 39168 to a custom encore template, change a 5-man
boss from Boss to MiniBoss kind, route a new world boss through
the WorldBoss kind), re-import to a byte-identical binary.

The exporter emits both spawnGroupKind (int 0..5) and the human-
readable spawnGroupKindName ("boss" / "mini-boss" / "rare-elite"
/ "trash" / "add" / "world-boss"); the importer accepts either
form.

Verified byte-identical round-trip on all three presets
(starter / wotlk / fiveman). CLI flag count 941 -> 943.
2026-05-09 22:11:16 -07:00
Kelsi
fa8719009b feat(editor): add WCDF (Creature Difficulty) open catalog format
Open replacement for Blizzard's CreatureDifficulty.dbc. Maps a
base creature entry to its difficulty variants:
Normal-10 / Normal-25 / Heroic-10 / Heroic-25 in WotLK raid
format. Each variant is itself a separate WCRT creature entry
with its own stats, abilities, and loot.

When a 25-man party engages an instance, the engine looks up the
encounter base creature's difficultyId, reads the normal25Id
field, and spawns that variant instead. This is how Lord
Marrowgar in 25-Heroic ICC has 30M HP and hits for 80k while the
same encounter in 10-Normal has 5M HP and hits for 25k — same
spawn point, different WCRT entries.

5-man dungeons typically use only normal10Id + heroic10Id (the
25-man fields stay 0 — engine falls through to the 10-man
variant when 25-man is queried). World bosses don't scale at
all (all 4 variant fields stay 0, engine falls back to the base
entry).

Cross-references back to WCRT — every non-zero variant id field
points at a WCRT.creatureId entry; the base creature itself
lives in WCRT too.

Three preset emitters: --gen-cdf (4 example bosses with full
4-variant routing), --gen-cdf-wotlk-raid (4 ICC-style raid
bosses Marrowgar/Deathwhisper/Saurfang/LK with all 4 difficulty
variants), --gen-cdf-fiveman (4 5-man dungeon bosses with only
Normal+Heroic 10-man set). resolveVariant(id, mode) is the
engine helper.

Validation enforces id+name+baseCreatureId presence,
spawnGroupKind 0..5, no duplicate ids; warns on:
  - WorldBoss kind with non-zero variant ids (world bosses don't scale)
  - duplicate baseCreatureId across routes (only first honored)
  - all-self-reference non-WorldBoss (creature doesn't actually scale)
  - Boss with n25 but not n10 (raid sequencing typo — n10 always
    comes with n25)

Wired through the cross-format table; WCDF appears automatically
in all 11 cross-format utilities. Format count 74 -> 75; CLI flag
count 936 -> 941.
2026-05-09 22:10:09 -07:00