feat(editor): add WSPC (Spell Power Cost) — completes spell-bucket five-pack

Open replacement for the per-spell power-cost fields in Spell.dbc
plus SpellPowerCost-related side tables. Defines categorical
power-cost buckets that spells reference (LowMana 5% / MediumMana
15% / HighMana 30% of caster max mana; fixed Rage-30 /
Energy-40 / Runic-30 / etc), so spells share cost metadata across
ranks instead of embedding per-rank cost numbers.

Completes the small lookup-bucket five-pack:
  WSRG — range bucket
  WSCT — cast time bucket
  WSDR — duration bucket
  WSCD — cooldown bucket
  WSPC — power cost bucket   (this catalog)

Five small integer ids per spell (range / cast / dur / cd / cost)
replace the dozens of duplicate per-rank fields that Blizzard's
Spell.dbc carries. Editing one bucket here retunes every spell
that references it — change LowMana from 5% to 4% and every
rank-1 bolt across every caster class becomes cheaper.

Cost can be flat (baseCost), per-level scaled (perLevelCost), or
percentage-of-max-power (percentOfBase) — the engine sums
whichever fields are non-zero. resolveCost(id, level, maxPower)
does the math. Twelve power types covering every WoW resource
(Mana / Rage / Focus / Energy / Happiness / Runic Power / Runes /
Soul Shards / Holy Power / Eclipse / Health / NoCost).

Three preset emitters: --gen-spc (4 baseline mana tiers),
--gen-spc-rage (4 fixed warrior rage costs including stance-locked
Whirlwind), --gen-spc-mixed (5 cross-class costs covering every
non-mana power type with refund-on-miss flag for energy).

Validation enforces id+name presence, powerType 0..11, no
duplicate ids; warns on percentOfBase outside [0,1] (would
overflow), NoCost type with non-zero cost fields, and non-NoCost
types with no cost set (would cast for free — easy bug to ship).

Wired through the cross-format table; WSPC appears automatically
in all 11 cross-format utilities. Format count 72 -> 73; CLI flag
count 922 -> 927.
This commit is contained in:
Kelsi 2026-05-09 22:00:55 -07:00
parent 74be3f6135
commit 88effe39cd
10 changed files with 695 additions and 0 deletions

View file

@ -111,6 +111,7 @@
#include "cli_spell_durations_catalog.hpp"
#include "cli_spell_cooldowns_catalog.hpp"
#include "cli_creature_families_catalog.hpp"
#include "cli_spell_power_costs_catalog.hpp"
#include "cli_quest_objective.hpp"
#include "cli_quest_reward.hpp"
#include "cli_clone.hpp"
@ -263,6 +264,7 @@ constexpr DispatchFn kDispatchTable[] = {
handleSpellDurationsCatalog,
handleSpellCooldownsCatalog,
handleCreatureFamiliesCatalog,
handleSpellPowerCostsCatalog,
handleQuestObjective,
handleQuestReward,
handleClone,