feat: add spell power cost to SpellDataResolver; fix IsUsableSpell mana check

Extend SpellDataInfo with manaCost and powerType fields, extracted from
Spell.dbc ManaCost and PowerType columns. This enables IsUsableSpell()
to properly check if the player has enough mana/rage/energy to cast.

Previously IsUsableSpell always returned notEnoughMana=false since cost
data wasn't available. Now it compares the spell's DBC mana cost against
the player's current power, returning accurate usability and mana state.

This fixes action bar addons showing abilities as usable when the player
lacks sufficient power, and enables OmniCC-style cooldown text to
properly dim insufficient-power abilities.
This commit is contained in:
Kelsi 2026-03-21 04:20:58 -07:00
parent c7e16646fc
commit 91794f421e
3 changed files with 35 additions and 4 deletions

View file

@ -295,7 +295,7 @@ public:
}
// Spell data resolver: spellId -> {castTimeMs, minRange, maxRange}
struct SpellDataInfo { uint32_t castTimeMs = 0; float minRange = 0; float maxRange = 0; };
struct SpellDataInfo { uint32_t castTimeMs = 0; float minRange = 0; float maxRange = 0; uint32_t manaCost = 0; uint8_t powerType = 0; };
using SpellDataResolver = std::function<SpellDataInfo(uint32_t)>;
void setSpellDataResolver(SpellDataResolver r) { spellDataResolver_ = std::move(r); }
SpellDataInfo getSpellData(uint32_t spellId) const {