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

Public Member Functions

 boss_razorgore (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 - this happens after JustEnteredCombat.
 
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 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
 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, bool allowedWhileCasting=true)
 Executes a function once the creature reaches the defined health point percent.
 
void ScheduleHealthCheckEvent (std::initializer_list< uint8 > healthPct, std::function< void()> exec, bool allowedWhileCasting=true)
 
void ProcessHealthCheck ()
 
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 - this happens after JustEnteredCombat.
 
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 - this happens after JustEnteredCombat.
 
void AttackStart (Unit *) override
 
void DoStartMovement (Unit *target, float distance=0.0f, float angle=0.0f)
 
void DoStartNoMovement (Unit *target)
 
void DoStopAttack ()
 
void DoRewardPlayersInArea ()
 
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=0ms, uint32 uniqueId=0)
 
void ScheduleTimedEvent (Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0ms, 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=0ms)
 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
 
bool IsEngaged () const
 Check if creature is currently engaged in combat.
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At =================================
 
void TriggerAlert (Unit const *who) const
 
void JustEnteredCombat (Unit *who) override
 Called when the unit enters combat.
 
virtual void JustStartedThreateningMe (Unit *who)
 
void EngagementStart (Unit *who)
 
void EngagementOver ()
 
void JustExitedCombat () override
 Called when the unit leaves combat.
 
virtual void IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureEvade (Creature *)
 
virtual void OnSpellStart (SpellInfo const *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void PathEndReached (uint32)
 
virtual void WaypointPathStarted (uint32)
 == Waypoints system =============================
 
virtual void WaypointStarted (uint32, uint32)
 
virtual void WaypointReached (uint32, uint32)
 
virtual void WaypointPathEnded (uint32, 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 *attacker)
 
virtual void OwnerAttacked (Unit *target)
 
void OnOwnerCombatInteraction (Unit *target)
 
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 ()
 
int32 VisualizeBoundary (uint32 duration, Unit *owner=nullptr, bool fill=false, bool checkZ=false) const
 
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)
 
virtual void DistancingStarted ()
 
virtual void DistancingEnded ()
 
- 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 EvadeTimerExpired ()
 Called when evade timer expires (target unreachable for too long)
 
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
 
bool _isEngaged
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Detailed Description

Constructor & Destructor Documentation

◆ boss_razorgore()

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

Member Function Documentation

◆ CanAIAttack()

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

Reimplemented from UnitAI.

109 {
110 return !(target->IsCreature() && !secondPhase);
111 }
bool secondPhase
Definition boss_razorgore.cpp:245

References Object::IsCreature(), and secondPhase.

◆ DamageTaken()

void boss_razorgore::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.

198 {
199 if (!secondPhase && damage >= me->GetHealth())
200 {
204 }
205 }
@ SPELL_EXPLODE_ORB
Definition boss_razorgore.cpp:50
@ SPELL_EXPLOSION
Definition boss_razorgore.cpp:51
@ SAY_DEATH
Definition boss_razorgore.cpp:33
SpellCastResult DoCastAOE(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:285
uint32 GetHealth() const
Definition Unit.h:1108
Talk
Definition hyjal.cpp:82
Creature * me
Definition ScriptedCreature.h:281

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

◆ DoAction()

void boss_razorgore::DoAction ( int32  action)
inlineoverridevirtual

Reimplemented from UnitAI.

176 {
177 if (action == ACTION_PHASE_TWO)
179
180 if (action == TALK_EGG_BROKEN_RAND)
182 }
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:30
@ SAY_EGGS_BROKEN3
Definition boss_razorgore.cpp:32
void DoChangePhase()
Definition boss_razorgore.cpp:125

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

◆ DoChangePhase()

void boss_razorgore::DoChangePhase ( )
inline
126 {
127 secondPhase = true;
130
132
134 troops->AI()->Talk(EMOTE_TROOPS_RETREAT);
135
136 for (ObjectGuid const& guid : _summonGUIDS)
137 {
138 if (Creature* creature = ObjectAccessor::GetCreature(*me, guid))
139 if (creature->IsAlive())
140 {
141 creature->CombatStop(true);
142 creature->SetReactState(REACT_PASSIVE);
143 creature->GetMotionMaster()->MovePoint(0, Position(-7560.568848f, -1028.553345f, 408.491211f, 0.523858f));
144 }
145 }
146 }
@ REACT_PASSIVE
Definition Unit.h:566
@ DATA_NEFARIAN_TROOPS
Definition blackwing_lair.h:43
@ SPELL_WARMING_FLAMES
Definition boss_razorgore.cpp:53
@ EMOTE_TROOPS_RETREAT
Definition boss_razorgore.cpp:35
InstanceScript *const instance
Definition ScriptedCreature.h:492
Definition Creature.h:47
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:394
void RemoveAllAuras()
Definition Unit.cpp:5580
Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition ObjectAccessor.cpp:210
Definition Position.h:27
GuidVector _summonGUIDS
Definition boss_razorgore.cpp:247
ObjectGuid _charmerGUID
Definition boss_razorgore.cpp:246

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::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from CreatureAI.

89 {
90 if (secondPhase)
91 {
92 _JustDied();
93 }
94 else
95 {
96 // Respawn shorty in case of failure during phase 1.
98 me->SetRespawnTime(30);
100
101 // Might not be required, safe measure.
102 me->SetLootRecipient(nullptr);
103
105 }
106 }
@ FAIL
Definition InstanceScript.h:60
@ DATA_EGG_EVENT
Definition blackwing_lair.h:112
void _JustDied()
Definition ScriptedCreature.cpp:664
void SaveRespawnTime() override
Definition Creature.cpp:2587
void SetRespawnTime(uint32 respawn)
Definition Creature.cpp:3730
void SetLootRecipient(Unit *unit, bool withGroup=true)
Definition Creature.cpp:1282
void SetCorpseRemoveTime(uint32 delay)
Definition Creature.cpp:3735
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::JustEngagedWith ( Unit )
inlineoverridevirtual

Called for reaction when initially engaged - this happens after JustEnteredCombat.

Reimplemented from CreatureAI.

114 {
116
117 events.ScheduleEvent(EVENT_CLEAVE, 15s);
118 events.ScheduleEvent(EVENT_STOMP, 35s);
119 events.ScheduleEvent(EVENT_FIREBALL, 7s);
120 events.ScheduleEvent(EVENT_CONFLAGRATION, 12s);
121
123 }
@ IN_PROGRESS
Definition InstanceScript.h:59
@ EVENT_FIREBALL
Definition boss_razorgore.cpp:71
@ EVENT_CONFLAGRATION
Definition boss_razorgore.cpp:72
@ EVENT_STOMP
Definition boss_razorgore.cpp:70
@ EVENT_CLEAVE
Definition boss_razorgore.cpp:69
events
Definition boss_sartura.cpp:43
void _JustEngagedWith()
Definition ScriptedCreature.cpp:677

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::JustSummoned ( Creature summon)
inlineoverridevirtual

Reimplemented from CreatureAI.

185 {
186 _summonGUIDS.push_back(summon->GetGUID());
187 summon->SetOwnerGUID(me->GetGUID());
188 summons.Summon(summon);
189 }
SummonList summons
Definition ScriptedCreature.h:539
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:114
void Summon(Creature const *summon)
Definition ScriptedCreature.h:88
void SetOwnerGUID(ObjectGuid owner)
Definition Unit.cpp:7655

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

◆ OnCharmed()

void boss_razorgore::OnCharmed ( bool  apply)
inlineoverridevirtual

Called when unit is charmed.

Implements UnitAI.

154 {
155 if (apply)
156 {
158 {
159 charmer->CastSpell(charmer, SPELL_MIND_EXHAUSTION, true);
160 charmer->CastSpell(me, SPELL_MINDCONTROL_VISUAL, false);
161 }
162 }
163 else
164 {
166 {
167 charmer->RemoveAurasDueToSpell(SPELL_MINDCONTROL_VISUAL);
168 me->EngageWithTarget(charmer);
169 me->AddThreat(charmer, 100.0f);
170 me->AI()->AttackStart(charmer);
171 }
172 }
173 }
@ SPELL_MINDCONTROL_VISUAL
Definition boss_razorgore.cpp:41
@ SPELL_MIND_EXHAUSTION
Definition boss_razorgore.cpp:43
CreatureAI * AI() const
Definition Creature.h:143
virtual void AttackStart(Unit *)
Definition UnitAI.cpp:28
Definition Unit.h:664
void AddThreat(Unit *victim, float fThreat, SpellSchoolMask schoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *threatSpell=nullptr)
Definition Unit.cpp:11413
void EngageWithTarget(Unit *who)
Definition Unit.cpp:7502
Unit * GetUnit(WorldObject const &, ObjectGuid const &guid)
Definition ObjectAccessor.cpp:199

References _charmerGUID, Unit::AddThreat(), Creature::AI(), UnitAI::AttackStart(), Unit::EngageWithTarget(), ObjectAccessor::GetUnit(), ScriptedAI::me, SPELL_MIND_EXHAUSTION, and SPELL_MINDCONTROL_VISUAL.

◆ Reset()

void boss_razorgore::Reset ( )
inlineoverridevirtual

Reimplemented from UnitAI.

80 {
81 _Reset();
83 secondPhase = false;
86 }
@ NOT_STARTED
Definition InstanceScript.h:58
void _Reset()
Definition ScriptedCreature.cpp:644
void DespawnAll(Milliseconds delay=0ms)
Definition ScriptedCreature.cpp:72

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::SetGUID ( ObjectGuid const &  guid,
int32   
)
inlineoverridevirtual

Reimplemented from UnitAI.

149 {
150 _charmerGUID = guid;
151 }

References _charmerGUID.

◆ SummonMovementInform()

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

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

Reimplemented from UnitAI.

192 {
193 if (movementType == POINT_MOTION_TYPE)
194 summon->DespawnOrUnsummon();
195 }
@ POINT_MOTION_TYPE
Definition MotionMaster.h:48

References Creature::DespawnOrUnsummon(), and POINT_MOTION_TYPE.

◆ UpdateAI()

void boss_razorgore::UpdateAI ( uint32  )
inlineoverridevirtual

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

Implements UnitAI.

208 {
209 if (!UpdateVictim())
210 return;
211
212 if (!me->IsCharmed())
213 events.Update(diff);
214
216 return;
217
218 while (uint32 eventId = events.ExecuteEvent())
219 {
220 switch (eventId)
221 {
222 case EVENT_CLEAVE:
224 events.ScheduleEvent(EVENT_CLEAVE, 7s, 10s);
225 break;
226 case EVENT_STOMP:
228 events.ScheduleEvent(EVENT_STOMP, 15s, 25s);
229 break;
230 case EVENT_FIREBALL:
232 events.ScheduleEvent(EVENT_FIREBALL, 12s, 15s);
233 break;
236 events.ScheduleEvent(EVENT_CONFLAGRATION, 30s);
237 break;
238 }
239 }
240
242 }
std::uint32_t uint32
Definition Define.h:107
@ UNIT_STATE_CASTING
Definition UnitDefines.h:188
@ SPELL_CLEAVE
Definition boss_razorgore.cpp:45
@ SPELL_CONFLAGRATION
Definition boss_razorgore.cpp:48
@ SPELL_FIREBALLVOLLEY
Definition boss_razorgore.cpp:47
@ SPELL_WARSTOMP
Definition boss_razorgore.cpp:46
bool UpdateVictim()
Definition CreatureAI.cpp:353
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:40
SpellCastResult DoCastVictim(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:277
bool IsCharmed() const
Definition Unit.h:1310
bool HasUnitState(const uint32 f) const
Definition Unit.h:736

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::_charmerGUID
private

◆ _summonGUIDS

GuidVector boss_razorgore::_summonGUIDS
private

Referenced by DoChangePhase(), and JustSummoned().

◆ secondPhase

bool boss_razorgore::secondPhase
private

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