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

Public Member Functions

 npc_wyrmrest_defenderAI (Creature *creature)
 
void Initialize ()
 
void Reset () override
 
void UpdateAI (uint32 diff) override
 
void SpellHit (Unit *, SpellInfo const *spell) override
 
- Public Member Functions inherited from VehicleAI
 VehicleAI (Creature *creature)
 
void MoveInLineOfSight (Unit *) override
 
void AttackStart (Unit *) override
 
void OnCharmed (bool apply) override
 
- 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 EnterCombat (Unit *)
 
virtual void JustDied (Unit *)
 
virtual void KilledUnit (Unit *)
 
virtual void JustSummoned (Creature *)
 
virtual void IsSummonedBy (Unit *)
 
virtual void SummonedCreatureDespawn (Creature *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SpellHitTarget (Unit *, SpellInfo const *)
 
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 DamageTaken (Unit *, uint32 &)
 
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

bool hpWarningReady
 
bool renewRecoveryCanCheck
 
uint32 RenewRecoveryChecker
 

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 VehicleAI
static int Permissible (Creature const *)
 
- 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_wyrmrest_defender::npc_wyrmrest_defenderAI::npc_wyrmrest_defenderAI ( Creature creature)
inline
525  : VehicleAI(creature)
526  {
527  Initialize();
528  }
void Initialize()
Definition: zone_dragonblight.cpp:530
VehicleAI(Creature *creature)
Definition: CombatAI.cpp:262

+ Here is the call graph for this function:

Member Function Documentation

void npc_wyrmrest_defender::npc_wyrmrest_defenderAI::Initialize ( void  )
inline
531  {
532  hpWarningReady = true;
533  renewRecoveryCanCheck = false;
534 
536  }
uint32 RenewRecoveryChecker
Definition: zone_dragonblight.cpp:541
bool hpWarningReady
Definition: zone_dragonblight.cpp:538
bool renewRecoveryCanCheck
Definition: zone_dragonblight.cpp:539

+ Here is the caller graph for this function:

void npc_wyrmrest_defender::npc_wyrmrest_defenderAI::Reset ( )
inlineoverridevirtual

Reimplemented from UnitAI.

544  {
545  Initialize();
546  }
void Initialize()
Definition: zone_dragonblight.cpp:530

+ Here is the call graph for this function:

void npc_wyrmrest_defender::npc_wyrmrest_defenderAI::SpellHit ( Unit ,
SpellInfo const spell 
)
inlineoverridevirtual

Reimplemented from CreatureAI.

571  {
572  switch (spell->Id)
573  {
578  break;
579  // Both below are for checking low hp warning
582  break;
583  case SPELL_RENEW:
584  if (!hpWarningReady && RenewRecoveryChecker <= 100)
585  {
586  RenewRecoveryChecker = 20000;
587  }
588  renewRecoveryCanCheck = true;
589  break;
590  }
591  }
Definition: zone_dragonblight.cpp:482
uint32 RenewRecoveryChecker
Definition: zone_dragonblight.cpp:541
void SetFlag(uint16 index, uint32 newFlag)
Definition: Object.cpp:1199
Definition: Unit.h:681
Creature *const me
Definition: CreatureAI.h:71
bool hpWarningReady
Definition: zone_dragonblight.cpp:538
Definition: zone_dragonblight.cpp:481
Unit * GetCharmerOrOwner() const
Definition: Unit.cpp:7627
Definition: zone_dragonblight.cpp:480
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
bool renewRecoveryCanCheck
Definition: zone_dragonblight.cpp:539
Definition: Unit.h:676
void RemoveFlag(uint16 index, uint32 oldFlag)
Definition: Object.cpp:1214
Definition: Unit.h:682
Definition: zone_dragonblight.cpp:486
Definition: UpdateFields.h:109
Definition: zone_dragonblight.cpp:485

+ Here is the call graph for this function:

void npc_wyrmrest_defender::npc_wyrmrest_defenderAI::UpdateAI ( uint32  diff)
inlineoverridevirtual

Reimplemented from VehicleAI.

549  {
550  // Check system for Health Warning should happen first time whenever get under 30%,
551  // after it should be able to happen only after recovery of last renew is fully done (20 sec),
552  // next one used won't interfere
553  if (hpWarningReady && me->GetHealthPct() <= 30.0f)
554  {
556  hpWarningReady = false;
557  }
558 
560  {
561  if (RenewRecoveryChecker <= diff)
562  {
563  renewRecoveryCanCheck = false;
564  hpWarningReady = true;
565  }
566  else RenewRecoveryChecker -= diff;
567  }
568  }
uint32 RenewRecoveryChecker
Definition: zone_dragonblight.cpp:541
Creature *const me
Definition: CreatureAI.h:71
bool hpWarningReady
Definition: zone_dragonblight.cpp:538
Definition: zone_dragonblight.cpp:480
bool renewRecoveryCanCheck
Definition: zone_dragonblight.cpp:539
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
float GetHealthPct() const
Definition: Unit.h:1434

+ Here is the call graph for this function:

Member Data Documentation

bool npc_wyrmrest_defender::npc_wyrmrest_defenderAI::hpWarningReady
bool npc_wyrmrest_defender::npc_wyrmrest_defenderAI::renewRecoveryCanCheck
uint32 npc_wyrmrest_defender::npc_wyrmrest_defenderAI::RenewRecoveryChecker

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