Core/AI: OnSpellCast, OnSpellFailed, OnSpellStart hooks (#27704)

(cherry picked from commit 3dca705acc)
This commit is contained in:
offl
2022-02-18 19:14:44 +02:00
committed by Shauren
parent bb18bd47e5
commit 050f55b62f
15 changed files with 97 additions and 34 deletions

View File

@@ -620,6 +620,21 @@ void SmartAI::SpellHitTarget(WorldObject* target, SpellInfo const* spellInfo)
GetScript()->ProcessEventsFor(SMART_EVENT_SPELLHIT_TARGET, target->ToUnit(), 0, 0, false, spellInfo, target->ToGameObject());
}
void SmartAI::OnSpellCast(SpellInfo const* spellInfo)
{
GetScript()->ProcessEventsFor(SMART_EVENT_ON_SPELL_CAST, nullptr, 0, 0, false, spellInfo);
}
void SmartAI::OnSpellFailed(SpellInfo const* spellInfo)
{
GetScript()->ProcessEventsFor(SMART_EVENT_ON_SPELL_FAILED, nullptr, 0, 0, false, spellInfo);
}
void SmartAI::OnSpellStart(SpellInfo const* spellInfo)
{
GetScript()->ProcessEventsFor(SMART_EVENT_ON_SPELL_START, nullptr, 0, 0, false, spellInfo);
}
void SmartAI::DamageTaken(Unit* doneBy, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/)
{
GetScript()->ProcessEventsFor(SMART_EVENT_DAMAGED, doneBy, damage);