AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
boss_razorgore::boss_razorgoreAI Struct Reference
Inheritance diagram for boss_razorgore::boss_razorgoreAI:
BossAI ScriptedAI CreatureAI UnitAI

Public Member Functions

 boss_razorgoreAI (Creature *creature)
 
void Reset () override
 
void JustDied (Unit *) override
 
bool CanAIAttack (Unit const *target) const override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged.
 
void DoChangePhase ()
 
void SetGUID (ObjectGuid const guid, int32) override
 
void OnCharmed (bool apply) override
 Called when unit is charmed.
 
void DoAction (int32 action) override
 
void JustSummoned (Creature *summon) override
 
void SummonMovementInform (Creature *summon, uint32 movementType, uint32) override
 Called when a summon reaches a waypoint or point movement finished.
 
void DamageTaken (Unit *, uint32 &damage, DamageEffectType, SpellSchoolMask) override
 Called at any Damage from any attacker (before damage apply)
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
- Public Member Functions inherited from BossAI
 BossAI (Creature *creature, uint32 bossId)
 
 ~BossAI () override
 
bool CanRespawn () override
 
void DamageTaken (Unit *attacker, uint32 &damage, DamageEffectType damagetype, SpellSchoolMask damageSchoolMask) override
 Called at any Damage from any attacker (before damage apply)
 
void JustSummoned (Creature *summon) override
 
void SummonedCreatureDespawn (Creature *summon) override
 
void SummonedCreatureDespawnAll () override
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
void ScheduleHealthCheckEvent (uint32 healthPct, std::function< void()> exec)
 Executes a function once the creature reaches the defined health point percent.
 
void ScheduleHealthCheckEvent (std::initializer_list< uint8 > healthPct, std::function< void()> exec)
 
void ScheduleEnrageTimer (uint32 spellId, Milliseconds timer, uint8 textId=0)
 
virtual void ExecuteEvent (uint32)
 
virtual void ScheduleTasks ()
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged.
 
void EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER) override
 
void JustDied (Unit *) override
 
void JustReachedHome () override
 
- Public Member Functions inherited from ScriptedAI
 ScriptedAI (Creature *creature)
 
 ~ScriptedAI () override
 
void AttackStartNoMove (Unit *target)
 
void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask) override
 Called at any Damage from any attacker (before damage apply)
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
void JustDied (Unit *) override
 
void KilledUnit (Unit *) override
 
void JustSummoned (Creature *) override
 
void SummonedCreatureDespawn (Creature *) override
 
void SpellHit (Unit *, SpellInfo const *) override
 
void SpellHitTarget (Unit *, SpellInfo const *) override
 
void MovementInform (uint32, uint32) override
 
void OnPossess (bool)
 
bool IsInRoom (const Position *pos, Axis axis, bool above)
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged.
 
void AttackStart (Unit *) override
 
void DoStartMovement (Unit *target, float distance=0.0f, float angle=0.0f)
 
void DoStartNoMovement (Unit *target)
 
void DoStopAttack ()
 
void DoCastSpell (Unit *target, SpellInfo const *spellInfo, bool triggered=false)
 
void DoPlaySoundToSet (WorldObject *source, uint32 soundId)
 
void DoPlayMusic (uint32 soundId, bool zone)
 
void DoAddThreat (Unit *unit, float amount)
 
void DoModifyThreatByPercent (Unit *unit, int32 pct)
 
void DoResetThreat (Unit *unit)
 
void DoResetThreatList ()
 
float DoGetThreat (Unit *unit)
 
void DoTeleportPlayer (Unit *unit, float x, float y, float z, float o)
 
void DoTeleportPlayer (Unit *unit, Position pos)
 
void DoTeleportAll (float x, float y, float z, float o)
 
UnitDoSelectLowestHpFriendly (float range, uint32 minHPDiff=1)
 
std::list< Creature * > DoFindFriendlyCC (float range)
 
std::list< Creature * > DoFindFriendlyMissingBuff (float range, uint32 spellId)
 
PlayerGetPlayerAtMinimumRange (float minRange)
 
CreatureDoSpawnCreature (uint32 entry, float offsetX, float offsetY, float offsetZ, float angle, uint32 type, uint32 despawntime)
 
bool IsUniqueTimedEventDone (uint32 id) const
 
void SetUniqueTimedEventDone (uint32 id)
 
void ResetUniqueTimedEvent (uint32 id)
 
void ClearUniqueTimedEventsDone ()
 
void ScheduleTimedEvent (Milliseconds timerMin, Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0s, uint32 uniqueId=0)
 
void ScheduleTimedEvent (Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0s, uint32 uniqueId=0)
 
void ScheduleUniqueTimedEvent (Milliseconds timer, std::function< void()> exec, uint32 uniqueId)
 
bool HealthBelowPct (uint32 pct) const
 
bool HealthAbovePct (uint32 pct) const
 
SpellInfo const * SelectSpell (Unit *target, uint32 school, uint32 mechanic, SelectTargetType targets, uint32 powerCostMin, uint32 powerCostMax, float rangeMin, float rangeMax, SelectEffect effect)
 
void SetEquipmentSlots (bool loadDefault, int32 mainHand=EQUIP_NO_CHANGE, int32 offHand=EQUIP_NO_CHANGE, int32 ranged=EQUIP_NO_CHANGE)
 
virtual bool CheckEvadeIfOutOfCombatArea () const
 
bool IsHeroic () const
 
Difficulty GetDifficulty () const
 
bool Is25ManRaid () const
 
template<class T >
const T & DUNGEON_MODE (const T &normal5, const T &heroic10) const
 
template<class T >
const T & RAID_MODE (const T &normal10, const T &normal25) const
 
template<class T >
const T & RAID_MODE (const T &normal10, const T &normal25, const T &heroic10, const T &heroic25) const
 
PlayerSelectTargetFromPlayerList (float maxdist, uint32 excludeAura=0, bool mustBeInLOS=false) const
 
void SetInvincibility (bool apply)
 
bool IsInvincible () const
 
void SetAutoAttackAllowed (bool allow)
 
bool IsAutoAttackAllowed () const
 
- Public Member Functions inherited from CreatureAI
void Talk (uint8 id, WorldObject const *whisperTarget=nullptr, Milliseconds delay=0s)
 Causes the creature to talk/say the text assigned to their entry in the creature_text database table.
 
void Talk (uint8 id, Milliseconds delay)
 
WorldObjectGetSummoner () const
 Returns the summoner creature/object, if the creature is a temporary summon.
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At =================================
 
void TriggerAlert (Unit const *who) const
 
virtual void IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureEvade (Creature *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void PathEndReached (uint32)
 
void OnCharmed (bool apply) override
 Called when unit is charmed.
 
void DoZoneInCombat (Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
 
virtual void ReceiveEmote (Player *, uint32)
 
virtual void OwnerAttackedBy (Unit *)
 
virtual void OwnerAttacked (Unit *)
 
virtual void CorpseRemoved (uint32 &)
 == Triggered Actions Requested ==================
 
virtual void PassengerBoarded (Unit *, int8, bool)
 == Fields =======================================
 
virtual bool BeforeSpellClick (Unit *)
 
virtual void OnSpellClick (Unit *, bool &)
 
virtual bool CanSeeAlways (WorldObject const *)
 
virtual bool CanBeSeen (Player const *)
 
virtual bool CanAlwaysBeDetectable (WorldObject const *)
 
virtual void PetStopAttack ()
 
virtual bool CheckInRoom ()
 
CreatureBoundary const * GetBoundary () const
 
void SetBoundary (CreatureBoundary const *boundary, bool negativeBoundaries=false)
 
bool IsInBoundary (Position const *who=nullptr) const
 
virtual void CalculateThreat (Unit *, float &, SpellInfo const *)
 
virtual bool OnTeleportUnreacheablePlayer (Player *)
 
virtual void OnAuraRemove (AuraApplication *, AuraRemoveMode)
 
- Public Member Functions inherited from UnitAI
 UnitAI (Unit *unit)
 
virtual ~UnitAI ()
 
virtual void InitializeAI ()
 
virtual uint32 GetData (uint32) const
 
virtual void SetData (uint32, uint32)
 
virtual ObjectGuid GetGUID (int32=0) const
 
UnitSelectTarget (SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 
template<class PREDICATE >
UnitSelectTarget (SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 Select the best (up to) <num> targets (in <targetType> order) from the threat list that fulfill the following:
 
template<class PREDICATE >
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
virtual void JustEnteredCombat (Unit *)
 Called when the unit enters combat.
 
virtual void JustExitedCombat ()
 Called when the unit leaves combat.
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 Called at any Damage to any victim (before damage apply)
 
virtual void HealReceived (Unit *, uint32 &)
 Called when the creature receives heal.
 
virtual void OnPowerUpdate (Powers, int32, int32, uint32)
 Called when the creature power updates.
 
virtual void HealDone (Unit *, uint32 &)
 Called when the unit heals.
 
virtual void OnCalculateMeleeDamageReceived (uint32 &, Unit *)
 Called during damage calculations.
 
virtual void OnCalculateSpellDamageReceived (int32 &, Unit *)
 
virtual void OnCalculatePeriodicTickReceived (uint32 &, Unit *)
 Called during calculation when receiving periodic healing or damage (DoT or HoT)
 
void AttackStartCaster (Unit *victim, float dist)
 
SpellCastResult DoAddAuraToAllHostilePlayers (uint32 spellid)
 
SpellCastResult DoCast (uint32 spellId)
 
SpellCastResult DoCast (Unit *victim, uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastSelf (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastToAllHostilePlayers (uint32 spellid, bool triggered=false)
 To specify the caster as target if the spell is self-cast.
 
SpellCastResult DoCastVictim (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastAOE (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastRandomTarget (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false, bool withTank=true)
 Cast the spell on a random unit from the threat list.
 
SpellCastResult DoCastMaxThreat (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false)
 Cast spell on the top threat target, which may not be the current victim.
 
float DoGetSpellMaxRange (uint32 spellId, bool positive=false)
 
void DoMeleeAttackIfReady ()
 
bool DoSpellAttackIfReady (uint32 spell)
 
void DoSpellAttackToRandomTargetIfReady (uint32 spell, uint32 threatTablePosition=0, float dist=0.f, bool playerOnly=true)
 
virtual void sGossipHello (Player *)
 
virtual void sGossipSelect (Player *, uint32, uint32)
 
virtual void sGossipSelectCode (Player *, uint32, uint32, char const *)
 
virtual void sQuestAccept (Player *, Quest const *)
 
virtual void sQuestSelect (Player *, Quest const *)
 
virtual void sQuestComplete (Player *, Quest const *)
 
virtual void sQuestReward (Player *, Quest const *, uint32)
 
virtual void sOnGameEvent (bool, uint16)
 
virtual std::string GetDebugInfo () const
 

Private Attributes

bool secondPhase
 
ObjectGuid _charmerGUID
 
GuidVector _summonGUIDS
 

Additional Inherited Members

- Public Types inherited from ScriptedAI
enum class  Axis {
  AXIS_X ,
  AXIS_Y
}
 
- Public Types inherited from CreatureAI
enum  EvadeReason {
  EVADE_REASON_NO_HOSTILES ,
  EVADE_REASON_BOUNDARY ,
  EVADE_REASON_SEQUENCE_BREAK ,
  EVADE_REASON_NO_PATH ,
  EVADE_REASON_OTHER
}
 
- Static Public Member Functions inherited from CreatureAI
static bool IsInBounds (CreatureBoundary const &boundary, Position const *who)
 
- Static Public Member Functions inherited from UnitAI
static void FillAISpellInfo ()
 
- Public Attributes inherited from BossAI
float callForHelpRange
 
InstanceScript *const instance
 
- Public Attributes inherited from ScriptedAI
Creatureme
 
- Static Public Attributes inherited from UnitAI
static AISpellInfoTypeAISpellInfo
 
- Protected Member Functions inherited from BossAI
void _Reset ()
 
void _JustEngagedWith ()
 
void _JustDied ()
 
void _JustReachedHome ()
 
void _EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
void TeleportCheaters ()
 
- Protected Member Functions inherited from CreatureAI
bool UpdateVictim ()
 
bool UpdateVictimWithGaze ()
 
void SetGazeOn (Unit *target)
 
CreatureDoSummon (uint32 entry, Position const &pos, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
CreatureDoSummon (uint32 entry, WorldObject *obj, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
CreatureDoSummonFlyer (uint32 entry, WorldObject *obj, float flightZ, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
virtual void MoveInLineOfSight (Unit *)
 
bool _EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
- Protected Attributes inherited from BossAI
SummonList summons
 
- Protected Attributes inherited from CreatureAI
Creature *const me
 
EventMap events
 
TaskScheduler scheduler
 
CreatureBoundary const * _boundary
 
bool _negateBoundary
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Detailed Description

Constructor & Destructor Documentation

◆ boss_razorgoreAI()

boss_razorgore::boss_razorgoreAI::boss_razorgoreAI ( Creature creature)
inline
@ DATA_RAZORGORE_THE_UNTAMED
Definition blackwing_lair.h:31
Definition ScriptedCreature.h:467

Member Function Documentation

◆ CanAIAttack()

bool boss_razorgore::boss_razorgoreAI::CanAIAttack ( Unit const *  target) const
inlineoverridevirtual

Reimplemented from UnitAI.

112 {
113 return !(target->IsCreature() && !secondPhase);
114 }
bool secondPhase
Definition boss_razorgore.cpp:258

References Object::IsCreature(), and secondPhase.

◆ DamageTaken()

void boss_razorgore::boss_razorgoreAI::DamageTaken ( Unit ,
uint32 ,
DamageEffectType  ,
SpellSchoolMask   
)
inlineoverridevirtual

Called at any Damage from any attacker (before damage apply)

Note
It use for recalculation damage or special reaction at damage for attack reaction use AttackedBy called for non DOT damage in Unit::DealDamage also

Reimplemented from UnitAI.

209 {
210 if (!secondPhase && damage >= me->GetHealth())
211 {
215 }
216 }
@ SPELL_EXPLODE_ORB
Definition boss_razorgore.cpp:48
@ SPELL_EXPLOSION
Definition boss_razorgore.cpp:49
@ SAY_DEATH
Definition boss_razorgore.cpp:31
SpellCastResult DoCastAOE(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:248
uint32 GetHealth() const
Definition Unit.h:1038
Talk
Definition hyjal.cpp:82
Creature * me
Definition ScriptedCreature.h:280

References UnitAI::DoCastAOE(), Unit::GetHealth(), ScriptedAI::me, SAY_DEATH, secondPhase, SPELL_EXPLODE_ORB, and SPELL_EXPLOSION.

◆ DoAction()

void boss_razorgore::boss_razorgoreAI::DoAction ( int32  action)
inlineoverridevirtual

Reimplemented from UnitAI.

181 {
182 if (action == ACTION_PHASE_TWO)
183 {
185 }
186
187 if (action == TALK_EGG_BROKEN_RAND)
188 {
190 }
191 }
uint32 urand(uint32 min, uint32 max)
Definition Random.cpp:44
@ TALK_EGG_BROKEN_RAND
Definition blackwing_lair.h:113
@ ACTION_PHASE_TWO
Definition blackwing_lair.h:111
@ SAY_EGGS_BROKEN1
Definition boss_razorgore.cpp:28
@ SAY_EGGS_BROKEN3
Definition boss_razorgore.cpp:30
void DoChangePhase()
Definition boss_razorgore.cpp:128

References ACTION_PHASE_TWO, DoChangePhase(), SAY_EGGS_BROKEN1, SAY_EGGS_BROKEN3, TALK_EGG_BROKEN_RAND, and urand().

◆ DoChangePhase()

void boss_razorgore::boss_razorgoreAI::DoChangePhase ( )
inline
129 {
130 secondPhase = true;
133
135
137 {
138 troops->AI()->Talk(EMOTE_TROOPS_RETREAT);
139 }
140
141 for (ObjectGuid const& guid : _summonGUIDS)
142 {
143 if (Creature* creature = ObjectAccessor::GetCreature(*me, guid))
144 {
145 if (creature->IsAlive())
146 {
147 creature->CombatStop(true);
148 creature->SetReactState(REACT_PASSIVE);
149 creature->GetMotionMaster()->MovePoint(0, Position(-7560.568848f, -1028.553345f, 408.491211f, 0.523858f));
150 }
151 }
152 }
153 }
@ REACT_PASSIVE
Definition Unit.h:548
@ DATA_NEFARIAN_TROOPS
Definition blackwing_lair.h:43
@ SPELL_WARMING_FLAMES
Definition boss_razorgore.cpp:51
@ EMOTE_TROOPS_RETREAT
Definition boss_razorgore.cpp:33
InstanceScript *const instance
Definition ScriptedCreature.h:474
Definition Creature.h:43
Creature * GetCreature(uint32 type)
Definition InstanceScript.cpp:115
Definition ObjectGuid.h:118
void Clear()
Definition ObjectGuid.h:138
SpellCastResult DoCastSelf(uint32 spellId, bool triggered=false)
Definition UnitAI.h:392
void RemoveAllAuras()
Definition Unit.cpp:5351
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition ObjectAccessor.cpp:210
Definition Position.h:27
ObjectGuid _charmerGUID
Definition boss_razorgore.cpp:259
GuidVector _summonGUIDS
Definition boss_razorgore.cpp:260

References _charmerGUID, _summonGUIDS, ObjectGuid::Clear(), DATA_NEFARIAN_TROOPS, UnitAI::DoCastSelf(), EMOTE_TROOPS_RETREAT, InstanceScript::GetCreature(), ObjectAccessor::GetCreature(), BossAI::instance, ScriptedAI::me, REACT_PASSIVE, Unit::RemoveAllAuras(), secondPhase, and SPELL_WARMING_FLAMES.

Referenced by DoAction().

◆ JustDied()

void boss_razorgore::boss_razorgoreAI::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from CreatureAI.

92 {
93 if (secondPhase)
94 {
95 _JustDied();
96 }
97 else
98 {
99 // Respawn shorty in case of failure during phase 1.
101 me->SetRespawnTime(30);
103
104 // Might not be required, safe measure.
105 me->SetLootRecipient(nullptr);
106
108 }
109 }
@ FAIL
Definition InstanceScript.h:60
@ DATA_EGG_EVENT
Definition blackwing_lair.h:112
void _JustDied()
Definition ScriptedCreature.cpp:644
void SaveRespawnTime() override
Definition Creature.cpp:2622
void SetRespawnTime(uint32 respawn)
Definition Creature.cpp:3792
void SetLootRecipient(Unit *unit, bool withGroup=true)
Definition Creature.cpp:1326
void SetCorpseRemoveTime(uint32 delay)
Definition Creature.cpp:3797
virtual void SetData(uint32, uint32)
Definition ZoneScript.h:52

References BossAI::_JustDied(), DATA_EGG_EVENT, FAIL, BossAI::instance, ScriptedAI::me, Creature::SaveRespawnTime(), secondPhase, Creature::SetCorpseRemoveTime(), ZoneScript::SetData(), Creature::SetLootRecipient(), and Creature::SetRespawnTime().

◆ JustEngagedWith()

void boss_razorgore::boss_razorgoreAI::JustEngagedWith ( Unit )
inlineoverridevirtual

Called for reaction when initially engaged.

Reimplemented from CreatureAI.

117 {
119
120 events.ScheduleEvent(EVENT_CLEAVE, 15s);
121 events.ScheduleEvent(EVENT_STOMP, 35s);
122 events.ScheduleEvent(EVENT_FIREBALL, 7s);
123 events.ScheduleEvent(EVENT_CONFLAGRATION, 12s);
124
126 }
@ IN_PROGRESS
Definition InstanceScript.h:59
@ EVENT_FIREBALL
Definition boss_razorgore.cpp:69
@ EVENT_CONFLAGRATION
Definition boss_razorgore.cpp:70
@ EVENT_STOMP
Definition boss_razorgore.cpp:68
@ EVENT_CLEAVE
Definition boss_razorgore.cpp:67
events
Definition boss_sartura.cpp:43
void _JustEngagedWith()
Definition ScriptedCreature.cpp:657

References BossAI::_JustEngagedWith(), DATA_EGG_EVENT, EVENT_CLEAVE, EVENT_CONFLAGRATION, EVENT_FIREBALL, EVENT_STOMP, IN_PROGRESS, BossAI::instance, and ZoneScript::SetData().

◆ JustSummoned()

void boss_razorgore::boss_razorgoreAI::JustSummoned ( Creature summon)
inlineoverridevirtual

Reimplemented from CreatureAI.

194 {
195 _summonGUIDS.push_back(summon->GetGUID());
196 summon->SetOwnerGUID(me->GetGUID());
197 summons.Summon(summon);
198 }
SummonList summons
Definition ScriptedCreature.h:517
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:112
void Summon(Creature const *summon)
Definition ScriptedCreature.h:88
void SetOwnerGUID(ObjectGuid owner)
Definition Unit.cpp:10618

References _summonGUIDS, Object::GetGUID(), ScriptedAI::me, Unit::SetOwnerGUID(), SummonList::Summon(), and BossAI::summons.

◆ OnCharmed()

void boss_razorgore::boss_razorgoreAI::OnCharmed ( bool  apply)
inlineoverridevirtual

Called when unit is charmed.

Implements UnitAI.

161 {
162 if (apply)
163 {
165 {
166 charmer->CastSpell(charmer, SPELL_MIND_EXHAUSTION, true);
167 charmer->CastSpell(me, SPELL_MINDCONTROL_VISUAL, false);
168 }
169 }
170 else
171 {
173 {
174 charmer->RemoveAurasDueToSpell(SPELL_MINDCONTROL_VISUAL);
175 me->TauntApply(charmer);
176 }
177 }
178 }
@ SPELL_MINDCONTROL_VISUAL
Definition boss_razorgore.cpp:39
@ SPELL_MIND_EXHAUSTION
Definition boss_razorgore.cpp:41
Definition Unit.h:636
void TauntApply(Unit *victim)
Definition Unit.cpp:14716
Unit * GetUnit(WorldObject const &, ObjectGuid const guid)
Definition ObjectAccessor.cpp:199

References _charmerGUID, ObjectAccessor::GetUnit(), ScriptedAI::me, SPELL_MIND_EXHAUSTION, SPELL_MINDCONTROL_VISUAL, and Unit::TauntApply().

◆ Reset()

void boss_razorgore::boss_razorgoreAI::Reset ( )
inlineoverridevirtual

Reimplemented from UnitAI.

83 {
84 _Reset();
86 secondPhase = false;
89 }
@ NOT_STARTED
Definition InstanceScript.h:58
void _Reset()
Definition ScriptedCreature.cpp:624
void DespawnAll(uint32 delay=0)
Definition ScriptedCreature.cpp:71

References _charmerGUID, BossAI::_Reset(), ObjectGuid::Clear(), DATA_EGG_EVENT, SummonList::DespawnAll(), BossAI::instance, NOT_STARTED, secondPhase, ZoneScript::SetData(), and BossAI::summons.

◆ SetGUID()

void boss_razorgore::boss_razorgoreAI::SetGUID ( ObjectGuid const  guid,
int32   
)
inlineoverridevirtual

Reimplemented from UnitAI.

156 {
157 _charmerGUID = guid;
158 }

References _charmerGUID.

◆ SummonMovementInform()

void boss_razorgore::boss_razorgoreAI::SummonMovementInform ( Creature ,
uint32  ,
uint32   
)
inlineoverridevirtual

Called when a summon reaches a waypoint or point movement finished.

Reimplemented from UnitAI.

201 {
202 if (movementType == POINT_MOTION_TYPE)
203 {
204 summon->DespawnOrUnsummon();
205 }
206 }
@ POINT_MOTION_TYPE
Definition MotionMaster.h:48

References Creature::DespawnOrUnsummon(), and POINT_MOTION_TYPE.

◆ UpdateAI()

void boss_razorgore::boss_razorgoreAI::UpdateAI ( uint32  )
inlineoverridevirtual

Use to start attacking a target. Called just before JustEngagedWith()

Implements UnitAI.

219 {
220 if (!UpdateVictim())
221 return;
222
223 if (!me->IsCharmed())
224 {
225 events.Update(diff);
226 }
227
229 return;
230
231 while (uint32 eventId = events.ExecuteEvent())
232 {
233 switch (eventId)
234 {
235 case EVENT_CLEAVE:
237 events.ScheduleEvent(EVENT_CLEAVE, 7s, 10s);
238 break;
239 case EVENT_STOMP:
241 events.ScheduleEvent(EVENT_STOMP, 15s, 25s);
242 break;
243 case EVENT_FIREBALL:
245 events.ScheduleEvent(EVENT_FIREBALL, 12s, 15s);
246 break;
249 events.ScheduleEvent(EVENT_CONFLAGRATION, 30s);
250 break;
251 }
252 }
253
255 }
std::uint32_t uint32
Definition Define.h:107
@ UNIT_STATE_CASTING
Definition UnitDefines.h:185
@ SPELL_CLEAVE
Definition boss_razorgore.cpp:43
@ SPELL_CONFLAGRATION
Definition boss_razorgore.cpp:46
@ SPELL_FIREBALLVOLLEY
Definition boss_razorgore.cpp:45
@ SPELL_WARSTOMP
Definition boss_razorgore.cpp:44
bool UpdateVictim()
Definition CreatureAI.cpp:280
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:39
SpellCastResult DoCastVictim(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:240
bool IsCharmed() const
Definition Unit.h:1244
bool HasUnitState(const uint32 f) const
Definition Unit.h:707

References UnitAI::DoCastVictim(), UnitAI::DoMeleeAttackIfReady(), EVENT_CLEAVE, EVENT_CONFLAGRATION, EVENT_FIREBALL, EVENT_STOMP, Unit::HasUnitState(), Unit::IsCharmed(), ScriptedAI::me, SPELL_CLEAVE, SPELL_CONFLAGRATION, SPELL_FIREBALLVOLLEY, SPELL_WARSTOMP, UNIT_STATE_CASTING, and CreatureAI::UpdateVictim().

Member Data Documentation

◆ _charmerGUID

ObjectGuid boss_razorgore::boss_razorgoreAI::_charmerGUID
private

◆ _summonGUIDS

GuidVector boss_razorgore::boss_razorgoreAI::_summonGUIDS
private

Referenced by DoChangePhase(), and JustSummoned().

◆ secondPhase

bool boss_razorgore::boss_razorgoreAI::secondPhase
private

The documentation for this struct was generated from the following file: