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

Public Member Functions

 npc_announcer_toc5AI (Creature *creature)
 
void NextStep (uint32 uiTimerStep, bool bNextStep=true, uint8 uiPhaseStep=0)
 
void SetData (uint32 uiType, uint32) override
 
void StartGrandChampionsAttack ()
 
void MovementInform (uint32 uiType, uint32 uiPointId) override
 
void DoSummonGrandChampion (uint32 uiBoss)
 
void DoStartArgentChampionEncounter ()
 
void SetGrandChampionsForEncounter ()
 
void SetArgentChampion ()
 
void StartEncounter ()
 
void AggroAllPlayers (Creature *temp)
 
void UpdateAI (uint32 uiDiff) override
 
void JustSummoned (Creature *summon) override
 
void SummonedCreatureDespawn (Creature *summon) 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 SpellHit (Unit *, SpellInfo const *) override
 
void SpellHitTarget (Unit *, SpellInfo const *) override
 
void OnPossess (bool)
 
void Reset () override
 
void EnterCombat (Unit *) override
 
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
 
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 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

InstanceScriptinstance
 
uint8 uiSummonTimes
 
uint8 uiPosition
 
uint8 uiLesserChampions
 
uint32 uiArgentChampion
 
uint32 uiFirstBoss
 
uint32 uiSecondBoss
 
uint32 uiThirdBoss
 
uint32 uiPhase
 
uint32 uiTimer
 
ObjectGuid uiVehicle1GUID
 
ObjectGuid uiVehicle2GUID
 
ObjectGuid uiVehicle3GUID
 
GuidList Champion1List
 
GuidList Champion2List
 
GuidList Champion3List
 
- 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)
 
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_announcer_toc5::npc_announcer_toc5AI::npc_announcer_toc5AI ( Creature creature)
inline
66  : ScriptedAI(creature)
67  {
68  instance = creature->GetInstanceScript();
69 
70  uiSummonTimes = 0;
71  uiPosition = 0;
73 
74  uiFirstBoss = 0;
75  uiSecondBoss = 0;
76  uiThirdBoss = 0;
77 
78  uiArgentChampion = 0;
79 
80  uiPhase = 0;
81  uiTimer = 0;
82 
86 
89  }
uint32 uiTimer
Definition: trial_of_the_champion.cpp:104
Definition: Unit.h:735
ScriptedAI(Creature *creature)
Definition: ScriptedCreature.cpp:100
Definition: Unit.h:674
Definition: Unit.h:1129
InstanceScript * GetInstanceScript()
Definition: Object.cpp:1540
void SetArgentChampion()
Definition: trial_of_the_champion.cpp:326
uint32 uiFirstBoss
Definition: trial_of_the_champion.cpp:99
void SetFlag(uint16 index, uint32 newFlag)
Definition: Object.cpp:1199
uint8 uiLesserChampions
Definition: trial_of_the_champion.cpp:95
Creature *const me
Definition: CreatureAI.h:71
uint32 uiArgentChampion
Definition: trial_of_the_champion.cpp:97
void SetGrandChampionsForEncounter()
Definition: trial_of_the_champion.cpp:315
uint32 uiThirdBoss
Definition: trial_of_the_champion.cpp:101
Definition: UpdateFields.h:109
InstanceScript * instance
Definition: trial_of_the_champion.cpp:91
uint32 uiSecondBoss
Definition: trial_of_the_champion.cpp:100
uint8 uiSummonTimes
Definition: trial_of_the_champion.cpp:93
Definition: UpdateFields.h:135
void SetReactState(ReactStates st)
Definition: Creature.h:502
uint32 uiPhase
Definition: trial_of_the_champion.cpp:103
uint8 uiPosition
Definition: trial_of_the_champion.cpp:94

+ Here is the call graph for this function:

Member Function Documentation

void npc_announcer_toc5::npc_announcer_toc5AI::AggroAllPlayers ( Creature temp)
inline
364  {
365  Map::PlayerList const &PlList = me->GetMap()->GetPlayers();
366 
367  if (PlList.isEmpty())
368  return;
369 
370  for (Map::PlayerList::const_iterator i = PlList.begin(); i != PlList.end(); ++i)
371  {
372  if (Player* player = i->GetSource())
373  {
374  if (player->IsGameMaster())
375  continue;
376 
377  if (player->IsAlive())
378  {
382  temp->SetInCombatWith(player);
383  player->SetInCombatWith(temp);
384  temp->AddThreat(player, 0.0f);
385  }
386  }
387  }
388  }
void AddThreat(Unit *victim, float fThreat, SpellSchoolMask schoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *threatSpell=NULL)
Definition: Unit.cpp:10691
Definition: Unit.h:674
Definition: Unit.h:1131
Map * GetMap() const
Definition: Object.h:543
void SetHomePosition(float x, float y, float z, float o)
Definition: Creature.h:670
iterator begin()
Definition: MapRefManager.h:37
Creature *const me
Definition: CreatureAI.h:71
float GetOrientation() const
Definition: Position.h:107
float GetPositionY() const
Definition: Position.h:105
float GetPositionZ() const
Definition: Position.h:106
Definition: LinkedList.h:141
bool isEmpty() const
Definition: LinkedList.h:102
void RemoveFlag(uint16 index, uint32 oldFlag)
Definition: Object.cpp:1214
PlayerList const & GetPlayers() const
Definition: Map.h:433
Definition: MapRefManager.h:26
Definition: UpdateFields.h:109
float GetPositionX() const
Definition: Position.h:104
void SetReactState(ReactStates st)
Definition: Creature.h:502
iterator end()
Definition: MapRefManager.h:38
void SetInCombatWith(Unit *enemy)
Definition: Unit.cpp:9840

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void npc_announcer_toc5::npc_announcer_toc5AI::DoStartArgentChampionEncounter ( )
inline
298  {
299  me->GetMotionMaster()->MovePoint(1, 735.81f, 661.92f, 412.39f);
300 
302  {
303  for (uint8 i = 0; i < 3; ++i)
304  {
306  pTrash->AI()->SetData(i, 0);
308  pTrash->AI()->SetData(i, 0);
310  pTrash->AI()->SetData(i, 0);
311  }
312  }
313  }
const Position SpawnPosition
Definition: trial_of_the_champion.cpp:57
Definition: trial_of_the_champion.h:70
MotionMaster * GetMotionMaster()
Definition: Unit.h:2101
Definition: Creature.h:467
Creature *const me
Definition: CreatureAI.h:71
void MovePoint(uint32 id, Position const &pos, bool generatePath=true)
Definition: MotionMaster.h:172
Definition: trial_of_the_champion.h:71
uint32 uiArgentChampion
Definition: trial_of_the_champion.cpp:97
uint8_t uint8
Definition: Define.h:152
Definition: trial_of_the_champion.h:72
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:

+ Here is the caller graph for this function:

void npc_announcer_toc5::npc_announcer_toc5AI::DoSummonGrandChampion ( uint32  uiBoss)
inline
188  {
189  ++uiSummonTimes;
190  uint32 VEHICLE_TO_SUMMON1 = 0;
191  uint32 VEHICLE_TO_SUMMON2 = 0;
192  switch (uiBoss)
193  {
194  case 0:
195  VEHICLE_TO_SUMMON1 = VEHICLE_MOKRA_SKILLCRUSHER_MOUNT;
196  VEHICLE_TO_SUMMON2 = VEHICLE_ORGRIMMAR_WOLF;
197  break;
198  case 1:
199  VEHICLE_TO_SUMMON1 = VEHICLE_ERESSEA_DAWNSINGER_MOUNT;
200  VEHICLE_TO_SUMMON2 = VEHICLE_SILVERMOON_HAWKSTRIDER;
201  break;
202  case 2:
203  VEHICLE_TO_SUMMON1 = VEHICLE_RUNOK_WILDMANE_MOUNT;
204  VEHICLE_TO_SUMMON2 = VEHICLE_THUNDER_BLUFF_KODO;
205  break;
206  case 3:
207  VEHICLE_TO_SUMMON1 = VEHICLE_ZUL_TORE_MOUNT;
208  VEHICLE_TO_SUMMON2 = VEHICLE_DARKSPEAR_RAPTOR;
209  break;
210  case 4:
211  VEHICLE_TO_SUMMON1 = VEHICLE_DEATHSTALKER_VESCERI_MOUNT;
212  VEHICLE_TO_SUMMON2 = VEHICLE_FORSAKE_WARHORSE;
213  break;
214  default:
215  return;
216  }
217 
218  if (Creature* pBoss = me->SummonCreature(VEHICLE_TO_SUMMON1, SpawnPosition))
219  {
220  switch (uiSummonTimes)
221  {
222  case 1:
223  {
224  uiVehicle1GUID = pBoss->GetGUID();
225  ObjectGuid uiGrandChampionBoss1;
226  if (Vehicle* pVehicle = pBoss->GetVehicleKit())
227  if (Unit* unit = pVehicle->GetPassenger(0))
228  uiGrandChampionBoss1 = unit->GetGUID();
230  instance->SetGuidData(DATA_GRAND_CHAMPION_1, uiGrandChampionBoss1);
231  pBoss->AI()->SetData(1, 0);
232  break;
233  }
234  case 2:
235  {
236  uiVehicle2GUID = pBoss->GetGUID();
237  ObjectGuid uiGrandChampionBoss2;
238  if (Vehicle* pVehicle = pBoss->GetVehicleKit())
239  if (Unit* unit = pVehicle->GetPassenger(0))
240  uiGrandChampionBoss2 = unit->GetGUID();
242  instance->SetGuidData(DATA_GRAND_CHAMPION_2, uiGrandChampionBoss2);
243  pBoss->AI()->SetData(2, 0);
244  break;
245  }
246  case 3:
247  {
248  uiVehicle3GUID = pBoss->GetGUID();
249  ObjectGuid uiGrandChampionBoss3;
250  if (Vehicle* pVehicle = pBoss->GetVehicleKit())
251  if (Unit* unit = pVehicle->GetPassenger(0))
252  uiGrandChampionBoss3 = unit->GetGUID();
254  instance->SetGuidData(DATA_GRAND_CHAMPION_3, uiGrandChampionBoss3);
255  pBoss->AI()->SetData(3, 0);
256  break;
257  }
258  default:
259  return;
260  }
261 
262  for (uint8 i = 0; i < 3; ++i)
263  {
264  if (Creature* pAdd = me->SummonCreature(VEHICLE_TO_SUMMON2, SpawnPosition, TEMPSUMMON_CORPSE_DESPAWN))
265  {
266  switch (uiSummonTimes)
267  {
268  case 1:
269  Champion1List.push_back(pAdd->GetGUID());
270  break;
271  case 2:
272  Champion2List.push_back(pAdd->GetGUID());
273  break;
274  case 3:
275  Champion3List.push_back(pAdd->GetGUID());
276  break;
277  }
278 
279  switch (i)
280  {
281  case 0:
282  pAdd->GetMotionMaster()->MoveFollow(pBoss, 2.0f, float(M_PI));
283  break;
284  case 1:
285  pAdd->GetMotionMaster()->MoveFollow(pBoss, 2.0f, float(M_PI) / 2);
286  break;
287  case 2:
288  pAdd->GetMotionMaster()->MoveFollow(pBoss, 2.0f, float(M_PI) / 2 + float(M_PI));
289  break;
290  }
291  }
292 
293  }
294  }
295  }
const Position SpawnPosition
Definition: trial_of_the_champion.cpp:57
Definition: Vehicle.h:32
Definition: trial_of_the_champion.h:122
Definition: trial_of_the_champion.h:46
#define M_PI
Definition: Common.h:163
Definition: trial_of_the_champion.h:44
ObjectGuid uiVehicle1GUID
Definition: trial_of_the_champion.cpp:106
virtual void SetGuidData(uint32, ObjectGuid)
Definition: ZoneScript.h:45
Definition: Object.h:58
Definition: Creature.h:467
Definition: trial_of_the_champion.h:121
Definition: trial_of_the_champion.h:48
Definition: trial_of_the_champion.h:116
Definition: trial_of_the_champion.h:47
GuidList Champion2List
Definition: trial_of_the_champion.cpp:111
Creature *const me
Definition: CreatureAI.h:71
Definition: trial_of_the_champion.h:119
GuidList Champion1List
Definition: trial_of_the_champion.cpp:110
Definition: trial_of_the_champion.h:42
uint32_t uint32
Definition: Define.h:150
Definition: trial_of_the_champion.h:114
ObjectGuid uiVehicle3GUID
Definition: trial_of_the_champion.cpp:108
Definition: trial_of_the_champion.h:120
Definition: trial_of_the_champion.h:118
Definition: trial_of_the_champion.h:112
GuidList Champion3List
Definition: trial_of_the_champion.cpp:112
InstanceScript * instance
Definition: trial_of_the_champion.cpp:91
Definition: trial_of_the_champion.h:115
uint8 uiSummonTimes
Definition: trial_of_the_champion.cpp:93
uint8_t uint8
Definition: Define.h:152
Definition: trial_of_the_champion.h:113
Definition: ObjectGuid.h:189
Definition: trial_of_the_champion.h:43
Definition: Unit.h:1305
ObjectGuid uiVehicle2GUID
Definition: trial_of_the_champion.cpp:107
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:

+ Here is the caller graph for this function:

void npc_announcer_toc5::npc_announcer_toc5AI::JustSummoned ( Creature summon)
inlineoverridevirtual

Reimplemented from ScriptedAI.

423  {
425  {
427  summon->SetReactState(REACT_PASSIVE);
428  }
429  }
Definition: Unit.h:674
Definition: Unit.h:1129
virtual uint32 GetData(uint32) const
Definition: ZoneScript.h:51
void SetFlag(uint16 index, uint32 newFlag)
Definition: Object.cpp:1199
Definition: trial_of_the_champion.h:26
Definition: InstanceScript.h:58
Definition: UpdateFields.h:109
InstanceScript * instance
Definition: trial_of_the_champion.cpp:91
void SetReactState(ReactStates st)
Definition: Creature.h:502

+ Here is the call graph for this function:

void npc_announcer_toc5::npc_announcer_toc5AI::MovementInform ( uint32  uiType,
uint32  uiPointId 
)
inlineoverridevirtual

Reimplemented from CreatureAI.

179  {
180  if (uiType != POINT_MOTION_TYPE)
181  return;
182 
183  if (uiPointId == 1)
185  }
#define ORIENTATION
Definition: trial_of_the_champion.cpp:51
Creature *const me
Definition: CreatureAI.h:71
void SetFacingTo(float ori)
Definition: Unit.cpp:15777
Definition: MotionMaster.h:46

+ Here is the call graph for this function:

void npc_announcer_toc5::npc_announcer_toc5AI::NextStep ( uint32  uiTimerStep,
bool  bNextStep = true,
uint8  uiPhaseStep = 0 
)
inline
115  {
116  uiTimer = uiTimerStep;
117  if (bNextStep)
118  ++uiPhase;
119  else
120  uiPhase = uiPhaseStep;
121  }
uint32 uiTimer
Definition: trial_of_the_champion.cpp:104
uint32 uiPhase
Definition: trial_of_the_champion.cpp:103

+ Here is the caller graph for this function:

void npc_announcer_toc5::npc_announcer_toc5AI::SetArgentChampion ( )
inline
327  {
328  uint8 uiTempBoss = urand(0, 1);
329 
330  switch (uiTempBoss)
331  {
332  case 0:
334  break;
335  case 1:
337  break;
338  }
339  }
Definition: trial_of_the_champion.h:68
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:45
uint32 uiArgentChampion
Definition: trial_of_the_champion.cpp:97
uint8_t uint8
Definition: Define.h:152
Definition: trial_of_the_champion.h:67

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void npc_announcer_toc5::npc_announcer_toc5AI::SetData ( uint32  uiType,
uint32   
)
inlineoverridevirtual

Reimplemented from UnitAI.

124  {
125  switch (uiType)
126  {
127  case DATA_START:
129  NextStep(10000, false, 1);
130  break;
131  case DATA_IN_POSITION: //movement done.
132  me->GetMotionMaster()->MovePoint(1, 735.81f, 661.92f, 412.39f);
134  instance->HandleGameObject(go->GetGUID(), false);
135  NextStep(10000, false, 3);
136  break;
138  {
140  GuidList TempList;
141  if (uiLesserChampions == 3 || uiLesserChampions == 6)
142  {
143  switch (uiLesserChampions)
144  {
145  case 3:
146  TempList = Champion2List;
147  break;
148  case 6:
149  TempList = Champion3List;
150  break;
151  }
152 
153  for (GuidList::const_iterator itr = TempList.begin(); itr != TempList.end(); ++itr)
154  if (Creature* summon = ObjectAccessor::GetCreature(*me, *itr))
155  AggroAllPlayers(summon);
156  }else if (uiLesserChampions == 9)
158 
159  break;
160  }
161  }
162  }
Definition: trial_of_the_champion.h:32
void AggroAllPlayers(Creature *temp)
Definition: trial_of_the_champion.cpp:363
uint32 uiFirstBoss
Definition: trial_of_the_champion.cpp:99
MotionMaster * GetMotionMaster()
Definition: Unit.h:2101
Definition: Creature.h:467
Definition: trial_of_the_champion.h:33
std::list< ObjectGuid > GuidList
Definition: ObjectGuid.h:333
void DoSummonGrandChampion(uint32 uiBoss)
Definition: trial_of_the_champion.cpp:187
GuidList Champion2List
Definition: trial_of_the_champion.cpp:111
uint8 uiLesserChampions
Definition: trial_of_the_champion.cpp:95
Creature *const me
Definition: CreatureAI.h:71
void MovePoint(uint32 id, Position const &pos, bool generatePath=true)
Definition: MotionMaster.h:172
virtual ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:93
void StartGrandChampionsAttack()
Definition: trial_of_the_champion.cpp:164
Definition: GameObject.h:880
Definition: trial_of_the_champion.h:40
void HandleGameObject(ObjectGuid guid, bool open, GameObject *go=nullptr)
Definition: InstanceScript.cpp:397
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:174
GuidList Champion3List
Definition: trial_of_the_champion.cpp:112
InstanceScript * instance
Definition: trial_of_the_champion.cpp:91
TC_GAME_API GameObject * GetGameObject(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:143
void NextStep(uint32 uiTimerStep, bool bNextStep=true, uint8 uiPhaseStep=0)
Definition: trial_of_the_champion.cpp:114
Definition: trial_of_the_champion.h:31

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void npc_announcer_toc5::npc_announcer_toc5AI::SetGrandChampionsForEncounter ( )
inline
316  {
317  uiFirstBoss = urand(0, 4);
318 
320  {
321  uiSecondBoss = urand(0, 4);
322  uiThirdBoss = urand(0, 4);
323  }
324  }
uint32 uiFirstBoss
Definition: trial_of_the_champion.cpp:99
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:45
uint32 uiThirdBoss
Definition: trial_of_the_champion.cpp:101
uint32 uiSecondBoss
Definition: trial_of_the_champion.cpp:100

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void npc_announcer_toc5::npc_announcer_toc5AI::StartEncounter ( )
inline
342  {
344 
346  {
348  {
350  SetData(DATA_START, 0);
351 
354  }
355 
359  me->SummonCreature(VEHICLE_BLACK_KNIGHT, 769.834f, 651.915f, 447.035f, 0);
360  }
361  }
Definition: trial_of_the_champion.h:32
Definition: Unit.h:735
void SetData(uint32 uiType, uint32) override
Definition: trial_of_the_champion.cpp:123
virtual uint32 GetData(uint32) const
Definition: ZoneScript.h:51
Definition: inflate.h:49
Definition: trial_of_the_champion.h:26
Creature *const me
Definition: CreatureAI.h:71
Definition: trial_of_the_champion.h:27
Definition: trial_of_the_champion.h:28
Definition: InstanceScript.h:58
void RemoveFlag(uint16 index, uint32 oldFlag)
Definition: Object.cpp:1214
void DoStartArgentChampionEncounter()
Definition: trial_of_the_champion.cpp:297
Definition: trial_of_the_champion.h:29
InstanceScript * instance
Definition: trial_of_the_champion.cpp:91
Definition: UpdateFields.h:135
Definition: trial_of_the_champion.h:127
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:

void npc_announcer_toc5::npc_announcer_toc5AI::StartGrandChampionsAttack ( )
inline
165  {
169 
170  if (pGrandChampion1 && pGrandChampion2 && pGrandChampion3)
171  {
172  AggroAllPlayers(pGrandChampion1);
173  AggroAllPlayers(pGrandChampion2);
174  AggroAllPlayers(pGrandChampion3);
175  }
176  }
void AggroAllPlayers(Creature *temp)
Definition: trial_of_the_champion.cpp:363
ObjectGuid uiVehicle1GUID
Definition: trial_of_the_champion.cpp:106
Definition: Creature.h:467
Creature *const me
Definition: CreatureAI.h:71
ObjectGuid uiVehicle3GUID
Definition: trial_of_the_champion.cpp:108
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:174
ObjectGuid uiVehicle2GUID
Definition: trial_of_the_champion.cpp:107

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void npc_announcer_toc5::npc_announcer_toc5AI::SummonedCreatureDespawn ( Creature summon)
inlineoverridevirtual

Reimplemented from ScriptedAI.

432  {
433  switch (summon->GetEntry())
434  {
446  break;
447  }
448  }
Definition: trial_of_the_champion.h:122
Definition: trial_of_the_champion.h:107
void SetData(uint32 uiType, uint32) override
Definition: trial_of_the_champion.cpp:123
Definition: trial_of_the_champion.h:106
Definition: trial_of_the_champion.h:121
Definition: trial_of_the_champion.h:119
Definition: trial_of_the_champion.h:110
Definition: trial_of_the_champion.h:109
Definition: trial_of_the_champion.h:120
Definition: trial_of_the_champion.h:118
uint32 GetEntry() const
Definition: Object.h:107
Definition: trial_of_the_champion.h:31
Definition: trial_of_the_champion.h:108

+ Here is the call graph for this function:

void npc_announcer_toc5::npc_announcer_toc5AI::UpdateAI ( uint32  uiDiff)
inlineoverridevirtual

Reimplemented from ScriptedAI.

391  {
392  ScriptedAI::UpdateAI(uiDiff);
393 
394  if (uiTimer <= uiDiff)
395  {
396  switch (uiPhase)
397  {
398  case 1:
400  NextStep(10000, true);
401  break;
402  case 2:
404  NextStep(0, false);
405  break;
406  case 3:
407  if (!Champion1List.empty())
408  {
409  for (GuidList::const_iterator itr = Champion1List.begin(); itr != Champion1List.end(); ++itr)
410  if (Creature* summon = ObjectAccessor::GetCreature(*me, *itr))
411  AggroAllPlayers(summon);
412  NextStep(0, false);
413  }
414  break;
415  }
416  } else uiTimer -= uiDiff;
417 
418  if (!UpdateVictim())
419  return;
420  }
uint32 uiTimer
Definition: trial_of_the_champion.cpp:104
void AggroAllPlayers(Creature *temp)
Definition: trial_of_the_champion.cpp:363
bool UpdateVictim()
Definition: CreatureAI.cpp:233
virtual void UpdateAI(uint32 diff) override
Definition: ScriptedCreature.cpp:125
Definition: Creature.h:467
void DoSummonGrandChampion(uint32 uiBoss)
Definition: trial_of_the_champion.cpp:187
Creature *const me
Definition: CreatureAI.h:71
GuidList Champion1List
Definition: trial_of_the_champion.cpp:110
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:174
uint32 uiThirdBoss
Definition: trial_of_the_champion.cpp:101
uint32 uiSecondBoss
Definition: trial_of_the_champion.cpp:100
void NextStep(uint32 uiTimerStep, bool bNextStep=true, uint8 uiPhaseStep=0)
Definition: trial_of_the_champion.cpp:114
uint32 uiPhase
Definition: trial_of_the_champion.cpp:103

+ Here is the call graph for this function:

Member Data Documentation

GuidList npc_announcer_toc5::npc_announcer_toc5AI::Champion1List
GuidList npc_announcer_toc5::npc_announcer_toc5AI::Champion2List
GuidList npc_announcer_toc5::npc_announcer_toc5AI::Champion3List
InstanceScript* npc_announcer_toc5::npc_announcer_toc5AI::instance
uint32 npc_announcer_toc5::npc_announcer_toc5AI::uiArgentChampion
uint32 npc_announcer_toc5::npc_announcer_toc5AI::uiFirstBoss
uint8 npc_announcer_toc5::npc_announcer_toc5AI::uiLesserChampions
uint32 npc_announcer_toc5::npc_announcer_toc5AI::uiPhase
uint8 npc_announcer_toc5::npc_announcer_toc5AI::uiPosition
uint32 npc_announcer_toc5::npc_announcer_toc5AI::uiSecondBoss
uint8 npc_announcer_toc5::npc_announcer_toc5AI::uiSummonTimes
uint32 npc_announcer_toc5::npc_announcer_toc5AI::uiThirdBoss
uint32 npc_announcer_toc5::npc_announcer_toc5AI::uiTimer
ObjectGuid npc_announcer_toc5::npc_announcer_toc5AI::uiVehicle1GUID
ObjectGuid npc_announcer_toc5::npc_announcer_toc5AI::uiVehicle2GUID
ObjectGuid npc_announcer_toc5::npc_announcer_toc5AI::uiVehicle3GUID

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