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. More...
 
void DoChangePhase ()
 
void SetGUID (ObjectGuid const guid, int32) override
 
void OnCharmed (bool apply) override
 Called when unit is charmed. More...
 
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. More...
 
void DamageTaken (Unit *, uint32 &damage, DamageEffectType, SpellSchoolMask) override
 Called at any Damage from any attacker (before damage apply) More...
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
- 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) More...
 
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() More...
 
void ScheduleHealthCheckEvent (uint32 healthPct, std::function< void()> exec)
 Executes a function once the creature reaches the defined health point percent. More...
 
void ScheduleHealthCheckEvent (std::initializer_list< uint8 > healthPct, std::function< void()> exec)
 
virtual void ExecuteEvent (uint32)
 
virtual void ScheduleTasks ()
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged. More...
 
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) More...
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
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. More...
 
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
 
- 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. More...
 
void Talk (uint8 id, Milliseconds delay)
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At ================================= More...
 
void TriggerAlert (Unit const *who) const
 
virtual bool CanRespawn ()
 
virtual void EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
virtual void JustEngagedWith (Unit *)
 Called for reaction when initially engaged. More...
 
virtual void JustDied (Unit *)
 
virtual void KilledUnit (Unit *)
 
virtual void JustSummoned (Creature *)
 
virtual void IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDespawn (Creature *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureDespawnAll ()
 
virtual void SummonedCreatureEvade (Creature *)
 
virtual void SpellHit (Unit *, SpellInfo const *)
 
virtual void SpellHitTarget (Unit *, SpellInfo const *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void MovementInform (uint32, uint32)
 
virtual void PathEndReached (uint32)
 
void OnCharmed (bool apply) override
 Called when unit is charmed. More...
 
virtual void JustReachedHome ()
 
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 ================== More...
 
virtual void PassengerBoarded (Unit *, int8, bool)
 == Fields ======================================= More...
 
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 bool CanAIAttack (Unit const *) const
 
virtual void AttackStart (Unit *)
 
virtual void UpdateAI (uint32)=0
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
virtual void InitializeAI ()
 
virtual void Reset ()
 
virtual void OnCharmed (bool apply)=0
 Called when unit is charmed. More...
 
virtual void DoAction (int32)
 
virtual uint32 GetData (uint32) const
 
virtual void SetData (uint32, uint32)
 
virtual void SetGUID (ObjectGuid, int32=0)
 
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: More...
 
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. More...
 
virtual void JustExitedCombat ()
 Called when the unit leaves combat. More...
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType)
 Called at any Damage to any victim (before damage apply) More...
 
virtual void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 Called at any Damage from any attacker (before damage apply) More...
 
virtual void HealReceived (Unit *, uint32 &)
 Called when the creature receives heal. More...
 
virtual void OnPowerUpdate (Powers, int32, int32, uint32)
 Called when the creature power updates. More...
 
virtual void HealDone (Unit *, uint32 &)
 Called when the unit heals. More...
 
virtual void OnCalculateMeleeDamageReceived (uint32 &, Unit *)
 Called during damage calculations. More...
 
virtual void OnCalculateSpellDamageReceived (int32 &, Unit *)
 
virtual void OnCalculatePeriodicTickReceived (uint32 &, Unit *)
 Called during calculation when receiving periodic healing or damage (DoT or HoT) More...
 
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. More...
 
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. More...
 
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. More...
 
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 SummonMovementInform (Creature *, uint32, uint32)
 Called when a summon reaches a waypoint or point movement finished. More...
 
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:457

Member Function Documentation

◆ CanAIAttack()

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

Reimplemented from UnitAI.

112 {
113 if (target->IsCreature() && !secondPhase)
114 {
115 return false;
116 }
117
118 if (me->GetThreatMgr().GetThreatListSize() > 1)
119 {
120 ThreatContainer::StorageType::const_iterator lastRef = me->GetThreatMgr().GetOnlineContainer().GetThreatList().end();
121 --lastRef;
122 if (Unit* lastTarget = (*lastRef)->getTarget())
123 {
124 if (lastTarget != target)
125 {
126 return !target->HasAura(SPELL_CONFLAGRATION);
127 }
128 }
129 }
130
131 return true;
132 }
@ SPELL_CONFLAGRATION
Definition: boss_razorgore.cpp:46
Creature * me
Definition: ScriptedCreature.h:280
StorageType const & GetThreatList() const
Definition: ThreatMgr.h:177
float GetThreatListSize() const
Definition: ThreatMgr.h:222
ThreatContainer & GetOnlineContainer()
Definition: ThreatMgr.h:276
Definition: Unit.h:630
ThreatMgr & GetThreatMgr()
Definition: Unit.h:839
bool secondPhase
Definition: boss_razorgore.cpp:276

References ThreatMgr::GetOnlineContainer(), ThreatContainer::GetThreatList(), ThreatMgr::GetThreatListSize(), Unit::GetThreatMgr(), Unit::HasAura(), Object::IsCreature(), ScriptedAI::me, secondPhase, and SPELL_CONFLAGRATION.

◆ 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 BossAI.

227 {
228 if (!secondPhase && damage >= me->GetHealth())
229 {
233 }
234 }
@ SPELL_EXPLODE_ORB
Definition: boss_razorgore.cpp:48
@ SPELL_EXPLOSION
Definition: boss_razorgore.cpp:49
@ SAY_DEATH
Definition: boss_razorgore.cpp:31
Talk
Definition: hyjal.cpp:82
SpellCastResult DoCastAOE(uint32 spellId, bool triggered=false)
Definition: UnitAI.cpp:248
uint32 GetHealth() const
Definition: Unit.h:869

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.

199 {
200 if (action == ACTION_PHASE_TWO)
201 {
203 }
204
205 if (action == TALK_EGG_BROKEN_RAND)
206 {
208 }
209 }
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:44
@ SAY_EGGS_BROKEN1
Definition: boss_razorgore.cpp:28
@ SAY_EGGS_BROKEN3
Definition: boss_razorgore.cpp:30
@ TALK_EGG_BROKEN_RAND
Definition: blackwing_lair.h:113
@ ACTION_PHASE_TWO
Definition: blackwing_lair.h:111
void DoChangePhase()
Definition: boss_razorgore.cpp:146

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
147 {
148 secondPhase = true;
151
153
155 {
156 troops->AI()->Talk(EMOTE_TROOPS_RETREAT);
157 }
158
159 for (ObjectGuid const& guid : _summonGUIDS)
160 {
161 if (Creature* creature = ObjectAccessor::GetCreature(*me, guid))
162 {
163 if (creature->IsAlive())
164 {
165 creature->CombatStop(true);
166 creature->SetReactState(REACT_PASSIVE);
167 creature->GetMotionMaster()->MovePoint(0, Position(-7560.568848f, -1028.553345f, 408.491211f, 0.523858f));
168 }
169 }
170 }
171 }
@ REACT_PASSIVE
Definition: Unit.h:548
@ SPELL_WARMING_FLAMES
Definition: boss_razorgore.cpp:51
@ EMOTE_TROOPS_RETREAT
Definition: boss_razorgore.cpp:33
@ DATA_NEFARIAN_TROOPS
Definition: blackwing_lair.h:43
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:213
SpellCastResult DoCastSelf(uint32 spellId, bool triggered=false)
Definition: UnitAI.h:392
InstanceScript *const instance
Definition: ScriptedCreature.h:464
Definition: Creature.h:46
Definition: ObjectGuid.h:118
void Clear()
Definition: ObjectGuid.h:138
Definition: Position.h:28
void RemoveAllAuras()
Definition: Unit.cpp:5290
Creature * GetCreature(uint32 type)
Definition: InstanceScript.cpp:100
ObjectGuid _charmerGUID
Definition: boss_razorgore.cpp:277
GuidVector _summonGUIDS
Definition: boss_razorgore.cpp:278

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 BossAI.

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:59
@ DATA_EGG_EVENT
Definition: blackwing_lair.h:112
void _JustDied()
Definition: ScriptedCreature.cpp:614
void SaveRespawnTime() override
Definition: Creature.cpp:2612
void SetRespawnTime(uint32 respawn)
Definition: Creature.cpp:3762
void SetLootRecipient(Unit *unit, bool withGroup=true)
Definition: Creature.cpp:1315
void SetCorpseRemoveTime(uint32 delay)
Definition: Creature.cpp:3767
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:53

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 BossAI.

135 {
137
138 events.ScheduleEvent(EVENT_CLEAVE, 15s);
139 events.ScheduleEvent(EVENT_STOMP, 35s);
140 events.ScheduleEvent(EVENT_FIREBALL, 7s);
141 events.ScheduleEvent(EVENT_CONFLAGRATION, 12s);
142
144 }
@ IN_PROGRESS
Definition: InstanceScript.h:58
@ 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:627

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 BossAI.

212 {
213 _summonGUIDS.push_back(summon->GetGUID());
214 summon->SetOwnerGUID(me->GetGUID());
215 summons.Summon(summon);
216 }
void Summon(Creature const *summon)
Definition: ScriptedCreature.h:88
SummonList summons
Definition: ScriptedCreature.h:501
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:109
void SetOwnerGUID(ObjectGuid owner)
Definition: Unit.cpp:10535

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.

Reimplemented from CreatureAI.

179 {
180 if (apply)
181 {
183 {
184 charmer->CastSpell(charmer, SPELL_MIND_EXHAUSTION, true);
185 charmer->CastSpell(me, SPELL_MINDCONTROL_VISUAL, false);
186 }
187 }
188 else
189 {
191 {
192 charmer->RemoveAurasDueToSpell(SPELL_MINDCONTROL_VISUAL);
193 me->TauntApply(charmer);
194 }
195 }
196 }
@ SPELL_MINDCONTROL_VISUAL
Definition: boss_razorgore.cpp:39
@ SPELL_MIND_EXHAUSTION
Definition: boss_razorgore.cpp:41
Unit * GetUnit(WorldObject const &, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:202
void TauntApply(Unit *victim)
Definition: Unit.cpp:14619

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 BossAI.

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

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.

174 {
175 _charmerGUID = guid;
176 }

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.

219 {
220 if (movementType == POINT_MOTION_TYPE)
221 {
222 summon->DespawnOrUnsummon();
223 }
224 }
@ POINT_MOTION_TYPE
Definition: MotionMaster.h:46

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()

Reimplemented from BossAI.

237 {
238 if (!UpdateVictim())
239 return;
240
241 if (!me->IsCharmed())
242 {
243 events.Update(diff);
244 }
245
247 return;
248
249 while (uint32 eventId = events.ExecuteEvent())
250 {
251 switch (eventId)
252 {
253 case EVENT_CLEAVE:
255 events.ScheduleEvent(EVENT_CLEAVE, 7s, 10s);
256 break;
257 case EVENT_STOMP:
259 events.ScheduleEvent(EVENT_STOMP, 15s, 25s);
260 break;
261 case EVENT_FIREBALL:
263 events.ScheduleEvent(EVENT_FIREBALL, 12s, 15s);
264 break;
267 events.ScheduleEvent(EVENT_CONFLAGRATION, 30s);
268 break;
269 }
270 }
271
273 }
std::uint32_t uint32
Definition: Define.h:107
@ UNIT_STATE_CASTING
Definition: UnitDefines.h:164
@ SPELL_CLEAVE
Definition: boss_razorgore.cpp:43
@ SPELL_FIREBALLVOLLEY
Definition: boss_razorgore.cpp:45
@ SPELL_WARSTOMP
Definition: boss_razorgore.cpp:44
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:39
SpellCastResult DoCastVictim(uint32 spellId, bool triggered=false)
Definition: UnitAI.cpp:240
bool UpdateVictim()
Definition: CreatureAI.cpp:269
bool IsCharmed() const
Definition: Unit.h:1266
bool HasUnitState(const uint32 f) const
Definition: Unit.h:673

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