![]() |
TrinityCore
|
#include <SmartAI.h>
Inheritance diagram for SmartAI:Public Member Functions | |
| ~SmartAI () | |
| SmartAI (Creature *creature, uint32 scriptId={}) | |
| bool | IsAIControlled () const |
| void | StartPath (uint32 pathId=0, bool repeat=false, Unit *invoker=nullptr, uint32 nodeId=0, uint32 fadeObjectDuration=0, Scripting::v2::ActionResultSetter< MovementStopReason > &&scriptResult={}) |
| WaypointPath const * | LoadPath (uint32 entry) |
| void | PausePath (uint32 delay, bool forced=false) |
| bool | CanResumePath () |
| void | StopPath (uint32 DespawnTime=0, uint32 quest=0, bool fail=false) |
| void | EndPath (bool fail=false) |
| void | ResumePath () |
| bool | HasEscortState (uint32 escortState) const |
| void | AddEscortState (uint32 escortState) |
| void | RemoveEscortState (uint32 escortState) |
| void | SetCombatMove (bool on, bool stopMoving=false) |
| bool | CanCombatMove () const |
| void | SetFollow (Unit *target, float dist=0.0f, float angle=0.0f, uint32 credit=0, uint32 end=0, uint32 creditType=0) |
| void | StopFollow (bool complete) |
| bool | IsEscortInvokerInRange () |
| void | WaypointReached (uint32 nodeId, uint32 pathId) override |
| void | WaypointPathEnded (uint32 nodeId, uint32 pathId) override |
| void | SetTimedActionList (SmartScriptHolder &e, uint32 entry, Unit *invoker, uint32 startFromEventId=0) |
| SmartScript * | GetScript () |
| void | JustReachedHome () override |
| void | JustEngagedWith (Unit *enemy) override |
| void | EnterEvadeMode (EvadeReason why) override |
| void | JustDied (Unit *killer) override |
| void | KilledUnit (Unit *victim) override |
| void | JustSummoned (Creature *creature) override |
| void | SummonedCreatureDies (Creature *summon, Unit *killer) override |
| void | AttackStart (Unit *who) override |
| == Triggered Actions Requested ================== | |
| void | MoveInLineOfSight (Unit *who) override |
| void | SpellHit (WorldObject *caster, SpellInfo const *spellInfo) override |
| void | SpellHitTarget (WorldObject *target, SpellInfo const *spellInfo) override |
| void | OnSpellCast (SpellInfo const *spellInfo) override |
| void | OnSpellFailed (SpellInfo const *spellInfo) override |
| void | OnSpellStart (SpellInfo const *spellInfo) override |
| void | OnAuraApplied (AuraApplication const *aurApp) override |
| void | OnAuraRemoved (AuraApplication const *aurApp) override |
| void | DamageTaken (Unit *doneBy, uint32 &damage, DamageEffectType, SpellInfo const *) override |
| void | HealReceived (Unit *doneBy, uint32 &addhealth) override |
| void | UpdateAI (uint32 diff) override |
| void | ReceiveEmote (Player *player, uint32 textEmote) override |
| void | MovementInform (uint32 MovementType, uint32 Data) override |
| void | IsSummonedBy (WorldObject *summoner) override |
| void | DamageDealt (Unit *doneTo, uint32 &damage, DamageEffectType) override |
| void | SummonedCreatureDespawn (Creature *unit) override |
| void | CorpseRemoved (uint32 &respawnDelay) override |
| == State checks ================================= | |
| void | OnDespawn () override |
| void | PassengerBoarded (Unit *who, int8 seatId, bool apply) override |
| == Fields ======================================= | |
| void | InitializeAI () override |
| void | JustAppeared () override |
| void | OnCharmed (bool isNew) override |
| void | DoAction (int32 param) override |
| uint32 | GetData (uint32 id) const override |
| void | SetData (uint32 id, uint32 value) override |
| void | SetData (uint32 id, uint32 value, Unit *invoker) |
| void | SetGUID (ObjectGuid const &guid, int32 id) override |
| ObjectGuid | GetGUID (int32 id) const override |
| void | SetRun (bool run=true) |
| void | SetEvadeDisabled (bool disable=true) |
| void | SetInvincibilityHpLevel (uint32 level) |
| bool | OnGossipHello (Player *player) override |
| bool | OnGossipSelect (Player *player, uint32 menuId, uint32 gossipListId) override |
| bool | OnGossipSelectCode (Player *player, uint32 menuId, uint32 gossipListId, char const *code) override |
| void | OnQuestAccept (Player *player, Quest const *quest) override |
| void | OnQuestReward (Player *player, Quest const *quest, LootItemType type, uint32 opt) override |
| void | OnGameEvent (bool start, uint16 eventId) override |
| void | SetDespawnTime (uint32 t) |
| void | StartDespawn () |
| void | OnSpellClick (Unit *clicker, bool spellClickHandled) override |
| void | SetWPPauseTimer (uint32 time) |
| void | SetGossipReturn (bool val) |
| void | SetEscortQuest (uint32 questID) |
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 |
| void | JustEnteredCombat (Unit *) override |
| virtual void | JustStartedThreateningMe (Unit *who) |
| virtual void | OnHealthDepleted (Unit *, bool) |
| 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 | OnChannelFinished (SpellInfo const *) |
| virtual bool | IsEscorted () const |
| void | DoZoneInCombat () |
| virtual void | OwnerAttackedBy (Unit *attacker) |
| virtual void | OwnerAttacked (Unit *target) |
| virtual Optional< QuestGiverStatus > | GetDialogStatus (Player const *player) |
| == Gossip system ================================ | |
| virtual void | WaypointStarted (uint32, uint32) |
| == Waypoints system ============================= | |
| 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 | Reset () |
| 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 | 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 std::string | GetDebugInfo () const |
Static Public Member Functions | |
| static int32 | Permissible (Creature const *) |
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 () |
Private Member Functions | |
| bool | AssistPlayerInCombatAgainst (Unit *who) |
| void | ReturnToLastOOCPos () |
| void | CheckConditions (uint32 diff) |
| void | UpdatePath (uint32 diff) |
| void | UpdateFollow (uint32 diff) |
| void | UpdateDespawn (uint32 diff) |
Additional Inherited Members | |
Static Public Attributes inherited from UnitAI | |
| static std::unordered_map< std::pair< uint32, Difficulty >, AISpellInfoType > | AISpellInfo |
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) |
Protected Attributes inherited from CreatureAI | |
| Creature *const | me |
| CreatureBoundary const * | _boundary |
| bool | _negateBoundary |
Protected Attributes inherited from UnitAI | |
| Unit *const | me |
Definition at line 36 of file SmartAI.cpp.
References _vehicleConditions, CONDITION_SOURCE_TYPE_CREATURE_TEMPLATE_VEHICLE, Object::GetEntry(), and sConditionMgr.
|
inline |
Definition at line 67 of file SmartAI.h.
Referenced by EnterEvadeMode(), and PausePath().
|
private |
Definition at line 451 of file SmartAI.cpp.
References UnitAI::CanAIAttack(), CREATURE_TYPE_FLAG_CAN_ASSIST, Unit::EngageWithTarget(), Unit::EnsureVictim(), WorldObject::GetCharmerOrOwnerPlayerOrPlayerItself(), Creature::GetCreatureDifficulty(), BaseEntity::GetTypeId(), Unit::GetVictim(), Creature::HasReactState(), IsAIControlled(), Unit::isInAccessiblePlaceFor(), Creature::IsInEvadeMode(), WorldObject::IsValidAssistTarget(), WorldObject::IsWithinDistInMap(), WorldObject::IsWithinLOSInMap(), CreatureAI::me, REACT_PASSIVE, SMART_MAX_AID_DIST, Object::ToCreature(), CreatureDifficulty::TypeFlags, and TYPEID_UNIT.
Referenced by MoveInLineOfSight().
|
overridevirtual |
== Triggered Actions Requested ==================
Reimplemented from CreatureAI.
Definition at line 572 of file SmartAI.cpp.
References _canCombatMove, _run, Unit::Attack(), MotionMaster::Clear(), Unit::GetMotionMaster(), IsAIControlled(), CreatureAI::me, MOTION_PRIORITY_NORMAL, Unit::PauseMovement(), SetRun(), and Creature::StartDefaultCombatMovement().
| bool SmartAI::CanResumePath | ( | ) |
Definition at line 135 of file SmartAI.cpp.
References HasEscortState(), SMART_ESCORT_ESCORTING, and SMART_ESCORT_PAUSED.
|
private |
Definition at line 883 of file SmartAI.cpp.
References _vehicleConditions, _vehicleConditionsTimer, CONDITION_SOURCE_TYPE_CREATURE_TEMPLATE_VEHICLE, Object::GetEntry(), ObjectAccessor::GetUnit(), Unit::GetVehicleKit(), CreatureAI::me, sConditionMgr, and Object::ToPlayer().
Referenced by UpdateAI().
|
overridevirtual |
== State checks =================================
Reimplemented from CreatureAI.
Definition at line 666 of file SmartAI.cpp.
References GetScript(), SmartScript::ProcessEventsFor(), and SMART_EVENT_CORPSE_REMOVED.
|
overridevirtual |
Reimplemented from UnitAI.
Definition at line 656 of file SmartAI.cpp.
References GetScript(), SmartScript::ProcessEventsFor(), and SMART_EVENT_DAMAGED_TARGET.
|
overridevirtual |
Reimplemented from UnitAI.
Definition at line 630 of file SmartAI.cpp.
References _invincibilityHPLevel, Unit::GetHealth(), GetScript(), IsAIControlled(), CreatureAI::me, SmartScript::ProcessEventsFor(), and SMART_EVENT_DAMAGED.
|
overridevirtual |
Reimplemented from UnitAI.
Definition at line 720 of file SmartAI.cpp.
References GetScript(), SmartScript::ProcessEventsFor(), and SMART_EVENT_ACTION_DONE.
| void SmartAI::EndPath | ( | bool | fail = false | ) |
Definition at line 185 of file SmartAI.cpp.
References _currentWaypointNodeId, _despawnState, _escortNPCFlags, _escortQuestId, _repeatWaypointPath, _waypointPauseTimer, Player::AreaExploredOrEventHappens(), Player::FailQuest(), Player::GetGroup(), SmartScript::GetPathId(), GetScript(), SmartScript::GetStoredTargetVector(), Player::GroupEventHappens(), Player::HasCorpse(), IsAIControlled(), Player::IsAtGroupRewardDistance(), WorldObject::IsInMap(), CreatureAI::me, SmartScript::ProcessEventsFor(), RemoveEscortState(), Unit::ReplaceAllNpcFlags(), SmartScript::SetPathId(), SMART_ESCORT_ESCORTING, SMART_ESCORT_PAUSED, SMART_ESCORT_RETURNING, SMART_ESCORT_TARGETS, SMART_EVENT_WAYPOINT_ENDED, StartDespawn(), StartPath(), and Object::ToPlayer().
Referenced by JustDied(), OnCharmed(), and StopPath().
|
overridevirtual |
Reimplemented from CreatureAI.
Definition at line 389 of file SmartAI.cpp.
References CreatureAI::_EnterEvadeMode(), _evadeDisabled, _followAngle, _followDistance, _followGUID, _run, AddEscortState(), Unit::AddUnitState(), Unit::AttackStop(), Unit::ClearUnitState(), Unit::GetCharmerOrOwner(), Unit::GetMotionMaster(), GetScript(), ObjectAccessor::GetUnit(), HasEscortState(), Unit::HasUnitState(), IsAIControlled(), ObjectGuid::IsEmpty(), CreatureAI::me, MotionMaster::MoveFollow(), MotionMaster::MoveTargetedHome(), SmartScript::OnReset(), PET_FOLLOW_ANGLE, PET_FOLLOW_DIST, SmartScript::ProcessEventsFor(), ReturnToLastOOCPos(), SetRun(), SMART_ESCORT_ESCORTING, SMART_ESCORT_RETURNING, SMART_EVENT_EVADE, and UNIT_STATE_EVADE.
Referenced by OnCharmed().
Reimplemented from UnitAI.
Definition at line 725 of file SmartAI.cpp.
|
overridevirtual |
Reimplemented from UnitAI.
Definition at line 737 of file SmartAI.cpp.
References ObjectGuid::Empty.
|
inline |
Definition at line 88 of file SmartAI.h.
Referenced by CorpseRemoved(), DamageDealt(), DamageTaken(), DoAction(), EndPath(), EnterEvadeMode(), HealReceived(), InitializeAI(), IsEscortInvokerInRange(), IsSummonedBy(), JustAppeared(), JustDied(), JustEngagedWith(), JustReachedHome(), JustSummoned(), KilledUnit(), LoadPath(), MoveInLineOfSight(), MovementInform(), OnAuraApplied(), OnAuraRemoved(), OnCharmed(), OnDespawn(), OnGameEvent(), OnGossipHello(), OnGossipSelect(), OnQuestAccept(), OnQuestReward(), OnSpellCast(), OnSpellClick(), OnSpellFailed(), OnSpellStart(), PassengerBoarded(), PausePath(), ReceiveEmote(), ResumePath(), SetData(), SetTimedActionList(), SpellHit(), SpellHitTarget(), StopFollow(), StopPath(), SummonedCreatureDespawn(), SummonedCreatureDies(), UpdateAI(), UpdatePath(), WaypointPathEnded(), and WaypointReached().
|
inline |
Definition at line 63 of file SmartAI.h.
Referenced by CanResumePath(), EnterEvadeMode(), JustDied(), LoadPath(), MoveInLineOfSight(), MovementInform(), OnCharmed(), PausePath(), StartPath(), StopPath(), UpdatePath(), WaypointPathEnded(), and WaypointReached().
Reimplemented from UnitAI.
Definition at line 641 of file SmartAI.cpp.
References GetScript(), SmartScript::ProcessEventsFor(), and SMART_EVENT_RECEIVE_HEAL.
|
overridevirtual |
Reimplemented from UnitAI.
Definition at line 494 of file SmartAI.cpp.
References _despawnState, _despawnTime, _escortState, _followAngle, _followArrivedEntry, _followArrivedTimer, _followCredit, _followCreditType, _followDistance, _followGUID, ObjectGuid::Clear(), GetScript(), CreatureAI::me, SmartScript::OnInitialize(), and SMART_ESCORT_NONE.
| bool SmartAI::IsAIControlled | ( | ) | const |
Definition at line 44 of file SmartAI.cpp.
References _charmed.
Referenced by AssistPlayerInCombatAgainst(), AttackStart(), DamageTaken(), EndPath(), EnterEvadeMode(), JustEngagedWith(), MoveInLineOfSight(), ReturnToLastOOCPos(), and SetCombatMove().
| bool SmartAI::IsEscortInvokerInRange | ( | ) |
Definition at line 301 of file SmartAI.cpp.
References WorldObject::GetDistance(), Player::GetGroup(), WorldObject::GetInstanceScript(), GetScript(), WorldObject::IsInMap(), CreatureAI::me, SMART_ESCORT_MAX_PLAYER_DIST, SMART_ESCORT_TARGETS, and Object::ToPlayer().
Referenced by UpdatePath().
|
overridevirtual |
Reimplemented from CreatureAI.
Definition at line 651 of file SmartAI.cpp.
References GetScript(), SmartScript::ProcessEventsFor(), SMART_EVENT_JUST_SUMMONED, Object::ToGameObject(), and Object::ToUnit().
|
overridevirtual |
Reimplemented from CreatureAI.
Definition at line 510 of file SmartAI.cpp.
References GetScript(), Unit::isDead(), CreatureAI::JustAppeared(), CreatureAI::me, SmartScript::OnReset(), SmartScript::ProcessEventsFor(), and SMART_EVENT_RESPAWN.
|
overridevirtual |
Reimplemented from CreatureAI.
Definition at line 549 of file SmartAI.cpp.
References EndPath(), GetScript(), HasEscortState(), SmartScript::ProcessEventsFor(), SMART_ESCORT_ESCORTING, and SMART_EVENT_DEATH.
|
overridevirtual |
Reimplemented from CreatureAI.
Definition at line 541 of file SmartAI.cpp.
References GetScript(), Unit::InterruptNonMeleeSpells(), IsAIControlled(), CreatureAI::me, SmartScript::ProcessEventsFor(), and SMART_EVENT_AGGRO.
|
overridevirtual |
Reimplemented from CreatureAI.
Definition at line 521 of file SmartAI.cpp.
References MotionMaster::GetCurrentMovementGeneratorType(), Creature::GetFormation(), CreatureGroup::GetLeader(), Unit::GetMotionMaster(), GetScript(), Creature::GetWaypointPathId(), CreatureGroup::IsFormed(), CreatureAI::me, MOTION_SLOT_DEFAULT, MotionMaster::MoveIdle(), MotionMaster::MovePath(), SmartScript::OnReset(), SmartScript::ProcessEventsFor(), Unit::ResumeMovement(), SMART_EVENT_REACHED_HOME, and WAYPOINT_MOTION_TYPE.
|
overridevirtual |
Reimplemented from CreatureAI.
Definition at line 562 of file SmartAI.cpp.
References GetScript(), SmartScript::ProcessEventsFor(), and SMART_EVENT_SUMMONED_UNIT.
|
overridevirtual |
Reimplemented from CreatureAI.
Definition at line 557 of file SmartAI.cpp.
References GetScript(), SmartScript::ProcessEventsFor(), and SMART_EVENT_KILL.
| WaypointPath const * SmartAI::LoadPath | ( | uint32 | entry | ) |
Definition at line 84 of file SmartAI.cpp.
References GetScript(), HasEscortState(), WaypointPath::Nodes, SmartScript::SetPathId(), SMART_ESCORT_ESCORTING, and sWaypointMgr.
Referenced by StartPath().
|
overridevirtual |
Reimplemented from CreatureAI.
Definition at line 435 of file SmartAI.cpp.
References AssistPlayerInCombatAgainst(), GetScript(), HasEscortState(), IsAIControlled(), CreatureAI::MoveInLineOfSight(), SmartScript::OnMoveInLineOfSight(), and SMART_ESCORT_ESCORTING.
Reimplemented from CreatureAI.
Definition at line 375 of file SmartAI.cpp.
References _OOCReached, Unit::ClearUnitState(), GetScript(), HasEscortState(), CreatureAI::me, POINT_MOTION_TYPE, SmartScript::ProcessEventsFor(), SMART_ESCORT_ESCORTING, SMART_ESCORT_LAST_OOC_POINT, SMART_EVENT_MOVEMENTINFORM, and UNIT_STATE_EVADE.
|
overridevirtual |
Reimplemented from CreatureAI.
Definition at line 620 of file SmartAI.cpp.
References AuraApplication::GetBase(), GetScript(), Aura::GetSpellInfo(), SmartScript::ProcessEventsFor(), and SMART_EVENT_ON_AURA_APPLIED.
|
overridevirtual |
Reimplemented from CreatureAI.
Definition at line 625 of file SmartAI.cpp.
References AuraApplication::GetBase(), GetScript(), Aura::GetSpellInfo(), SmartScript::ProcessEventsFor(), and SMART_EVENT_ON_AURA_REMOVED.
|
overridevirtual |
Reimplemented from CreatureAI.
Definition at line 681 of file SmartAI.cpp.
References _charmed, _repeatWaypointPath, _run, ObjectGuid::Clear(), EndPath(), Unit::EngageWithTarget(), EnterEvadeMode(), Unit::GetCharmer(), Unit::GetFollowAngle(), Unit::GetMotionMaster(), GetScript(), ObjectAccessor::GetUnit(), HasEscortState(), Creature::HasReactState(), Unit::IsCharmed(), ObjectGuid::IsEmpty(), Unit::IsInCombat(), Creature::IsInEvadeMode(), Unit::isPossessed(), Unit::IsVehicle(), Unit::LastCharmerGUID, CreatureAI::me, MotionMaster::MoveFollow(), NoHostiles, UnitAI::OnCharmed(), PET_FOLLOW_DIST, SmartScript::ProcessEventsFor(), REACT_PASSIVE, Unit::SetWalk(), SMART_ESCORT_ESCORTING, SMART_ESCORT_PAUSED, SMART_ESCORT_RETURNING, SMART_EVENT_CHARMED, SMART_EVENT_FLAG_WHILE_CHARMED, and StartPath().
|
overridevirtual |
Reimplemented from UnitAI.
Definition at line 671 of file SmartAI.cpp.
References GetScript(), SmartScript::ProcessEventsFor(), and SMART_EVENT_ON_DESPAWN.
|
overridevirtual |
Reimplemented from UnitAI.
Definition at line 870 of file SmartAI.cpp.
References GetScript(), SmartScript::ProcessEventsFor(), SMART_EVENT_GAME_EVENT_END, and SMART_EVENT_GAME_EVENT_START.
|
overridevirtual |
Reimplemented from CreatureAI.
Definition at line 753 of file SmartAI.cpp.
References _gossipReturn, GetScript(), SmartScript::ProcessEventsFor(), and SMART_EVENT_GOSSIP_HELLO.
|
overridevirtual |
Reimplemented from CreatureAI.
Definition at line 760 of file SmartAI.cpp.
References _gossipReturn, GetScript(), SmartScript::ProcessEventsFor(), and SMART_EVENT_GOSSIP_SELECT.
|
overridevirtual |
Reimplemented from CreatureAI.
Definition at line 767 of file SmartAI.cpp.
Reimplemented from CreatureAI.
Definition at line 772 of file SmartAI.cpp.
References Quest::GetQuestId(), GetScript(), SmartScript::ProcessEventsFor(), and SMART_EVENT_ACCEPTED_QUEST.
|
overridevirtual |
Reimplemented from CreatureAI.
Definition at line 777 of file SmartAI.cpp.
References Quest::GetQuestId(), GetScript(), SmartScript::ProcessEventsFor(), and SMART_EVENT_REWARD_QUEST.
|
overridevirtual |
Reimplemented from CreatureAI.
Definition at line 605 of file SmartAI.cpp.
References GetScript(), SmartScript::ProcessEventsFor(), and SMART_EVENT_ON_SPELL_CAST.
|
overridevirtual |
Reimplemented from CreatureAI.
Definition at line 875 of file SmartAI.cpp.
References GetScript(), SmartScript::ProcessEventsFor(), and SMART_EVENT_ON_SPELLCLICK.
|
overridevirtual |
Reimplemented from CreatureAI.
Definition at line 610 of file SmartAI.cpp.
References GetScript(), SmartScript::ProcessEventsFor(), and SMART_EVENT_ON_SPELL_FAILED.
|
overridevirtual |
Reimplemented from CreatureAI.
Definition at line 615 of file SmartAI.cpp.
References GetScript(), SmartScript::ProcessEventsFor(), and SMART_EVENT_ON_SPELL_START.
== Fields =======================================
Reimplemented from CreatureAI.
Definition at line 676 of file SmartAI.cpp.
References GetScript(), SmartScript::ProcessEventsFor(), SMART_EVENT_PASSENGER_BOARDED, and SMART_EVENT_PASSENGER_REMOVED.
| void SmartAI::PausePath | ( | uint32 | delay, |
| bool | forced = false |
||
| ) |
Definition at line 100 of file SmartAI.cpp.
References _currentWaypointNodeId, _run, _waypointPauseForced, _waypointPauseTimer, _waypointReached, AddEscortState(), MotionMaster::GetCurrentMovementGeneratorType(), Creature::GetCurrentWaypointInfo(), BaseEntity::GetGUID(), Unit::GetMotionMaster(), Position::GetPosition(), GetScript(), HasEscortState(), CreatureAI::me, MOTION_SLOT_DEFAULT, Unit::PauseMovement(), SmartScript::ProcessEventsFor(), Creature::SetHomePosition(), SetRun(), SMART_ESCORT_ESCORTING, SMART_ESCORT_PAUSED, SMART_EVENT_WAYPOINT_PAUSED, TC_LOG_ERROR, ObjectGuid::ToString(), and WAYPOINT_MOTION_TYPE.
Definition at line 49 of file SmartAI.h.
References PERMIT_BASE_NO.
Reimplemented from CreatureAI.
Definition at line 646 of file SmartAI.cpp.
References GetScript(), SmartScript::ProcessEventsFor(), and SMART_EVENT_RECEIVE_EMOTE.
|
inline |
Definition at line 71 of file SmartAI.h.
Referenced by EndPath(), ResumePath(), and UpdatePath().
| void SmartAI::ResumePath | ( | ) |
Definition at line 258 of file SmartAI.cpp.
References _currentWaypointNodeId, _run, _waypointPauseForced, _waypointPauseTimer, _waypointReached, GetScript(), CreatureAI::me, SmartScript::ProcessEventsFor(), RemoveEscortState(), Unit::ResumeMovement(), SetRun(), SMART_ESCORT_PAUSED, and SMART_EVENT_WAYPOINT_RESUMED.
Referenced by UpdatePath().
|
private |
Definition at line 272 of file SmartAI.cpp.
References Creature::GetHomePosition(), Unit::GetMotionMaster(), IsAIControlled(), CreatureAI::me, MotionMaster::MovePoint(), Unit::SetWalk(), and SMART_ESCORT_LAST_OOC_POINT.
Referenced by EnterEvadeMode().
| void SmartAI::SetCombatMove | ( | bool | on, |
| bool | stopMoving = false |
||
| ) |
Definition at line 782 of file SmartAI.cpp.
References _canCombatMove, _run, Unit::GetMotionMaster(), MotionMaster::GetMovementGenerator(), Unit::GetVictim(), MotionMaster::HasMovementGenerator(), Creature::HasReactState(), IsAIControlled(), Creature::IsEngaged(), CreatureAI::me, REACT_PASSIVE, MotionMaster::Remove(), SetRun(), Creature::StartDefaultCombatMovement(), and Unit::StopMoving().
Definition at line 730 of file SmartAI.cpp.
References GetScript(), SmartScript::ProcessEventsFor(), and SMART_EVENT_DATA_SET.
|
inline |
Definition at line 216 of file SmartAI.h.
Referenced by StopFollow(), and StopPath().
| void SmartAI::SetEvadeDisabled | ( | bool | disable = true | ) |
Definition at line 748 of file SmartAI.cpp.
References _evadeDisabled.
| void SmartAI::SetFollow | ( | Unit * | target, |
| float | dist = 0.0f, |
||
| float | angle = 0.0f, |
||
| uint32 | credit = 0, |
||
| uint32 | end = 0, |
||
| uint32 | creditType = 0 |
||
| ) |
Definition at line 817 of file SmartAI.cpp.
References _followAngle, _followArrivedEntry, _followArrivedTimer, _followCredit, _followCreditType, _followDistance, _followGUID, _run, BaseEntity::GetGUID(), Unit::GetMotionMaster(), CreatureAI::me, MotionMaster::MoveFollow(), SetRun(), and StopFollow().
|
overridevirtual |
Reimplemented from UnitAI.
Definition at line 735 of file SmartAI.cpp.
|
inline |
Definition at line 204 of file SmartAI.h.
Referenced by SmartScript::ProcessAction().
| void SmartAI::SetRun | ( | bool | run = true | ) |
Definition at line 742 of file SmartAI.cpp.
References _run, CreatureAI::me, and Unit::SetWalk().
Referenced by AttackStart(), EnterEvadeMode(), PausePath(), ResumePath(), SetCombatMove(), SetFollow(), and WaypointReached().
| void SmartAI::SetTimedActionList | ( | SmartScriptHolder & | e, |
| uint32 | entry, | ||
| Unit * | invoker, | ||
| uint32 | startFromEventId = 0 |
||
| ) |
Definition at line 865 of file SmartAI.cpp.
References GetScript(), and SmartScript::SetTimedActionList().
|
overridevirtual |
Reimplemented from CreatureAI.
Definition at line 595 of file SmartAI.cpp.
References GetScript(), SmartScript::ProcessEventsFor(), SMART_EVENT_SPELLHIT, Object::ToGameObject(), and Object::ToUnit().
|
overridevirtual |
Reimplemented from CreatureAI.
Definition at line 600 of file SmartAI.cpp.
References GetScript(), SmartScript::ProcessEventsFor(), SMART_EVENT_SPELLHIT_TARGET, Object::ToGameObject(), and Object::ToUnit().
|
inline |
Definition at line 221 of file SmartAI.h.
Referenced by EndPath(), StopFollow(), and StopPath().
| void SmartAI::StartPath | ( | uint32 | pathId = 0, |
| bool | repeat = false, |
||
| Unit * | invoker = nullptr, |
||
| uint32 | nodeId = 0, |
||
| uint32 | fadeObjectDuration = 0, |
||
| Scripting::v2::ActionResultSetter< MovementStopReason > && | scriptResult = {} |
||
| ) |
Definition at line 49 of file SmartAI.cpp.
References _currentWaypointNodeId, _escortNPCFlags, _escortState, _repeatWaypointPath, _waypointPathEnded, Default, Unit::GetMotionMaster(), Unit::GetNpcFlags(), BaseEntity::GetTypeId(), HasEscortState(), LoadPath(), CreatureAI::me, MotionMaster::MovePath(), Unit::ReplaceAllNpcFlags(), SMART_ESCORT_ESCORTING, StopPath(), TYPEID_PLAYER, and UNIT_NPC_FLAG_NONE.
Referenced by EndPath(), and OnCharmed().
| void SmartAI::StopFollow | ( | bool | complete | ) |
Definition at line 836 of file SmartAI.cpp.
References _followAngle, _followArrivedEntry, _followArrivedTimer, _followCredit, _followCreditType, _followDistance, _followGUID, ObjectGuid::Clear(), MotionMaster::Clear(), Unit::GetMotionMaster(), ObjectAccessor::GetPlayer(), GetScript(), Player::GroupEventHappens(), CreatureAI::me, MotionMaster::MoveIdle(), SmartScript::ProcessEventsFor(), Player::RewardPlayerAndGroupAtEvent(), SetDespawnTime(), SMART_EVENT_FOLLOW_COMPLETED, and StartDespawn().
Referenced by SetFollow(), and UpdateFollow().
Definition at line 146 of file SmartAI.cpp.
References _currentWaypointNodeId, _despawnState, _escortQuestId, EndPath(), MotionMaster::GetCurrentMovementGeneratorType(), Creature::GetCurrentWaypointInfo(), Unit::GetMotionMaster(), GetScript(), HasEscortState(), CreatureAI::me, MotionMaster::MoveIdle(), SmartScript::ProcessEventsFor(), SetDespawnTime(), SMART_ESCORT_ESCORTING, SMART_EVENT_WAYPOINT_ENDED, SMART_EVENT_WAYPOINT_STOPPED, StartDespawn(), and WAYPOINT_MOTION_TYPE.
Referenced by StartPath(), and UpdatePath().
|
overridevirtual |
Reimplemented from CreatureAI.
Definition at line 661 of file SmartAI.cpp.
References Object::GetEntry(), GetScript(), SmartScript::ProcessEventsFor(), and SMART_EVENT_SUMMON_DESPAWNED.
Reimplemented from CreatureAI.
Definition at line 567 of file SmartAI.cpp.
References GetScript(), SmartScript::ProcessEventsFor(), and SMART_EVENT_SUMMONED_UNIT_DIES.
|
overridevirtual |
Implements UnitAI.
Definition at line 281 of file SmartAI.cpp.
References CheckConditions(), CreatureAI::EngagementOver(), GetScript(), Unit::IsAlive(), CreatureAI::IsEngaged(), CreatureAI::me, SmartScript::OnUpdate(), UpdateDespawn(), UpdateFollow(), UpdatePath(), and CreatureAI::UpdateVictim().
|
private |
Definition at line 984 of file SmartAI.cpp.
References _despawnState, _despawnTime, Creature::DespawnOrUnsummon(), CreatureAI::me, and Unit::SetVisible().
Referenced by UpdateAI().
|
private |
Definition at line 965 of file SmartAI.cpp.
References _followArrivedEntry, _followArrivedTimer, _followGUID, WorldObject::FindNearestCreature(), INTERACTION_DISTANCE, ObjectGuid::IsEmpty(), CreatureAI::me, and StopFollow().
Referenced by UpdateAI().
|
private |
Definition at line 912 of file SmartAI.cpp.
References _escortInvokerCheckTimer, _escortQuestId, _OOCReached, _waypointPathEnded, _waypointPauseForced, _waypointPauseTimer, _waypointReached, Creature::DespawnOrUnsummon(), GetScript(), HasEscortState(), IsEscortInvokerInRange(), Unit::IsInCombat(), CreatureAI::me, SmartScript::ProcessEventsFor(), RemoveEscortState(), ResumePath(), SMART_ESCORT_ESCORTING, SMART_ESCORT_PAUSED, SMART_ESCORT_RETURNING, SMART_EVENT_DEATH, SMART_EVENT_REACHED_HOME, and StopPath().
Referenced by UpdateAI().
Reimplemented from CreatureAI.
Definition at line 366 of file SmartAI.cpp.
References GetScript(), HasEscortState(), SmartScript::ProcessEventsFor(), SMART_ESCORT_ESCORTING, and SMART_EVENT_WAYPOINT_ENDED.
Reimplemented from CreatureAI.
Definition at line 337 of file SmartAI.cpp.
References _currentWaypointNodeId, _run, _waypointPathEnded, _waypointPauseForced, _waypointPauseTimer, _waypointReached, MotionMaster::GetCurrentMovementGeneratorType(), Unit::GetMotionMaster(), Position::GetPosition(), GetScript(), HasEscortState(), CreatureAI::me, WaypointPath::Nodes, Unit::PauseMovement(), SmartScript::ProcessEventsFor(), Creature::SetHomePosition(), SetRun(), SMART_ESCORT_ESCORTING, SMART_EVENT_WAYPOINT_REACHED, sWaypointMgr, and WAYPOINT_MOTION_TYPE.
|
private |
Definition at line 274 of file SmartAI.h.
Referenced by AttackStart(), and SetCombatMove().
|
private |
Definition at line 252 of file SmartAI.h.
Referenced by IsAIControlled(), and OnCharmed().
|
private |
Definition at line 264 of file SmartAI.h.
Referenced by EndPath(), PausePath(), ResumePath(), StartPath(), StopPath(), and WaypointReached().
|
private |
Definition at line 278 of file SmartAI.h.
Referenced by EndPath(), InitializeAI(), StopPath(), and UpdateDespawn().
|
private |
Definition at line 277 of file SmartAI.h.
Referenced by InitializeAI(), and UpdateDespawn().
|
private |
Definition at line 263 of file SmartAI.h.
Referenced by UpdatePath().
|
private |
Definition at line 262 of file SmartAI.h.
Referenced by EndPath(), and StartPath().
|
private |
Definition at line 287 of file SmartAI.h.
Referenced by EndPath(), StopPath(), and UpdatePath().
|
private |
Definition at line 261 of file SmartAI.h.
Referenced by InitializeAI(), and StartPath().
|
private |
Definition at line 273 of file SmartAI.h.
Referenced by EnterEvadeMode(), and SetEvadeDisabled().
|
private |
Definition at line 259 of file SmartAI.h.
Referenced by EnterEvadeMode(), InitializeAI(), SetFollow(), and StopFollow().
|
private |
Definition at line 256 of file SmartAI.h.
Referenced by InitializeAI(), SetFollow(), StopFollow(), and UpdateFollow().
|
private |
Definition at line 254 of file SmartAI.h.
Referenced by InitializeAI(), SetFollow(), StopFollow(), and UpdateFollow().
|
private |
Definition at line 255 of file SmartAI.h.
Referenced by InitializeAI(), SetFollow(), and StopFollow().
|
private |
Definition at line 253 of file SmartAI.h.
Referenced by InitializeAI(), SetFollow(), and StopFollow().
|
private |
Definition at line 258 of file SmartAI.h.
Referenced by EnterEvadeMode(), InitializeAI(), SetFollow(), and StopFollow().
|
private |
Definition at line 257 of file SmartAI.h.
Referenced by EnterEvadeMode(), InitializeAI(), SetFollow(), StopFollow(), and UpdateFollow().
|
private |
Definition at line 285 of file SmartAI.h.
Referenced by OnGossipHello(), and OnGossipSelect().
|
private |
Definition at line 275 of file SmartAI.h.
Referenced by DamageTaken().
|
private |
Definition at line 269 of file SmartAI.h.
Referenced by MovementInform(), and UpdatePath().
|
private |
Definition at line 268 of file SmartAI.h.
Referenced by EndPath(), OnCharmed(), and StartPath().
|
private |
Definition at line 272 of file SmartAI.h.
Referenced by AttackStart(), EnterEvadeMode(), OnCharmed(), PausePath(), ResumePath(), SetCombatMove(), SetFollow(), SetRun(), and WaypointReached().
|
private |
|
private |
Definition at line 281 of file SmartAI.h.
Referenced by CheckConditions(), and SmartAI().
|
private |
Definition at line 282 of file SmartAI.h.
Referenced by CheckConditions().
|
private |
Definition at line 270 of file SmartAI.h.
Referenced by StartPath(), UpdatePath(), and WaypointReached().
|
private |
Definition at line 267 of file SmartAI.h.
Referenced by PausePath(), ResumePath(), UpdatePath(), and WaypointReached().
|
private |
Definition at line 266 of file SmartAI.h.
Referenced by EndPath(), PausePath(), ResumePath(), UpdatePath(), and WaypointReached().
|
private |
Definition at line 265 of file SmartAI.h.
Referenced by PausePath(), ResumePath(), UpdatePath(), and WaypointReached().