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

Public Member Functions

 npc_warden_mellicharAI (Creature *creature)
 
void Initialize ()
 
void Reset () override
 
void AttackStart (Unit *) override
 
void MoveInLineOfSight (Unit *who) override
 
void EnterCombat (Unit *) override
 
void JustSummoned (Creature *summon) override
 
bool CanProgress ()
 
void DoPrepareForPhase ()
 
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 JustDied (Unit *) 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 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

InstanceScriptinstance
 
bool IsRunning
 
bool CanSpawn
 
uint32 EventProgress_Timer
 
uint32 Phase
 
- 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_warden_mellichar::npc_warden_mellicharAI::npc_warden_mellicharAI ( Creature creature)
inline
278  : ScriptedAI(creature)
279  {
280  Initialize();
281  instance = creature->GetInstanceScript();
282  }
void Initialize()
Definition: arcatraz.cpp:284
ScriptedAI(Creature *creature)
Definition: ScriptedCreature.cpp:100
InstanceScript * GetInstanceScript()
Definition: Object.cpp:1540
InstanceScript * instance
Definition: arcatraz.cpp:293

+ Here is the call graph for this function:

Member Function Documentation

void npc_warden_mellichar::npc_warden_mellicharAI::AttackStart ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

311 { }
bool npc_warden_mellichar::npc_warden_mellicharAI::CanProgress ( )
inline
349  {
350  if (Phase == 7 && instance->GetData(DATA_WARDEN_4) == DONE)
351  return true;
352  if (Phase == 6 && instance->GetData(DATA_WARDEN_3) == DONE)
353  return true;
354  if (Phase == 5 && instance->GetData(DATA_WARDEN_2) == DONE)
355  return true;
356  if (Phase == 4)
357  return true;
358  if (Phase == 3 && instance->GetData(DATA_WARDEN_1) == DONE)
359  return true;
361  return true;
363  return true;
364 
365  return false;
366  }
Definition: arcatraz.h:32
virtual uint32 GetData(uint32) const
Definition: ZoneScript.h:51
Definition: inflate.h:49
Definition: arcatraz.h:39
Definition: InstanceScript.h:59
InstanceScript * instance
Definition: arcatraz.cpp:293
Definition: arcatraz.h:37
Definition: arcatraz.h:36
EncounterState GetBossState(uint32 id) const
Definition: InstanceScript.h:227
Phase
Definition: boss_kiljaeden.cpp:153
Definition: arcatraz.h:38

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void npc_warden_mellichar::npc_warden_mellicharAI::DoPrepareForPhase ( )
inline
369  {
372 
373  switch (Phase)
374  {
375  case 2:
379  break;
380  case 3:
383  break;
384  case 5:
387  break;
388  case 6:
391  break;
392  case 7:
394  break;
395  }
396  CanSpawn = true;
397  }
Definition: arcatraz.h:40
bool CanSpawn
Definition: arcatraz.cpp:296
Definition: arcatraz.cpp:266
Creature *const me
Definition: CreatureAI.h:71
virtual ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:93
Definition: arcatraz.h:39
Definition: arcatraz.h:42
Definition: InstanceScript.h:59
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:52
Definition: arcatraz.cpp:265
void DoCast(uint32 spellId)
Definition: UnitAI.cpp:101
Definition: arcatraz.cpp:263
void HandleGameObject(ObjectGuid guid, bool open, GameObject *go=nullptr)
Definition: InstanceScript.cpp:397
InstanceScript * instance
Definition: arcatraz.cpp:293
Definition: arcatraz.h:37
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true)
Definition: Unit.cpp:2916
Definition: SpellAuraDefines.h:64
void RemoveAurasByType(AuraType auraType, std::function< bool(AuraApplication const *)> const &check)
Definition: Unit.cpp:3567
Definition: arcatraz.h:36
Definition: arcatraz.cpp:264
Phase
Definition: boss_kiljaeden.cpp:153
Definition: arcatraz.h:38

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void npc_warden_mellichar::npc_warden_mellicharAI::EnterCombat ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

332  {
333  Talk(YELL_INTRO1);
335 
338  IsRunning = true;
339  }
Definition: arcatraz.cpp:268
Definition: arcatraz.h:32
Creature *const me
Definition: CreatureAI.h:71
virtual ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:93
Definition: arcatraz.h:42
Definition: InstanceScript.h:59
void DoCast(uint32 spellId)
Definition: UnitAI.cpp:101
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
Definition: arcatraz.cpp:233
void HandleGameObject(ObjectGuid guid, bool open, GameObject *go=nullptr)
Definition: InstanceScript.cpp:397
InstanceScript * instance
Definition: arcatraz.cpp:293
virtual bool SetBossState(uint32 id, EncounterState state)
Definition: InstanceScript.cpp:273
bool IsRunning
Definition: arcatraz.cpp:295

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void npc_warden_mellichar::npc_warden_mellicharAI::Initialize ( void  )
inline
285  {
286  IsRunning = false;
287  CanSpawn = false;
288 
289  EventProgress_Timer = 22000;
290  Phase = 1;
291  }
bool CanSpawn
Definition: arcatraz.cpp:296
uint32 EventProgress_Timer
Definition: arcatraz.cpp:298
Phase
Definition: boss_kiljaeden.cpp:153
bool IsRunning
Definition: arcatraz.cpp:295

+ Here is the caller graph for this function:

void npc_warden_mellichar::npc_warden_mellicharAI::JustSummoned ( Creature summon)
inlineoverridevirtual

Reimplemented from ScriptedAI.

342  {
343  DoZoneInCombat(summon);
344  if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true))
345  summon->AI()->AttackStart(target);
346  }
void DoZoneInCombat(Creature *creature=NULL, float maxRangeToNearestTarget=50.0f)
Definition: CreatureAI.cpp:47
Definition: UnitAI.h:35
CreatureAI * AI() const
Definition: Creature.h:525
Unit * SelectTarget(SelectAggroTarget targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, int32 aura=0)
Definition: UnitAI.cpp:91
Definition: Unit.h:1305
virtual void AttackStart(Unit *)
Definition: UnitAI.cpp:29

+ Here is the call graph for this function:

void npc_warden_mellichar::npc_warden_mellicharAI::MoveInLineOfSight ( Unit who)
inlineoverridevirtual

Reimplemented from CreatureAI.

314  {
315  if (IsRunning)
316  return;
317 
318  if (!me->GetVictim() && me->CanCreatureAttack(who))
319  {
320  if (!me->CanFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
321  return;
322  if (who->GetTypeId() != TYPEID_PLAYER)
323  return;
324 
325  float attackRadius = me->GetAttackDistance(who)/10;
326  if (me->IsWithinDistInMap(who, attackRadius) && me->IsWithinLOSInMap(who))
327  EnterCombat(who);
328  }
329  }
bool IsWithinLOSInMap(WorldObject const *obj) const
Definition: Object.cpp:1584
#define CREATURE_Z_ATTACK_RANGE
Definition: Creature.h:459
void EnterCombat(Unit *) override
Definition: arcatraz.cpp:331
float GetDistanceZ(WorldObject const *obj) const
Definition: Object.cpp:1546
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true) const
Definition: Object.cpp:1663
Creature *const me
Definition: CreatureAI.h:71
TypeID GetTypeId() const
Definition: Object.h:113
float GetAttackDistance(Unit const *player) const
Definition: Creature.cpp:1586
Unit * GetVictim() const
Definition: Unit.h:1379
bool CanFly() const override
Definition: Creature.h:500
Definition: ObjectGuid.h:33
bool CanCreatureAttack(Unit const *victim, bool force=true) const
Definition: Creature.cpp:2170
bool IsRunning
Definition: arcatraz.cpp:295

+ Here is the call graph for this function:

void npc_warden_mellichar::npc_warden_mellicharAI::Reset ( )
inlineoverridevirtual

Reimplemented from ScriptedAI.

302  {
303  Initialize();
304 
307 
309  }
void Initialize()
Definition: arcatraz.cpp:284
Definition: arcatraz.h:32
Definition: arcatraz.cpp:267
Definition: Unit.h:674
void SetFlag(uint16 index, uint32 newFlag)
Definition: Object.cpp:1199
Creature *const me
Definition: CreatureAI.h:71
Definition: InstanceScript.h:58
void DoCast(uint32 spellId)
Definition: UnitAI.cpp:101
InstanceScript * instance
Definition: arcatraz.cpp:293
virtual bool SetBossState(uint32 id, EncounterState state)
Definition: InstanceScript.cpp:273
Definition: UpdateFields.h:109

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void npc_warden_mellichar::npc_warden_mellicharAI::UpdateAI ( uint32  diff)
inlineoverridevirtual

Reimplemented from ScriptedAI.

400  {
401  if (!IsRunning)
402  return;
403 
404  if (EventProgress_Timer <= diff)
405  {
407  {
408  Reset();
409  return;
410  }
411 
412  if (CanSpawn)
413  {
414  //continue beam omega pod, unless we are about to summon skyriss
415  if (Phase != 7)
417 
418  switch (Phase)
419  {
420  case 2:
421  switch (urand(0, 1))
422  {
423  case 0:
424  me->SummonCreature(ENTRY_TRICKSTER, 478.326f, -148.505f, 42.56f, 3.19f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000);
425  break;
426  case 1:
427  me->SummonCreature(ENTRY_PH_HUNTER, 478.326f, -148.505f, 42.56f, 3.19f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000);
428  break;
429  }
430  break;
431  case 3:
432  me->SummonCreature(ENTRY_MILLHOUSE, 413.292f, -148.378f, 42.56f, 6.27f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000);
433  break;
434  case 4:
436  break;
437  case 5:
438  switch (urand(0, 1))
439  {
440  case 0:
441  me->SummonCreature(ENTRY_AKKIRIS, 420.179f, -174.396f, 42.58f, 0.02f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000);
442  break;
443  case 1:
444  me->SummonCreature(ENTRY_SULFURON, 420.179f, -174.396f, 42.58f, 0.02f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000);
445  break;
446  }
447  break;
448  case 6:
449  switch (urand(0, 1))
450  {
451  case 0:
452  me->SummonCreature(ENTRY_TW_DRAK, 471.795f, -174.58f, 42.58f, 3.06f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000);
453  break;
454  case 1:
455  me->SummonCreature(ENTRY_BL_DRAK, 471.795f, -174.58f, 42.58f, 3.06f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000);
456  break;
457  }
458  break;
459  case 7:
460  me->SummonCreature(ENTRY_SKYRISS, 445.763f, -191.639f, 44.64f, 1.60f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000);
462  break;
463  }
464  CanSpawn = false;
465  ++Phase;
466  }
467  if (CanProgress())
468  {
469  switch (Phase)
470  {
471  case 1:
472  Talk(YELL_INTRO2);
473  EventProgress_Timer = 10000;
474  ++Phase;
475  break;
476  case 2:
479  EventProgress_Timer = 7000;
480  break;
481  case 3:
484  EventProgress_Timer = 10000;
485  break;
486  case 4:
488  EventProgress_Timer = 15000;
489  break;
490  case 5:
493  EventProgress_Timer = 15000;
494  break;
495  case 6:
498  EventProgress_Timer = 15000;
499  break;
500  case 7:
502  EventProgress_Timer = 15000;
503  break;
504  }
505  }
506  }
507  else
508  EventProgress_Timer -= diff;
509  }
Definition: arcatraz.cpp:235
Definition: arcatraz.h:32
Definition: arcatraz.cpp:267
Definition: arcatraz.cpp:239
Definition: arcatraz.cpp:237
void DoPrepareForPhase()
Definition: arcatraz.cpp:368
bool CanSpawn
Definition: arcatraz.cpp:296
Definition: InstanceScript.h:60
Definition: arcatraz.cpp:234
Definition: arcatraz.cpp:257
uint32 Phase
Definition: arcatraz.cpp:299
Definition: arcatraz.cpp:255
Creature *const me
Definition: CreatureAI.h:71
Definition: arcatraz.cpp:246
Definition: arcatraz.cpp:236
Definition: arcatraz.cpp:247
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:45
bool CanProgress()
Definition: arcatraz.cpp:348
void DoCast(uint32 spellId)
Definition: UnitAI.cpp:101
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
void Reset() override
Definition: arcatraz.cpp:301
Definition: arcatraz.cpp:249
InstanceScript * instance
Definition: arcatraz.cpp:293
Definition: arcatraz.cpp:238
uint32 EventProgress_Timer
Definition: arcatraz.cpp:298
Definition: arcatraz.cpp:251
Definition: arcatraz.cpp:240
Definition: arcatraz.cpp:252
Definition: arcatraz.cpp:254
EncounterState GetBossState(uint32 id) const
Definition: InstanceScript.h:227
Phase
Definition: boss_kiljaeden.cpp:153
bool IsRunning
Definition: arcatraz.cpp:295
TempSummon * SummonCreature(uint32 id, Position const &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0) const
Definition: Object.cpp:2346
Definition: Object.h:54

+ Here is the call graph for this function:

Member Data Documentation

bool npc_warden_mellichar::npc_warden_mellicharAI::CanSpawn
uint32 npc_warden_mellichar::npc_warden_mellicharAI::EventProgress_Timer
InstanceScript* npc_warden_mellichar::npc_warden_mellicharAI::instance
bool npc_warden_mellichar::npc_warden_mellicharAI::IsRunning
uint32 npc_warden_mellichar::npc_warden_mellicharAI::Phase

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