feat(Core/AI): port OnSpellStart/OnSpellCast/OnSpellFailed/OnChannelF… (#25026)

Co-authored-by: offl <11556157+offl@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Andrew
2026-03-07 18:02:58 -03:00
committed by GitHub
parent b632aa9dd6
commit 33a438a585
8 changed files with 55 additions and 27 deletions
@@ -756,9 +756,26 @@ void BossAI::UpdateAI(uint32 diff)
DoMeleeAttackIfReady();
}
void BossAI::OnSpellCastFinished(SpellInfo const* spellInfo, SpellFinishReason reason)
void BossAI::OnSpellCast(SpellInfo const* spellInfo)
{
ScriptedAI::OnSpellCast(spellInfo);
_CheckHealthAfterCast();
}
void BossAI::OnChannelFinished(SpellInfo const* spellInfo)
{
ScriptedAI::OnChannelFinished(spellInfo);
_CheckHealthAfterCast();
}
void BossAI::OnSpellFailed(SpellInfo const* spellInfo)
{
ScriptedAI::OnSpellFailed(spellInfo);
_CheckHealthAfterCast();
}
void BossAI::_CheckHealthAfterCast()
{
ScriptedAI::OnSpellCastFinished(spellInfo, reason);
// Check if any health check events are pending (i.e. waiting for the boss to stop casting.
if (_nextHealthCheck.IsPending() && me->IsInCombat())
{
@@ -490,7 +490,9 @@ public:
bool CanRespawn() override;
void OnSpellCastFinished(SpellInfo const* spell, SpellFinishReason reason) override;
void OnSpellCast(SpellInfo const* spell) override;
void OnChannelFinished(SpellInfo const* spell) override;
void OnSpellFailed(SpellInfo const* spell) override;
void DamageTaken(Unit* attacker, uint32& damage, DamageEffectType damagetype, SpellSchoolMask damageSchoolMask) override;
void JustSummoned(Creature* summon) override;
void SummonedCreatureDespawn(Creature* summon) override;
@@ -534,6 +536,7 @@ protected:
SummonList summons;
private:
void _CheckHealthAfterCast();
uint32 const _bossId;
std::list<HealthCheckEventData> _healthCheckEvents;
HealthCheckEventData _nextHealthCheck;