feat: resolve spell \$d duration to real seconds from SpellDuration.dbc

Spell descriptions now substitute \$d with actual duration values:
  Before: "X damage over X sec"
  After:  "30 damage over 18 sec"

Implementation:
- DurationIndex field (40) added to all expansion Spell.dbc layouts
- SpellDuration.dbc loaded during cache build: maps index → base ms
- cleanSpellDescription substitutes \$d with resolved seconds/minutes
- getSpellDuration() accessor on GameHandler

Combined with \$s1/\$s2/\$s3 from the previous commit, most common
spell description templates are now fully resolved with real values.
This commit is contained in:
Kelsi 2026-03-23 01:00:18 -07:00
parent a5aa1faf7a
commit 11ecc475c8
7 changed files with 48 additions and 4 deletions

View file

@ -2245,6 +2245,7 @@ public:
/// 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;
float getSpellDuration(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)
@ -3327,6 +3328,7 @@ private:
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};
float durationSec = 0.0f; // resolved from DurationIndex → SpellDuration.dbc
};
std::unordered_map<uint32_t, SpellNameEntry> spellNameCache_;
bool spellNameCacheLoaded_ = false;