feat: resolve spell \$s1/\$s2/\$s3 to real DBC damage/heal values

Spell descriptions now substitute \$s1/\$s2/\$s3 template variables
with actual effect base points from Spell.dbc (field 80/81/82).
For example: "causes \$s1 Fire Damage" → "causes 562 Fire Damage".

Implementation:
- Added EffectBasePoints0/1/2 to all 4 expansion DBC layouts
- SpellNameEntry now stores effectBasePoints[3]
- loadSpellNameCache reads base points during DBC iteration
- cleanSpellDescription substitutes \$s1→abs(base)+1 when available
- getSpellEffectBasePoints() accessor on GameHandler

Values are DBC base points (before spell power scaling). Still uses
"X" placeholder for unresolved variables (\$d, \$o1, etc.).
This commit is contained in:
Kelsi 2026-03-23 00:51:19 -07:00
parent f9464dbacd
commit a5aa1faf7a
7 changed files with 852 additions and 804 deletions

View file

@ -2244,6 +2244,7 @@ public:
const std::string& getSpellRank(uint32_t spellId) const;
/// Returns the tooltip/description text from Spell.dbc (empty if unknown or has no text).
const std::string& getSpellDescription(uint32_t spellId) const;
const int32_t* getSpellEffectBasePoints(uint32_t spellId) const;
std::string getEnchantName(uint32_t enchantId) const;
const std::string& getSkillLineName(uint32_t spellId) const;
/// Returns the DispelType for a spell (0=none,1=magic,2=curse,3=disease,4=poison,5+=other)
@ -3322,7 +3323,11 @@ private:
// Trainer
bool trainerWindowOpen_ = false;
TrainerListData currentTrainerList_;
struct SpellNameEntry { std::string name; std::string rank; std::string description; uint32_t schoolMask = 0; uint8_t dispelType = 0; uint32_t attrEx = 0; };
struct SpellNameEntry {
std::string name; std::string rank; std::string description;
uint32_t schoolMask = 0; uint8_t dispelType = 0; uint32_t attrEx = 0;
int32_t effectBasePoints[3] = {0, 0, 0};
};
std::unordered_map<uint32_t, SpellNameEntry> spellNameCache_;
bool spellNameCacheLoaded_ = false;