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

Public Member Functions

 npc_gothik_minionAI (Creature *creature)
 
bool isOnSameSide (Unit const *who) const
 
void DoAction (int32 param) override
 
void DamageTaken (Unit *attacker, uint32 &damage) override
 
void JustDied (Unit *) override
 
void EnterEvadeMode (EvadeReason why) override
 
void UpdateAI (uint32 diff) override
 
- Public Member Functions inherited from CombatAI
 CombatAI (Creature *c)
 
void InitializeAI () override
 
void Reset () override
 
void EnterCombat (Unit *who) override
 
void SpellInterrupted (uint32 spellId, uint32 unTimeMs) 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 KilledUnit (Unit *)
 
virtual void JustSummoned (Creature *)
 
virtual void IsSummonedBy (Unit *)
 
virtual void SummonedCreatureDespawn (Creature *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SpellHit (Unit *, SpellInfo const *)
 
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 AttackStart (Unit *)
 
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 &)
 
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 liveSide
 
bool gateClose
 

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 CombatAI
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)
 
virtual void MoveInLineOfSight (Unit *)
 
bool _EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
- Protected Attributes inherited from CombatAI
EventMap events
 
SpellVct spells
 
- Protected Attributes inherited from CreatureAI
Creature *const me
 
CreatureBoundary const_boundary
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Constructor & Destructor Documentation

npc_gothik_minion::npc_gothik_minionAI::npc_gothik_minionAI ( Creature creature)
inline
508  : CombatAI(creature)
509  {
511  gateClose = false;
512  }
#define IN_LIVE_SIDE(who)
Definition: boss_gothik.cpp:105
bool gateClose
Definition: boss_gothik.cpp:515
Creature *const me
Definition: CreatureAI.h:71
CombatAI(Creature *c)
Definition: CombatAI.h:42
bool liveSide
Definition: boss_gothik.cpp:514

Member Function Documentation

void npc_gothik_minion::npc_gothik_minionAI::DamageTaken ( Unit attacker,
uint32 damage 
)
inlineoverridevirtual

Reimplemented from UnitAI.

528  {
529  if (gateClose && !isOnSameSide(attacker))
530  damage = 0;
531  }
bool gateClose
Definition: boss_gothik.cpp:515
bool isOnSameSide(Unit const *who) const
Definition: boss_gothik.cpp:517

+ Here is the call graph for this function:

void npc_gothik_minion::npc_gothik_minionAI::DoAction ( int32  param)
inlineoverridevirtual

Reimplemented from UnitAI.

523  {
524  gateClose = param != 0;
525  }
bool gateClose
Definition: boss_gothik.cpp:515
void npc_gothik_minion::npc_gothik_minionAI::EnterEvadeMode ( EvadeReason  why)
inlineoverridevirtual

Reimplemented from CreatureAI.

541  {
542  if (!gateClose)
543  {
545  return;
546  }
547 
548  if (!_EnterEvadeMode())
549  return;
550 
551  Map::PlayerList const &PlayerList = me->GetMap()->GetPlayers();
552  for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
553  {
554  if (i->GetSource() && i->GetSource()->IsAlive() && isOnSameSide(i->GetSource()))
555  {
556  AttackStart(i->GetSource());
557  return;
558  }
559  }
560 
562  Reset();
563  }
void MoveIdle()
Definition: MotionMaster.cpp:185
Map * GetMap() const
Definition: Object.h:543
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition: CreatureAI.cpp:168
MotionMaster * GetMotionMaster()
Definition: Unit.h:2101
bool gateClose
Definition: boss_gothik.cpp:515
iterator begin()
Definition: MapRefManager.h:37
bool _EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition: CreatureAI.cpp:255
void Reset() override
Definition: CombatAI.cpp:60
Creature *const me
Definition: CreatureAI.h:71
Definition: LinkedList.h:141
PlayerList const & GetPlayers() const
Definition: Map.h:433
Definition: MapRefManager.h:26
bool isOnSameSide(Unit const *who) const
Definition: boss_gothik.cpp:517
virtual void AttackStart(Unit *)
Definition: UnitAI.cpp:29
iterator end()
Definition: MapRefManager.h:38

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool npc_gothik_minion::npc_gothik_minionAI::isOnSameSide ( Unit const who) const
inline
518  {
519  return (liveSide == IN_LIVE_SIDE(who));
520  }
#define IN_LIVE_SIDE(who)
Definition: boss_gothik.cpp:105
bool liveSide
Definition: boss_gothik.cpp:514

+ Here is the caller graph for this function:

void npc_gothik_minion::npc_gothik_minionAI::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from CombatAI.

534  {
535  if (me->IsSummon())
536  if (Unit* owner = me->ToTempSummon()->GetSummoner())
537  CombatAI::JustDied(owner);
538  }
Unit * GetSummoner() const
Definition: TemporarySummon.cpp:37
TempSummon * ToTempSummon()
Definition: Unit.h:2206
Creature *const me
Definition: CreatureAI.h:71
void JustDied(Unit *killer) override
Definition: CombatAI.cpp:65
bool IsSummon() const
Definition: Unit.h:1401
Definition: Unit.h:1305

+ Here is the call graph for this function:

void npc_gothik_minion::npc_gothik_minionAI::UpdateAI ( uint32  diff)
inlineoverridevirtual

Reimplemented from CombatAI.

566  {
567  if (gateClose && (!isOnSameSide(me) || (me->GetVictim() && !isOnSameSide(me->GetVictim()))))
568  {
570  return;
571  }
572 
573  CombatAI::UpdateAI(diff);
574  }
bool gateClose
Definition: boss_gothik.cpp:515
Creature *const me
Definition: CreatureAI.h:71
Definition: CreatureAI.h:90
Unit * GetVictim() const
Definition: Unit.h:1379
void EnterEvadeMode(EvadeReason why) override
Definition: boss_gothik.cpp:540
bool isOnSameSide(Unit const *who) const
Definition: boss_gothik.cpp:517
void UpdateAI(uint32 diff) override
Definition: CombatAI.cpp:83

+ Here is the call graph for this function:

Member Data Documentation

bool npc_gothik_minion::npc_gothik_minionAI::gateClose
bool npc_gothik_minion::npc_gothik_minionAI::liveSide

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