Commit graph

2 commits

Author SHA1 Message Date
Kelsi
7ecc829c4d feat(editor): add WSCD JSON round-trip (--export/--import-wscd-json)
Closes the editing loop on the spell-cooldown bucket catalog: dump
a .wscd to JSON, hand-edit cooldownMs / bucketKind / category
flags (e.g. retune the global cooldown from 1.5s to 1.0s, mark a
bucket as IgnoresCooldownReduction, add Polymorph variants to the
class family bucket), re-import to a byte-identical binary.

The exporter emits both bucketKind (int 0..4) and the human-
readable bucketKindName ("spell", "item", "class", "global",
"misc"); same dual form for categoryFlags (int bitfield AND
"AffectedByHaste|OnGCDStart" pipe-separated label string). The
importer prefers the int form for categoryFlags when both are
present so unknown flag bits round-trip losslessly, falling back
to the label form for hand-edited sidecars.

Verified byte-identical round-trip on all three presets
(starter / class / items). CLI flag count 912 -> 914.
2026-05-09 21:50:39 -07:00
Kelsi
493db026dd feat(editor): add WSCD (Spell Cooldown Category) open catalog format
Open replacement for SpellCooldown.dbc plus the per-spell
category-cooldown fields in Spell.dbc. Defines the shared-cooldown
buckets that related spells reference: casting one spell triggers
a cooldown on every other spell in the same bucket. Mage Polymorph
variants (Sheep / Pig / Turtle / Cat) all share one bucket so
morphing a target locks all variants at once. Healing potions and
mana potions share the SharedWithItems bucket so consuming one
locks the other.

Distinct from WSDR (which times how long an aura stays on a
target) — WSCD times how long before a spell can be cast again.
The global cooldown (GCD) is itself just one bucket of this kind,
flagged with OnGCDStart so the engine triggers it at cast start
rather than cast finish.

Three preset emitters: --gen-cdb (4 baseline buckets including
GCD), --gen-cdb-class (5 mage-specific class cooldowns including
the Polymorph family), --gen-cdb-items (5 item cooldowns
including the heal/mana potion shared bucket and the 60min
Hearthstone family). Validation enforces id+name presence,
bucketKind 0..4, no duplicate ids, and warns on Global without
OnGCDStart (engine wouldn't trigger on cast start) and Spell
kind with SharedWithItems (contradictory).

categoryFlags is a bitfield (AffectedByHaste / SharedWithItems /
OnGCDStart / IgnoresCooldownReduction); --info-wscd decodes the
bits to label list. Wired through the cross-format table; WSCD
appears automatically in all 9 cross-format utilities. Format
count 70 -> 71; CLI flag count 907 -> 912.
2026-05-09 21:49:13 -07:00