![]() |
TrinityCore
|
#include <ScriptedFollowerAI.h>
Inheritance diagram for FollowerAI:Public Member Functions | |
| FollowerAI (Creature *creature) noexcept | |
| ~FollowerAI () | |
| void | MoveInLineOfSight (Unit *) override |
| void | JustDied (Unit *) override |
| void | JustReachedHome () override |
| void | OwnerAttackedBy (Unit *other) override |
| void | UpdateAI (uint32) override |
| virtual void | UpdateFollowerAI (uint32) |
| void | StartFollow (Player *player, uint32 factionForFollower=0, uint32 quest=0) |
| void | SetFollowPaused (bool paused) |
| void | SetFollowComplete (bool withEndEvent=false) |
| bool | IsEscorted () const override |
| bool | HasFollowState (uint32 uiFollowState) const |
Public Member Functions inherited from ScriptedAI | |
| ScriptedAI (Creature *creature, uint32 scriptId=0) noexcept | |
| virtual | ~ScriptedAI () |
| void | AttackStartNoMove (Unit *target) |
| void | AttackStart (Unit *) override |
| == Triggered Actions Requested ================== | |
| 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 | AddThreat (Unit *victim, float amount, Unit *who=nullptr) |
| void | ModifyThreatByPercent (Unit *victim, int32 pct, Unit *who=nullptr) |
| void | ResetThreat (Unit *victim, Unit *who=nullptr) |
| void | ResetThreatList (Unit *who=nullptr) |
| float | GetThreat (Unit const *victim, Unit const *who=nullptr) |
| void | ForceCombatStop (Creature *who, bool reset=true) |
| void | ForceCombatStopForCreatureEntry (uint32 entry, float maxSearchRange=250.0f, bool samePhase=true, bool reset=true) |
| void | ForceCombatStopForCreatureEntry (std::vector< uint32 > creatureEntries, float maxSearchRange=250.0f, bool samePhase=true, bool reset=true) |
| 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) |
| Unit * | DoSelectLowestHpFriendly (float range, uint32 minHPDiff=1) |
| Unit * | DoSelectBelowHpPctFriendlyWithEntry (uint32 entry, float range, uint8 hpPct=1, bool excludeSelf=true) |
| std::list< Creature * > | DoFindFriendlyCC (float range) |
| std::list< Creature * > | DoFindFriendlyMissingBuff (float range, uint32 spellId) |
| Player * | GetPlayerAtMinimumRange (float minRange) |
| Creature * | DoSpawnCreature (uint32 entry, float offsetX, float offsetY, float offsetZ, float angle, uint32 type, Milliseconds despawntime) |
| bool | HealthBelowPct (uint32 pct) const |
| bool | HealthAbovePct (uint32 pct) const |
| SpellInfo const * | SelectSpell (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 | IsLFR () const |
| bool | IsNormal () const |
| bool | IsHeroic () const |
| bool | IsMythic () const |
| bool | IsMythicPlus () const |
| bool | IsHeroicOrHigher () const |
| bool | IsTimewalking () const |
| Difficulty | GetDifficulty () const |
| bool | Is25ManRaid () const |
| void | SetAggressiveStateAfter (Milliseconds timer, Creature *who=nullptr, bool startCombat=true, Creature *summoner=nullptr, StartCombatArgs const &combatArgs={ }) |
| void | DoAddEvent (Milliseconds timer, BasicEvent *event, WorldObject *who=nullptr) |
| template<class T > | |
| T const & | DUNGEON_MODE (T const &normal5, T const &heroic10) const |
| template<class T > | |
| T const & | RAID_MODE (T const &normal10, T const &normal25) const |
| template<class T > | |
| T const & | RAID_MODE (T const &normal10, T const &normal25, T const &heroic10, T const &heroic25) const |
Public Member Functions inherited from CreatureAI | |
| CreatureAI (Creature *creature, uint32 scriptId={}) noexcept | |
| virtual | ~CreatureAI () |
| uint32 | GetId () const |
| bool | IsEngaged () const |
| void | Talk (uint8 id, WorldObject const *whisperTarget=nullptr) |
| void | MoveInLineOfSight_Safe (Unit *who) |
| == Reactions At ================================= | |
| void | TriggerAlert (Unit const *who) const |
| virtual void | EnterEvadeMode (EvadeReason why=EvadeReason::Other) |
| void | JustEnteredCombat (Unit *) override |
| virtual void | JustStartedThreateningMe (Unit *who) |
| virtual void | JustEngagedWith (Unit *) |
| virtual void | OnHealthDepleted (Unit *, bool) |
| virtual void | KilledUnit (Unit *) |
| virtual void | JustSummoned (Creature *) |
| virtual void | IsSummonedBy (WorldObject *) |
| virtual void | SummonedCreatureDespawn (Creature *) |
| virtual void | SummonedCreatureDies (Creature *, Unit *) |
| virtual void | JustSummonedGameobject (GameObject *) |
| virtual void | SummonedGameobjectDespawn (GameObject *) |
| virtual void | JustRegisteredDynObject (DynamicObject *) |
| virtual void | JustUnregisteredDynObject (DynamicObject *) |
| virtual void | JustRegisteredAreaTrigger (AreaTrigger *) |
| virtual void | JustUnregisteredAreaTrigger (AreaTrigger *) |
| virtual void | SpellHit (WorldObject *, SpellInfo const *) |
| virtual void | SpellHitTarget (WorldObject *, SpellInfo const *) |
| virtual void | OnSpellCast (SpellInfo const *) |
| virtual void | OnSpellFailed (SpellInfo const *) |
| virtual void | OnSpellStart (SpellInfo const *) |
| virtual void | OnChannelFinished (SpellInfo const *) |
| virtual void | OnAuraApplied (AuraApplication const *) |
| virtual void | OnAuraRemoved (AuraApplication const *) |
| virtual void | JustAppeared () |
| virtual void | MovementInform (uint32, uint32) |
| void | OnCharmed (bool isNew) override |
| void | DoZoneInCombat () |
| virtual void | ReceiveEmote (Player *, uint32) |
| virtual void | OwnerAttacked (Unit *target) |
| virtual void | CorpseRemoved (uint32 &) |
| == State checks ================================= | |
| virtual Optional< QuestGiverStatus > | GetDialogStatus (Player const *player) |
| == Gossip system ================================ | |
| virtual bool | OnGossipHello (Player *) |
| virtual bool | OnGossipSelect (Player *, uint32, uint32) |
| virtual bool | OnGossipSelectCode (Player *, uint32, uint32, char const *) |
| virtual void | OnQuestAccept (Player *, Quest const *) |
| virtual void | OnQuestReward (Player *, Quest const *, LootItemType, uint32) |
| virtual void | WaypointStarted (uint32, uint32) |
| == Waypoints system ============================= | |
| virtual void | WaypointReached (uint32, uint32) |
| virtual void | WaypointPathEnded (uint32, uint32) |
| virtual void | PassengerBoarded (Unit *, int8, bool) |
| == Fields ======================================= | |
| virtual void | OnSpellClick (Unit *, bool) |
| virtual bool | CanSeeAlways (WorldObject const *) |
| virtual PlayerAI * | GetAIForCharmedPlayer (Player *) |
| int32 | VisualizeBoundary (Seconds duration, Unit *owner=nullptr, bool fill=false) const |
| virtual bool | CheckInRoom () |
| CreatureBoundary const * | GetBoundary () const |
| void | SetBoundary (CreatureBoundary const *boundary, bool negativeBoundaries=false) |
| bool | IsInBoundary (Position const *who=nullptr) const |
Public Member Functions inherited from UnitAI | |
| UnitAI (Unit *unit) | |
| virtual | ~UnitAI () |
| virtual bool | CanAIAttack (Unit const *) const |
| virtual void | InitializeAI () |
| virtual void | Reset () |
| virtual void | DoAction (int32 param) |
| virtual uint32 | GetData (uint32 id) const |
| virtual void | SetData (uint32 id, uint32 value) |
| virtual void | SetGUID (ObjectGuid const &guid, int32 id) |
| virtual ObjectGuid | GetGUID (int32 id) const |
| Unit * | SelectTarget (SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0) |
| template<class PREDICATE > | |
| Unit * | SelectTarget (SelectTargetMethod targetType, uint32 offset, PREDICATE const &predicate) |
| void | SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0) |
| template<class PREDICATE > | |
| void | SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 offset, PREDICATE const &predicate) |
| virtual void | JustExitedCombat () |
| virtual void | OnDespawn () |
| virtual void | DamageDealt (Unit *, uint32 &, DamageEffectType) |
| virtual void | DamageTaken (Unit *, uint32 &, DamageEffectType, SpellInfo const *) |
| virtual void | HealReceived (Unit *, uint32 &) |
| virtual void | HealDone (Unit *, uint32 &) |
| virtual void | SpellInterrupted (uint32, uint32) |
| void | AttackStartCaster (Unit *victim, float dist) |
| SpellCastResult | DoCast (uint32 spellId) |
| SpellCastResult | DoCast (Unit *victim, uint32 spellId, CastSpellExtraArgs const &args={}) |
| SpellCastResult | DoCastSelf (uint32 spellId, CastSpellExtraArgs const &args={}) |
| SpellCastResult | DoCastVictim (uint32 spellId, CastSpellExtraArgs const &args={}) |
| SpellCastResult | DoCastAOE (uint32 spellId, CastSpellExtraArgs const &args={}) |
| bool | DoSpellAttackIfReady (uint32 spellId) |
| virtual void | OnGameEvent (bool, uint16) |
| virtual std::string | GetDebugInfo () const |
Protected Member Functions | |
| Player * | GetLeaderForFollower () |
Protected Member Functions inherited from CreatureAI | |
| bool | UpdateVictim () |
| Creature * | DoSummon (uint32 entry, Position const &pos, Milliseconds despawnTime=30s, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN) |
| Creature * | DoSummon (uint32 entry, WorldObject *obj, float radius=5.0f, Milliseconds despawnTime=30s, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN) |
| Creature * | DoSummonFlyer (uint32 entry, WorldObject *obj, float flightZ, float radius=5.0f, Milliseconds despawnTime=30s, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN) |
| void | EngagementStart (Unit *who) |
| void | EngagementOver () |
| bool | _EnterEvadeMode (EvadeReason why=EvadeReason::Other) |
Private Member Functions | |
| void | AddFollowState (uint32 followState) |
| void | RemoveFollowState (uint32 followState) |
| bool | ShouldAssistPlayerInCombatAgainst (Unit *who) const |
Private Attributes | |
| ObjectGuid | _leaderGUID |
| uint32 | _updateFollowTimer |
| uint32 | _followState |
| uint32 | _questForFollow |
Additional Inherited Members | |
Static Public Member Functions inherited from CreatureAI | |
| static void | DoZoneInCombat (Creature *creature) |
| 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 std::unordered_map< std::pair< uint32, Difficulty >, AISpellInfoType > | AISpellInfo |
Protected Attributes inherited from CreatureAI | |
| Creature *const | me |
| CreatureBoundary const * | _boundary |
| bool | _negateBoundary |
Protected Attributes inherited from UnitAI | |
| Unit *const | me |
Definition at line 35 of file ScriptedFollowerAI.h.
|
explicitnoexcept |
Definition at line 34 of file ScriptedFollowerAI.cpp.
|
inline |
Definition at line 39 of file ScriptedFollowerAI.h.
|
inlineprivate |
Definition at line 63 of file ScriptedFollowerAI.h.
Referenced by SetFollowComplete(), SetFollowPaused(), and StartFollow().
|
protected |
Definition at line 228 of file ScriptedFollowerAI.cpp.
References _leaderGUID, BaseEntity::GetGUID(), ObjectAccessor::GetPlayer(), Unit::IsAlive(), WorldObject::IsWithinDistInMap(), MAX_PLAYER_DISTANCE, CreatureAI::me, TC_LOG_DEBUG, and ObjectGuid::ToString().
Referenced by JustDied(), JustReachedHome(), npc_tooga::npc_toogaAI::MoveInLineOfSight(), SetFollowPaused(), and UpdateAI().
|
inline |
Definition at line 57 of file ScriptedFollowerAI.h.
Referenced by JustDied(), JustReachedHome(), MoveInLineOfSight(), npc_tooga::npc_toogaAI::MoveInLineOfSight(), SetFollowComplete(), SetFollowPaused(), StartFollow(), UpdateAI(), and npc_tooga::npc_toogaAI::UpdateFollowerAI().
|
inlineoverridevirtual |
Reimplemented from CreatureAI.
Definition at line 56 of file ScriptedFollowerAI.h.
References STATE_FOLLOW_INPROGRESS.
|
overridevirtual |
Reimplemented from CreatureAI.
Definition at line 44 of file ScriptedFollowerAI.cpp.
References _leaderGUID, _questForFollow, GetLeaderForFollower(), HasFollowState(), and STATE_FOLLOW_INPROGRESS.
|
overridevirtual |
Reimplemented from CreatureAI.
Definition at line 63 of file ScriptedFollowerAI.cpp.
References Creature::DespawnOrUnsummon(), GetLeaderForFollower(), Unit::GetMotionMaster(), HasFollowState(), CreatureAI::me, MotionMaster::MoveFollow(), PET_FOLLOW_ANGLE, PET_FOLLOW_DIST, STATE_FOLLOW_INPROGRESS, and STATE_FOLLOW_PAUSED.
|
overridevirtual |
Reimplemented from CreatureAI.
Reimplemented in npc_tooga::npc_toogaAI.
Definition at line 36 of file ScriptedFollowerAI.cpp.
References HasFollowState(), CreatureAI::MoveInLineOfSight(), ShouldAssistPlayerInCombatAgainst(), and STATE_FOLLOW_INPROGRESS.
Referenced by npc_tooga::npc_toogaAI::MoveInLineOfSight().
|
overridevirtual |
Reimplemented from CreatureAI.
Definition at line 78 of file ScriptedFollowerAI.cpp.
References Unit::EngageWithTarget(), Creature::HasReactState(), CreatureAI::me, REACT_PASSIVE, and ShouldAssistPlayerInCombatAgainst().
|
inlineprivate |
Definition at line 64 of file ScriptedFollowerAI.h.
Referenced by SetFollowComplete(), and SetFollowPaused().
| void FollowerAI::SetFollowComplete | ( | bool | withEndEvent = false | ) |
Definition at line 212 of file ScriptedFollowerAI.cpp.
References AddFollowState(), FOLLOW_MOTION_TYPE, Unit::GetMotionMaster(), HasFollowState(), Unit::HasUnitState(), CreatureAI::me, MotionMaster::Remove(), RemoveFollowState(), STATE_FOLLOW_COMPLETE, STATE_FOLLOW_POSTEVENT, and UNIT_STATE_FOLLOW.
Referenced by npc_tooga::npc_toogaAI::MoveInLineOfSight(), npc_tooga::npc_toogaAI::MovementInform(), and npc_tooga::npc_toogaAI::UpdateFollowerAI().
| void FollowerAI::SetFollowPaused | ( | bool | paused | ) |
Definition at line 191 of file ScriptedFollowerAI.cpp.
References AddFollowState(), FOLLOW_MOTION_TYPE, GetLeaderForFollower(), Unit::GetMotionMaster(), HasFollowState(), Unit::HasUnitState(), CreatureAI::me, MotionMaster::MoveFollow(), PET_FOLLOW_ANGLE, PET_FOLLOW_DIST, MotionMaster::Remove(), RemoveFollowState(), STATE_FOLLOW_COMPLETE, STATE_FOLLOW_INPROGRESS, STATE_FOLLOW_PAUSED, and UNIT_STATE_FOLLOW.
|
private |
Definition at line 259 of file ScriptedFollowerAI.cpp.
References UnitAI::CanAIAttack(), CREATURE_TYPE_FLAG_CAN_ASSIST, Creature::GetCreatureDifficulty(), BaseEntity::GetTypeId(), Unit::GetVictim(), WorldObject::IsFriendlyTo(), Unit::isInAccessiblePlaceFor(), Creature::IsInEvadeMode(), WorldObject::IsWithinDistInMap(), WorldObject::IsWithinLOSInMap(), MAX_PLAYER_DISTANCE, CreatureAI::me, Object::ToCreature(), CreatureDifficulty::TypeFlags, and TYPEID_UNIT.
Referenced by MoveInLineOfSight(), and OwnerAttackedBy().
Definition at line 150 of file ScriptedFollowerAI.cpp.
References _leaderGUID, _questForFollow, AddFollowState(), MotionMaster::Clear(), CONFIG_RESPAWN_DYNAMIC_ESCORTNPC, Creature::GetCreatureData(), BaseEntity::GetGUID(), Unit::GetMotionMaster(), WorldObject::GetName(), Creature::GetRespawnDelay(), HasFollowState(), Creature::IsEngaged(), CreatureAI::me, MOTION_PRIORITY_NORMAL, MotionMaster::MoveFollow(), Unit::PauseMovement(), PET_FOLLOW_ANGLE, PET_FOLLOW_DIST, Unit::ReplaceAllNpcFlags(), Unit::ReplaceAllNpcFlags2(), Creature::SaveRespawnTime(), Unit::SetFaction(), SPAWNGROUP_FLAG_ESCORTQUESTNPC, STATE_FOLLOW_INPROGRESS, sWorld, TC_LOG_DEBUG, TC_LOG_ERROR, ObjectGuid::ToString(), UNIT_NPC_FLAG_2_NONE, and UNIT_NPC_FLAG_NONE.
Referenced by npc_altar_altercation_ariok::JustAppeared(), and npc_tooga::npc_toogaAI::OnQuestAccept().
|
overridevirtual |
Reimplemented from ScriptedAI.
Reimplemented in npc_altar_altercation_ariok.
Definition at line 84 of file ScriptedFollowerAI.cpp.
References _questForFollow, _updateFollowTimer, Creature::DespawnOrUnsummon(), BaseEntity::GetGUID(), GetLeaderForFollower(), Player::GetQuestStatus(), HasFollowState(), Creature::IsEngaged(), WorldObject::IsWithinDistInMap(), MAX_PLAYER_DISTANCE, CreatureAI::me, QUEST_STATUS_COMPLETE, QUEST_STATUS_INCOMPLETE, STATE_FOLLOW_COMPLETE, STATE_FOLLOW_INPROGRESS, STATE_FOLLOW_POSTEVENT, TC_LOG_DEBUG, ObjectGuid::ToString(), and UpdateFollowerAI().
|
virtual |
Reimplemented in npc_tooga::npc_toogaAI.
Definition at line 145 of file ScriptedFollowerAI.cpp.
References CreatureAI::UpdateVictim().
Referenced by UpdateAI().
|
private |
Definition at line 69 of file ScriptedFollowerAI.h.
|
private |
Definition at line 67 of file ScriptedFollowerAI.h.
Referenced by GetLeaderForFollower(), JustDied(), and StartFollow().
|
private |
Definition at line 70 of file ScriptedFollowerAI.h.
Referenced by JustDied(), StartFollow(), and UpdateAI().
|
private |
Definition at line 68 of file ScriptedFollowerAI.h.
Referenced by UpdateAI().