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

Public Member Functions

 npc_leryssaAI (Creature *creature)
 
void MovementInform (uint32 type, uint32) 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 Reset () override
 
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 ()
 
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

bool bDone
 
uint32 phase
 
uint32 phaseTimer
 
- 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_leryssa::npc_leryssaAI::npc_leryssaAI ( Creature creature)
inline
1354  : ScriptedAI(creature)
1355  {
1356  bDone = false;
1357  phase = 0;
1358  phaseTimer = 0;
1359 
1361  }
Definition: Unit.h:208
ScriptedAI(Creature *creature)
Definition: ScriptedCreature.cpp:100
void RemoveStandFlags(uint8 flags)
Definition: Unit.h:1494
uint32 phaseTimer
Definition: zone_borean_tundra.cpp:1366
bool bDone
Definition: zone_borean_tundra.cpp:1363
uint32 phase
Definition: zone_borean_tundra.cpp:1365

+ Here is the call graph for this function:

Member Function Documentation

void npc_leryssa::npc_leryssaAI::MovementInform ( uint32  type,
uint32   
)
inlineoverridevirtual

Reimplemented from CreatureAI.

1369  {
1370  if (type != POINT_MOTION_TYPE)
1371  return;
1372 
1373  if (!bDone)
1374  {
1375  if (Creature* talbot = me->FindNearestCreature(NPC_PRINCE_VALANAR, 50.0f, true))
1376  ENSURE_AI(npc_counselor_talbot::npc_counselor_talbotAI, talbot->GetAI())->bCheck = true;
1377 
1379  me->CastSpell(me, SPELL_STUN, true);
1380 
1381  if (me->IsSummon())
1382  if (Unit* summoner = me->ToTempSummon()->GetSummoner())
1383  ENSURE_AI(npc_thassarian::npc_thassarianAI, summoner->GetAI())->leryssaInPosition = true;
1384  bDone = true;
1385  }
1386  else
1387  {
1389  if (me->IsSummon())
1390  if (Unit* summoner = me->ToTempSummon()->GetSummoner())
1391  summoner->SetStandState(UNIT_STAND_STATE_SIT);
1392  phaseTimer = 1500;
1393  phase = 1;
1394  }
1395  }
Definition: Unit.h:208
Definition: zone_borean_tundra.cpp:813
void AddUnitState(uint32 f)
Definition: Unit.h:1394
uint32 phaseTimer
Definition: zone_borean_tundra.cpp:1366
Definition: Creature.h:467
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition: Object.cpp:2443
Unit * GetSummoner() const
Definition: TemporarySummon.cpp:37
TempSummon * ToTempSummon()
Definition: Unit.h:2206
Creature *const me
Definition: CreatureAI.h:71
#define ENSURE_AI(a, b)
Definition: ScriptedCreature.h:29
Definition: Unit.h:553
bool bDone
Definition: zone_borean_tundra.cpp:1363
Definition: zone_borean_tundra.cpp:850
uint32 phase
Definition: zone_borean_tundra.cpp:1365
void SetStandState(UnitStandStateType state, uint32 animKitID=0)
Definition: Unit.cpp:12772
bool IsSummon() const
Definition: Unit.h:1401
Definition: Unit.h:1305
Definition: MotionMaster.h:46
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
Definition: zone_borean_tundra.cpp:808
Definition: zone_borean_tundra.cpp:1235

+ Here is the call graph for this function:

void npc_leryssa::npc_leryssaAI::UpdateAI ( uint32  diff)
inlineoverridevirtual

Reimplemented from ScriptedAI.

1398  {
1399  ScriptedAI::UpdateAI(diff);
1400 
1401  if (phaseTimer <= diff)
1402  {
1403  switch (phase)
1404  {
1405  case 1:
1406  if (me->IsSummon())
1407  if (Unit* summoner = me->ToTempSummon()->GetSummoner())
1408  if (Creature* thassarian = summoner->ToCreature())
1409  thassarian->AI()->Talk(SAY_THASSARIAN_4);
1410  phaseTimer = 5000;
1411  ++phase;
1412  break;
1413  case 2:
1415  phaseTimer = 5000;
1416  ++phase;
1417  break;
1418  case 3:
1419  if (me->IsSummon())
1420  if (Unit* summoner = me->ToTempSummon()->GetSummoner())
1421  if (Creature* thassarian = summoner->ToCreature())
1422  thassarian->AI()->Talk(SAY_THASSARIAN_5);
1423  phaseTimer = 5000;
1424  ++phase;
1425  break;
1426  case 4:
1428  phaseTimer = 5000;
1429  ++phase;
1430  break;
1431  case 5:
1432  if (me->IsSummon())
1433  if (Unit* summoner = me->ToTempSummon()->GetSummoner())
1434  if (Creature* thassarian = summoner->ToCreature())
1435  thassarian->AI()->Talk(SAY_THASSARIAN_6);
1436  phaseTimer = 5000;
1437  ++phase;
1438  break;
1439 
1440  case 6:
1442  phaseTimer = 5000;
1443  ++phase;
1444  break;
1445  case 7:
1446  if (me->IsSummon())
1447  if (Unit* summoner = me->ToTempSummon()->GetSummoner())
1448  if (Creature* thassarian = summoner->ToCreature())
1449  {
1450  thassarian->AI()->Talk(SAY_THASSARIAN_7);
1451  ENSURE_AI(npc_thassarian::npc_thassarianAI, thassarian->GetAI())->phase = 16;
1452  }
1453  phaseTimer = 5000;
1454  phase = 0;
1455  break;
1456  }
1457  } else phaseTimer -= diff;
1458 
1459  if (!UpdateVictim())
1460  return;
1461 
1463  }
Definition: zone_borean_tundra.cpp:821
bool UpdateVictim()
Definition: CreatureAI.cpp:233
Definition: zone_borean_tundra.cpp:822
uint32 phaseTimer
Definition: zone_borean_tundra.cpp:1366
Definition: zone_borean_tundra.cpp:838
virtual void UpdateAI(uint32 diff) override
Definition: ScriptedCreature.cpp:125
Definition: zone_borean_tundra.cpp:840
Definition: Creature.h:467
Unit * GetSummoner() const
Definition: TemporarySummon.cpp:37
TempSummon * ToTempSummon()
Definition: Unit.h:2206
Creature *const me
Definition: CreatureAI.h:71
#define ENSURE_AI(a, b)
Definition: ScriptedCreature.h:29
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
Definition: zone_borean_tundra.cpp:839
Definition: zone_borean_tundra.cpp:850
uint32 phase
Definition: zone_borean_tundra.cpp:1365
Definition: zone_borean_tundra.cpp:820
Creature * ToCreature()
Definition: Object.h:194
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:49
Definition: zone_borean_tundra.cpp:823
bool IsSummon() const
Definition: Unit.h:1401
Definition: Unit.h:1305

+ Here is the call graph for this function:

Member Data Documentation

bool npc_leryssa::npc_leryssaAI::bDone
uint32 npc_leryssa::npc_leryssaAI::phase
uint32 npc_leryssa::npc_leryssaAI::phaseTimer

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