fix(Core/Cooldown): Implement spell cooldown overrides to address cha… (#15143)

This commit is contained in:
Skjalf
2023-02-22 23:00:18 -03:00
committed by GitHub
parent 9b858e4653
commit fff0e17133
6 changed files with 126 additions and 2 deletions

View File

@@ -2804,6 +2804,16 @@ void Creature::AddSpellCooldown(uint32 spell_id, uint32 /*itemid*/, uint32 end_t
{
_AddCreatureSpellCooldown(spellInfo->Id, 0, spellcooldown);
}
if (sSpellMgr->HasSpellCooldownOverride(spellInfo->Id))
{
if (IsCharmed() && GetCharmer()->IsPlayer())
{
WorldPacket data;
BuildCooldownPacket(data, SPELL_COOLDOWN_FLAG_NONE, spellInfo->Id, spellcooldown);
GetCharmer()->ToPlayer()->SendDirectMessage(&data);
}
}
}
uint32 Creature::GetSpellCooldown(uint32 spell_id) const