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

Public Member Functions

 npc_tirion_tocAI (Creature *creature)
 
void Reset () override
 
void AttackStart (Unit *) override
 
void UpdateAI (uint32 uiDiff) override
 
- Public Member Functions inherited from ScriptedAI
 ScriptedAI (Creature *creature)
 
virtual ~ScriptedAI ()
 
void AttackStartNoMove (Unit *target)
 
void DamageTaken (Unit *, uint32 &) override
 
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 OnPossess (bool)
 
void EnterCombat (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)
 

Private Attributes

InstanceScript_instance
 

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 ScriptedAI
bool IsFleeing
 
- 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)
 
virtual void MoveInLineOfSight (Unit *)
 
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_tirion_toc::npc_tirion_tocAI::npc_tirion_tocAI ( Creature creature)
inline
524  : ScriptedAI(creature)
525  {
527  }
InstanceScript * _instance
Definition: trial_of_the_crusader.cpp:795
ScriptedAI(Creature *creature)
Definition: ScriptedCreature.cpp:100
InstanceScript * GetInstanceScript()
Definition: Object.cpp:1540
Creature *const me
Definition: CreatureAI.h:71

+ Here is the call graph for this function:

Member Function Documentation

void npc_tirion_toc::npc_tirion_tocAI::AttackStart ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

531 { }
void npc_tirion_toc::npc_tirion_tocAI::Reset ( )
inlineoverridevirtual

Reimplemented from ScriptedAI.

529 { }
void npc_tirion_toc::npc_tirion_tocAI::UpdateAI ( uint32  uiDiff)
inlineoverridevirtual

Reimplemented from ScriptedAI.

534  {
535  if (!_instance)
536  return;
537 
539  return;
540 
541  uint32 _updateTimer = _instance->GetData(TYPE_EVENT_TIMER);
542  if (_updateTimer <= uiDiff)
543  {
544  switch (_instance->GetData(TYPE_EVENT))
545  {
546  case 110:
549  _updateTimer = 22*IN_MILLISECONDS;
551  break;
552  case 140:
555  _updateTimer = 5*IN_MILLISECONDS;
557  break;
558  case 150:
561  {
563 
565  {
566  temp->GetMotionMaster()->MovePoint(0, ToCCommonLoc[5].GetPositionX(), ToCCommonLoc[5].GetPositionY(), ToCCommonLoc[5].GetPositionZ());
568  temp->SetReactState(REACT_PASSIVE);
569  }
570  }
571  _updateTimer = 3*IN_MILLISECONDS;
573  break;
574  case 155:
575  // keep the raid in combat for the whole encounter, pauses included
577  _updateTimer = 5*IN_MILLISECONDS;
579  break;
580  case 200:
583  {
586  {
587  temp->GetMotionMaster()->MovePoint(0, ToCCommonLoc[5].GetPositionX(), ToCCommonLoc[5].GetPositionY(), ToCCommonLoc[5].GetPositionZ());
589  temp->SetReactState(REACT_PASSIVE);
590  }
591  }
592  _updateTimer = 5*IN_MILLISECONDS;
594  break;
595  case 220:
597  break;
598  case 300:
601  {
604  {
605  temp->GetMotionMaster()->MovePoint(2, ToCCommonLoc[5].GetPositionX(), ToCCommonLoc[5].GetPositionY(), ToCCommonLoc[5].GetPositionZ());
608  }
609  }
610  _updateTimer = 5*IN_MILLISECONDS;
612  break;
613  case 315:
615  break;
616  case 400:
619  _updateTimer = 5*IN_MILLISECONDS;
621  break;
622  case 666:
624  _updateTimer = 5*IN_MILLISECONDS;
626  break;
627  case 1010:
629  _updateTimer = 7*IN_MILLISECONDS;
631  me->SummonCreature(NPC_FIZZLEBANG, ToCSpawnLoc[0].GetPositionX(), ToCSpawnLoc[0].GetPositionY(), ToCSpawnLoc[0].GetPositionZ(), 2, TEMPSUMMON_CORPSE_TIMED_DESPAWN, DESPAWN_TIME);
633  break;
634  case 1180:
636  _updateTimer = 3*IN_MILLISECONDS;
638  break;
639  case 2000:
641  _updateTimer = 18*IN_MILLISECONDS;
642  _instance->SetData(TYPE_EVENT, 2010);
643  break;
644  case 2030:
646  _updateTimer = 5*IN_MILLISECONDS;
648  break;
649  case 3000:
651  _updateTimer = 12*IN_MILLISECONDS;
652  _instance->SetData(TYPE_EVENT, 3050);
653  break;
654  case 3001:
656  _updateTimer = 10*IN_MILLISECONDS;
657  _instance->SetData(TYPE_EVENT, 3051);
658  break;
659  case 3060:
661  _updateTimer = 5*IN_MILLISECONDS;
662  _instance->SetData(TYPE_EVENT, 3070);
663  break;
664  case 3061:
666  _updateTimer = 5*IN_MILLISECONDS;
667  _instance->SetData(TYPE_EVENT, 3071);
668  break;
669  //Summoning crusaders
670  case 3091:
671  if (Creature* pChampionController = me->SummonCreature(NPC_CHAMPIONS_CONTROLLER, ToCCommonLoc[1]))
672  pChampionController->AI()->SetData(0, HORDE);
673  _updateTimer = 3*IN_MILLISECONDS;
674  _instance->SetData(TYPE_EVENT, 3092);
675  break;
676  //Summoning crusaders
677  case 3090:
678  if (Creature* pChampionController = me->SummonCreature(NPC_CHAMPIONS_CONTROLLER, ToCCommonLoc[1]))
679  pChampionController->AI()->SetData(0, ALLIANCE);
680  _updateTimer = 3*IN_MILLISECONDS;
681  _instance->SetData(TYPE_EVENT, 3092);
682  break;
683  case 3092:
685  pChampionController->AI()->SetData(1, NOT_STARTED);
686  _instance->SetData(TYPE_EVENT, 3095);
687  break;
688  //Crusaders battle end
689  case 3100:
691  _updateTimer = 5*IN_MILLISECONDS;
693  break;
694  case 4000:
696  _updateTimer = 13*IN_MILLISECONDS;
697  _instance->SetData(TYPE_EVENT, 4010);
698  break;
699  case 4010:
702  {
703  temp->SetVisible(false);
704  temp->SetReactState(REACT_PASSIVE);
705  temp->SummonCreature(NPC_LIGHT_ESSENCE, TwinValkyrsLoc[0].GetPositionX(), TwinValkyrsLoc[0].GetPositionY(), TwinValkyrsLoc[0].GetPositionZ());
706  temp->SummonCreature(NPC_LIGHT_ESSENCE, TwinValkyrsLoc[1].GetPositionX(), TwinValkyrsLoc[1].GetPositionY(), TwinValkyrsLoc[1].GetPositionZ());
707  }
709  {
710  temp->SetVisible(false);
711  temp->SetReactState(REACT_PASSIVE);
712  temp->SummonCreature(NPC_DARK_ESSENCE, TwinValkyrsLoc[2].GetPositionX(), TwinValkyrsLoc[2].GetPositionY(), TwinValkyrsLoc[2].GetPositionZ());
713  temp->SummonCreature(NPC_DARK_ESSENCE, TwinValkyrsLoc[3].GetPositionX(), TwinValkyrsLoc[3].GetPositionY(), TwinValkyrsLoc[3].GetPositionZ());
714  }
715  _updateTimer = 3*IN_MILLISECONDS;
716  _instance->SetData(TYPE_EVENT, 4015);
717  break;
718  case 4015:
721  {
722  temp->GetMotionMaster()->MovePoint(1, ToCCommonLoc[8].GetPositionX(), ToCCommonLoc[8].GetPositionY(), ToCCommonLoc[8].GetPositionZ());
723  temp->SetVisible(true);
724  }
726  {
727  temp->GetMotionMaster()->MovePoint(1, ToCCommonLoc[9].GetPositionX(), ToCCommonLoc[9].GetPositionY(), ToCCommonLoc[9].GetPositionZ());
728  temp->SetVisible(true);
729  }
730  _updateTimer = 10*IN_MILLISECONDS;
731  _instance->SetData(TYPE_EVENT, 4016);
732  break;
733  case 4016:
735  _instance->SetData(TYPE_EVENT, 4017);
736  break;
737  case 4040:
738  _updateTimer = 1*MINUTE*IN_MILLISECONDS;
739  _instance->SetData(TYPE_EVENT, 5000);
740  break;
741  case 5000:
743  _updateTimer = 10*IN_MILLISECONDS;
744  _instance->SetData(TYPE_EVENT, 5005);
745  break;
746  case 5005:
747  _updateTimer = 8*IN_MILLISECONDS;
748  _instance->SetData(TYPE_EVENT, 5010);
749  me->SummonCreature(NPC_LICH_KING, ToCCommonLoc[2].GetPositionX(), ToCCommonLoc[2].GetPositionY(), ToCCommonLoc[2].GetPositionZ(), 5);
750  break;
751  case 5020:
753  _updateTimer = 1*IN_MILLISECONDS;
755  break;
756  case 6000:
757  me->SummonCreature(NPC_TIRION_FORDRING, EndSpawnLoc[0].GetPositionX(), EndSpawnLoc[0].GetPositionY(), EndSpawnLoc[0].GetPositionZ());
758  me->SummonCreature(NPC_ARGENT_MAGE, EndSpawnLoc[1].GetPositionX(), EndSpawnLoc[1].GetPositionY(), EndSpawnLoc[1].GetPositionZ());
759  me->SummonGameObject(GO_PORTAL_TO_DALARAN, EndSpawnLoc[2].GetPositionX(), EndSpawnLoc[2].GetPositionY(), EndSpawnLoc[2].GetPositionZ(), 5, 0, 0, 0, 0, 0);
760  _updateTimer = 20*IN_MILLISECONDS;
761  _instance->SetData(TYPE_EVENT, 6005);
762  break;
763  case 6005:
765  tirionFordring->AI()->Talk(SAY_STAGE_4_06);
766  _updateTimer = 20*IN_MILLISECONDS;
767  _instance->SetData(TYPE_EVENT, 6010);
768  break;
769  case 6010:
770  if (IsHeroic())
771  {
773  tirionFordring->AI()->Talk(SAY_STAGE_4_07);
774  _updateTimer = 1*MINUTE*IN_MILLISECONDS;
776  _instance->SetData(TYPE_EVENT, 6020);
777  }
778  else
779  _instance->SetData(TYPE_EVENT, 6030);
780  break;
781  case 6020:
783  _updateTimer = 5*IN_MILLISECONDS;
784  _instance->SetData(TYPE_EVENT, 6030);
785  break;
786  default:
787  break;
788  }
789  }
790  else
791  _updateTimer -= uiDiff;
792  _instance->SetData(TYPE_EVENT_TIMER, _updateTimer);
793  }
InstanceScript * _instance
Definition: trial_of_the_crusader.cpp:795
void DespawnOrUnsummon(uint32 msTimeToDespawn=0)
Definition: Creature.cpp:1774
GameObject * SummonGameObject(uint32 entry, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime)
Definition: Object.cpp:2372
Definition: trial_of_the_crusader.h:23
Definition: UpdateFields.h:136
Definition: Object.h:61
Definition: Unit.h:674
Definition: trial_of_the_crusader.h:17
Definition: trial_of_the_crusader.h:233
Definition: trial_of_the_crusader.cpp:45
const Position EndSpawnLoc[]
Definition: trial_of_the_crusader.h:141
Definition: trial_of_the_crusader.cpp:42
Definition: Unit.h:1129
Definition: trial_of_the_crusader.cpp:32
Definition: trial_of_the_crusader.h:261
virtual uint32 GetData(uint32) const
Definition: ZoneScript.h:51
Definition: trial_of_the_crusader.h:200
Definition: inflate.h:49
Definition: trial_of_the_crusader.cpp:33
void SetUInt32Value(uint16 index, uint32 value)
Definition: Object.cpp:996
Definition: trial_of_the_crusader.h:182
Definition: trial_of_the_crusader.cpp:38
bool IsHeroic() const
Definition: ScriptedCreature.h:268
Definition: Creature.h:467
Definition: Object.h:60
void SetFlag(uint16 index, uint32 newFlag)
Definition: Object.cpp:1199
Definition: trial_of_the_crusader.h:24
Definition: SharedDefines.h:2413
Definition: Common.h:97
Definition: SharedDefines.h:1000
Definition: trial_of_the_crusader.cpp:80
Definition: trial_of_the_crusader.cpp:43
const Position ToCSpawnLoc[]
Definition: trial_of_the_crusader.h:47
Creature *const me
Definition: CreatureAI.h:71
Definition: trial_of_the_crusader.h:186
virtual ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:93
Definition: trial_of_the_crusader.h:193
Definition: trial_of_the_crusader.cpp:44
void DoUseDoorOrButton(ObjectGuid guid, uint32 withRestoreTime=0, bool useAlternativeState=false)
Definition: InstanceScript.cpp:407
Definition: trial_of_the_crusader.h:44
Definition: trial_of_the_crusader.h:232
float GetPositionY() const
Definition: Position.h:105
const Position TwinValkyrsLoc[]
Definition: trial_of_the_crusader.h:117
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:52
const Position ToCCommonLoc[]
Definition: trial_of_the_crusader.h:54
Definition: gnomeregan.h:40
Definition: InstanceScript.h:58
float GetPositionZ() const
Definition: Position.h:106
Definition: trial_of_the_crusader.h:195
uint32_t uint32
Definition: Define.h:150
Definition: trial_of_the_crusader.cpp:47
Definition: InstanceScript.h:62
Definition: trial_of_the_crusader.h:235
void clearReferences()
Definition: ThreatManager.cpp:396
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
Definition: trial_of_the_crusader.cpp:37
virtual bool SetBossState(uint32 id, EncounterState state)
Definition: InstanceScript.cpp:273
Definition: trial_of_the_crusader.h:236
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:174
Definition: trial_of_the_crusader.cpp:36
Definition: trial_of_the_crusader.cpp:34
Definition: SharedDefines.h:999
Definition: trial_of_the_crusader.h:183
Definition: trial_of_the_crusader.cpp:81
Definition: trial_of_the_crusader.cpp:41
Definition: SharedDefines.h:2440
Definition: trial_of_the_crusader.h:194
Definition: trial_of_the_crusader.h:264
Definition: trial_of_the_crusader.cpp:39
Definition: trial_of_the_crusader.cpp:35
Definition: trial_of_the_crusader.h:181
Definition: UpdateFields.h:109
Definition: trial_of_the_crusader.cpp:31
Definition: Common.h:103
ThreatManager & getThreatManager()
Definition: Unit.h:1998
Definition: Object.h:59
void SetInCombatWithZone()
Definition: Creature.cpp:2299
Definition: trial_of_the_crusader.cpp:46
Definition: trial_of_the_crusader.h:12
float GetPositionX() const
Definition: Position.h:104
EncounterState GetBossState(uint32 id) const
Definition: InstanceScript.h:227
Definition: trial_of_the_crusader.h:180
void SetReactState(ReactStates st)
Definition: Creature.h:502
Definition: trial_of_the_crusader.cpp:40
Definition: Unit.h:698
TempSummon * SummonCreature(uint32 id, Position const &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0) const
Definition: Object.cpp:2346

+ Here is the call graph for this function:

Member Data Documentation

InstanceScript* npc_tirion_toc::npc_tirion_tocAI::_instance
private

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