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

Public Member Functions

 npc_sinclariAI (Creature *creature)
 
void Reset () override
 
void sGossipSelect (Player *player, uint32 menuId, uint32 gossipListId) override
 
void DoAction (int32 actionId) override
 
void UpdateAI (uint32 diff) override
 
void ScheduleIntro ()
 
void ScheduleOutro ()
 
void JustSummoned (Creature *summon) override
 
void SummonedCreatureDespawn (Creature *summon) 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 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 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 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)
 

Private Attributes

InstanceScript_instance
 
TaskScheduler _scheduler
 
SummonList _summons
 

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 ()
 
- Public Attributes inherited from ScriptedAI
bool IsFleeing
 
- 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_sinclari_vh::npc_sinclariAI::npc_sinclariAI ( Creature creature)
inline
346  : ScriptedAI(creature), _summons(creature)
347  {
348  _instance = creature->GetInstanceScript();
349  }
ScriptedAI(Creature *creature)
Definition: ScriptedCreature.cpp:100
InstanceScript * GetInstanceScript()
Definition: Object.cpp:1540
SummonList _summons
Definition: violet_hold.cpp:519
InstanceScript * _instance
Definition: violet_hold.cpp:516

+ Here is the call graph for this function:

Member Function Documentation

void npc_sinclari_vh::npc_sinclariAI::DoAction ( int32  actionId)
inlineoverridevirtual

Reimplemented from UnitAI.

389  {
390  if (actionId == ACTION_SINCLARI_OUTRO)
391  {
392  me->SetVisible(true);
393  ScheduleOutro();
394  }
395  }
void ScheduleOutro()
Definition: violet_hold.cpp:489
Creature *const me
Definition: CreatureAI.h:71
void SetVisible(bool x)
Definition: Unit.cpp:10368
Definition: violet_hold.h:150

+ Here is the call graph for this function:

void npc_sinclari_vh::npc_sinclariAI::JustSummoned ( Creature summon)
inlineoverridevirtual

Reimplemented from ScriptedAI.

504  {
505  ScriptedAI::JustSummoned(summon);
506  _summons.Summon(summon);
507  }
void Summon(Creature const *summon)
Definition: ScriptedCreature.h:92
void JustSummoned(Creature *) override
Definition: ScriptedCreature.h:166
SummonList _summons
Definition: violet_hold.cpp:519

+ Here is the call graph for this function:

void npc_sinclari_vh::npc_sinclariAI::Reset ( )
inlineoverridevirtual

Reimplemented from ScriptedAI.

352  {
354  for (uint8 i = 0; i < PortalIntroCount; ++i)
356  summon->AI()->SetData(DATA_PORTAL_LOCATION, i);
357 
358  me->SetVisible(true);
360 
361  std::list<Creature*> guardList;
363  for (Creature* guard : guardList)
364  {
365  guard->Respawn(true);
366  guard->SetVisible(true);
367  guard->SetReactState(REACT_AGGRESSIVE);
368  guard->AI()->EnterEvadeMode();
369  }
370  }
Definition: Unit.h:735
Definition: Object.h:61
Definition: Unit.h:1131
void DespawnAll()
Definition: ScriptedCreature.cpp:66
Position const PortalIntroPositions[PortalIntroPositionsSize]
Definition: instance_violet_hold.cpp:56
Definition: Creature.h:467
void SetFlag(uint16 index, uint32 newFlag)
Definition: Object.cpp:1199
void GetCreatureListWithEntryInGrid(std::list< Creature * > &lList, uint32 uiEntry, float fMaxSearchRange) const
Definition: Object.cpp:2483
Definition: violet_hold.h:61
Creature *const me
Definition: CreatureAI.h:71
uint8 const PortalIntroCount
Definition: violet_hold.h:28
void SetVisible(bool x)
Definition: Unit.cpp:10368
SummonList _summons
Definition: violet_hold.cpp:519
Definition: violet_hold.h:90
uint8_t uint8
Definition: Define.h:152
Definition: UpdateFields.h:135
TempSummon * SummonCreature(uint32 id, Position const &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0) const
Definition: Object.cpp:2346
Definition: violet_hold.h:117

+ Here is the call graph for this function:

void npc_sinclari_vh::npc_sinclariAI::ScheduleIntro ( )
inline
408  {
409  _scheduler.Schedule(Seconds(1), [this](TaskContext task)
410  {
411  switch (task.GetRepeatCounter())
412  {
413  case 0:
414  me->SetWalk(true);
416  task.Repeat(Seconds(1));
417  break;
418  case 1:
421  task.Repeat(Seconds(3));
422  break;
423  case 2:
424  me->SetFacingTo(SinclariPositions[0].GetOrientation());
426 
427  task.Schedule(Seconds(1), [this](TaskContext /*task*/)
428  {
429  std::list<Creature*> guardList;
431  for (Creature* guard : guardList)
432  {
433  guard->SetReactState(REACT_PASSIVE);
434  guard->SetWalk(false);
435  guard->GetMotionMaster()->MovePoint(0, GuardsMovePosition);
436  }
437  });
438 
439  task.Repeat(Seconds(2));
440  break;
441  case 3:
444  task.Repeat(Seconds(5));
445  break;
446  case 4:
447  me->SetFacingTo(SinclariPositions[1].GetOrientation());
448 
449  task.Schedule(Seconds(1), [this](TaskContext /*task*/)
450  {
451  std::list<Creature*> guardList;
453  for (Creature* guard : guardList)
454  guard->SetVisible(false);
455  });
456 
457  task.Repeat(Seconds(6));
458  break;
459  case 5:
461  task.Repeat(Seconds(4));
462  break;
463  case 6:
465  task.Repeat(Seconds(1));
466  break;
467  case 7:
469  {
470  mainDoor->SetGoState(GO_STATE_READY);
471  mainDoor->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED);
472  }
473  task.Repeat(Seconds(5));
474  break;
475  case 8:
476  me->SetVisible(false);
477  task.Repeat(Seconds(1));
478  break;
479  case 9:
481  // [1] GUID: Full: 0xF1300077C202E6DD Type: Creature Entry: 30658 Low: 190173
482  break;
483  default:
484  break;
485  }
486  });
487  }
Definition: violet_hold.cpp:146
TempSummon * SummonCreature(uint32 entry, Position const &pos, SummonPropertiesEntry const *properties=NULL, uint32 duration=0, Unit *summoner=NULL, uint32 spellId=0, uint32 vehId=0)
Definition: Object.cpp:2219
Map * GetMap() const
Definition: Object.h:543
void DespawnAll()
Definition: ScriptedCreature.cpp:66
Definition: Unit.h:1129
Position const DefenseSystemLocation
Definition: instance_violet_hold.cpp:30
MotionMaster * GetMotionMaster()
Definition: Unit.h:2101
Definition: Creature.h:467
std::chrono::seconds Seconds
Seconds shorthand typedef.
Definition: Duration.h:27
TaskScheduler _scheduler
Definition: violet_hold.cpp:517
TaskContext & Repeat(std::chrono::duration< _Rep, _Period > const &duration)
Definition: TaskScheduler.h:482
Position const SinclariPositions[]
Definition: violet_hold.cpp:305
void GetCreatureListWithEntryInGrid(std::list< Creature * > &lList, uint32 uiEntry, float fMaxSearchRange) const
Definition: Object.cpp:2483
Creature *const me
Definition: CreatureAI.h:71
void MovePoint(uint32 id, Position const &pos, bool generatePath=true)
Definition: MotionMaster.h:172
Definition: InstanceScript.h:59
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:52
void SetVisible(bool x)
Definition: Unit.cpp:10368
Definition: SharedDefines.h:2122
GameObject * GetGameObject(uint32 type)
Definition: InstanceScript.h:184
Definition: SharedDefines.h:2544
SummonList _summons
Definition: violet_hold.cpp:519
Definition: GameObject.h:880
void SetFacingTo(float ori)
Definition: Unit.cpp:15777
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
Definition: violet_hold.h:80
Definition: UpdateFields.h:319
TaskScheduler::repeated_t GetRepeatCounter() const
Returns the repeat counter which increases every time the task is repeated.
Definition: TaskScheduler.cpp:194
Definition: violet_hold.cpp:145
Definition: GameObject.h:823
TaskScheduler & Schedule(std::chrono::duration< _Rep, _Period > const &time, task_handler_t const &task)
Definition: TaskScheduler.h:232
Definition: violet_hold.h:118
bool SetWalk(bool enable)
Definition: Unit.cpp:15800
void HandleEmoteCommand(uint32 anim_id)
Definition: Unit.cpp:1444
Definition: SharedDefines.h:2509
Position const GuardsMovePosition
Definition: violet_hold.cpp:313
TaskContext & Schedule(std::chrono::duration< _Rep, _Period > const &time, TaskScheduler::task_handler_t const &task)
Definition: TaskScheduler.h:522
Definition: TaskScheduler.h:411
Definition: violet_hold.h:58
InstanceScript * _instance
Definition: violet_hold.cpp:516
Definition: violet_hold.h:117

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void npc_sinclari_vh::npc_sinclariAI::ScheduleOutro ( )
inline
490  {
491  _scheduler.Schedule(Seconds(4), [this](TaskContext task)
492  {
495 
496  task.Schedule(Seconds(10), [this](TaskContext /*task*/)
497  {
499  });
500  });
501  }
Definition: Unit.h:735
MotionMaster * GetMotionMaster()
Definition: Unit.h:2101
std::chrono::seconds Seconds
Seconds shorthand typedef.
Definition: Duration.h:27
void SetFlag(uint16 index, uint32 newFlag)
Definition: Object.cpp:1199
TaskScheduler _scheduler
Definition: violet_hold.cpp:517
Position const SinclariPositions[]
Definition: violet_hold.cpp:305
Creature *const me
Definition: CreatureAI.h:71
void MovePoint(uint32 id, Position const &pos, bool generatePath=true)
Definition: MotionMaster.h:172
Definition: violet_hold.cpp:147
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
TaskScheduler & Schedule(std::chrono::duration< _Rep, _Period > const &time, task_handler_t const &task)
Definition: TaskScheduler.h:232
Definition: UpdateFields.h:135
TaskContext & Schedule(std::chrono::duration< _Rep, _Period > const &time, TaskScheduler::task_handler_t const &task)
Definition: TaskScheduler.h:522
Definition: TaskScheduler.h:411

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void npc_sinclari_vh::npc_sinclariAI::sGossipSelect ( Player player,
uint32  menuId,
uint32  gossipListId 
)
inlineoverridevirtual

Reimplemented from UnitAI.

373  {
374  if (menuId == GOSSIP_MENU_START_ENCOUNTER && gossipListId == 0)
375  {
378  ScheduleIntro();
379  player->PlayerTalkClass->SendCloseGossip();
380  }
381  else if (menuId == GOSSIP_MENU_SEND_ME_IN && gossipListId == 0)
382  {
383  me->CastSpell(player, SPELL_TELEPORT_PLAYER, true);
384  player->PlayerTalkClass->SendCloseGossip();
385  }
386  }
Definition: violet_hold.cpp:133
Definition: Unit.h:735
Creature *const me
Definition: CreatureAI.h:71
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:52
Definition: violet_hold.cpp:150
Definition: InstanceScript.h:62
void RemoveFlag(uint16 index, uint32 oldFlag)
Definition: Object.cpp:1214
Definition: UpdateFields.h:135
void ScheduleIntro()
Definition: violet_hold.cpp:407
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: violet_hold.cpp:149
Definition: violet_hold.h:58
InstanceScript * _instance
Definition: violet_hold.cpp:516

+ Here is the call graph for this function:

void npc_sinclari_vh::npc_sinclariAI::SummonedCreatureDespawn ( Creature summon)
inlineoverridevirtual

Reimplemented from ScriptedAI.

510  {
511  _summons.Despawn(summon);
513  }
void Despawn(Creature const *summon)
Definition: ScriptedCreature.h:93
void SummonedCreatureDespawn(Creature *) override
Definition: ScriptedCreature.h:169
SummonList _summons
Definition: violet_hold.cpp:519

+ Here is the call graph for this function:

void npc_sinclari_vh::npc_sinclariAI::UpdateAI ( uint32  diff)
inlineoverridevirtual

Reimplemented from ScriptedAI.

398  {
399  _scheduler.Update(diff);
400 
401  if (!UpdateVictim())
402  return;
403 
405  }
bool UpdateVictim()
Definition: CreatureAI.cpp:233
TaskScheduler _scheduler
Definition: violet_hold.cpp:517
TaskScheduler & Update(success_t const &callback=EmptyCallback)
Definition: TaskScheduler.cpp:26
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:49

+ Here is the call graph for this function:

Member Data Documentation

InstanceScript* npc_sinclari_vh::npc_sinclariAI::_instance
private
TaskScheduler npc_sinclari_vh::npc_sinclariAI::_scheduler
private
SummonList npc_sinclari_vh::npc_sinclariAI::_summons
private

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