AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
npc_captain_saeed::npc_captain_saeedAI Struct Reference
Inheritance diagram for npc_captain_saeed::npc_captain_saeedAI:
npc_escortAI ScriptedAI CreatureAI UnitAI

Public Member Functions

 npc_captain_saeedAI (Creature *creature)
 
void Reset () override
 
void MoveInLineOfSight (Unit *who) override
 
void SetGUID (ObjectGuid playerGUID, int32 type) override
 
void EnterEvadeMode (EvadeReason why) override
 
void SummonsAction (Unit *who)
 
void WaypointReached (uint32 i) override
 
void JustEngagedWith (Unit *who) override
 Called for reaction when initially engaged. More...
 
void JustDied (Unit *) override
 
void CorpseRemoved (uint32 &) override
 == Triggered Actions Requested ================== More...
 
uint32 GetData (uint32 data) const override
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
- Public Member Functions inherited from npc_escortAI
 npc_escortAI (Creature *creature)
 
 ~npc_escortAI () override
 
void AttackStart (Unit *who) override
 
void MoveInLineOfSight (Unit *who) override
 
void JustDied (Unit *) override
 
void JustRespawned () override
 
void ReturnToLastPoint ()
 
void EnterEvadeMode (EvadeReason=EVADE_REASON_OTHER) override
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
virtual void UpdateEscortAI (uint32 diff)
 
void MovementInform (uint32, uint32) override
 
void AddWaypoint (uint32 id, float x, float y, float z, uint32 waitTime=0)
 
bool SetNextWaypoint (uint32 pointId, float x, float y, float z, float orientation)
 
bool SetNextWaypoint (uint32 pointId, bool setPosition=true)
 
bool GetWaypointPosition (uint32 pointId, float &x, float &y, float &z)
 
void GenerateWaypointArray (Movement::PointsArray *points)
 
virtual void WaypointReached (uint32 pointId)=0
 
virtual void WaypointStart (uint32)
 
void Start (bool isActiveAttacker=true, bool run=false, ObjectGuid playerGUID=ObjectGuid::Empty, Quest const *quest=nullptr, bool instantRespawn=false, bool canLoopPath=false, bool resetWaypoints=true)
 
void SetRun (bool on=true)
 
void SetEscortPaused (bool on)
 
bool HasEscortState (uint32 escortState)
 
bool IsEscorted () override
 
void SetMaxPlayerDistance (float newMax)
 
float GetMaxPlayerDistance ()
 
void SetDespawnAtEnd (bool despawn)
 
void SetDespawnAtFar (bool despawn)
 
bool GetAttack ()
 
void SetCanAttack (bool attack)
 
ObjectGuid GetEventStarterGUID ()
 
void AddEscortState (uint32 escortState)
 
void RemoveEscortState (uint32 escortState)
 
- Public Member Functions inherited from ScriptedAI
 ScriptedAI (Creature *creature)
 
 ~ScriptedAI () override
 
void AttackStartNoMove (Unit *target)
 
void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask) override
 Called at any Damage from any attacker (before damage apply) More...
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
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 MovementInform (uint32, uint32) override
 
void OnPossess (bool)
 
bool IsInRoom (const Position *pos, Axis axis, bool above)
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged. More...
 
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 DoPlayMusic (uint32 soundId, bool zone)
 
void DoAddThreat (Unit *unit, float amount)
 
void DoModifyThreatByPercent (Unit *unit, int32 pct)
 
void DoResetThreat (Unit *unit)
 
void DoResetThreatList ()
 
float DoGetThreat (Unit *unit)
 
void DoTeleportPlayer (Unit *unit, float x, float y, float z, float o)
 
void DoTeleportPlayer (Unit *unit, Position pos)
 
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 IsUniqueTimedEventDone (uint32 id) const
 
void SetUniqueTimedEventDone (uint32 id)
 
void ResetUniqueTimedEvent (uint32 id)
 
void ClearUniqueTimedEventsDone ()
 
void ScheduleTimedEvent (Milliseconds timerMin, Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0s, uint32 uniqueId=0)
 
void ScheduleTimedEvent (Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0s, uint32 uniqueId=0)
 
void ScheduleUniqueTimedEvent (Milliseconds timer, std::function< void()> exec, uint32 uniqueId)
 
bool HealthBelowPct (uint32 pct) const
 
bool HealthAbovePct (uint32 pct) const
 
SpellInfo const * SelectSpell (Unit *target, uint32 school, uint32 mechanic, SelectTargetType targets, uint32 powerCostMin, uint32 powerCostMax, 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)
 
virtual bool CheckEvadeIfOutOfCombatArea () 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
 
PlayerSelectTargetFromPlayerList (float maxdist, uint32 excludeAura=0, bool mustBeInLOS=false) const
 
- Public Member Functions inherited from CreatureAI
void Talk (uint8 id, WorldObject const *whisperTarget=nullptr, Milliseconds delay=0s)
 Causes the creature to talk/say the text assigned to their entry in the creature_text database table. More...
 
void Talk (uint8 id, Milliseconds delay)
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
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 JustEngagedWith (Unit *)
 Called for reaction when initially engaged. More...
 
virtual void JustDied (Unit *)
 
virtual void KilledUnit (Unit *)
 
virtual void JustSummoned (Creature *)
 
virtual void IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDespawn (Creature *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureDespawnAll ()
 
virtual void SummonedCreatureEvade (Creature *)
 
virtual void SpellHit (Unit *, SpellInfo const *)
 
virtual void SpellHitTarget (Unit *, SpellInfo const *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void MovementInform (uint32, uint32)
 
virtual void PathEndReached (uint32)
 
void OnCharmed (bool apply) override
 Called when unit is charmed. More...
 
virtual void JustReachedHome ()
 
void DoZoneInCombat (Creature *creature=nullptr, float maxRangeToNearestTarget=250.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 bool BeforeSpellClick (Unit *)
 
virtual void OnSpellClick (Unit *, bool &)
 
virtual bool CanSeeAlways (WorldObject const *)
 
virtual bool CanBeSeen (Player const *)
 
virtual bool CanAlwaysBeDetectable (WorldObject const *)
 
virtual void PetStopAttack ()
 
virtual bool CheckInRoom ()
 
CreatureBoundary const * GetBoundary () const
 
void SetBoundary (CreatureBoundary const *boundary, bool negativeBoundaries=false)
 
bool IsInBoundary (Position const *who=nullptr) const
 
virtual void CalculateThreat (Unit *, float &, SpellInfo const *)
 
virtual bool OnTeleportUnreacheablePlayer (Player *)
 
virtual void OnAuraRemove (AuraApplication *, AuraRemoveMode)
 
- Public Member Functions inherited from UnitAI
 UnitAI (Unit *unit)
 
virtual ~UnitAI ()
 
virtual bool CanAIAttack (Unit const *) const
 
virtual void AttackStart (Unit *)
 
virtual void UpdateAI (uint32)=0
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
virtual void InitializeAI ()
 
virtual void Reset ()
 
virtual void OnCharmed (bool apply)=0
 Called when unit is charmed. More...
 
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 (SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 
template<class PREDICATE >
UnitSelectTarget (SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 Select the best (up to) <num> targets (in <targetType> order) from the threat list that fulfill the following: More...
 
template<class PREDICATE >
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
virtual void JustEnteredCombat (Unit *)
 Called when the unit enters combat. More...
 
virtual void JustExitedCombat ()
 Called when the unit leaves combat. More...
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType)
 Called at any Damage to any victim (before damage apply) More...
 
virtual void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 Called at any Damage from any attacker (before damage apply) More...
 
virtual void HealReceived (Unit *, uint32 &)
 Called when the creature receives heal. More...
 
virtual void OnPowerUpdate (Powers, int32, int32, uint32)
 Called when the creature power updates. More...
 
virtual void HealDone (Unit *, uint32 &)
 Called when the unit heals. More...
 
virtual void OnCalculateMeleeDamageReceived (uint32 &, Unit *)
 Called during damage calculations. More...
 
virtual void OnCalculateSpellDamageReceived (int32 &, Unit *)
 
virtual void OnCalculatePeriodicTickReceived (uint32 &, Unit *)
 Called during calculation when receiving periodic healing or damage (DoT or HoT) More...
 
void AttackStartCaster (Unit *victim, float dist)
 
SpellCastResult DoAddAuraToAllHostilePlayers (uint32 spellid)
 
SpellCastResult DoCast (uint32 spellId)
 
SpellCastResult DoCast (Unit *victim, uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastSelf (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastToAllHostilePlayers (uint32 spellid, bool triggered=false)
 To specify the caster as target if the spell is self-cast. More...
 
SpellCastResult DoCastVictim (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastAOE (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastRandomTarget (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false, bool withTank=true)
 Cast the spell on a random unit from the threat list. More...
 
SpellCastResult DoCastMaxThreat (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false)
 Cast spell on the top threat target, which may not be the current victim. More...
 
float DoGetSpellMaxRange (uint32 spellId, bool positive=false)
 
void DoMeleeAttackIfReady ()
 
bool DoSpellAttackIfReady (uint32 spell)
 
void DoSpellAttackToRandomTargetIfReady (uint32 spell, uint32 threatTablePosition=0, float dist=0.f, bool playerOnly=true)
 
virtual void SummonMovementInform (Creature *, uint32, uint32)
 Called when a summon reaches a waypoint or point movement finished. More...
 
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 sQuestComplete (Player *, Quest const *)
 
virtual void sQuestReward (Player *, Quest const *, uint32)
 
virtual void sOnGameEvent (bool, uint16)
 
virtual std::string GetDebugInfo () const
 

Public Attributes

SummonList summons
 
EventMap events
 
bool started
 
bool fight
 
- Public Attributes inherited from ScriptedAI
Creatureme
 

Additional Inherited Members

- Public Types inherited from ScriptedAI
enum class  Axis {
  AXIS_X ,
  AXIS_Y
}
 
- Public Types inherited from CreatureAI
enum  EvadeReason {
  EVADE_REASON_NO_HOSTILES ,
  EVADE_REASON_BOUNDARY ,
  EVADE_REASON_SEQUENCE_BREAK ,
  EVADE_REASON_NO_PATH ,
  EVADE_REASON_OTHER
}
 
- Static Public Member Functions inherited from CreatureAI
static bool IsInBounds (CreatureBoundary const &boundary, Position const *who)
 
- Static Public Member Functions inherited from UnitAI
static void FillAISpellInfo ()
 
- Static Public Attributes inherited from UnitAI
static AISpellInfoTypeAISpellInfo
 
- Protected Member Functions inherited from npc_escortAI
PlayerGetPlayerForEscort ()
 
- 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)
 
virtual void MoveInLineOfSight (Unit *)
 
bool _EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
- Protected Attributes inherited from CreatureAI
Creature *const me
 
EventMap events
 
TaskScheduler scheduler
 
CreatureBoundary const * _boundary
 
bool _negateBoundary
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Detailed Description

Constructor & Destructor Documentation

◆ npc_captain_saeedAI()

npc_captain_saeed::npc_captain_saeedAI::npc_captain_saeedAI ( Creature creature)
inline
65: npc_escortAI(creature), summons(me) {}
Creature * me
Definition: ScriptedCreature.h:280
Definition: ScriptedEscortAI.h:53
SummonList summons
Definition: zone_netherstorm.cpp:67

Member Function Documentation

◆ CorpseRemoved()

void npc_captain_saeed::npc_captain_saeedAI::CorpseRemoved ( uint32 )
inlineoverridevirtual

== Triggered Actions Requested ==================

== State checks =================================

Reimplemented from CreatureAI.

206 {
208 }
void DespawnAll(uint32 delay=0)
Definition: ScriptedCreature.cpp:71

References SummonList::DespawnAll(), and summons.

◆ EnterEvadeMode()

void npc_captain_saeed::npc_captain_saeedAI::EnterEvadeMode ( EvadeReason  why)
inlineoverridevirtual

Reimplemented from npc_escortAI.

141 {
142 if (fight)
143 SetEscortPaused(false);
144
145 SummonsAction(nullptr);
147 }
void EnterEvadeMode(EvadeReason=EVADE_REASON_OTHER) override
Definition: ScriptedEscortAI.cpp:201
void SetEscortPaused(bool on)
Definition: ScriptedEscortAI.cpp:523
bool fight
Definition: zone_netherstorm.cpp:69
void SummonsAction(Unit *who)
Definition: zone_netherstorm.cpp:149

References npc_escortAI::EnterEvadeMode(), fight, npc_escortAI::SetEscortPaused(), and SummonsAction().

◆ GetData()

uint32 npc_captain_saeed::npc_captain_saeedAI::GetData ( uint32  data) const
inlineoverridevirtual

Reimplemented from UnitAI.

211 {
212 if (data == 1)
213 return (uint32)started;
214
215 return 0;
216 }
std::uint32_t uint32
Definition: Define.h:107
bool started
Definition: zone_netherstorm.cpp:69

References started.

◆ JustDied()

void npc_captain_saeed::npc_captain_saeedAI::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from npc_escortAI.

197 {
198 Player* player = GetPlayerForEscort();
199 if (player)
201
203 }
@ QUEST_DIMENSIUS_DEVOURING
Definition: zone_netherstorm.cpp:49
Player * GetPlayerForEscort()
Definition: ScriptedEscortAI.h:114
Definition: Player.h:1064
void FailQuest(uint32 quest_id)
Definition: PlayerQuest.cpp:880

References SummonList::DespawnAll(), Player::FailQuest(), npc_escortAI::GetPlayerForEscort(), QUEST_DIMENSIUS_DEVOURING, and summons.

◆ JustEngagedWith()

void npc_captain_saeed::npc_captain_saeedAI::JustEngagedWith ( Unit )
inlineoverridevirtual

Called for reaction when initially engaged.

Reimplemented from ScriptedAI.

192 {
193 SummonsAction(who);
194 }

References SummonsAction().

◆ MoveInLineOfSight()

void npc_captain_saeed::npc_captain_saeedAI::MoveInLineOfSight ( Unit who)
inlineoverridevirtual

Reimplemented from npc_escortAI.

91 {
92 if (Player* player = GetPlayerForEscort())
93 if (me->GetDistance(who) < 10.0f && !me->GetVictim())
94 if (player->IsValidAttackTarget(who))
95 {
96 AttackStart(who);
97 return;
98 }
99
101 }
void AttackStart(Unit *who) override
Definition: ScriptedEscortAI.cpp:52
void MoveInLineOfSight(Unit *who) override
Definition: ScriptedEscortAI.cpp:135
float GetDistance(WorldObject const *obj) const
Definition: Object.cpp:1245
Unit * GetVictim() const
Definition: Unit.h:789

References npc_escortAI::AttackStart(), WorldObject::GetDistance(), npc_escortAI::GetPlayerForEscort(), Unit::GetVictim(), ScriptedAI::me, and npc_escortAI::MoveInLineOfSight().

◆ Reset()

void npc_captain_saeed::npc_captain_saeedAI::Reset ( )
inlineoverridevirtual

Reimplemented from ScriptedAI.

72 {
73 if (!summons.empty())
74 {
75 for (ObjectGuid const& guid : summons)
76 if (Creature* cr = ObjectAccessor::GetCreature(*me, guid))
77 {
78 float x, y, z, o;
79 cr->GetRespawnPosition(x, y, z, &o);
80 cr->SetHomePosition(x, y, z, o);
81 }
82 }
83 events.Reset();
84 summons.clear();
85 started = false;
86 fight = false;
88 }
events
Definition: boss_sartura.cpp:43
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:213
bool empty() const
Definition: ScriptedCreature.h:73
void clear()
Definition: ScriptedCreature.h:83
Definition: Creature.h:46
Definition: ObjectGuid.h:118
void RestoreFaction()
Definition: Unit.cpp:18651

References SummonList::clear(), SummonList::empty(), fight, ObjectAccessor::GetCreature(), ScriptedAI::me, Unit::RestoreFaction(), started, and summons.

◆ SetGUID()

void npc_captain_saeed::npc_captain_saeedAI::SetGUID ( ObjectGuid  playerGUID,
int32  type 
)
inlineoverridevirtual

Reimplemented from UnitAI.

104 {
105 if (type == DATA_START_ENCOUNTER)
106 {
107 Start(true, true, playerGUID);
108 SetEscortPaused(true);
109 started = true;
110
111 std::list<Creature*> cl;
113 for (std::list<Creature*>::iterator itr = cl.begin(); itr != cl.end(); ++itr)
114 {
115 summons.Summon(*itr);
116 (*itr)->HandleEmoteCommand(EMOTE_ONESHOT_ROAR);
117 (*itr)->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_ACTIVE);
118 }
119 cl.clear();
121 for (std::list<Creature*>::iterator itr = cl.begin(); itr != cl.end(); ++itr)
122 {
123 summons.Summon(*itr);
124 (*itr)->HandleEmoteCommand(EMOTE_ONESHOT_ROAR);
125 (*itr)->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_ACTIVE);
126 }
127
130 events.ScheduleEvent(EVENT_START_WALK, 3000);
131 }
132 else if (type == DATA_START_FIGHT)
133 {
135 SetEscortPaused(false);
137 }
138 }
@ UNIT_NPC_FLAG_NONE
Definition: UnitDefines.h:293
@ EVENT_START_WALK
Definition: zone_netherstorm.cpp:36
@ SAY_SAEED_0
Definition: zone_netherstorm.cpp:43
@ DATA_START_FIGHT
Definition: zone_netherstorm.cpp:41
@ SAY_SAEED_2
Definition: zone_netherstorm.cpp:45
@ DATA_START_ENCOUNTER
Definition: zone_netherstorm.cpp:40
@ NPC_PROTECTORATE_DEFENDER
Definition: zone_netherstorm.cpp:33
@ NPC_PROTECTORATE_AVENGER
Definition: zone_netherstorm.cpp:32
Talk
Definition: hyjal.cpp:82
@ EMOTE_ONESHOT_ROAR
Definition: SharedDefines.h:1907
@ FACTION_ESCORTEE_N_NEUTRAL_ACTIVE
Definition: SharedDefines.h:216
void Summon(Creature const *summon)
Definition: ScriptedCreature.h:88
void Start(bool isActiveAttacker=true, bool run=false, ObjectGuid playerGUID=ObjectGuid::Empty, Quest const *quest=nullptr, bool instantRespawn=false, bool canLoopPath=false, bool resetWaypoints=true)
Definition: ScriptedEscortAI.cpp:449
void GetCreaturesWithEntryInRange(std::list< Creature * > &creatureList, float radius, uint32 entry)
Definition: Object.cpp:3084
void SetFaction(uint32 faction)
Definition: Unit.cpp:10018
void ReplaceAllNpcFlags(NPCFlags flags)
Definition: Unit.h:697

References DATA_START_ENCOUNTER, DATA_START_FIGHT, EMOTE_ONESHOT_ROAR, EVENT_START_WALK, FACTION_ESCORTEE_N_NEUTRAL_ACTIVE, WorldObject::GetCreaturesWithEntryInRange(), ScriptedAI::me, NPC_PROTECTORATE_AVENGER, NPC_PROTECTORATE_DEFENDER, Unit::ReplaceAllNpcFlags(), SAY_SAEED_0, SAY_SAEED_2, npc_escortAI::SetEscortPaused(), Unit::SetFaction(), npc_escortAI::Start(), started, SummonList::Summon(), summons, and UNIT_NPC_FLAG_NONE.

◆ SummonsAction()

void npc_captain_saeed::npc_captain_saeedAI::SummonsAction ( Unit who)
inline
150 {
151 float i = 0;
152 for (GuidList::iterator itr = summons.begin(); itr != summons.end(); ++itr, i += 1.0f)
153 if (Creature* cr = ObjectAccessor::GetCreature(*me, *itr))
154 {
155 if (!who)
156 {
157 cr->GetMotionMaster()->Clear(false);
158 cr->GetMotionMaster()->MoveFollow(me, 2.0f, M_PI / 2.0f + (i / summons.size() * M_PI));
159 }
160 else
161 {
162 cr->SetHomePosition(cr->GetPositionX(), cr->GetPositionY(), cr->GetPositionZ(), cr->GetOrientation());
163 cr->AI()->AttackStart(who);
164 }
165 }
166 }
iterator begin()
Definition: ScriptedCreature.h:48
iterator end()
Definition: ScriptedCreature.h:58
size_type size() const
Definition: ScriptedCreature.h:78

References SummonList::begin(), SummonList::end(), ObjectAccessor::GetCreature(), ScriptedAI::me, SummonList::size(), and summons.

Referenced by EnterEvadeMode(), JustEngagedWith(), and UpdateAI().

◆ UpdateAI()

void npc_captain_saeed::npc_captain_saeedAI::UpdateAI ( uint32  )
inlineoverridevirtual

Use to start attacking a target. Called just before JustEngagedWith()

Reimplemented from npc_escortAI.

219 {
221
222 events.Update(diff);
223 switch (events.ExecuteEvent())
224 {
225 case EVENT_START_WALK:
226 SummonsAction(nullptr);
227 SetEscortPaused(false);
228 break;
231 events.ScheduleEvent(EVENT_START_FIGHT2, 3000);
232 break;
234 if (Creature* dimensius = me->FindNearestCreature(NPC_DIMENSIUS, 50.0f))
235 {
236 dimensius->RemoveAurasDueToSpell(SPELL_DIMENSIUS_TRANSFORM);
237 dimensius->ReplaceAllUnitFlags(UNIT_FLAG_DISABLE_MOVE);
238 AttackStart(dimensius);
239 fight = true;
240 }
241 break;
242 }
243
244 if (!UpdateVictim())
245 return;
246
248 }
@ UNIT_FLAG_DISABLE_MOVE
Definition: UnitDefines.h:231
@ NPC_DIMENSIUS
Definition: zone_netherstorm.cpp:34
@ EVENT_START_FIGHT1
Definition: zone_netherstorm.cpp:37
@ SPELL_DIMENSIUS_TRANSFORM
Definition: zone_netherstorm.cpp:51
@ SAY_SAEED_3
Definition: zone_netherstorm.cpp:46
@ EVENT_START_FIGHT2
Definition: zone_netherstorm.cpp:38
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:39
bool UpdateVictim()
Definition: CreatureAI.cpp:269
void UpdateAI(uint32 diff) override
Use to start attacking a target. Called just before JustEngagedWith()
Definition: ScriptedEscortAI.cpp:240
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition: Object.cpp:2446

References npc_escortAI::AttackStart(), UnitAI::DoMeleeAttackIfReady(), EVENT_START_FIGHT1, EVENT_START_FIGHT2, EVENT_START_WALK, fight, WorldObject::FindNearestCreature(), ScriptedAI::me, NPC_DIMENSIUS, SAY_SAEED_3, npc_escortAI::SetEscortPaused(), SPELL_DIMENSIUS_TRANSFORM, SummonsAction(), UNIT_FLAG_DISABLE_MOVE, npc_escortAI::UpdateAI(), and CreatureAI::UpdateVictim().

◆ WaypointReached()

void npc_captain_saeed::npc_captain_saeedAI::WaypointReached ( uint32  i)
inlineoverridevirtual

Implements npc_escortAI.

169 {
170 Player* player = GetPlayerForEscort();
171 if (!player)
172 return;
173
174 switch (i)
175 {
176 case 16:
179 SetEscortPaused(true);
180 break;
181 case 18:
182 events.ScheduleEvent(EVENT_START_FIGHT1, 0);
183 SetEscortPaused(true);
184 break;
185 case 19:
187 break;
188 }
189 }
@ UNIT_NPC_FLAG_GOSSIP
Definition: UnitDefines.h:294
@ SAY_SAEED_1
Definition: zone_netherstorm.cpp:44

References SummonList::DespawnAll(), EVENT_START_FIGHT1, npc_escortAI::GetPlayerForEscort(), ScriptedAI::me, Unit::ReplaceAllNpcFlags(), SAY_SAEED_1, npc_escortAI::SetEscortPaused(), summons, and UNIT_NPC_FLAG_GOSSIP.

Member Data Documentation

◆ events

EventMap npc_captain_saeed::npc_captain_saeedAI::events

◆ fight

bool npc_captain_saeed::npc_captain_saeedAI::fight

Referenced by EnterEvadeMode(), Reset(), and UpdateAI().

◆ started

bool npc_captain_saeed::npc_captain_saeedAI::started

Referenced by GetData(), Reset(), and SetGUID().

◆ summons

SummonList npc_captain_saeed::npc_captain_saeedAI::summons