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

Public Member Functions

 npc_image_of_medivhAI (Creature *creature)
 
void Initialize ()
 
void Reset () override
 
void EnterCombat (Unit *) override
 
void MovementInform (uint32 type, uint32 id) override
 
void StartEvent ()
 
uint32 NextStep (uint32 step)
 
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 JustSummoned (Creature *) 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 ()
 
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
 
ObjectGuid ArcanagosGUID
 
uint32 YellTimer
 
uint32 Step
 
uint32 FireMedivhTimer
 
uint32 FireArcanagosTimer
 
bool EventStarted
 
- 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_image_of_medivh::npc_image_of_medivhAI::npc_image_of_medivhAI ( Creature creature)
inline
443  : ScriptedAI(creature)
444  {
445  Initialize();
446  Step = 0;
447  FireArcanagosTimer = 0;
448  FireMedivhTimer = 0;
449  instance = creature->GetInstanceScript();
450  }
ScriptedAI(Creature *creature)
Definition: ScriptedCreature.cpp:100
void Initialize()
Definition: karazhan.cpp:452
InstanceScript * GetInstanceScript()
Definition: Object.cpp:1540
InstanceScript * instance
Definition: karazhan.cpp:459
uint32 FireArcanagosTimer
Definition: karazhan.cpp:466
uint32 Step
Definition: karazhan.cpp:464
uint32 FireMedivhTimer
Definition: karazhan.cpp:465

+ Here is the call graph for this function:

Member Function Documentation

void npc_image_of_medivh::npc_image_of_medivhAI::EnterCombat ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

486 { }
void npc_image_of_medivh::npc_image_of_medivhAI::Initialize ( void  )
inline
453  {
455  EventStarted = false;
456  YellTimer = 0;
457  }
ObjectGuid ArcanagosGUID
Definition: karazhan.cpp:461
uint32 YellTimer
Definition: karazhan.cpp:463
bool EventStarted
Definition: karazhan.cpp:468
void Clear()
Definition: ObjectGuid.h:215

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void npc_image_of_medivh::npc_image_of_medivhAI::MovementInform ( uint32  type,
uint32  id 
)
inlineoverridevirtual

Reimplemented from CreatureAI.

489  {
490  if (type != POINT_MOTION_TYPE)
491  return;
492  if (id == 1)
493  {
494  StartEvent();
497  }
498  }
static float MedivPos[4]
Definition: karazhan.cpp:428
void SetOrientation(float orientation)
Definition: Position.h:99
Creature *const me
Definition: CreatureAI.h:71
void StartEvent()
Definition: karazhan.cpp:500
Definition: MotionMaster.h:46

+ Here is the call graph for this function:

uint32 npc_image_of_medivh::npc_image_of_medivhAI::NextStep ( uint32  step)
inline
516  {
517  switch (step)
518  {
519  case 0: return 9999999;
520  case 1:
522  return 10000;
523  case 2:
526  return 20000;
527  case 3:
529  return 10000;
530  case 4:
533  return 20000;
534  case 5:
536  return 20000;
537  case 6:
540  return 10000;
541  case 7:
542  FireArcanagosTimer = 500;
543  return 5000;
544  case 8:
545  FireMedivhTimer = 500;
547  return 10000;
548  case 9:
550  return 10000;
551  case 10:
553  DoCast(arca, SPELL_CONFLAGRATION_BLAST, false);
554  return 1000;
555  case 11:
558  return 5000;
559  case 12:
561  {
562  arca->GetMotionMaster()->MovePoint(0, -11010.82f, -1761.18f, 156.47f);
563  arca->setActive(true);
564  arca->InterruptNonMeleeSpells(true);
565  arca->SetSpeed(MOVE_FLIGHT, 2.0f);
566  }
567  return 10000;
568  case 13:
570  return 10000;
571  case 14:
572  {
573  me->SetVisible(false);
574  me->ClearInCombat();
575 
576  InstanceMap::PlayerList const &PlayerList = me->GetMap()->GetPlayers();
577  for (InstanceMap::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
578  {
579  if (i->GetSource()->IsAlive())
580  {
581  if (i->GetSource()->GetQuestStatus(9645) == QUEST_STATUS_INCOMPLETE)
582  i->GetSource()->CompleteQuest(9645);
583  }
584  }
585  return 50000;
586  }
587  case 15:
589  arca->DealDamage(arca, arca->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
590  return 5000;
591  default:
592  return 9999999;
593  }
594  }
Definition: Unit.h:605
Definition: SharedDefines.h:961
Map * GetMap() const
Definition: Object.h:543
virtual void TextEmote(std::string const &text, WorldObject const *target=nullptr, bool isBossEmote=false)
Definition: Unit.cpp:16403
void ClearInCombat()
Definition: Unit.cpp:9946
ObjectGuid ArcanagosGUID
Definition: karazhan.cpp:461
#define SAY_DIALOG_MEDIVH_1
Definition: karazhan.cpp:417
#define SAY_DIALOG_MEDIVH_9
Definition: karazhan.cpp:425
#define SAY_DIALOG_ARCANAGOS_8
Definition: karazhan.cpp:424
arena_t NULL
Definition: jemalloc_internal.h:624
Definition: Creature.h:467
#define SAY_DIALOG_ARCANAGOS_4
Definition: karazhan.cpp:420
iterator begin()
Definition: MapRefManager.h:37
uint32 FireArcanagosTimer
Definition: karazhan.cpp:466
#define SAY_DIALOG_MEDIVH_3
Definition: karazhan.cpp:419
Definition: karazhan.cpp:51
Creature *const me
Definition: CreatureAI.h:71
Definition: SharedDefines.h:288
#define SAY_DIALOG_ARCANAGOS_2
Definition: karazhan.cpp:418
void SetVisible(bool x)
Definition: Unit.cpp:10368
Definition: LinkedList.h:141
void DoCast(uint32 spellId)
Definition: UnitAI.cpp:101
Definition: karazhan.cpp:50
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:174
PlayerList const & GetPlayers() const
Definition: Map.h:433
virtual void Yell(std::string const &text, Language language, WorldObject const *target=nullptr)
Definition: Unit.cpp:16398
Definition: MapRefManager.h:26
Definition: QuestDef.h:113
Definition: Unit.h:662
#define SAY_DIALOG_ARCANAGOS_6
Definition: karazhan.cpp:422
#define SAY_DIALOG_MEDIVH_5
Definition: karazhan.cpp:421
#define EMOTE_DIALOG_MEDIVH_7
Definition: karazhan.cpp:423
uint32 FireMedivhTimer
Definition: karazhan.cpp:465
iterator end()
Definition: MapRefManager.h:38

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void npc_image_of_medivh::npc_image_of_medivhAI::Reset ( )
inlineoverridevirtual

Reimplemented from ScriptedAI.

471  {
472  Initialize();
473 
475  {
477  (*me).GetMotionMaster()->MovePoint(1, MedivPos[0], MedivPos[1], MedivPos[2]);
478  Step = 0;
479  }
480  else
481  {
483  me->RemoveCorpse();
484  }
485  }
static float MedivPos[4]
Definition: karazhan.cpp:428
void Initialize()
Definition: karazhan.cpp:452
InstanceScript * instance
Definition: karazhan.cpp:459
arena_t NULL
Definition: jemalloc_internal.h:624
Definition: karazhan.h:54
virtual void SetGuidData(uint32, ObjectGuid)
Definition: ZoneScript.h:45
Creature *const me
Definition: CreatureAI.h:71
virtual ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:93
Definition: SharedDefines.h:288
ObjectGuid const & GetGUID() const
Definition: Object.h:105
uint32 Step
Definition: karazhan.cpp:464
void RemoveCorpse(bool setSpawnTime=true)
Definition: Creature.cpp:280
Definition: Unit.h:662
uint32 GetHealth() const
Definition: Unit.h:1426
uint32 DealDamage(Unit *victim, uint32 damage, CleanDamage const *cleanDamage=NULL, DamageEffectType damagetype=DIRECT_DAMAGE, SpellSchoolMask damageSchoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *spellProto=NULL, bool durabilityLoss=true)
Definition: Unit.cpp:613
bool IsEmpty() const
Definition: ObjectGuid.h:242

+ Here is the call graph for this function:

void npc_image_of_medivh::npc_image_of_medivhAI::StartEvent ( )
inline
501  {
502  Step = 1;
503  EventStarted = true;
505  if (!Arcanagos)
506  return;
507  ArcanagosGUID = Arcanagos->GetGUID();
508  Arcanagos->SetDisableGravity(true);
509  Arcanagos->GetMotionMaster()->MovePoint(0, ArcanagosPos[0], ArcanagosPos[1], ArcanagosPos[2]);
510  Arcanagos->SetOrientation(ArcanagosPos[3]);
512  YellTimer = 10000;
513  }
static float MedivPos[4]
Definition: karazhan.cpp:428
ObjectGuid ArcanagosGUID
Definition: karazhan.cpp:461
void SetOrientation(float orientation)
Definition: Position.h:99
MotionMaster * GetMotionMaster()
Definition: Unit.h:2101
static float ArcanagosPos[4]
Definition: karazhan.cpp:429
Definition: Creature.h:467
bool SetDisableGravity(bool disable, bool packetOnly=false)
Definition: Unit.cpp:15818
uint32 YellTimer
Definition: karazhan.cpp:463
Creature *const me
Definition: CreatureAI.h:71
void MovePoint(uint32 id, Position const &pos, bool generatePath=true)
Definition: MotionMaster.h:172
bool EventStarted
Definition: karazhan.cpp:468
Definition: karazhan.cpp:56
ObjectGuid const & GetGUID() const
Definition: Object.h:105
uint32 Step
Definition: karazhan.cpp:464
Definition: Object.h:59
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_image_of_medivh::npc_image_of_medivhAI::UpdateAI ( uint32  diff)
inlineoverridevirtual

Reimplemented from ScriptedAI.

597  {
598  if (YellTimer <= diff)
599  {
600  if (EventStarted)
601  YellTimer = NextStep(Step++);
602  } else YellTimer -= diff;
603 
604  if (Step >= 7 && Step <= 12)
605  {
607 
608  if (FireArcanagosTimer <= diff)
609  {
610  if (arca)
611  arca->CastSpell(me, SPELL_FIRE_BALL, false);
612  FireArcanagosTimer = 6000;
613  } else FireArcanagosTimer -= diff;
614 
615  if (FireMedivhTimer <= diff)
616  {
617  if (arca)
618  DoCast(arca, SPELL_FIRE_BALL);
619  FireMedivhTimer = 5000;
620  } else FireMedivhTimer -= diff;
621  }
622  }
TC_GAME_API Unit * GetUnit(WorldObject const &, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:163
ObjectGuid ArcanagosGUID
Definition: karazhan.cpp:461
uint32 FireArcanagosTimer
Definition: karazhan.cpp:466
uint32 YellTimer
Definition: karazhan.cpp:463
Creature *const me
Definition: CreatureAI.h:71
void DoCast(uint32 spellId)
Definition: UnitAI.cpp:101
bool EventStarted
Definition: karazhan.cpp:468
uint32 Step
Definition: karazhan.cpp:464
uint32 NextStep(uint32 step)
Definition: karazhan.cpp:515
Definition: karazhan.cpp:48
Definition: Unit.h:1305
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
uint32 FireMedivhTimer
Definition: karazhan.cpp:465

+ Here is the call graph for this function:

Member Data Documentation

ObjectGuid npc_image_of_medivh::npc_image_of_medivhAI::ArcanagosGUID
bool npc_image_of_medivh::npc_image_of_medivhAI::EventStarted
uint32 npc_image_of_medivh::npc_image_of_medivhAI::FireArcanagosTimer
uint32 npc_image_of_medivh::npc_image_of_medivhAI::FireMedivhTimer
InstanceScript* npc_image_of_medivh::npc_image_of_medivhAI::instance
uint32 npc_image_of_medivh::npc_image_of_medivhAI::Step
uint32 npc_image_of_medivh::npc_image_of_medivhAI::YellTimer

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