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

Public Member Functions

void selectAbility (int asel)
 
 aqsentinelAI (Creature *creature)
 
void Initialize ()
 
void ClearBuddyList ()
 
void AddBuddyToList (ObjectGuid CreatureGUID)
 
void GiveBuddyMyList (Creature *c)
 
void SendMyListToBuddies ()
 
void CallBuddiesToAttack (Unit *who)
 
void AddSentinelsNear (Unit *)
 
int pickAbilityRandom (bool *chosenAbilities)
 
void GetOtherSentinels (Unit *who)
 
void Reset () override
 
void GainSentinelAbility (uint32 id)
 
void EnterCombat (Unit *who) override
 
void JustDied (Unit *) override
 
- Public Member Functions inherited from ScriptedAI
 ScriptedAI (Creature *creature)
 
virtual ~ScriptedAI ()
 
void AttackStartNoMove (Unit *target)
 
void DamageTaken (Unit *, uint32 &) override
 
virtual void UpdateAI (uint32 diff) 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 ()
 
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

uint32 ability
 
int abselected
 
ObjectGuid NearbyGUID [3]
 
bool gatherOthersWhenAggro
 
- 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_anubisath_sentinel::aqsentinelAI::aqsentinelAI ( Creature creature)
inline
93  : ScriptedAI(creature)
94  {
95  Initialize();
96  abselected = 0; // just initialization of variable
97  ability = 0;
98  }
ScriptedAI(Creature *creature)
Definition: ScriptedCreature.cpp:100
void Initialize()
Definition: mob_anubisath_sentinel.cpp:100
uint32 ability
Definition: mob_anubisath_sentinel.cpp:74
int abselected
Definition: mob_anubisath_sentinel.cpp:75

+ Here is the call graph for this function:

Member Function Documentation

void npc_anubisath_sentinel::aqsentinelAI::AddBuddyToList ( ObjectGuid  CreatureGUID)
inline
116  {
117  if (CreatureGUID == me->GetGUID())
118  return;
119 
120  for (int i=0; i<3; ++i)
121  {
122  if (NearbyGUID[i] == CreatureGUID)
123  return;
124  if (!NearbyGUID[i])
125  {
126  NearbyGUID[i] = CreatureGUID;
127  return;
128  }
129  }
130  }
Creature *const me
Definition: CreatureAI.h:71
ObjectGuid NearbyGUID[3]
Definition: mob_anubisath_sentinel.cpp:106
ObjectGuid const & GetGUID() const
Definition: Object.h:105

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void npc_anubisath_sentinel::aqsentinelAI::AddSentinelsNear ( Unit )
inline
166  {
167  std::list<Creature*> assistList;
168  me->GetCreatureListWithEntryInGrid(assistList, 15264, 70.0f);
169 
170  if (assistList.empty())
171  return;
172 
173  for (std::list<Creature*>::const_iterator iter = assistList.begin(); iter != assistList.end(); ++iter)
174  AddBuddyToList((*iter)->GetGUID());
175  }
void GetCreatureListWithEntryInGrid(std::list< Creature * > &lList, uint32 uiEntry, float fMaxSearchRange) const
Definition: Object.cpp:2483
Creature *const me
Definition: CreatureAI.h:71
void AddBuddyToList(ObjectGuid CreatureGUID)
Definition: mob_anubisath_sentinel.cpp:115

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void npc_anubisath_sentinel::aqsentinelAI::CallBuddiesToAttack ( Unit who)
inline
149  {
150  for (int32 i = 0; i < 3; ++i)
151  {
153  if (c)
154  {
155  if (!c->IsInCombat())
156  {
157  c->SetNoCallAssistance(true);
158  if (c->AI())
159  c->AI()->AttackStart(who);
160  }
161  }
162  }
163  }
void SetNoCallAssistance(bool val)
Definition: Creature.h:618
bool IsInCombat() const
Definition: Unit.h:1584
Definition: Creature.h:467
Creature *const me
Definition: CreatureAI.h:71
CreatureAI * AI() const
Definition: Creature.h:525
ObjectGuid NearbyGUID[3]
Definition: mob_anubisath_sentinel.cpp:106
int32_t int32
Definition: Define.h:146
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:174
virtual void AttackStart(Unit *)
Definition: UnitAI.cpp:29

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void npc_anubisath_sentinel::aqsentinelAI::ClearBuddyList ( )
inline
109  {
110  NearbyGUID[0].Clear();
111  NearbyGUID[1].Clear();
112  NearbyGUID[2].Clear();
113  }
ObjectGuid NearbyGUID[3]
Definition: mob_anubisath_sentinel.cpp:106
void Clear()
Definition: ObjectGuid.h:215

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void npc_anubisath_sentinel::aqsentinelAI::EnterCombat ( Unit who)
inlineoverridevirtual

Reimplemented from ScriptedAI.

247  {
249  GetOtherSentinels(who);
250 
252  DoZoneInCombat();
253  }
bool gatherOthersWhenAggro
Definition: mob_anubisath_sentinel.cpp:221
void DoZoneInCombat(Creature *creature=NULL, float maxRangeToNearestTarget=50.0f)
Definition: CreatureAI.cpp:47
uint32 ability
Definition: mob_anubisath_sentinel.cpp:74
void GainSentinelAbility(uint32 id)
Definition: mob_anubisath_sentinel.cpp:241
void GetOtherSentinels(Unit *who)
Definition: mob_anubisath_sentinel.cpp:193

+ Here is the call graph for this function:

void npc_anubisath_sentinel::aqsentinelAI::GainSentinelAbility ( uint32  id)
inline
242  {
243  me->AddAura(id, me);
244  }
Aura * AddAura(uint32 spellId, Unit *target)
Definition: Unit.cpp:14463
Creature *const me
Definition: CreatureAI.h:71

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void npc_anubisath_sentinel::aqsentinelAI::GetOtherSentinels ( Unit who)
inline
194  {
195  bool chosenAbilities[9];
196  memset(chosenAbilities, 0, sizeof(chosenAbilities));
197  selectAbility(pickAbilityRandom(chosenAbilities));
198 
199  ClearBuddyList();
201  int bli;
202  for (bli = 0; bli < 3; ++bli)
203  {
204  if (!NearbyGUID[bli])
205  break;
206 
208  if (!pNearby)
209  break;
210 
211  AddSentinelsNear(pNearby);
212  ENSURE_AI(aqsentinelAI, pNearby->AI())->gatherOthersWhenAggro = false;
213  ENSURE_AI(aqsentinelAI, pNearby->AI())->selectAbility(pickAbilityRandom(chosenAbilities));
214  }
215  /*if (bli < 3)
216  DoYell("I dont have enough buddies.", LANG_NEUTRAL, 0);*/
218  CallBuddiesToAttack(who);
219  }
bool gatherOthersWhenAggro
Definition: mob_anubisath_sentinel.cpp:221
int pickAbilityRandom(bool *chosenAbilities)
Definition: mob_anubisath_sentinel.cpp:177
void selectAbility(int asel)
Definition: mob_anubisath_sentinel.cpp:77
void SendMyListToBuddies()
Definition: mob_anubisath_sentinel.cpp:141
Definition: Creature.h:467
aqsentinelAI(Creature *creature)
Definition: mob_anubisath_sentinel.cpp:93
Creature *const me
Definition: CreatureAI.h:71
#define ENSURE_AI(a, b)
Definition: ScriptedCreature.h:29
CreatureAI * AI() const
Definition: Creature.h:525
ObjectGuid NearbyGUID[3]
Definition: mob_anubisath_sentinel.cpp:106
void CallBuddiesToAttack(Unit *who)
Definition: mob_anubisath_sentinel.cpp:148
void ClearBuddyList()
Definition: mob_anubisath_sentinel.cpp:108
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:174
void AddSentinelsNear(Unit *)
Definition: mob_anubisath_sentinel.cpp:165

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void npc_anubisath_sentinel::aqsentinelAI::GiveBuddyMyList ( Creature c)
inline
133  {
134  aqsentinelAI* cai = ENSURE_AI(aqsentinelAI, (c)->AI());
135  for (int32 i = 0; i < 3; ++i)
136  if (!NearbyGUID[i].IsEmpty() && NearbyGUID[i] != c->GetGUID())
137  cai->AddBuddyToList(NearbyGUID[i]);
138  cai->AddBuddyToList(me->GetGUID());
139  }
aqsentinelAI(Creature *creature)
Definition: mob_anubisath_sentinel.cpp:93
Creature *const me
Definition: CreatureAI.h:71
#define ENSURE_AI(a, b)
Definition: ScriptedCreature.h:29
ObjectGuid NearbyGUID[3]
Definition: mob_anubisath_sentinel.cpp:106
int32_t int32
Definition: Define.h:146
ObjectGuid const & GetGUID() const
Definition: Object.h:105

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void npc_anubisath_sentinel::aqsentinelAI::Initialize ( void  )
inline
101  {
102  ClearBuddyList();
103  gatherOthersWhenAggro = true;
104  }
bool gatherOthersWhenAggro
Definition: mob_anubisath_sentinel.cpp:221
void ClearBuddyList()
Definition: mob_anubisath_sentinel.cpp:108

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void npc_anubisath_sentinel::aqsentinelAI::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

256  {
257  for (int ni = 0; ni < 3; ++ni)
258  {
260  if (!sent)
261  continue;
262  if (sent->isDead())
263  continue;
264  sent->ModifyHealth(int32(sent->CountPctFromMaxHealth(50)));
266  }
267  }
int32 ModifyHealth(int32 val)
Definition: Unit.cpp:10216
Definition: Creature.h:467
aqsentinelAI(Creature *creature)
Definition: mob_anubisath_sentinel.cpp:93
Creature *const me
Definition: CreatureAI.h:71
#define ENSURE_AI(a, b)
Definition: ScriptedCreature.h:29
CreatureAI * AI() const
Definition: Creature.h:525
ObjectGuid NearbyGUID[3]
Definition: mob_anubisath_sentinel.cpp:106
uint32 ability
Definition: mob_anubisath_sentinel.cpp:74
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:174
bool isDead() const
Definition: Unit.h:1694
void GainSentinelAbility(uint32 id)
Definition: mob_anubisath_sentinel.cpp:241
int32_t int32
Definition: g3dmath.h:167
uint32 CountPctFromMaxHealth(int32 pct) const
Definition: Unit.h:1435

+ Here is the call graph for this function:

int npc_anubisath_sentinel::aqsentinelAI::pickAbilityRandom ( bool chosenAbilities)
inline
178  {
179  for (int t = 0; t < 2; ++t)
180  {
181  for (int i = !t ? (rand32()%9) : 0; i < 9; ++i)
182  {
183  if (!chosenAbilities[i])
184  {
185  chosenAbilities[i] = true;
186  return i;
187  }
188  }
189  }
190  return 0; // should never happen
191  }
uint32 rand32()
Definition: Random.cpp:64

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void npc_anubisath_sentinel::aqsentinelAI::Reset ( )
inlineoverridevirtual

Reimplemented from ScriptedAI.

224  {
225  if (!me->isDead())
226  {
227  for (int i = 0; i < 3; ++i)
228  {
229  if (!NearbyGUID[i])
230  continue;
231  if (Creature* pNearby = ObjectAccessor::GetCreature(*me, NearbyGUID[i]))
232  {
233  if (pNearby->isDead())
234  pNearby->Respawn();
235  }
236  }
237  }
238  Initialize();
239  }
void Initialize()
Definition: mob_anubisath_sentinel.cpp:100
Definition: Creature.h:467
Creature *const me
Definition: CreatureAI.h:71
ObjectGuid NearbyGUID[3]
Definition: mob_anubisath_sentinel.cpp:106
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:174
bool isDead() const
Definition: Unit.h:1694

+ Here is the call graph for this function:

void npc_anubisath_sentinel::aqsentinelAI::selectAbility ( int  asel)
inline
78  {
79  switch (asel)
80  {
81  case 0: ability = SPELL_MENDING_BUFF;break;
82  case 1: ability = SPELL_KNOCK_BUFF;break;
83  case 2: ability = SPELL_MANAB_BUFF;break;
84  case 3: ability = SPELL_REFLECTAF_BUFF;break;
85  case 4: ability = SPELL_REFLECTSFr_BUFF;break;
86  case 5: ability = SPELL_THORNS_BUFF;break;
87  case 6: ability = SPELL_THUNDER_BUFF;break;
88  case 7: ability = SPELL_MSTRIKE_BUFF;break;
89  case 8: ability = SPELL_STORM_BUFF;break;
90  }
91  }
Definition: mob_anubisath_sentinel.cpp:45
Definition: mob_anubisath_sentinel.cpp:48
Definition: mob_anubisath_sentinel.cpp:58
Definition: mob_anubisath_sentinel.cpp:49
Definition: mob_anubisath_sentinel.cpp:41
Definition: mob_anubisath_sentinel.cpp:43
Definition: mob_anubisath_sentinel.cpp:55
uint32 ability
Definition: mob_anubisath_sentinel.cpp:74
Definition: mob_anubisath_sentinel.cpp:50
Definition: mob_anubisath_sentinel.cpp:52

+ Here is the caller graph for this function:

void npc_anubisath_sentinel::aqsentinelAI::SendMyListToBuddies ( )
inline
142  {
143  for (int32 i = 0; i < 3; ++i)
144  if (Creature* pNearby = ObjectAccessor::GetCreature(*me, NearbyGUID[i]))
145  GiveBuddyMyList(pNearby);
146  }
Definition: Creature.h:467
Creature *const me
Definition: CreatureAI.h:71
ObjectGuid NearbyGUID[3]
Definition: mob_anubisath_sentinel.cpp:106
int32_t int32
Definition: Define.h:146
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:174
void GiveBuddyMyList(Creature *c)
Definition: mob_anubisath_sentinel.cpp:132

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

uint32 npc_anubisath_sentinel::aqsentinelAI::ability
int npc_anubisath_sentinel::aqsentinelAI::abselected
bool npc_anubisath_sentinel::aqsentinelAI::gatherOthersWhenAggro
ObjectGuid npc_anubisath_sentinel::aqsentinelAI::NearbyGUID[3]

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