TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boss_onyxia::boss_onyxiaAI Struct Reference

Public Member Functions

 boss_onyxiaAI (Creature *creature)
 
void Initialize ()
 
void Reset () override
 
void EnterCombat (Unit *) override
 
void JustSummoned (Creature *summoned) override
 
void KilledUnit (Unit *) override
 
void SpellHit (Unit *, const SpellInfo *Spell) override
 
void MovementInform (uint32 type, uint32 id) override
 
void SpellHitTarget (Unit *target, const SpellInfo *Spell) override
 
OnyxMoveGetMoveData ()
 
void SetNextRandomPoint ()
 
void UpdateAI (uint32 diff) override
 
- Public Member Functions inherited from BossAI
 BossAI (Creature *creature, uint32 bossId)
 
virtual ~BossAI ()
 
void SummonedCreatureDespawn (Creature *summon) override
 
virtual void ExecuteEvent (uint32)
 
virtual void ScheduleTasks ()
 
void JustDied (Unit *) override
 
void JustReachedHome () override
 
bool CanAIAttack (Unit const *target) const override
 
- Public Member Functions inherited from ScriptedAI
 ScriptedAI (Creature *creature)
 
virtual ~ScriptedAI ()
 
void AttackStartNoMove (Unit *target)
 
void DamageTaken (Unit *, uint32 &) override
 
void OnPossess (bool)
 
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 DoResetThreat ()
 
float DoGetThreat (Unit *unit)
 
void DoModifyThreatPercent (Unit *unit, int32 pct)
 
void DoTeleportTo (float x, float y, float z, uint32 time=0)
 
void DoTeleportTo (float const pos[4])
 
void DoTeleportPlayer (Unit *unit, float x, float y, float z, float o)
 
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 HealthBelowPct (uint32 pct) const
 
bool HealthAbovePct (uint32 pct) const
 
SpellInfo constSelectSpell (Unit *target, uint32 school, uint32 mechanic, SelectTargetType targets, 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)
 
void SetCombatMovement (bool allowMovement)
 
bool IsCombatMovementAllowed () 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
 
- Public Member Functions inherited from CreatureAI
void Talk (uint8 id, WorldObject const *whisperTarget=nullptr)
 
 CreatureAI (Creature *creature)
 
virtual ~CreatureAI ()
 
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 IsSummonedBy (Unit *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted () const
 
virtual void JustRespawned ()
 
void OnCharmed (bool apply) override
 
void DoZoneInCombat (Creature *creature=NULL, float maxRangeToNearestTarget=50.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 void OnSpellClick (Unit *, bool &)
 
virtual bool CanSeeAlways (WorldObject const *)
 
int32 VisualizeBoundary (uint32 duration, Unit *owner=nullptr, bool fill=false) const
 
virtual bool CheckInRoom ()
 
CreatureBoundary constGetBoundary () const
 
- Public Member Functions inherited from UnitAI
 UnitAI (Unit *unit)
 
virtual ~UnitAI ()
 
virtual void InitializeAI ()
 
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 (SelectAggroTarget targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, int32 aura=0)
 
template<class PREDICATE >
UnitSelectTarget (SelectAggroTarget targetType, uint32 position, PREDICATE const &predicate)
 
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectAggroTarget targetType, float dist=0.0f, bool playerOnly=false, int32 aura=0)
 
template<class PREDICATE >
void SelectTargetList (std::list< Unit * > &targetList, PREDICATE const &predicate, uint32 maxTargets, SelectAggroTarget targetType)
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType)
 
virtual void HealReceived (Unit *, uint32 &)
 
virtual void HealDone (Unit *, uint32 &)
 
virtual void SpellInterrupted (uint32, uint32)
 
void AttackStartCaster (Unit *victim, float dist)
 
void DoCast (uint32 spellId)
 
void DoCast (Unit *victim, uint32 spellId, bool triggered=false)
 
void DoCastVictim (uint32 spellId, bool triggered=false)
 
void DoCastAOE (uint32 spellId, bool triggered=false)
 
void DoMeleeAttackIfReady ()
 
bool DoSpellAttackIfReady (uint32 spellId)
 
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 sQuestReward (Player *, Quest const *, uint32)
 
virtual bool sOnDummyEffect (Unit *, uint32, SpellEffIndex)
 
virtual void sOnGameEvent (bool, uint16)
 

Private Attributes

OnyxMovePointData
 
uint8 Phase
 
uint8 MovePoint
 
uint8 SummonWhelpCount
 
ObjectGuid triggerGUID
 
ObjectGuid tankGUID
 
bool IsMoving
 

Additional Inherited Members

- Public Types inherited from CreatureAI
enum  EvadeReason { EVADE_REASON_NO_HOSTILES, EVADE_REASON_BOUNDARY, EVADE_REASON_SEQUENCE_BREAK, EVADE_REASON_OTHER }
 
- Static Public Member Functions inherited from UnitAI
static void FillAISpellInfo ()
 
- Public Attributes inherited from BossAI
InstanceScript *const instance
 
- Public Attributes inherited from ScriptedAI
bool IsFleeing
 
- Static Public Attributes inherited from UnitAI
static AISpellInfoTypeAISpellInfo
 
- Protected Member Functions inherited from BossAI
void _Reset ()
 
void _EnterCombat ()
 
void _JustDied ()
 
void _JustReachedHome ()
 
void _DespawnAtEvade ()
 
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)
 
bool CheckBoundary (Position const *who=nullptr) const
 
void SetBoundary (CreatureBoundary const *boundary)
 
virtual void MoveInLineOfSight (Unit *)
 
bool _EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
- Protected Attributes inherited from BossAI
EventMap events
 
SummonList summons
 
TaskScheduler scheduler
 
- Protected Attributes inherited from CreatureAI
Creature *const me
 
CreatureBoundary const_boundary
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Constructor & Destructor Documentation

boss_onyxia::boss_onyxiaAI::boss_onyxiaAI ( Creature creature)
inline
132  : BossAI(creature, DATA_ONYXIA)
133  {
134  Initialize();
135  }
void Initialize()
Definition: boss_onyxia.cpp:137
Definition: onyxias_lair.h:27
BossAI(Creature *creature, uint32 bossId)
Definition: ScriptedCreature.cpp:444

+ Here is the call graph for this function:

Member Function Documentation

void boss_onyxia::boss_onyxiaAI::EnterCombat ( Unit )
inlineoverridevirtual

Reimplemented from BossAI.

162  {
163  _EnterCombat();
164  Talk(SAY_AGGRO);
166  events.ScheduleEvent(EVENT_TAIL_SWEEP, urand(15000, 20000));
167  events.ScheduleEvent(EVENT_CLEAVE, urand(2000, 5000));
170  }
void _EnterCombat()
Definition: ScriptedCreature.cpp:480
Definition: onyxias_lair.h:70
Definition: boss_onyxia.cpp:82
Definition: DBCEnums.h:183
void DoStartTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry)
Definition: InstanceScript.cpp:518
Definition: boss_onyxia.cpp:80
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:45
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
Definition: boss_onyxia.cpp:83
void ScheduleEvent(uint32 eventId, Milliseconds const &time, uint32 group=0, uint8 phase=0)
Definition: EventMap.h:123
Definition: boss_onyxia.cpp:81
EventMap events
Definition: ScriptedCreature.h:371
Definition: boss_onyxia.cpp:39
InstanceScript *const instance
Definition: ScriptedCreature.h:340

+ Here is the call graph for this function:

OnyxMove* boss_onyxia::boss_onyxiaAI::GetMoveData ( )
inline
295  {
296  uint8 MaxCount = sizeof(MoveData) / sizeof(OnyxMove);
297 
298  for (uint8 i = 0; i < MaxCount; ++i)
299  {
300  if (MoveData[i].LocId == MovePoint)
301  return &MoveData[i];
302  }
303 
304  return NULL;
305  }
uint8 MovePoint
Definition: boss_onyxia.cpp:474
arena_t NULL
Definition: jemalloc_internal.h:624
static OnyxMove MoveData[8]
Definition: boss_onyxia.cpp:99
uint8_t uint8
Definition: Define.h:152
Definition: boss_onyxia.cpp:91

+ Here is the caller graph for this function:

void boss_onyxia::boss_onyxiaAI::Initialize ( void  )
inline
138  {
139  Phase = PHASE_START;
140  MovePoint = urand(0, 5);
142  SummonWhelpCount = 0;
143  triggerGUID.Clear();
144  tankGUID.Clear();
145  IsMoving = false;
146  }
bool IsMoving
Definition: boss_onyxia.cpp:478
uint8 MovePoint
Definition: boss_onyxia.cpp:474
ObjectGuid triggerGUID
Definition: boss_onyxia.cpp:476
OnyxMove * PointData
Definition: boss_onyxia.cpp:472
ObjectGuid tankGUID
Definition: boss_onyxia.cpp:477
uint8 SummonWhelpCount
Definition: boss_onyxia.cpp:475
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:45
void Clear()
Definition: ObjectGuid.h:215
Definition: onyxias_lair.h:45
OnyxMove * GetMoveData()
Definition: boss_onyxia.cpp:294
Phase
Definition: boss_kiljaeden.cpp:153

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void boss_onyxia::boss_onyxiaAI::JustSummoned ( Creature summoned)
inlineoverridevirtual

Reimplemented from BossAI.

173  {
174  summoned->SetInCombatWithZone();
175  if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
176  summoned->AI()->AttackStart(target);
177 
178  switch (summoned->GetEntry())
179  {
180  case NPC_WHELP:
182  break;
183  case NPC_LAIRGUARD:
184  summoned->setActive(true);
185  break;
186  }
187  summons.Summon(summoned);
188  }
Definition: onyxias_lair.h:52
void setActive(bool isActiveObject)
Definition: Object.cpp:1473
void Summon(Creature const *summon)
Definition: ScriptedCreature.h:92
uint8 SummonWhelpCount
Definition: boss_onyxia.cpp:475
Definition: UnitAI.h:35
CreatureAI * AI() const
Definition: Creature.h:525
Unit * SelectTarget(SelectAggroTarget targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, int32 aura=0)
Definition: UnitAI.cpp:91
SummonList summons
Definition: ScriptedCreature.h:372
Definition: onyxias_lair.h:53
void SetInCombatWithZone()
Definition: Creature.cpp:2299
uint32 GetEntry() const
Definition: Object.h:107
Definition: Unit.h:1305
virtual void AttackStart(Unit *)
Definition: UnitAI.cpp:29

+ Here is the call graph for this function:

void boss_onyxia::boss_onyxiaAI::KilledUnit ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

192  {
193  Talk(SAY_KILL);
194  }
Definition: boss_onyxia.cpp:40
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42

+ Here is the call graph for this function:

void boss_onyxia::boss_onyxiaAI::MovementInform ( uint32  type,
uint32  id 
)
inlineoverridevirtual

Reimplemented from CreatureAI.

214  {
215  if (type == POINT_MOTION_TYPE)
216  {
217  switch (id)
218  {
219  case 8:
221  if (PointData)
222  {
223  me->SetSpeed(MOVE_FLIGHT, 1.0f);
225  }
226  break;
227  case 9:
228  me->SetCanFly(false);
229  me->SetDisableGravity(false);
232  me->Kill(trigger);
234  // tank selection based on phase one. If tank is not there i take nearest one
235  if (Unit* tank = ObjectAccessor::GetUnit(*me, tankGUID))
236  me->GetMotionMaster()->MoveChase(tank);
237  else if (Unit* newtarget = SelectTarget(SELECT_TARGET_NEAREST, 0))
238  me->GetMotionMaster()->MoveChase(newtarget);
241  events.ScheduleEvent(EVENT_TAIL_SWEEP, urand(15000, 20000));
242  events.ScheduleEvent(EVENT_CLEAVE, urand(2000, 5000));
244  break;
245  case 10:
246  me->SetCanFly(true);
247  me->SetDisableGravity(true);
249  me->SetFacingTo(me->GetOrientation() + float(M_PI));
251  triggerGUID = trigger->GetGUID();
253  me->SetSpeed(MOVE_FLIGHT, 1.0f);
261  break;
262  case 11:
263  if (PointData)
266  break;
267  default:
268  IsMoving = false;
269  break;
270  }
271  }
272  }
Position const Phase2Floating
Definition: boss_onyxia.cpp:114
void Kill(Unit *victim, bool durabilityLoss=true)
Definition: Unit.cpp:13513
bool IsMoving
Definition: boss_onyxia.cpp:478
Definition: Unit.h:605
void MoveIdle()
Definition: MotionMaster.cpp:185
float fX
Definition: boss_onyxia.cpp:96
Definition: Unit.h:1131
Definition: onyxias_lair.h:32
TC_GAME_API Unit * GetUnit(WorldObject const &, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:163
float fY
Definition: boss_onyxia.cpp:96
Position const MiddleRoomLocation
Definition: boss_onyxia.cpp:111
#define M_PI
Definition: Common.h:163
void MoveChase(Unit *target, float dist=0.0f, float angle=0.0f)
Definition: MotionMaster.cpp:241
Definition: boss_onyxia.cpp:82
MotionMaster * GetMotionMaster()
Definition: Unit.h:2101
Definition: Unit.h:254
float fZ
Definition: boss_onyxia.cpp:96
Definition: boss_onyxia.cpp:41
ObjectGuid triggerGUID
Definition: boss_onyxia.cpp:476
Definition: Unit.h:253
Definition: Object.h:58
Definition: Creature.h:467
Definition: boss_onyxia.cpp:84
OnyxMove * PointData
Definition: boss_onyxia.cpp:472
bool SetDisableGravity(bool disable, bool packetOnly=false)
Definition: Unit.cpp:15818
Definition: boss_onyxia.cpp:87
ObjectGuid tankGUID
Definition: boss_onyxia.cpp:477
void SetByteFlag(uint16 index, uint8 offset, uint8 newFlag)
Definition: Object.cpp:1252
Creature *const me
Definition: CreatureAI.h:71
void MovePoint(uint32 id, Position const &pos, bool generatePath=true)
Definition: MotionMaster.h:172
float GetOrientation() const
Definition: Position.h:107
Definition: boss_onyxia.cpp:80
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:45
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:52
Unit * SelectTarget(SelectAggroTarget targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, int32 aura=0)
Definition: UnitAI.cpp:91
bool SetCanFly(bool enable)
Definition: Unit.cpp:15899
void RemoveByteFlag(uint16 index, uint8 offset, uint8 newFlag)
Definition: Object.cpp:1271
void SetFacingTo(float ori)
Definition: Unit.cpp:15777
Definition: boss_onyxia.cpp:88
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
Definition: boss_onyxia.cpp:83
void ScheduleEvent(uint32 eventId, Milliseconds const &time, uint32 group=0, uint8 phase=0)
Definition: EventMap.h:123
Definition: boss_onyxia.cpp:81
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:174
uint8 LocId
Definition: boss_onyxia.cpp:93
Definition: boss_onyxia.cpp:79
Definition: UpdateFields.h:124
OnyxMove * GetMoveData()
Definition: boss_onyxia.cpp:294
EventMap events
Definition: ScriptedCreature.h:371
void SetSpeed(UnitMoveType mtype, float rate, bool forced=false)
Definition: Unit.cpp:10531
void MoveTakeoff(uint32 id, Position const &pos)
Definition: MotionMaster.cpp:313
Definition: Unit.h:1305
void SetReactState(ReactStates st)
Definition: Creature.h:502
Definition: MotionMaster.h:46
Phase
Definition: boss_kiljaeden.cpp:153
Definition: onyxias_lair.h:55
TempSummon * SummonCreature(uint32 id, Position const &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0) const
Definition: Object.cpp:2346
InstanceScript *const instance
Definition: ScriptedCreature.h:340
Definition: boss_onyxia.cpp:85
Definition: boss_onyxia.cpp:86
Definition: UnitAI.h:38

+ Here is the call graph for this function:

void boss_onyxia::boss_onyxiaAI::Reset ( )
inlineoverridevirtual

Reimplemented from BossAI.

149  {
150  Initialize();
151 
153  SetCombatMovement(true);
154 
155  _Reset();
159  }
Definition: Unit.h:1131
void Initialize()
Definition: boss_onyxia.cpp:137
Definition: onyxias_lair.h:32
Definition: onyxias_lair.h:70
void DoStopTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry)
Definition: InstanceScript.cpp:529
Definition: DBCEnums.h:183
bool IsCombatMovementAllowed() const
Definition: ScriptedCreature.h:261
Creature *const me
Definition: CreatureAI.h:71
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:52
void _Reset()
Definition: ScriptedCreature.cpp:457
void SetCombatMovement(bool allowMovement)
Definition: ScriptedCreature.cpp:382
void SetReactState(ReactStates st)
Definition: Creature.h:502
Phase
Definition: boss_kiljaeden.cpp:153
InstanceScript *const instance
Definition: ScriptedCreature.h:340

+ Here is the call graph for this function:

void boss_onyxia::boss_onyxiaAI::SetNextRandomPoint ( )
inline
308  {
309  uint8 MaxCount = sizeof(MoveData) / sizeof(OnyxMove);
310 
311  uint8 iTemp = urand(0, MaxCount - 1);
312 
313  if (iTemp >= MovePoint)
314  ++iTemp;
315 
316  MovePoint = iTemp;
317  }
uint8 MovePoint
Definition: boss_onyxia.cpp:474
static OnyxMove MoveData[8]
Definition: boss_onyxia.cpp:99
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:45
uint8_t uint8
Definition: Define.h:152
Definition: boss_onyxia.cpp:91

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void boss_onyxia::boss_onyxiaAI::SpellHit ( Unit ,
const SpellInfo Spell 
)
inlineoverridevirtual

Reimplemented from ScriptedAI.

197  {
198  if (Spell->Id == SPELL_BREATH_EAST_TO_WEST ||
199  Spell->Id == SPELL_BREATH_WEST_TO_EAST ||
200  Spell->Id == SPELL_BREATH_SE_TO_NW ||
201  Spell->Id == SPELL_BREATH_NW_TO_SE ||
202  Spell->Id == SPELL_BREATH_SW_TO_NE ||
203  Spell->Id == SPELL_BREATH_NE_TO_SW)
204  {
207 
208  me->SetSpeed(MOVE_FLIGHT, 1.5f);
210  }
211  }
uint32 Id
Definition: SpellInfo.h:329
Definition: Unit.h:605
uint8 LocIdEnd
Definition: boss_onyxia.cpp:94
Position const MiddleRoomLocation
Definition: boss_onyxia.cpp:111
uint8 MovePoint
Definition: boss_onyxia.cpp:474
Definition: boss_onyxia.cpp:64
MotionMaster * GetMotionMaster()
Definition: Unit.h:2101
OnyxMove * PointData
Definition: boss_onyxia.cpp:472
Definition: boss_onyxia.cpp:63
Definition: boss_onyxia.cpp:69
Creature *const me
Definition: CreatureAI.h:71
void MovePoint(uint32 id, Position const &pos, bool generatePath=true)
Definition: MotionMaster.h:172
Definition: boss_onyxia.cpp:68
Definition: boss_onyxia.cpp:67
Definition: boss_onyxia.cpp:66
OnyxMove * GetMoveData()
Definition: boss_onyxia.cpp:294
void SetSpeed(UnitMoveType mtype, float rate, bool forced=false)
Definition: Unit.cpp:10531

+ Here is the call graph for this function:

void boss_onyxia::boss_onyxiaAI::SpellHitTarget ( Unit target,
const SpellInfo Spell 
)
inlineoverridevirtual

Reimplemented from ScriptedAI.

275  {
276  //Workaround - Couldn't find a way to group this spells (All Eruption)
277  if (((Spell->Id >= 17086 && Spell->Id <= 17095) ||
278  (Spell->Id == 17097) ||
279  (Spell->Id >= 18351 && Spell->Id <= 18361) ||
280  (Spell->Id >= 18564 && Spell->Id <= 18576) ||
281  (Spell->Id >= 18578 && Spell->Id <= 18607) ||
282  (Spell->Id == 18609) ||
283  (Spell->Id >= 18611 && Spell->Id <= 18628) ||
284  (Spell->Id >= 21132 && Spell->Id <= 21133) ||
285  (Spell->Id >= 21135 && Spell->Id <= 21139) ||
286  (Spell->Id >= 22191 && Spell->Id <= 22202) ||
287  (Spell->Id >= 22267 && Spell->Id <= 22268)) &&
288  (target->GetTypeId() == TYPEID_PLAYER))
289  {
291  }
292  }
uint32 Id
Definition: SpellInfo.h:329
Definition: InstanceScript.h:60
TypeID GetTypeId() const
Definition: Object.h:113
Definition: onyxias_lair.h:33
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:52
Definition: ObjectGuid.h:33
InstanceScript *const instance
Definition: ScriptedCreature.h:340

+ Here is the call graph for this function:

void boss_onyxia::boss_onyxiaAI::UpdateAI ( uint32  diff)
inlineoverridevirtual
Todo:
: In what cases is this null? What should we do?

Reimplemented from BossAI.

320  {
321  if (!UpdateVictim())
322  return;
323 
324  //Common to PHASE_START && PHASE_END
325  if (Phase == PHASE_START || Phase == PHASE_END)
326  {
327  //Specific to PHASE_START || PHASE_END
328  if (Phase == PHASE_START)
329  {
330  if (HealthBelowPct(65))
331  {
332  if (Unit* target = me->GetVictim())
333  tankGUID = target->GetGUID();
334  SetCombatMovement(false);
337  me->AttackStop();
339  return;
340  }
341  }
342 
343  events.Update(diff);
344 
345  while (uint32 eventId = events.ExecuteEvent())
346  {
347  switch (eventId)
348  {
349  case EVENT_BELLOWING_ROAR: // Phase PHASE_END
350  {
352  // Eruption
353  GameObject* Floor = NULL;
356  me->VisitNearbyGridObject(30, searcher);
357  if (Floor)
360  break;
361  }
362  case EVENT_FLAME_BREATH: // Phase PHASE_START and PHASE_END
365  break;
366  case EVENT_TAIL_SWEEP: // Phase PHASE_START and PHASE_END
368  events.ScheduleEvent(EVENT_TAIL_SWEEP, urand(15000, 20000));
369  break;
370  case EVENT_CLEAVE: // Phase PHASE_START and PHASE_END
372  events.ScheduleEvent(EVENT_CLEAVE, urand(2000, 5000));
373  break;
374  case EVENT_WING_BUFFET: // Phase PHASE_START and PHASE_END
377  break;
378  default:
379  break;
380  }
381  }
383  }
384  else
385  {
386  if (HealthBelowPct(40))
387  {
388  Phase = PHASE_END;
391  SetCombatMovement(true);
392  IsMoving = false;
393  Position const pos = me->GetHomePosition();
394  me->GetMotionMaster()->MovePoint(9, pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ() + 12.0f);
396  return;
397  }
398 
399  if (!me->isMoving())
401  me->SetFacingToObject(trigger);
402 
403  events.Update(diff);
404 
405  while (uint32 eventId = events.ExecuteEvent())
406  {
407  switch (eventId)
408  {
409  case EVENT_DEEP_BREATH: // Phase PHASE_BREATH
410  if (!IsMoving)
411  {
412  if (me->IsNonMeleeSpellCast(false))
413  me->InterruptNonMeleeSpells(false);
414 
416  if (PointData)
419  }
420  else
422  break;
423  case EVENT_MOVEMENT: // Phase PHASE_BREATH
425  {
428 
429  if (!PointData)
430  return;
431 
433  IsMoving = true;
435  }
436  else
438  break;
439  case EVENT_FIREBALL: // Phase PHASE_BREATH
440  if (!IsMoving)
441  {
442  if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
443  DoCast(target, SPELL_FIREBALL);
445  }
446  else
448  break;
449  case EVENT_LAIR_GUARD: // Phase PHASE_BREATH
452  break;
453  case EVENT_WHELP_SPAWN: // Phase PHASE_BREATH
456  if (SummonWhelpCount >= RAID_MODE(20, 40))
457  {
458  SummonWhelpCount = 0;
460  }
461  else
463  break;
464  default:
465  break;
466  }
467  }
468  }
469  }
bool AttackStop()
Definition: Unit.cpp:7337
Definition: onyxias_lair.h:52
bool IsMoving
Definition: boss_onyxia.cpp:478
void DoCastAOE(uint32 spellId, bool triggered=false)
Definition: UnitAI.cpp:167
float fX
Definition: boss_onyxia.cpp:96
bool UpdateVictim()
Definition: CreatureAI.cpp:233
Definition: onyxias_lair.h:32
Definition: GridNotifiers.h:323
float fY
Definition: boss_onyxia.cpp:96
Definition: Unit.h:565
Definition: boss_onyxia.cpp:57
Definition: Unit.h:1129
Definition: boss_onyxia.cpp:51
bool HealthBelowPct(uint32 pct) const
Definition: ScriptedCreature.h:247
Definition: boss_onyxia.cpp:82
Position const Phase2Location
Definition: boss_onyxia.cpp:113
MotionMaster * GetMotionMaster()
Definition: Unit.h:2101
float fZ
Definition: boss_onyxia.cpp:96
arena_t NULL
Definition: jemalloc_internal.h:624
virtual void SetGuidData(uint32, ObjectGuid)
Definition: ZoneScript.h:45
ObjectGuid triggerGUID
Definition: boss_onyxia.cpp:476
Definition: Object.h:58
Definition: Creature.h:467
Definition: boss_onyxia.cpp:84
OnyxMove * PointData
Definition: boss_onyxia.cpp:472
Definition: boss_onyxia.cpp:53
void SetNextRandomPoint()
Definition: boss_onyxia.cpp:307
Definition: boss_onyxia.cpp:87
bool IsNonMeleeSpellCast(bool withDelayed, bool skipChanneled=false, bool skipAutorepeat=false, bool isAutoshoot=false, bool skipInstant=true) const
Definition: Unit.cpp:2886
ObjectGuid tankGUID
Definition: boss_onyxia.cpp:477
void VisitNearbyGridObject(float const &radius, NOTIFIER &notifier) const
Definition: Object.h:588
Definition: boss_onyxia.cpp:74
Definition: onyxias_lair.h:40
uint8 SummonWhelpCount
Definition: boss_onyxia.cpp:475
bool isMoving() const
Definition: Unit.h:2186
Creature *const me
Definition: CreatureAI.h:71
void MovePoint(uint32 id, Position const &pos, bool generatePath=true)
Definition: MotionMaster.h:172
void SetFacingToObject(WorldObject const *object)
Definition: Unit.cpp:15787
Definition: boss_onyxia.cpp:80
Definition: boss_onyxia.cpp:52
Definition: boss_onyxia.cpp:44
Definition: UnitAI.h:35
uint32 SpellId
Definition: boss_onyxia.cpp:95
Definition: boss_onyxia.cpp:42
Unit * GetVictim() const
Definition: Unit.h:1379
float GetPositionY() const
Definition: Position.h:105
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:45
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:52
Definition: GridNotifiers.h:1301
Unit * SelectTarget(SelectAggroTarget targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, int32 aura=0)
Definition: UnitAI.cpp:91
float GetPositionZ() const
Definition: Position.h:106
Definition: onyxias_lair.h:47
uint32_t uint32
Definition: Define.h:150
void DoCast(uint32 spellId)
Definition: UnitAI.cpp:101
Definition: GameObject.h:880
Definition: boss_onyxia.cpp:88
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
Definition: onyxias_lair.h:46
Definition: boss_onyxia.cpp:83
void ScheduleEvent(uint32 eventId, Milliseconds const &time, uint32 group=0, uint8 phase=0)
Definition: EventMap.h:123
Definition: boss_onyxia.cpp:81
void SetCombatMovement(bool allowMovement)
Definition: ScriptedCreature.cpp:382
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:174
void Update(uint32 time)
Definition: EventMap.h:54
const T & RAID_MODE(const T &normal10, const T &normal25) const
Definition: ScriptedCreature.h:293
ObjectGuid const & GetGUID() const
Definition: Object.h:105
uint8 LocId
Definition: boss_onyxia.cpp:93
Definition: onyxias_lair.h:45
Definition: onyxias_lair.h:53
Definition: boss_onyxia.cpp:79
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true)
Definition: Unit.cpp:2916
uint32 ExecuteEvent()
Definition: EventMap.cpp:46
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:49
bool HasUnitState(const uint32 f) const
Definition: Unit.h:1395
Definition: Position.h:27
OnyxMove * GetMoveData()
Definition: boss_onyxia.cpp:294
EventMap events
Definition: ScriptedCreature.h:371
Definition: boss_onyxia.cpp:50
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition: UnitAI.cpp:159
Position const SpawnLocations[3]
Definition: boss_onyxia.cpp:116
T check(T value)
Definition: format.h:305
float GetPositionX() const
Definition: Position.h:104
Definition: Unit.h:1305
void SetReactState(ReactStates st)
Definition: Creature.h:502
Phase
Definition: boss_kiljaeden.cpp:153
void GetHomePosition(float &x, float &y, float &z, float &ori) const
Definition: Creature.h:672
TempSummon * SummonCreature(uint32 id, Position const &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0) const
Definition: Object.cpp:2346
InstanceScript *const instance
Definition: ScriptedCreature.h:340
Definition: boss_onyxia.cpp:85
Definition: boss_onyxia.cpp:86

+ Here is the call graph for this function:

Member Data Documentation

bool boss_onyxia::boss_onyxiaAI::IsMoving
private
uint8 boss_onyxia::boss_onyxiaAI::MovePoint
private
uint8 boss_onyxia::boss_onyxiaAI::Phase
private
OnyxMove* boss_onyxia::boss_onyxiaAI::PointData
private
uint8 boss_onyxia::boss_onyxiaAI::SummonWhelpCount
private
ObjectGuid boss_onyxia::boss_onyxiaAI::tankGUID
private
ObjectGuid boss_onyxia::boss_onyxiaAI::triggerGUID
private

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