Commit graph

2 commits

Author SHA1 Message Date
Kelsi
2d78dd57a7 feat(editor): add WBAB JSON round-trip (--export/--import-wbab-json)
Dual encoding for both WBAB enums on import:
statBonusKind (int 0..9 OR 255 OR token "stamina" /
"intellect" / "spirit" / "allstats" / "armor" /
"spellpower" / "attackpower" / "critrating" /
"hasterating" / "manaregen" / "other"), and a NEW
"+"-joined bitmask string form for targetTypeMask
("self+party+raid+friendly" parsed by splitting on '+'
then OR-ing the bits). The "+" syntax matches what
targetMaskString emits on info display so the round-
trip uses identical syntax.

Per-bit token form is more useful than raw bitfield
ints for hand-edited JSON — operators can read
"self+raid" and immediately know the buff hits self
plus all raid members without doing 0x05 & flag math.

All 3 presets (mage/druid/raid) byte-identical
roundtrip OK. Token-form import smoke-tested with
spellpower + self+raid+friendly together. CLI flag
count 1139 -> 1141.
2026-05-10 01:15:26 -07:00
Kelsi
abf264abfe feat(editor): add WBAB (Buff & Aura Book) — 102nd open format
Novel replacement for the implicit rank-chain
relationships that vanilla WoW encoded by burying
nextRank/prevRank pointers inside Spell.dbc with no
explicit graph structure. Each WBAB entry is one long-
duration class buff at one specific rank, with explicit
edges to adjacent ranks via previousRankId and
nextRankId fields. The graph-shaped data is novel among
the 100+ catalog set: most catalogs have flat rows; WBAB
is genuinely a graph where rows are nodes and the rank
fields are edges.

Both directions are stored explicitly so the spellbook
UI's "upgrade to next rank" button can traverse without
scanning the full table. Helper methods walkChainBack-
ToRoot() returns the full chain root->tip for the rank-
picker widget; findChainTip() returns the highest rank
for auto-cast logic.

Three preset emitters demonstrating the pattern:
makeMage (Arcane Intellect ranks 1-4 with chain edges),
makeDruid (Mark of the Wild ranks 1-5 with chain edges),
makeRaidMax (6 max-rank standalone raid buffs — one per
buffing class — with no chain edges to show the
standalone case).

Validator catches several rank-chain-specific bugs:
self-referencing edges (entry.next == entry.id would
create a 1-element cycle), missing referenced entries
(next/prev pointing to non-existent ids), and most
importantly back-edge symmetry — if A.nextRankId=B then
B.previousRankId MUST equal A.buffId or the spellbook
upgrade traversal will derail. Symmetric back-edge check
is unique to graph-shaped catalogs.

Also fixed a crash in --catalog-find where the recursive
directory iterator threw on permission-denied subdirs
(common when walking /tmp). Now uses the
skip_permission_denied directory_options + per-step
error_code clearing for defensive resumption.

Format count 101 -> 102. CLI flag count 1134 -> 1139.
2026-05-10 01:13:42 -07:00