mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/AI: OnSpellCast, OnSpellFailed, OnSpellStart hooks (#27704)
(cherry picked from commit 3dca705acc)
This commit is contained in:
@@ -20,7 +20,6 @@
|
||||
#include "ObjectAccessor.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "Spell.h"
|
||||
#include "SpellInfo.h"
|
||||
#include "SpellScript.h"
|
||||
|
||||
@@ -122,9 +121,9 @@ struct boss_exarch_maladaar : public BossAI
|
||||
}
|
||||
}
|
||||
|
||||
void OnSpellCastFinished(SpellInfo const* spell, SpellFinishReason reason) override
|
||||
void OnSpellCast(SpellInfo const* spell) override
|
||||
{
|
||||
if (reason == SPELL_FINISHED_SUCCESSFUL_CAST && spell->Id == SPELL_STOLEN_SOUL)
|
||||
if (spell->Id == SPELL_STOLEN_SOUL)
|
||||
if (roll_chance_i(25))
|
||||
Talk(SAY_SOUL_CLEAVE);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "Spell.h"
|
||||
#include "SpellInfo.h"
|
||||
#include "SpellScript.h"
|
||||
#include "the_botanica.h"
|
||||
@@ -97,9 +96,9 @@ struct boss_commander_sarannis : public BossAI
|
||||
}
|
||||
}
|
||||
|
||||
void OnSpellCastFinished(SpellInfo const* spell, SpellFinishReason reason) override
|
||||
void OnSpellCast(SpellInfo const* spell) override
|
||||
{
|
||||
if (reason == SPELL_FINISHED_SUCCESSFUL_CAST && spell->Id == SPELL_SUMMON_REINFORCEMENTS)
|
||||
if (spell->Id == SPELL_SUMMON_REINFORCEMENTS)
|
||||
Talk(SAY_SUMMON);
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "Spell.h"
|
||||
#include "SpellInfo.h"
|
||||
#include "the_botanica.h"
|
||||
|
||||
@@ -82,9 +81,9 @@ struct boss_warp_splinter : public BossAI
|
||||
Talk(SAY_DEATH);
|
||||
}
|
||||
|
||||
void OnSpellCastFinished(SpellInfo const* spell, SpellFinishReason reason) override
|
||||
void OnSpellCast(SpellInfo const* spell) override
|
||||
{
|
||||
if (reason == SPELL_FINISHED_SUCCESSFUL_CAST && spell->Id == SPELL_SUMMON_SAPLINGS)
|
||||
if (spell->Id == SPELL_SUMMON_SAPLINGS)
|
||||
{
|
||||
for (uint32 summonSpells : SummonSaplingsSpells)
|
||||
DoCastSelf(summonSpells, true);
|
||||
|
||||
Reference in New Issue
Block a user