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

Public Member Functions

 boss_alarAI (Creature *creature)
 
void Initialize ()
 
void Reset () override
 
void EnterCombat (Unit *) override
 
void JustSummoned (Creature *summon) override
 
void MoveInLineOfSight (Unit *) override
 
void AttackStart (Unit *who) override
 
void DamageTaken (Unit *, uint32 &damage) override
 
void SpellHit (Unit *, const SpellInfo *spell) override
 
void MovementInform (uint32 type, uint32) override
 
void UpdateAI (uint32 diff) override
 
void DoMeleeAttackIfReady ()
 
- 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 KilledUnit (Unit *) override
 
void SpellHitTarget (Unit *, SpellInfo const *) override
 
void OnPossess (bool)
 
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)
 

Public Attributes

WaitEventType WaitEvent
 
uint32 WaitTimer
 
bool AfterMoving
 
uint32 Platforms_Move_Timer
 
uint32 DiveBomb_Timer
 
uint32 MeltArmor_Timer
 
uint32 Charge_Timer
 
uint32 FlamePatch_Timer
 
uint32 Berserk_Timer
 
float DefaultMoveSpeedRate
 
bool Phase1
 
bool ForceMove
 
uint32 ForceTimer
 
int8 cur_wp
 
- Public Attributes inherited from BossAI
InstanceScript *const instance
 
- Public Attributes inherited from ScriptedAI
bool IsFleeing
 

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 ()
 
- 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)
 
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_alar::boss_alarAI::boss_alarAI ( Creature creature)
inline
82  : BossAI(creature, DATA_ALAR)
83  {
84  Initialize();
86  DiveBomb_Timer = 0;
87  MeltArmor_Timer = 0;
88  Charge_Timer = 0;
89  FlamePatch_Timer = 0;
90  }
Definition: the_eye.h:30
void Initialize()
Definition: boss_alar.cpp:92
uint32 Charge_Timer
Definition: boss_alar.cpp:115
uint32 MeltArmor_Timer
Definition: boss_alar.cpp:114
uint32 FlamePatch_Timer
Definition: boss_alar.cpp:116
Definition: Unit.h:600
uint32 DiveBomb_Timer
Definition: boss_alar.cpp:113
BossAI(Creature *creature, uint32 bossId)
Definition: ScriptedCreature.cpp:444
float DefaultMoveSpeedRate
Definition: boss_alar.cpp:119
float GetSpeedRate(UnitMoveType mtype) const
Definition: Unit.h:2087

+ Here is the call graph for this function:

Member Function Documentation

void boss_alar::boss_alarAI::AttackStart ( Unit who)
inlineoverridevirtual

Reimplemented from ScriptedAI.

159  {
160  if (Phase1)
161  AttackStartNoMove(who);
162  else
164  }
void AttackStartNoMove(Unit *target)
Definition: ScriptedCreature.cpp:108
bool Phase1
Definition: boss_alar.cpp:121
void AttackStart(Unit *) override
Definition: ScriptedCreature.cpp:117

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void boss_alar::boss_alarAI::DamageTaken ( Unit ,
uint32 damage 
)
inlineoverridevirtual

Reimplemented from ScriptedAI.

167  {
168  if (damage >= me->GetHealth() && Phase1)
169  {
170  damage = 0;
171  if (!WaitEvent)
172  {
173  WaitEvent = WE_DIE;
174  WaitTimer = 0;
175  me->SetHealth(0);
177  me->RemoveAllAuras();
179  me->AttackStop();
181  me->SetSpeed(MOVE_RUN, 5.0f);
182  me->GetMotionMaster()->Clear();
183  me->GetMotionMaster()->MovePoint(0, waypoint[5][0], waypoint[5][1], waypoint[5][2]);
184  }
185  }
186  }
bool AttackStop()
Definition: Unit.cpp:7337
void RemoveAllAuras()
Definition: Unit.cpp:3920
static ObjectGuid const Empty
Definition: ObjectGuid.h:196
Definition: Unit.h:674
void Clear(bool reset=true)
Definition: MotionMaster.h:138
MotionMaster * GetMotionMaster()
Definition: Unit.h:2101
bool Phase1
Definition: boss_alar.cpp:121
void SetFlag(uint16 index, uint32 newFlag)
Definition: Object.cpp:1199
WaitEventType WaitEvent
Definition: boss_alar.cpp:107
Creature *const me
Definition: CreatureAI.h:71
void MovePoint(uint32 id, Position const &pos, bool generatePath=true)
Definition: MotionMaster.h:172
Definition: boss_alar.cpp:66
uint32 WaitTimer
Definition: boss_alar.cpp:108
Definition: Unit.h:600
Definition: UpdateFields.h:109
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true)
Definition: Unit.cpp:2916
void SetSpeed(UnitMoveType mtype, float rate, bool forced=false)
Definition: Unit.cpp:10531
void SetHealth(uint32 val)
Definition: Unit.cpp:11537
uint32 GetHealth() const
Definition: Unit.h:1426
void SetTarget(ObjectGuid const &guid) override
Definition: Creature.cpp:2675
static float waypoint[6][3]
Definition: boss_alar.cpp:50

+ Here is the call graph for this function:

void boss_alar::boss_alarAI::DoMeleeAttackIfReady ( )
inline
424  {
425  if (me->isAttackReady() && !me->IsNonMeleeSpellCast(false))
426  {
428  {
430  me->resetAttackTimer();
431  }
432  else
433  {
434  Unit* target = NULL;
436  if (target)
437  AttackStart(target);
438  else
439  {
440  DoCast(me, SPELL_FLAME_BUFFET, true);
441  me->setAttackTimer(BASE_ATTACK, 1500);
442  }
443  }
444  }
445  }
void setAttackTimer(WeaponAttackType type, uint32 time)
Definition: Unit.h:1354
void AttackStart(Unit *who) override
Definition: boss_alar.cpp:158
Unit * SelectNearestTargetInAttackDistance(float dist=0) const
Definition: Creature.cpp:1970
void AttackerStateUpdate(Unit *victim, WeaponAttackType attType=BASE_ATTACK, bool extra=false)
Definition: Unit.cpp:1874
arena_t NULL
Definition: jemalloc_internal.h:624
bool IsNonMeleeSpellCast(bool withDelayed, bool skipChanneled=false, bool skipAutorepeat=false, bool isAutoshoot=false, bool skipInstant=true) const
Definition: Unit.cpp:2886
Creature *const me
Definition: CreatureAI.h:71
Unit * GetVictim() const
Definition: Unit.h:1379
bool IsWithinMeleeRange(const Unit *obj, float dist=MELEE_RANGE) const
Definition: Unit.cpp:508
void DoCast(uint32 spellId)
Definition: UnitAI.cpp:101
bool isAttackReady(WeaponAttackType type=BASE_ATTACK) const
Definition: Unit.h:1357
void resetAttackTimer(WeaponAttackType type=BASE_ATTACK)
Definition: Unit.cpp:481
Definition: boss_alar.cpp:33
Definition: Unit.h:1305
Definition: Unit.h:617

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void boss_alar::boss_alarAI::EnterCombat ( Unit )
inlineoverridevirtual

Reimplemented from BossAI.

143  {
144  _EnterCombat();
145  me->SetDisableGravity(true); // after enterevademode will be set walk movement
146  me->setActive(true);
147  }
void _EnterCombat()
Definition: ScriptedCreature.cpp:480
void setActive(bool isActiveObject)
Definition: Object.cpp:1473
bool SetDisableGravity(bool disable, bool packetOnly=false)
Definition: Unit.cpp:15818
Creature *const me
Definition: CreatureAI.h:71

+ Here is the call graph for this function:

void boss_alar::boss_alarAI::Initialize ( void  )
inline
93  {
94  Berserk_Timer = 1200000;
96 
97  Phase1 = true;
99  WaitTimer = 0;
100  AfterMoving = false;
101  ForceMove = false;
102  ForceTimer = 5000;
103 
104  cur_wp = 4;
105  }
Definition: boss_alar.cpp:62
uint32 Berserk_Timer
Definition: boss_alar.cpp:117
bool Phase1
Definition: boss_alar.cpp:121
int8 cur_wp
Definition: boss_alar.cpp:125
WaitEventType WaitEvent
Definition: boss_alar.cpp:107
uint32 Platforms_Move_Timer
Definition: boss_alar.cpp:112
uint32 WaitTimer
Definition: boss_alar.cpp:108
bool AfterMoving
Definition: boss_alar.cpp:110
uint32 ForceTimer
Definition: boss_alar.cpp:123
bool ForceMove
Definition: boss_alar.cpp:122

+ Here is the caller graph for this function:

void boss_alar::boss_alarAI::JustSummoned ( Creature summon)
inlineoverridevirtual

Reimplemented from BossAI.

150  {
151  if (summon->GetEntry() == CREATURE_EMBER_OF_ALAR)
152  if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
153  summon->AI()->AttackStart(target);
154  }
Definition: UnitAI.h:35
CreatureAI * AI() const
Definition: Creature.h:525
Definition: boss_alar.cpp:43
Unit * SelectTarget(SelectAggroTarget targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, int32 aura=0)
Definition: UnitAI.cpp:91
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_alar::boss_alarAI::MoveInLineOfSight ( Unit )
inlineoverridevirtual

Reimplemented from CreatureAI.

156 { }
void boss_alar::boss_alarAI::MovementInform ( uint32  type,
uint32   
)
inlineoverridevirtual

Reimplemented from CreatureAI.

199  {
200  if (type == POINT_MOTION_TYPE)
201  {
202  WaitTimer = 1;
203  AfterMoving = true;
204  ForceMove = false;
205  }
206  }
uint32 WaitTimer
Definition: boss_alar.cpp:108
bool AfterMoving
Definition: boss_alar.cpp:110
bool ForceMove
Definition: boss_alar.cpp:122
Definition: MotionMaster.h:46
void boss_alar::boss_alarAI::Reset ( )
inlineoverridevirtual

Reimplemented from BossAI.

128  {
129  Initialize();
130  _Reset();
131 
134  //me->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10);
135  //me->SetFloatValue(UNIT_FIELD_COMBATREACH, 10);
137  me->SetDisableGravity(true);
139  me->setActive(false);
140  }
Definition: Unit.h:674
void Initialize()
Definition: boss_alar.cpp:92
void setActive(bool isActiveObject)
Definition: Object.cpp:1473
void ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply)
Definition: Unit.cpp:9615
bool SetDisableGravity(bool disable, bool packetOnly=false)
Definition: Unit.cpp:15818
Creature *const me
Definition: CreatureAI.h:71
Definition: SharedDefines.h:290
void _Reset()
Definition: ScriptedCreature.cpp:457
void RemoveFlag(uint16 index, uint32 oldFlag)
Definition: Object.cpp:1214
uint32 GetNativeDisplayId() const
Definition: Unit.h:2014
Definition: Unit.h:600
void SetDisplayId(uint32 modelId) override
Definition: Creature.cpp:2664
Definition: UpdateFields.h:109
void SetSpeed(UnitMoveType mtype, float rate, bool forced=false)
Definition: Unit.cpp:10531
Definition: SharedDefines.h:1862
float DefaultMoveSpeedRate
Definition: boss_alar.cpp:119

+ Here is the call graph for this function:

void boss_alar::boss_alarAI::SpellHit ( Unit ,
const SpellInfo spell 
)
inlineoverridevirtual

Reimplemented from ScriptedAI.

189  {
190  if (spell->Id == SPELL_DIVE_BOMB_VISUAL)
191  {
193  me->SetDisplayId(11686);
194  //me->SendUpdateObjectToAllExcept(NULL);
195  }
196  }
uint32 Id
Definition: SpellInfo.h:329
void ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply)
Definition: Unit.cpp:9615
Creature *const me
Definition: CreatureAI.h:71
Definition: SharedDefines.h:290
Definition: boss_alar.cpp:39
void SetDisplayId(uint32 modelId) override
Definition: Creature.cpp:2664
Definition: SharedDefines.h:1862

+ Here is the call graph for this function:

void boss_alar::boss_alarAI::UpdateAI ( uint32  diff)
inlineoverridevirtual

Reimplemented from BossAI.

209  {
210  if (!me->IsInCombat()) // sometimes IsInCombat but !incombat, faction bug?
211  return;
212 
213  if (Berserk_Timer <= diff)
214  {
215  DoCast(me, SPELL_BERSERK, true);
216  Berserk_Timer = 60000;
217  }
218  else
219  Berserk_Timer -= diff;
220 
221  if (ForceMove)
222  {
223  if (ForceTimer <= diff)
224  {
225  me->GetMotionMaster()->MovePoint(0, waypoint[cur_wp][0], waypoint[cur_wp][1], waypoint[cur_wp][2]);
226  ForceTimer = 5000;
227  }
228  else
229  ForceTimer -= diff;
230 
231  }
232  if (WaitEvent)
233  {
234  if (WaitTimer)
235  {
236  if (WaitTimer <= diff)
237  {
238  if (AfterMoving)
239  {
241  AfterMoving = false;
242  }
243 
244  switch (WaitEvent)
245  {
246  case WE_PLATFORM:
247  Platforms_Move_Timer = 30000 + rand32() % 5000;
248  break;
249  case WE_QUILL:
250  DoCast(me, SPELL_FLAME_QUILLS, true);
252  WaitTimer = 10000;
254  return;
255  case WE_DIE:
256  ForceMove = false;
258  WaitTimer = 5000;
260  return;
261  case WE_REVIVE:
263  me->SetFullHealth();
266  DoZoneInCombat();
267  DoCast(me, SPELL_REBIRTH, true);
268  MeltArmor_Timer = 60000;
269  Charge_Timer = 7000;
270  DiveBomb_Timer = 40000 + rand32() % 5000;
271  FlamePatch_Timer = 30000;
272  Phase1 = false;
273  break;
274  case WE_METEOR:
277  WaitEvent = WE_DIVE;
278  WaitTimer = 4000;
279  return;
280  case WE_DIVE:
281  if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
282  {
284  DoCast(target, SPELL_DIVE_BOMB, true);
285  float dist = 3.0f;
286  if (me->IsWithinDist3d(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 5.0f))
287  dist = 5.0f;
288  WaitTimer = 1000 + uint32(floor(dist / 80 * 1000.0f));
289  me->SetPosition(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0.0f);
290  me->StopMoving();
291  WaitEvent = WE_LAND;
292  }
293  else
294  {
295  EnterEvadeMode();
296  return;
297  }
298  case WE_LAND:
300  WaitTimer = 2000;
301  return;
302  case WE_SUMMON:
303  for (uint8 i = 0; i < 2; ++i)
308  DoCast(me, SPELL_REBIRTH_2, true);
309  break;
310  case WE_DUMMY:
311  default:
312  break;
313  }
314 
315  WaitEvent = WE_NONE;
316  WaitTimer = 0;
317  }
318  else
319  WaitTimer -= diff;
320  }
321  return;
322  }
323 
324  if (Phase1)
325  {
326  if (me->getThreatManager().getThreatList().empty())
327  {
328  EnterEvadeMode();
329  return;
330  }
331 
332  if (Platforms_Move_Timer <= diff)
333  {
334  if (cur_wp == 4)
335  {
336  cur_wp = 0;
338  }
339  else
340  {
341  if (urand(0, 4)) // next platform
342  {
344  if (cur_wp == 3)
345  cur_wp = 0;
346  else
347  ++cur_wp;
349  }
350  else // flame quill
351  {
352  cur_wp = 4;
354  }
355  }
356  ForceMove = true;
357  ForceTimer = 5000;
358  me->GetMotionMaster()->MovePoint(0, waypoint[cur_wp][0], waypoint[cur_wp][1], waypoint[cur_wp][2]);
359  WaitTimer = 0;
360  return;
361  }
362  else
363  Platforms_Move_Timer -= diff;
364  }
365  else
366  {
367  if (Charge_Timer <= diff)
368  {
369  Unit* target= SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true);
370  if (target)
371  DoCast(target, SPELL_CHARGE);
372  Charge_Timer = 30000;
373  }
374  else
375  Charge_Timer -= diff;
376 
377  if (MeltArmor_Timer <= diff)
378  {
380  MeltArmor_Timer = 60000;
381  }
382  else
383  MeltArmor_Timer -= diff;
384 
385  if (DiveBomb_Timer <= diff)
386  {
387  me->AttackStop();
388  me->GetMotionMaster()->MovePoint(6, waypoint[4][0], waypoint[4][1], waypoint[4][2]);
392  WaitTimer = 0;
393  DiveBomb_Timer = 40000 + rand32() % 5000;
394  return;
395  }
396  else
397  DiveBomb_Timer -= diff;
398 
399  if (FlamePatch_Timer <= diff)
400  {
401  if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
402  {
403  Creature* Summoned = me->SummonCreature(CREATURE_FLAME_PATCH_ALAR, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 120000);
404  if (Summoned)
405  {
407  Summoned->SetObjectScale(Summoned->GetObjectScale() * 2.5f);
408  Summoned->SetDisplayId(11686);
409  Summoned->setFaction(me->getFaction());
410  Summoned->SetLevel(me->getLevel());
411  Summoned->CastSpell(Summoned, SPELL_FLAME_PATCH, false);
412  }
413  }
414  FlamePatch_Timer = 30000;
415  }
416  else
417  FlamePatch_Timer -= diff;
418  }
419 
421  }
bool AttackStop()
Definition: Unit.cpp:7337
Definition: Unit.h:214
Definition: Unit.h:207
Definition: boss_alar.cpp:64
Definition: boss_alar.cpp:37
void MoveIdle()
Definition: MotionMaster.cpp:185
Definition: Unit.h:674
Definition: boss_alar.cpp:62
Definition: boss_alar.cpp:38
uint32 getFaction() const
Definition: Unit.h:1466
Definition: boss_alar.cpp:70
static Vector3int16 floor(const Vector3 &v)
uint32 Berserk_Timer
Definition: boss_alar.cpp:117
Definition: boss_alar.cpp:41
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition: CreatureAI.cpp:168
void DoZoneInCombat(Creature *creature=NULL, float maxRangeToNearestTarget=50.0f)
Definition: CreatureAI.cpp:47
MotionMaster * GetMotionMaster()
Definition: Unit.h:2101
Definition: boss_alar.cpp:71
bool IsInCombat() const
Definition: Unit.h:1584
bool Phase1
Definition: boss_alar.cpp:121
ThreatContainer::StorageType const & getThreatList() const
Definition: ThreatManager.h:263
void SetUInt32Value(uint16 index, uint32 value)
Definition: Object.cpp:996
void ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply)
Definition: Unit.cpp:9615
Definition: boss_alar.cpp:67
Definition: Creature.h:467
uint32 Charge_Timer
Definition: boss_alar.cpp:115
int8 cur_wp
Definition: boss_alar.cpp:125
void SetFlag(uint16 index, uint32 newFlag)
Definition: Object.cpp:1199
void SetObjectScale(float scale) override
Definition: Creature.cpp:2653
WaitEventType WaitEvent
Definition: boss_alar.cpp:107
void SetPosition(float x, float y, float z, float o)
Definition: Creature.cpp:2537
uint8 getLevel() const
Definition: Unit.h:1408
Definition: boss_alar.cpp:46
void setFaction(uint32 faction)
Definition: Unit.h:1467
Definition: boss_alar.cpp:35
Creature *const me
Definition: CreatureAI.h:71
Definition: UpdateFields.h:115
void MovePoint(uint32 id, Position const &pos, bool generatePath=true)
Definition: MotionMaster.h:172
Definition: boss_alar.cpp:65
Definition: boss_alar.cpp:66
Definition: UnitAI.h:35
void SetLevel(uint8 lvl)
Definition: Unit.cpp:11523
Definition: boss_alar.cpp:63
float GetPositionY() const
Definition: Position.h:105
Definition: Object.h:56
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:45
uint32 Platforms_Move_Timer
Definition: boss_alar.cpp:112
uint32 WaitTimer
Definition: boss_alar.cpp:108
Definition: boss_alar.cpp:43
Definition: SharedDefines.h:290
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: boss_alar.cpp:40
uint32 MeltArmor_Timer
Definition: boss_alar.cpp:114
void DoCast(uint32 spellId)
Definition: UnitAI.cpp:101
Creature * DoSpawnCreature(uint32 entry, float offsetX, float offsetY, float offsetZ, float angle, uint32 type, uint32 despawntime)
Definition: ScriptedCreature.cpp:177
bool IsWithinDist3d(float x, float y, float z, float dist) const
Definition: Object.cpp:1638
bool AfterMoving
Definition: boss_alar.cpp:110
Definition: boss_alar.cpp:36
Definition: boss_alar.cpp:69
Definition: boss_alar.cpp:39
void RemoveFlag(uint16 index, uint32 oldFlag)
Definition: Object.cpp:1214
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:3586
uint32 FlamePatch_Timer
Definition: boss_alar.cpp:116
uint32 GetNativeDisplayId() const
Definition: Unit.h:2014
Definition: Unit.h:600
void SetDisplayId(uint32 modelId) override
Definition: Creature.cpp:2664
uint32 DiveBomb_Timer
Definition: boss_alar.cpp:113
Definition: UpdateFields.h:109
ThreatManager & getThreatManager()
Definition: Unit.h:1998
void SetFloatValue(uint16 index, float value)
Definition: Object.cpp:1067
uint32 rand32()
Definition: Random.cpp:64
Definition: UpdateFields.h:124
Definition: boss_alar.cpp:34
uint8_t uint8
Definition: Define.h:152
uint32 ForceTimer
Definition: boss_alar.cpp:123
void SetSpeed(UnitMoveType mtype, float rate, bool forced=false)
Definition: Unit.cpp:10531
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition: UnitAI.cpp:159
void SetFullHealth()
Definition: Unit.h:1440
uint32_t uint32
Definition: g3dmath.h:168
float GetPositionX() const
Definition: Position.h:104
Definition: SharedDefines.h:1862
bool ForceMove
Definition: boss_alar.cpp:122
Definition: Unit.h:1305
void StopMoving()
-------—End of Pet responses methods-------—
Definition: Unit.cpp:12743
void DoMeleeAttackIfReady()
Definition: boss_alar.cpp:423
void CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:869
Definition: Unit.h:698
Definition: boss_alar.cpp:47
float GetObjectScale() const
Definition: Object.h:110
float DefaultMoveSpeedRate
Definition: boss_alar.cpp:119
TempSummon * SummonCreature(uint32 id, Position const &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0) const
Definition: Object.cpp:2346
Definition: boss_alar.cpp:72
static float waypoint[6][3]
Definition: boss_alar.cpp:50

+ Here is the call graph for this function:

Member Data Documentation

bool boss_alar::boss_alarAI::AfterMoving
uint32 boss_alar::boss_alarAI::Berserk_Timer
uint32 boss_alar::boss_alarAI::Charge_Timer
int8 boss_alar::boss_alarAI::cur_wp
float boss_alar::boss_alarAI::DefaultMoveSpeedRate
uint32 boss_alar::boss_alarAI::DiveBomb_Timer
uint32 boss_alar::boss_alarAI::FlamePatch_Timer
bool boss_alar::boss_alarAI::ForceMove
uint32 boss_alar::boss_alarAI::ForceTimer
uint32 boss_alar::boss_alarAI::MeltArmor_Timer
bool boss_alar::boss_alarAI::Phase1
uint32 boss_alar::boss_alarAI::Platforms_Move_Timer
WaitEventType boss_alar::boss_alarAI::WaitEvent
uint32 boss_alar::boss_alarAI::WaitTimer

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