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

Public Member Functions

 npc_blessed_bannerAI (Creature *creature)
 
void Reset () override
 
void EnterCombat (Unit *) override
 
void MoveInLineOfSight (Unit *) override
 
void JustSummoned (Creature *Summoned) override
 
void JustDied (Unit *) override
 
void UpdateAI (uint32 diff) override
 
- Public Member Functions inherited from ScriptedAI
 ScriptedAI (Creature *creature)
 
virtual ~ScriptedAI ()
 
void AttackStartNoMove (Unit *target)
 
void DamageTaken (Unit *, uint32 &) override
 
void KilledUnit (Unit *) override
 
void SummonedCreatureDespawn (Creature *) override
 
void SpellHit (Unit *, SpellInfo const *) override
 
void SpellHitTarget (Unit *, SpellInfo const *) 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 ()
 
virtual void MovementInform (uint32, uint32)
 
void OnCharmed (bool apply) override
 
virtual void JustReachedHome ()
 
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 bool CanAIAttack (Unit const *) const
 
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

EventMap events
 
bool HalofSpawned
 
uint32 PhaseCount
 
SummonList Summons
 
ObjectGuid guidDalfors
 
ObjectGuid guidPriest [3]
 
ObjectGuid guidMason [3]
 
ObjectGuid guidHalof
 
- 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 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 CreatureAI
Creature *const me
 
CreatureBoundary const_boundary
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Constructor & Destructor Documentation

npc_blessed_banner::npc_blessed_bannerAI::npc_blessed_bannerAI ( Creature creature)
inline
422  : ScriptedAI(creature), Summons(me)
423  {
424  HalofSpawned = false;
425  PhaseCount = 0;
426 
427  SetCombatMovement(false);
428  }
ScriptedAI(Creature *creature)
Definition: ScriptedCreature.cpp:100
SummonList Summons
Definition: zone_icecrown.cpp:436
bool HalofSpawned
Definition: zone_icecrown.cpp:432
Creature *const me
Definition: CreatureAI.h:71
void SetCombatMovement(bool allowMovement)
Definition: ScriptedCreature.cpp:382
uint32 PhaseCount
Definition: zone_icecrown.cpp:434

+ Here is the call graph for this function:

Member Function Documentation

void npc_blessed_banner::npc_blessed_bannerAI::EnterCombat ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

451 { }
void npc_blessed_banner::npc_blessed_bannerAI::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

462  {
463  Summons.DespawnAll();
465  }
void DespawnOrUnsummon(uint32 msTimeToDespawn=0)
Definition: Creature.cpp:1774
Creature *const me
Definition: CreatureAI.h:71
Definition: boss_urom.cpp:72

+ Here is the call graph for this function:

void npc_blessed_banner::npc_blessed_bannerAI::JustSummoned ( Creature Summoned)
inlineoverridevirtual

Reimplemented from ScriptedAI.

457  {
458  Summons.Summon(Summoned);
459  }
Definition: boss_urom.cpp:72

+ Here is the call graph for this function:

void npc_blessed_banner::npc_blessed_bannerAI::MoveInLineOfSight ( Unit )
inlineoverridevirtual

Reimplemented from CreatureAI.

453 { }
void npc_blessed_banner::npc_blessed_bannerAI::Reset ( )
inlineoverridevirtual

Reimplemented from ScriptedAI.

444  {
445  me->setRegeneratingHealth(false);
447  Talk(BANNER_SAY);
449  }
EventMap events
Definition: zone_icecrown.cpp:430
void setRegeneratingHealth(bool regenHealth)
Definition: Creature.h:663
Definition: zone_icecrown.cpp:334
Definition: zone_icecrown.cpp:348
Creature *const me
Definition: CreatureAI.h:71
void DoCast(uint32 spellId)
Definition: UnitAI.cpp:101
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
void ScheduleEvent(uint32 eventId, Milliseconds const &time, uint32 group=0, uint8 phase=0)
Definition: EventMap.h:123
Definition: zone_icecrown.cpp:358

+ Here is the call graph for this function:

void npc_blessed_banner::npc_blessed_bannerAI::UpdateAI ( uint32  diff)
inlineoverridevirtual

Reimplemented from ScriptedAI.

468  {
469  events.Update(diff);
470 
471  switch (events.ExecuteEvent())
472  {
473  case EVENT_SPAWN:
474  {
476  {
477  guidDalfors = Dalfors->GetGUID();
478  Dalfors->GetMotionMaster()->MovePoint(0, DalforsPos[1]);
479  }
481  {
482  guidPriest[0] = Priest1->GetGUID();
483  Priest1->GetMotionMaster()->MovePoint(0, Priest1Pos[1]);
484  }
486  {
487  guidPriest[1] = Priest2->GetGUID();
488  Priest2->GetMotionMaster()->MovePoint(0, Priest2Pos[1]);
489  }
491  {
492  guidPriest[2] = Priest3->GetGUID();
493  Priest3->GetMotionMaster()->MovePoint(0, Priest3Pos[1]);
494  }
495  if (Creature* Mason1 = DoSummon(NPC_ARGENT_MASON, Mason1Pos[0]))
496  {
497  guidMason[0] = Mason1->GetGUID();
498  Mason1->GetMotionMaster()->MovePoint(0, Mason1Pos[1]);
499  }
500  if (Creature* Mason2 = DoSummon(NPC_ARGENT_MASON, Mason2Pos[0]))
501  {
502  guidMason[1] = Mason2->GetGUID();
503  Mason2->GetMotionMaster()->MovePoint(0, Mason2Pos[1]);
504  }
505  if (Creature* Mason3 = DoSummon(NPC_ARGENT_MASON, Mason3Pos[0]))
506  {
507  guidMason[2] = Mason3->GetGUID();
508  Mason3->GetMotionMaster()->MovePoint(0, Mason3Pos[1]);
509  }
511  }
512  break;
513  case EVENT_INTRO_1:
514  {
516  Dalfors->AI()->Talk(DALFORS_SAY_PRE_1);
518  }
519  break;
520  case EVENT_INTRO_2:
521  {
523  {
524  Dalfors->SetFacingTo(6.215f);
525  Dalfors->AI()->Talk(DALFORS_SAY_PRE_2);
526  }
528  }
529  break;
530  case EVENT_INTRO_3:
531  {
533  {
534  Dalfors->GetMotionMaster()->MovePoint(0, DalforsPos[2]);
535  Dalfors->SetHomePosition(DalforsPos[2]);
536  }
537  if (Creature* Priest1 = ObjectAccessor::GetCreature(*me, guidPriest[0]))
538  {
539  Priest1->SetFacingTo(5.7421f);
540  Priest1->SetHomePosition(Priest1Pos[1]);
541  }
542  if (Creature* Priest2 = ObjectAccessor::GetCreature(*me, guidPriest[1]))
543  {
544  Priest2->SetFacingTo(5.7421f);
545  Priest2->SetHomePosition(Priest2Pos[1]);
546  }
547  if (Creature* Priest3 = ObjectAccessor::GetCreature(*me, guidPriest[2]))
548  {
549  Priest3->SetFacingTo(5.7421f);
550  Priest3->SetHomePosition(Priest3Pos[1]);
551  }
552  if (Creature* Mason1 = ObjectAccessor::GetCreature(*me, guidMason[0]))
553  {
554  Mason1->GetMotionMaster()->MovePoint(0, Mason1Pos[2]);
555  Mason1->SetHomePosition(Mason1Pos[2]);
556  }
557  if (Creature* Mason2 = ObjectAccessor::GetCreature(*me, guidMason[1]))
558  {
559  Mason2->GetMotionMaster()->MovePoint(0, Mason2Pos[2]);
560  Mason2->SetHomePosition(Mason2Pos[2]);
561  }
562  if (Creature* Mason3 = ObjectAccessor::GetCreature(*me, guidMason[2]))
563  {
564  Mason3->GetMotionMaster()->MovePoint(0, Mason3Pos[2]);
565  Mason3->SetHomePosition(Mason3Pos[2]);
566  }
569  }
570  break;
571  case EVENT_MASON_ACTION:
572  {
573  if (Creature* Mason1 = ObjectAccessor::GetCreature(*me, guidMason[0]))
574  {
575  Mason1->SetFacingTo(2.8972f);
576  Mason1->AI()->SetData(1, 1); // triggers SAI actions on npc
577  }
578  if (Creature* Mason2 = ObjectAccessor::GetCreature(*me, guidMason[1]))
579  {
580  Mason2->SetFacingTo(3.1241f);
581  Mason2->AI()->SetData(1, 1); // triggers SAI actions on npc
582  }
583  if (Creature* Mason3 = ObjectAccessor::GetCreature(*me, guidMason[2]))
584  {
585  Mason3->SetFacingTo(3.6651f);
586  Mason3->AI()->SetData(1, 1); // triggers SAI actions on npc
587  }
588  }
589  break;
590  case EVENT_START_FIGHT:
591  {
593  LK->AI()->Talk(LK_TALK_1);
595  Dalfors->AI()->Talk(DALFORS_SAY_START);
597  }
598  break;
599  case EVENT_WAVE_SPAWN:
600  {
601  if (PhaseCount == 3)
602  {
604  LK->AI()->Talk(LK_TALK_2);
605  }
606  else if (PhaseCount == 6)
607  {
609  LK->AI()->Talk(LK_TALK_3);
610  }
611  if (Creature* tempsum = DoSummon(NPC_SCOURGE_DRUDGE, Mason3Pos[0]))
612  {
613  tempsum->SetHomePosition(DalforsPos[2]);
614  tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me, NPC_BLESSED_BANNER, 100));
615  }
616  if (urand(0, 1) == 0)
617  {
619  {
620  tempsum->SetHomePosition(DalforsPos[2]);
621  tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me, NPC_BLESSED_BANNER, 100));
622  }
624  {
625  tempsum->SetHomePosition(DalforsPos[2]);
626  tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me, NPC_BLESSED_BANNER, 100));
627  }
628  }
629  else
630  {
632  {
633  tempsum->SetHomePosition(DalforsPos[2]);
634  tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me, NPC_BLESSED_BANNER, 100));
635  }
637  {
638  tempsum->SetHomePosition(DalforsPos[2]);
639  tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me, NPC_BLESSED_BANNER, 100));
640  }
641  }
642 
643  PhaseCount++;
644 
645  if (PhaseCount < 8)
646  events.ScheduleEvent(EVENT_WAVE_SPAWN, urand(10000, 20000));
647  else
648  events.ScheduleEvent(EVENT_HALOF, urand(10000, 20000));
649  }
650  break;
651  case EVENT_HALOF:
652  {
654  LK->AI()->Talk(LK_TALK_4);
655  if (Creature* tempsum = DoSummon(NPC_SCOURGE_DRUDGE, Mason1Pos[0]))
656  {
657  tempsum->SetHomePosition(DalforsPos[2]);
658  tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me, NPC_BLESSED_BANNER, 100));
659  }
660  if (Creature* tempsum = DoSummon(NPC_SCOURGE_DRUDGE, Mason2Pos[0]))
661  {
662  tempsum->SetHomePosition(DalforsPos[2]);
663  tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me, NPC_BLESSED_BANNER, 100));
664  }
666  {
667  HalofSpawned = true;
668  guidHalof = tempsum->GetGUID();
669  tempsum->SetHomePosition(DalforsPos[2]);
670  tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me, NPC_BLESSED_BANNER, 100));
671  }
672  }
673  break;
674  case EVENT_ENDED:
675  {
676  Summons.DespawnAll();
678  }
679  break;
680  }
681 
682  if (PhaseCount == 8)
684  if (Halof->isDead())
685  {
687  Summons.DespawnEntry(NPC_HIDEOUS_PLAGEBRINGER);
688  Summons.DespawnEntry(NPC_REANIMATED_CAPTAIN);
689  Summons.DespawnEntry(NPC_SCOURGE_DRUDGE);
690  Summons.DespawnEntry(NPC_HALOF_THE_DEATHBRINGER);
692  Dalfors->AI()->Talk(DALFORS_YELL_FINISHED);
694  }
695  }
ObjectGuid guidMason[3]
Definition: zone_icecrown.cpp:440
EventMap events
Definition: zone_icecrown.cpp:430
void DespawnOrUnsummon(uint32 msTimeToDespawn=0)
Definition: Creature.cpp:1774
Position const Mason2Pos[3]
Definition: zone_icecrown.cpp:401
Position const Mason1Pos[3]
Definition: zone_icecrown.cpp:394
Definition: zone_icecrown.cpp:352
Definition: zone_icecrown.cpp:350
Definition: zone_icecrown.cpp:364
Definition: zone_icecrown.cpp:362
Definition: zone_icecrown.cpp:339
TC_GAME_API Creature * GetClosestCreatureWithEntry(WorldObject *source, uint32 entry, float maxSearchRange, bool alive)
Definition: ScriptedCreature.cpp:611
Definition: zone_icecrown.cpp:353
Definition: zone_icecrown.cpp:361
Definition: Creature.h:467
bool HalofSpawned
Definition: zone_icecrown.cpp:432
Definition: zone_icecrown.cpp:355
Position const Priest3Pos[2]
Definition: zone_icecrown.cpp:388
Definition: zone_icecrown.cpp:360
Definition: zone_icecrown.cpp:346
Definition: zone_icecrown.cpp:356
ObjectGuid guidHalof
Definition: zone_icecrown.cpp:441
Position const Mason3Pos[3]
Definition: zone_icecrown.cpp:408
Creature *const me
Definition: CreatureAI.h:71
ObjectGuid guidPriest[3]
Definition: zone_icecrown.cpp:439
Creature * DoSummon(uint32 entry, Position const &pos, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
Definition: CreatureAI.cpp:377
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:45
Definition: zone_icecrown.cpp:351
Definition: zone_icecrown.cpp:363
ObjectGuid guidDalfors
Definition: zone_icecrown.cpp:438
Definition: zone_icecrown.cpp:343
void DoCast(uint32 spellId)
Definition: UnitAI.cpp:101
Position const DalforsPos[3]
Definition: zone_icecrown.cpp:369
void ScheduleEvent(uint32 eventId, Milliseconds const &time, uint32 group=0, uint8 phase=0)
Definition: EventMap.h:123
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:174
void Update(uint32 time)
Definition: EventMap.h:54
Definition: zone_icecrown.cpp:338
Position const Priest2Pos[2]
Definition: zone_icecrown.cpp:382
Definition: zone_icecrown.cpp:345
Position const Priest1Pos[2]
Definition: zone_icecrown.cpp:376
uint32 ExecuteEvent()
Definition: EventMap.cpp:46
Definition: zone_icecrown.cpp:354
Definition: zone_icecrown.cpp:341
Definition: zone_icecrown.cpp:349
Definition: zone_icecrown.cpp:335
Definition: zone_icecrown.cpp:365
Definition: zone_icecrown.cpp:358
Definition: zone_icecrown.cpp:340
Definition: zone_icecrown.cpp:342
uint32 PhaseCount
Definition: zone_icecrown.cpp:434
Definition: boss_urom.cpp:72
Definition: zone_icecrown.cpp:359
Definition: zone_icecrown.cpp:344
Definition: zone_icecrown.cpp:366

+ Here is the call graph for this function:

Member Data Documentation

EventMap npc_blessed_banner::npc_blessed_bannerAI::events
ObjectGuid npc_blessed_banner::npc_blessed_bannerAI::guidDalfors
ObjectGuid npc_blessed_banner::npc_blessed_bannerAI::guidHalof
ObjectGuid npc_blessed_banner::npc_blessed_bannerAI::guidMason[3]
ObjectGuid npc_blessed_banner::npc_blessed_bannerAI::guidPriest[3]
bool npc_blessed_banner::npc_blessed_bannerAI::HalofSpawned
uint32 npc_blessed_banner::npc_blessed_bannerAI::PhaseCount
SummonList npc_blessed_banner::npc_blessed_bannerAI::Summons

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