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

Public Member Functions

 npc_sinster_reflectionAI (Creature *creature)
 
void Initialize ()
 
void Reset () override
 
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 EnterCombat (Unit *) override
 
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

uint8 victimClass
 
uint32 uiTimer [3]
 
- 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_sinster_reflection::npc_sinster_reflectionAI::npc_sinster_reflectionAI ( Creature creature)
inline
1292  : ScriptedAI(creature)
1293  {
1294  Initialize();
1295  }
ScriptedAI(Creature *creature)
Definition: ScriptedCreature.cpp:100
void Initialize()
Definition: boss_kiljaeden.cpp:1297

+ Here is the call graph for this function:

Member Function Documentation

void npc_sinster_reflection::npc_sinster_reflectionAI::Initialize ( void  )
inline
1298  {
1299  uiTimer[0] = 0;
1300  uiTimer[1] = 0;
1301  uiTimer[2] = 0;
1302  victimClass = 0;
1303  }
uint8 victimClass
Definition: boss_kiljaeden.cpp:1305
uint32 uiTimer[3]
Definition: boss_kiljaeden.cpp:1306

+ Here is the caller graph for this function:

void npc_sinster_reflection::npc_sinster_reflectionAI::Reset ( )
inlineoverridevirtual

Reimplemented from ScriptedAI.

1309  {
1310  Initialize();
1311  }
void Initialize()
Definition: boss_kiljaeden.cpp:1297

+ Here is the call graph for this function:

void npc_sinster_reflection::npc_sinster_reflectionAI::UpdateAI ( uint32  diff)
inlineoverridevirtual

Reimplemented from ScriptedAI.

1314  {
1315  if (!UpdateVictim())
1316  return;
1317 
1318  if ((victimClass == 0) && me->GetVictim())
1319  {
1321  switch (victimClass)
1322  {
1323  case CLASS_DRUID:
1324  break;
1325  case CLASS_HUNTER:
1326  break;
1327  case CLASS_MAGE:
1328  break;
1329  case CLASS_WARLOCK:
1330  break;
1331  case CLASS_WARRIOR:
1332  me->SetCanDualWield(true);
1333  break;
1334  case CLASS_PALADIN:
1335  break;
1336  case CLASS_PRIEST:
1337  break;
1338  case CLASS_SHAMAN:
1339  me->SetCanDualWield(true);
1340  break;
1341  case CLASS_ROGUE:
1342  me->SetCanDualWield(true);
1343  break;
1344  }
1345  }
1346 
1347  switch (victimClass)
1348  {
1349  case CLASS_DRUID:
1350  if (uiTimer[1] <= diff)
1351  {
1353  uiTimer[1] = urand(2000, 4000);
1354  }
1356  break;
1357  case CLASS_HUNTER:
1358  if (uiTimer[1] <= diff)
1359  {
1361  uiTimer[1] = urand(8000, 10000);
1362  }
1363  if (uiTimer[2] <= diff)
1364  {
1365  DoCastVictim(SPELL_SR_SHOOT, false);
1366  uiTimer[2] = urand(4000, 6000);
1367  }
1368  if (me->IsWithinMeleeRange(me->GetVictim(), 6))
1369  {
1370  if (uiTimer[0] <= diff)
1371  {
1373  uiTimer[0] = urand(6000, 8000);
1374  }
1376  }
1377  break;
1378  case CLASS_MAGE:
1379  if (uiTimer[1] <= diff)
1380  {
1382  uiTimer[1] = urand(2000, 4000);
1383  }
1385  break;
1386  case CLASS_WARLOCK:
1387  if (uiTimer[1] <= diff)
1388  {
1390  uiTimer[1] = urand(3000, 5000);
1391  }
1392  if (uiTimer[2] <= diff)
1393  {
1395  uiTimer[2] = urand(2000, 4000);
1396  }
1398  break;
1399  case CLASS_WARRIOR:
1400  if (uiTimer[1] <= diff)
1401  {
1403  uiTimer[1] = urand(9000, 11000);
1404  }
1406  break;
1407  case CLASS_PALADIN:
1408  if (uiTimer[1] <= diff)
1409  {
1411  uiTimer[1] = urand(6000, 8000);
1412  }
1413  if (uiTimer[2] <= diff)
1414  {
1416  uiTimer[2] = urand(2000, 4000);
1417  }
1419  break;
1420  case CLASS_PRIEST:
1421  if (uiTimer[1] <= diff)
1422  {
1424  uiTimer[1] = urand(4000, 6000);
1425  }
1426  if (uiTimer[2] <= diff)
1427  {
1428  DoCast(me, SPELL_SR_RENEW, false);
1429  uiTimer[2] = urand(6000, 8000);
1430  }
1432  break;
1433  case CLASS_SHAMAN:
1434  if (uiTimer[1] <= diff)
1435  {
1437  uiTimer[1] = urand(4000, 6000);
1438  }
1440  break;
1441  case CLASS_ROGUE:
1442  if (uiTimer[1] <= diff)
1443  {
1445  uiTimer[1] = urand(4000, 6000);
1446  }
1448  break;
1449  }
1450  TC_LOG_DEBUG("scripts", "Sinister-Timer");
1451  for (uint8 i = 0; i < 3; ++i)
1452  uiTimer[i] -= diff;
1453  }
Definition: SharedDefines.h:170
Unit * EnsureVictim() const
Definition: Unit.h:1381
void SetCanDualWield(bool value) override
Definition: Creature.cpp:1423
bool UpdateVictim()
Definition: CreatureAI.cpp:233
Definition: boss_kiljaeden.cpp:135
Definition: boss_kiljaeden.cpp:117
uint8 victimClass
Definition: boss_kiljaeden.cpp:1305
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:198
Definition: boss_kiljaeden.cpp:119
Definition: SharedDefines.h:168
Definition: SharedDefines.h:167
Definition: boss_kiljaeden.cpp:126
Creature *const me
Definition: CreatureAI.h:71
Definition: SharedDefines.h:171
Definition: boss_kiljaeden.cpp:132
Definition: UnitAI.h:35
Unit * GetVictim() const
Definition: Unit.h:1379
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:45
Unit * SelectTarget(SelectAggroTarget targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, int32 aura=0)
Definition: UnitAI.cpp:91
Definition: boss_kiljaeden.cpp:131
bool IsWithinMeleeRange(const Unit *obj, float dist=MELEE_RANGE) const
Definition: Unit.cpp:508
void DoCast(uint32 spellId)
Definition: UnitAI.cpp:101
Definition: SharedDefines.h:173
Definition: boss_kiljaeden.cpp:129
Definition: SharedDefines.h:174
Definition: boss_kiljaeden.cpp:137
Definition: boss_kiljaeden.cpp:125
Definition: boss_kiljaeden.cpp:128
Definition: SharedDefines.h:169
uint32 uiTimer[3]
Definition: boss_kiljaeden.cpp:1306
uint8 getClass() const
Definition: Unit.h:1413
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:49
uint8_t uint8
Definition: Define.h:152
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition: UnitAI.cpp:159
Definition: boss_kiljaeden.cpp:116
Definition: boss_kiljaeden.cpp:121
Definition: SharedDefines.h:175
Definition: SharedDefines.h:177
Definition: boss_kiljaeden.cpp:123

+ Here is the call graph for this function:

Member Data Documentation

uint32 npc_sinster_reflection::npc_sinster_reflectionAI::uiTimer[3]
uint8 npc_sinster_reflection::npc_sinster_reflectionAI::victimClass

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