AzerothCore 3.3.5a
OpenSource WoW Emulator
|
#include "SmartAI.h"
Public Member Functions | |
~SmartAI () override | |
SmartAI (Creature *c) | |
bool | IsAIControlled () const |
void | StartPath (bool run=false, uint32 path=0, bool repeat=false, Unit *invoker=nullptr) |
bool | LoadPath (uint32 entry) |
void | PausePath (uint32 delay, bool forced=false) |
void | StopPath (uint32 DespawnTime=0, uint32 quest=0, bool fail=false) |
void | EndPath (bool fail=false) |
void | ResumePath () |
WayPoint * | GetNextWayPoint () |
void | GenerateWayPointArray (Movement::PointsArray *points) |
bool | HasEscortState (uint32 uiEscortState) |
void | AddEscortState (uint32 uiEscortState) |
bool | IsEscorted () override |
void | RemoveEscortState (uint32 uiEscortState) |
void | SetAutoAttack (bool on) |
void | SetCombatMove (bool on, float chaseRange=0.0f) |
bool | CanCombatMove () |
void | SetFollow (Unit *target, float dist=0.0f, float angle=0.0f, uint32 credit=0, uint32 end=0, uint32 creditType=0, bool aliveState=true) |
void | StopFollow (bool complete) |
void | MoveAway (float distance) |
void | SetScript9 (SmartScriptHolder &e, uint32 entry, WorldObject *invoker) |
SmartScript * | GetScript () |
bool | IsEscortInvokerInRange () |
void | JustRespawned () override |
void | JustReachedHome () override |
void | JustEngagedWith (Unit *enemy) override |
Called for reaction when initially engaged. More... | |
void | EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER) override |
void | JustDied (Unit *killer) override |
void | KilledUnit (Unit *victim) override |
void | JustSummoned (Creature *creature) override |
void | SummonedCreatureDies (Creature *summon, Unit *killer) override |
void | SummonedCreatureEvade (Creature *summon) override |
void | AttackStart (Unit *who) override |
void | MoveInLineOfSight (Unit *who) override |
void | SpellHit (Unit *unit, SpellInfo const *spellInfo) override |
void | SpellHitTarget (Unit *target, SpellInfo const *spellInfo) override |
void | DamageTaken (Unit *done_by, uint32 &damage, DamageEffectType damagetype, SpellSchoolMask damageSchoolMask) override |
Called at any Damage from any attacker (before damage apply) More... | |
void | HealReceived (Unit *doneBy, uint32 &addhealth) override |
Called when the creature receives heal. More... | |
void | UpdateAI (uint32 diff) override |
Use to start attacking a target. Called just before JustEngagedWith() More... | |
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 damagetyp) override |
Called at any Damage to any victim (before damage apply) More... | |
void | SummonedCreatureDespawn (Creature *unit) override |
void | CorpseRemoved (uint32 &respawnDelay) override |
== Triggered Actions Requested ================== More... | |
void | PassengerBoarded (Unit *who, int8 seatId, bool apply) override |
== Fields ======================================= More... | |
void | InitializeAI () override |
void | OnCharmed (bool apply) override |
Called when unit is charmed. More... | |
bool | CanAIAttack (Unit const *who) const override |
void | DoAction (int32 param=0) override |
uint32 | GetData (uint32 id=0) const override |
void | SetData (uint32 id, uint32 value) override |
void | SetData (uint32 id, uint32 value, WorldObject *invoker) |
void | SetGUID (ObjectGuid guid, int32 id=0) override |
ObjectGuid | GetGUID (int32 id=0) const override |
void | MovepointReached (uint32 id) |
void | SetRun (bool run=true) |
void | SetFly (bool fly=true) |
void | SetSwim (bool swim=true) |
void | SetEvadeDisabled (bool disable=true) |
void | SetInvincibilityHpLevel (uint32 level) |
void | sGossipHello (Player *player) override |
void | sGossipSelect (Player *player, uint32 sender, uint32 action) override |
void | sGossipSelectCode (Player *player, uint32 sender, uint32 action, const char *code) override |
void | sQuestAccept (Player *player, Quest const *quest) override |
void | sQuestReward (Player *player, Quest const *quest, uint32 opt) override |
void | sOnGameEvent (bool start, uint16 eventId) override |
void | SetDespawnTime (uint32 t) |
void | StartDespawn () |
void | OnSpellClick (Unit *clicker, bool &result) override |
void | PathEndReached (uint32 pathId) override |
bool | CanRespawn () override |
void | SetCanRespawn (bool canSpawn) |
void | SetWPPauseTimer (uint32 time) |
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 |
Unit * | SelectTarget (SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0) |
template<class PREDICATE > | |
Unit * | SelectTarget (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 |
Static Public Member Functions | |
static int32 | Permissible (Creature const *) |
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 () |
Public Attributes | |
uint32 | mEscortQuestID |
Private Member Functions | |
void | ReturnToLastOOCPos () |
void | UpdatePath (const uint32 diff) |
uint32 | GetWPCount () |
bool | AssistPlayerInCombatAgainst (Unit *who) |
void | UpdateDespawn (const uint32 diff) |
void | CheckConditions (const uint32 diff) |
Private Attributes | |
bool | mIsCharmed |
uint32 | mFollowCreditType |
uint32 | mFollowArrivedTimer |
uint32 | mFollowCredit |
uint32 | mFollowArrivedEntry |
bool | mFollowArrivedAlive |
ObjectGuid | mFollowGuid |
float | mFollowDist |
float | mFollowAngle |
SmartScript | mScript |
WPPath * | mWayPoints |
uint32 | mEscortState |
uint32 | mCurrentWPID |
bool | mWPReached |
bool | mOOCReached |
uint32 | mWPPauseTimer |
WayPoint * | mLastWP |
uint32 | mEscortNPCFlags |
bool | mCanRepeatPath |
bool | mRun |
bool | mEvadeDisabled |
bool | mCanAutoAttack |
bool | mCanCombatMove |
bool | mForcedPaused |
uint32 | mInvincibilityHpLevel |
uint32 | mDespawnTime |
uint32 | mDespawnState |
uint32 | mEscortInvokerCheckTimer |
bool | mJustReset |
bool | mcanSpawn |
ConditionList | conditions |
uint32 | m_ConditionsTimer |
|
inlineoverride |
|
explicit |
References CONDITION_SOURCE_TYPE_CREATURE_TEMPLATE_VEHICLE, conditions, Object::GetEntry(), Unit::GetVehicleKit(), m_ConditionsTimer, mCanAutoAttack, mCanCombatMove, mCanRepeatPath, mcanSpawn, mCurrentWPID, mDespawnState, mDespawnTime, CreatureAI::me, mEscortInvokerCheckTimer, mEscortNPCFlags, mEscortQuestID, mEscortState, mEvadeDisabled, mFollowAngle, mFollowArrivedAlive, mFollowArrivedEntry, mFollowArrivedTimer, mFollowCredit, mFollowCreditType, mFollowDist, mForcedPaused, mInvincibilityHpLevel, mIsCharmed, mJustReset, mLastWP, mOOCReached, mRun, mWayPoints, mWPPauseTimer, mWPReached, sConditionMgr, and SMART_ESCORT_NONE.
|
inline |
References mEscortState.
Referenced by EnterEvadeMode(), PausePath(), and StartPath().
|
private |
References AttackStart(), CREATURE_TYPE_FLAG_CAN_ASSIST, Unit::GetCharmerOrOwnerOrOwnGUID(), Creature::GetCreatureTemplate(), Unit::GetVictim(), IsAIControlled(), ObjectGuid::IsPlayer(), Unit::IsValidAssistTarget(), WorldObject::IsWithinDistInMap(), WorldObject::IsWithinLOSInMap(), CreatureAI::me, SMART_MAX_AID_DIST, and CreatureTemplate::type_flags.
Referenced by MoveInLineOfSight().
|
overridevirtual |
Reimplemented from UnitAI.
References Unit::Attack(), ESCORT_MOTION_TYPE, Unit::GetMotionMaster(), MotionMaster::GetMotionSlotType(), Unit::HasUnitFlag(), Unit::IsWithinMeleeRange(), mCanAutoAttack, mCanCombatMove, CreatureAI::me, MOTION_SLOT_ACTIVE, MotionMaster::MoveChase(), MotionMaster::MovementExpired(), mRun, POINT_MOTION_TYPE, SetRun(), Unit::StopMoving(), and UNIT_FLAG_POSSESSED.
Referenced by AssistPlayerInCombatAgainst(), MoveInLineOfSight(), and OnCharmed().
|
overridevirtual |
Reimplemented from UnitAI.
Reimplemented in npc_pos_freed_slave::npc_pos_freed_slaveAI.
References Creature::GetReactState(), CreatureAI::me, and REACT_PASSIVE.
|
inline |
References mCanCombatMove.
|
inlineoverridevirtual |
|
private |
References conditions, ObjectAccessor::GetUnit(), Unit::GetVehicleKit(), m_ConditionsTimer, CreatureAI::me, sConditionMgr, Vehicle::Seats, and Object::ToPlayer().
Referenced by UpdateAI().
|
overridevirtual |
== Triggered Actions Requested ==================
== State checks =================================
Reimplemented from CreatureAI.
References EndPath(), GetScript(), IsEscorted(), SmartScript::ProcessEventsFor(), and SMART_EVENT_CORPSE_REMOVED.
|
overridevirtual |
Called at any Damage to any victim (before damage apply)
Reimplemented from UnitAI.
References GetScript(), SmartScript::ProcessEventsFor(), and SMART_EVENT_DAMAGED_TARGET.
|
overridevirtual |
Called at any Damage from any attacker (before damage apply)
Reimplemented from UnitAI.
References Unit::GetHealth(), GetScript(), IsAIControlled(), CreatureAI::me, mInvincibilityHpLevel, NODAMAGE, SmartScript::ProcessEventsFor(), and SMART_EVENT_DAMAGED.
|
overridevirtual |
Reimplemented from UnitAI.
References GetScript(), SmartScript::ProcessEventsFor(), and SMART_EVENT_ACTION_DONE.
void SmartAI::EndPath | ( | bool | fail = false | ) |
References Player::AreaExploredOrEventHappens(), Player::FailQuest(), Player::GetGroup(), Player::GetQuestStatus(), GetScript(), SmartScript::GetStoredTargetVector(), Player::GroupEventHappens(), Player::HasCorpse(), IsAIControlled(), Player::IsAtGroupRewardDistance(), WorldObject::IsInMap(), mCanRepeatPath, mCurrentWPID, mDespawnState, CreatureAI::me, mEscortNPCFlags, mEscortQuestID, mLastWP, mRun, mWayPoints, mWPPauseTimer, GroupReference::next(), SmartScript::ProcessEventsFor(), QUEST_STATUS_INCOMPLETE, 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 CorpseRemoved(), JustDied(), MovepointReached(), OnCharmed(), StopPath(), and UpdatePath().
|
overridevirtual |
Reimplemented from CreatureAI.
Reimplemented in npc_black_morass_summoned_add, and npc_pos_freed_slave::npc_pos_freed_slaveAI.
References CreatureAI::_EnterEvadeMode(), AddEscortState(), Unit::AddUnitState(), Unit::AttackStop(), Unit::ClearUnitState(), Unit::GetCharmerGUID(), Unit::GetMotionMaster(), GetScript(), ObjectAccessor::GetUnit(), HasEscortState(), Unit::HasUnitFlag(), Unit::HasUnitState(), ObjectGuid::IsPlayer(), CreatureAI::me, mEvadeDisabled, mFollowAngle, mFollowDist, mFollowGuid, MotionMaster::MoveFollow(), MotionMaster::MoveTargetedHome(), mRun, SmartScript::OnReset(), SmartScript::ProcessEventsFor(), ReturnToLastOOCPos(), SetRun(), SMART_ESCORT_ESCORTING, SMART_ESCORT_RETURNING, SMART_EVENT_EVADE, UNIT_FLAG_POSSESSED, and UNIT_STATE_EVADE.
Referenced by npc_black_morass_summoned_add::EnterEvadeMode().
void SmartAI::GenerateWayPointArray | ( | Movement::PointsArray * | points | ) |
References Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), MovementInfo::HasMovementFlag(), WorldObject::m_movementInfo, mCurrentWPID, CreatureAI::me, MOVEMENTFLAG_CAN_FLY, MOVEMENTFLAG_DISABLE_GRAVITY, mWayPoints, WayPoint::x, WayPoint::y, and WayPoint::z.
Referenced by ResumePath(), and StartPath().
Reimplemented from UnitAI.
|
overridevirtual |
WayPoint * SmartAI::GetNextWayPoint | ( | ) |
References WayPoint::id, LOG_ERROR, mCurrentWPID, mLastWP, and mWayPoints.
Referenced by MovepointReached(), StartPath(), and UpdatePath().
|
inline |
References mScript.
Referenced by CorpseRemoved(), DamageDealt(), DamageTaken(), DoAction(), EndPath(), EnterEvadeMode(), HealReceived(), InitializeAI(), IsEscortInvokerInRange(), IsSummonedBy(), JustDied(), JustEngagedWith(), JustReachedHome(), JustRespawned(), JustSummoned(), KilledUnit(), LoadPath(), MoveInLineOfSight(), MovementInform(), MovepointReached(), OnCharmed(), OnSpellClick(), PassengerBoarded(), PathEndReached(), PausePath(), ReceiveEmote(), SetData(), SetScript9(), sGossipHello(), sGossipSelect(), sOnGameEvent(), SpellHit(), SpellHitTarget(), sQuestAccept(), sQuestReward(), StartPath(), StopFollow(), StopPath(), SummonedCreatureDespawn(), SummonedCreatureDies(), SummonedCreatureEvade(), UpdateAI(), and UpdatePath().
|
inlineprivate |
|
inline |
References mEscortState.
Referenced by EnterEvadeMode(), JustDied(), LoadPath(), MoveAway(), MovementInform(), MovepointReached(), OnCharmed(), PausePath(), SetCombatMove(), StartPath(), StopPath(), and UpdatePath().
Called when the creature receives heal.
Reimplemented from UnitAI.
References GetScript(), SmartScript::ProcessEventsFor(), and SMART_EVENT_RECEIVE_HEAL.
|
overridevirtual |
Reimplemented from UnitAI.
References GetScript(), Unit::isDead(), JustReachedHome(), CreatureAI::me, mJustReset, SmartScript::OnInitialize(), SmartScript::ProcessEventsFor(), and SMART_EVENT_RESPAWN.
bool SmartAI::IsAIControlled | ( | ) | const |
References mIsCharmed.
Referenced by AssistPlayerInCombatAgainst(), DamageTaken(), EndPath(), JustEngagedWith(), MoveAway(), MoveInLineOfSight(), ReturnToLastOOCPos(), SetCombatMove(), and UpdateAI().
|
inlineoverridevirtual |
Reimplemented from CreatureAI.
References mEscortState, and SMART_ESCORT_ESCORTING.
Referenced by CorpseRemoved().
bool SmartAI::IsEscortInvokerInRange | ( | ) |
References WorldObject::GetDistance(), Player::GetGroup(), WorldObject::GetInstanceScript(), GetScript(), WorldObject::IsInMap(), SmartScript::IsPlayer(), CreatureAI::me, GroupReference::next(), SMART_ESCORT_MAX_PLAYER_DIST, and SMART_ESCORT_TARGETS.
Referenced by UpdatePath().
|
overridevirtual |
Reimplemented from CreatureAI.
References GetScript(), SmartScript::ProcessEventsFor(), SMART_EVENT_JUST_SUMMONED, Object::ToGameObject(), and Object::ToUnit().
|
overridevirtual |
Reimplemented from CreatureAI.
References EndPath(), GetScript(), HasEscortState(), SmartScript::ProcessEventsFor(), SMART_ESCORT_ESCORTING, and SMART_EVENT_DEATH.
|
overridevirtual |
Called for reaction when initially engaged.
Reimplemented from CreatureAI.
References CURRENT_CHANNELED_SPELL, GetScript(), Unit::InterruptSpell(), IsAIControlled(), CreatureAI::me, SmartScript::ProcessEventsFor(), and SMART_EVENT_AGGRO.
|
overridevirtual |
Reimplemented from CreatureAI.
References MotionMaster::GetCurrentMovementGeneratorType(), Unit::GetMotionMaster(), GetScript(), Creature::GetWaypointPath(), IDLE_MOTION_TYPE, CreatureAI::me, mJustReset, MotionMaster::MovePath(), SmartScript::OnReset(), SmartScript::ProcessEventsFor(), SMART_EVENT_REACHED_HOME, and CreatureAI::UpdateVictim().
Referenced by InitializeAI(), and JustRespawned().
|
overridevirtual |
Reimplemented from CreatureAI.
References ObjectGuid::Clear(), CreatureTemplate::faction, Creature::GetCreatureTemplate(), Unit::GetFaction(), GetScript(), JustReachedHome(), mDespawnState, mDespawnTime, CreatureAI::me, mEscortState, mFollowAngle, mFollowArrivedAlive, mFollowArrivedEntry, mFollowArrivedTimer, mFollowCredit, mFollowCreditType, mFollowDist, mFollowGuid, mJustReset, SmartScript::ProcessEventsFor(), Unit::RestoreFaction(), Unit::SetVisible(), SMART_ESCORT_NONE, and SMART_EVENT_RESPAWN.
|
overridevirtual |
Reimplemented from CreatureAI.
References SmartScript::AddCreatureSummon(), Object::GetGUID(), GetScript(), SmartScript::ProcessEventsFor(), and SMART_EVENT_SUMMONED_UNIT.
|
overridevirtual |
Reimplemented from CreatureAI.
References GetScript(), SmartScript::ProcessEventsFor(), and SMART_EVENT_KILL.
bool SmartAI::LoadPath | ( | uint32 | entry | ) |
References GetScript(), HasEscortState(), mWayPoints, SmartScript::SetPathId(), SMART_ESCORT_ESCORTING, and sSmartWaypointMgr.
Referenced by StartPath().
void SmartAI::MoveAway | ( | float | distance | ) |
References CHASE_MOTION_TYPE, MotionMaster::Clear(), WorldObject::GetClosePoint(), MotionMaster::GetCurrentMovementGeneratorType(), Unit::GetMotionMaster(), WorldObject::GetObjectSize(), Unit::GetVictim(), HasEscortState(), IsAIControlled(), WorldObject::IsWithinLOS(), mCanCombatMove, CreatureAI::me, MotionMaster::MovePoint(), POINT_MOTION_TYPE, SMART_ESCORT_ESCORTING, SMART_RANDOM_POINT, and Unit::StopMoving().
|
overridevirtual |
Reimplemented from CreatureAI.
Reimplemented in npc_fairbanks::npc_fairbanksAI.
References AssistPlayerInCombatAgainst(), AttackStart(), Creature::CanStartAttack(), MotionMaster::Clear(), Unit::ClearUnitState(), Unit::GetMotionMaster(), GetScript(), Unit::GetVictim(), Creature::HasReactState(), Unit::HasUnitState(), IsAIControlled(), CreatureAI::me, SmartScript::OnMoveInLineOfSight(), REACT_AGGRESSIVE, REACT_PASSIVE, and UNIT_STATE_DISTRACTED.
Referenced by npc_fairbanks::npc_fairbanksAI::MoveInLineOfSight().
Reimplemented from CreatureAI.
References Unit::ClearUnitState(), ESCORT_MOTION_TYPE, GetScript(), HasEscortState(), CreatureAI::me, MovepointReached(), POINT_MOTION_TYPE, SmartScript::ProcessEventsFor(), SMART_ESCORT_ESCORTING, SMART_ESCORT_LAST_OOC_POINT, SMART_EVENT_MOVEMENTINFORM, SMART_EVENT_WAYPOINT_DATA_REACHED, UNIT_STATE_EVADE, and WAYPOINT_MOTION_TYPE.
void SmartAI::MovepointReached | ( | uint32 | id | ) |
References EndPath(), ESCORT_MOTION_TYPE, Movement::MoveSpline::Finalized(), MotionMaster::GetCurrentMovementGeneratorType(), Unit::GetMotionMaster(), MotionMaster::GetMotionSlotType(), GetNextWayPoint(), Position::GetOrientation(), Position::GetPosition(), GetScript(), GetWPCount(), HasEscortState(), mCurrentWPID, CreatureAI::me, mLastWP, mOOCReached, MOTION_SLOT_ACTIVE, MotionMaster::MoveIdle(), MotionMaster::MovementExpired(), Unit::movespline, mRun, mWPReached, SmartScript::ProcessEventsFor(), ResumePath(), Creature::SetHomePosition(), Creature::SetPosition(), SetRun(), SMART_ESCORT_ESCORTING, SMART_ESCORT_LAST_OOC_POINT, SMART_ESCORT_PAUSED, SMART_EVENT_WAYPOINT_REACHED, Unit::StopMovingOnCurrentPos(), WayPoint::x, WayPoint::y, and WayPoint::z.
Referenced by MovementInform().
|
overridevirtual |
Called when unit is charmed.
Reimplemented from CreatureAI.
References AttackStart(), EndPath(), Unit::GetCharmer(), GetScript(), HasEscortState(), Unit::IsCharmed(), Creature::IsInEvadeMode(), mCanRepeatPath, CreatureAI::me, mIsCharmed, mRun, SmartScript::ProcessEventsFor(), Creature::SetWalk(), SMART_ESCORT_ESCORTING, SMART_ESCORT_PAUSED, SMART_ESCORT_RETURNING, SMART_EVENT_CHARMED, and StartPath().
|
overridevirtual |
Reimplemented from CreatureAI.
References GetScript(), SmartScript::ProcessEventsFor(), and SMART_EVENT_ON_SPELLCLICK.
== Fields =======================================
Reimplemented from CreatureAI.
References GetScript(), SmartScript::ProcessEventsFor(), SMART_EVENT_PASSENGER_BOARDED, and SMART_EVENT_PASSENGER_REMOVED.
|
overridevirtual |
Reimplemented from CreatureAI.
References GetScript(), Creature::GetWaypointPath(), Creature::LoadPath(), CreatureAI::me, SmartScript::ProcessEventsFor(), and SMART_EVENT_WAYPOINT_DATA_ENDED.
void SmartAI::PausePath | ( | uint32 | delay, |
bool | forced = false |
||
) |
References AddEscortState(), ESCORT_MOTION_TYPE, Object::GetEntry(), Unit::GetMotionMaster(), MotionMaster::GetMotionSlotType(), GetScript(), HasEscortState(), LOG_ERROR, mCurrentWPID, CreatureAI::me, mForcedPaused, MOTION_SLOT_ACTIVE, MotionMaster::MoveIdle(), MotionMaster::MovementExpired(), mRun, mWayPoints, mWPPauseTimer, mWPReached, SmartScript::ProcessEventsFor(), Unit::SetFacingTo(), SetRun(), SMART_ESCORT_ESCORTING, SMART_ESCORT_PAUSED, SMART_EVENT_WAYPOINT_PAUSED, and Unit::StopMoving().
References PERMIT_BASE_NO.
Reimplemented from CreatureAI.
References GetScript(), SmartScript::ProcessEventsFor(), and SMART_EVENT_RECEIVE_EMOTE.
|
inline |
References mEscortState.
Referenced by EndPath(), and UpdatePath().
void SmartAI::ResumePath | ( | ) |
References GenerateWayPointArray(), Unit::GetMotionMaster(), CreatureAI::me, mLastWP, MotionMaster::MoveSplinePath(), mRun, and SetRun().
Referenced by MovepointReached(), and UpdatePath().
|
private |
References Creature::GetHomePosition(), Unit::GetMotionMaster(), IsAIControlled(), CreatureAI::me, MotionMaster::MovePoint(), Creature::SetWalk(), and SMART_ESCORT_LAST_OOC_POINT.
Referenced by EnterEvadeMode().
|
inline |
References mCanAutoAttack.
|
inline |
void SmartAI::SetCombatMove | ( | bool | on, |
float | chaseRange = 0.0f |
||
) |
References Unit::CastStop(), CHASE_MOTION_TYPE, MotionMaster::Clear(), MotionMaster::GetCurrentMovementGeneratorType(), Unit::GetMotionMaster(), Unit::GetVictim(), HasEscortState(), IDLE_MOTION_TYPE, IsAIControlled(), mCanCombatMove, CreatureAI::me, MotionMaster::MoveChase(), MotionMaster::MoveIdle(), mRun, SetRun(), SMART_ESCORT_ESCORTING, and Unit::StopMoving().
void SmartAI::SetData | ( | uint32 | id, |
uint32 | value, | ||
WorldObject * | invoker | ||
) |
References GetScript(), SmartScript::ProcessEventsFor(), SMART_EVENT_DATA_SET, Object::ToGameObject(), and Object::ToUnit().
|
inline |
References mDespawnState, and mDespawnTime.
Referenced by StopFollow(), and StopPath().
void SmartAI::SetEvadeDisabled | ( | bool | disable = true | ) |
References mEvadeDisabled.
void SmartAI::SetFly | ( | bool | fly = true | ) |
References CreatureAI::me, and Creature::SetCanFly().
void SmartAI::SetFollow | ( | Unit * | target, |
float | dist = 0.0f , |
||
float | angle = 0.0f , |
||
uint32 | credit = 0 , |
||
uint32 | end = 0 , |
||
uint32 | creditType = 0 , |
||
bool | aliveState = true |
||
) |
References Object::GetGUID(), Unit::GetMotionMaster(), CreatureAI::me, mFollowAngle, mFollowArrivedAlive, mFollowArrivedEntry, mFollowArrivedTimer, mFollowCredit, mFollowCreditType, mFollowDist, mFollowGuid, MotionMaster::MoveFollow(), mRun, SetRun(), and StopFollow().
|
overridevirtual |
Reimplemented from UnitAI.
|
inline |
References mInvincibilityHpLevel.
Referenced by SmartScript::ProcessAction().
void SmartAI::SetRun | ( | bool | run = true | ) |
References CreatureAI::me, mRun, and Creature::SetWalk().
Referenced by AttackStart(), EnterEvadeMode(), MovepointReached(), PausePath(), ResumePath(), SetCombatMove(), SetFollow(), StartPath(), and UpdatePath().
void SmartAI::SetScript9 | ( | SmartScriptHolder & | e, |
uint32 | entry, | ||
WorldObject * | invoker | ||
) |
References Object::GetGUID(), GetScript(), SmartScript::mLastInvoker, and SmartScript::SetScript9().
void SmartAI::SetSwim | ( | bool | swim = true | ) |
References CreatureAI::me, and Creature::SetSwim().
|
inline |
References mWPPauseTimer.
|
overridevirtual |
Reimplemented from UnitAI.
References GetScript(), SmartScript::ProcessEventsFor(), and SMART_EVENT_GOSSIP_HELLO.
Reimplemented from UnitAI.
Reimplemented in npc_stable_master::npc_stable_masterAI.
References GetScript(), SmartScript::ProcessEventsFor(), and SMART_EVENT_GOSSIP_SELECT.
Referenced by npc_stable_master::npc_stable_masterAI::sGossipSelect().
|
overridevirtual |
Reimplemented from UnitAI.
|
overridevirtual |
Reimplemented from UnitAI.
References GetScript(), SmartScript::ProcessEventsFor(), SMART_EVENT_GAME_EVENT_END, and SMART_EVENT_GAME_EVENT_START.
Reimplemented from CreatureAI.
References GetScript(), SmartScript::ProcessEventsFor(), and SMART_EVENT_SPELLHIT.
Reimplemented from CreatureAI.
References GetScript(), SmartScript::ProcessEventsFor(), and SMART_EVENT_SPELLHIT_TARGET.
Reimplemented from UnitAI.
References Quest::GetQuestId(), GetScript(), SmartScript::ProcessEventsFor(), and SMART_EVENT_ACCEPTED_QUEST.
Reimplemented from UnitAI.
References Quest::GetQuestId(), GetScript(), SmartScript::ProcessEventsFor(), and SMART_EVENT_REWARD_QUEST.
|
inline |
void SmartAI::StartPath | ( | bool | run = false , |
uint32 | path = 0 , |
||
bool | repeat = false , |
||
Unit * | invoker = nullptr |
||
) |
References AddEscortState(), GenerateWayPointArray(), Unit::GetMotionMaster(), GetNextWayPoint(), Unit::GetNpcFlags(), GetScript(), HasEscortState(), Object::IsPlayer(), LoadPath(), mCanRepeatPath, CreatureAI::me, mEscortNPCFlags, MotionMaster::MoveSplinePath(), mWayPoints, SmartScript::ProcessEventsFor(), Unit::ReplaceAllNpcFlags(), SetRun(), SMART_ESCORT_ESCORTING, SMART_EVENT_WAYPOINT_START, StopPath(), and UNIT_NPC_FLAG_NONE.
Referenced by EndPath(), and OnCharmed().
void SmartAI::StopFollow | ( | bool | complete | ) |
References ObjectGuid::Clear(), MotionMaster::Clear(), Unit::GetMotionMaster(), ObjectAccessor::GetPlayer(), GetScript(), Player::GroupEventHappens(), CreatureAI::me, mFollowAngle, mFollowArrivedEntry, mFollowArrivedTimer, mFollowCredit, mFollowCreditType, mFollowDist, mFollowGuid, MotionMaster::MoveIdle(), SmartScript::ProcessEventsFor(), Player::RewardPlayerAndGroupAtEvent(), SetDespawnTime(), SMART_EVENT_FOLLOW_COMPLETED, StartDespawn(), and Unit::StopMoving().
Referenced by SetFollow(), and UpdateAI().
References EndPath(), ESCORT_MOTION_TYPE, Unit::GetMotionMaster(), MotionMaster::GetMotionSlotType(), GetScript(), HasEscortState(), mCurrentWPID, CreatureAI::me, mEscortQuestID, MOTION_SLOT_ACTIVE, MotionMaster::MoveIdle(), MotionMaster::MovementExpired(), SmartScript::ProcessEventsFor(), SetDespawnTime(), SMART_ESCORT_ESCORTING, SMART_EVENT_WAYPOINT_STOPPED, and Unit::StopMoving().
Referenced by StartPath(), and UpdatePath().
|
overridevirtual |
Reimplemented from CreatureAI.
References Object::GetGUID(), GetScript(), SmartScript::ProcessEventsFor(), SmartScript::RemoveCreatureSummon(), and SMART_EVENT_SUMMON_DESPAWNED.
Reimplemented from CreatureAI.
References GetScript(), SmartScript::ProcessEventsFor(), and SMART_EVENT_SUMMONED_UNIT_DIES.
|
overridevirtual |
Reimplemented from CreatureAI.
References GetScript(), SmartScript::ProcessEventsFor(), and SMART_EVENT_SUMMONED_UNIT_EVADE.
|
overridevirtual |
Use to start attacking a target. Called just before JustEngagedWith()
Implements UnitAI.
References CheckConditions(), UnitAI::DoMeleeAttackIfReady(), WorldObject::FindNearestCreature(), Unit::GetCharmInfo(), GetScript(), INTERACTION_DISTANCE, IsAIControlled(), mCanAutoAttack, CreatureAI::me, mFollowArrivedAlive, mFollowArrivedEntry, mFollowArrivedTimer, mFollowGuid, SmartScript::OnUpdate(), StopFollow(), UpdateDespawn(), UpdatePath(), and CreatureAI::UpdateVictim().
|
private |
References Creature::DespawnOrUnsummon(), mDespawnState, mDespawnTime, CreatureAI::me, and Unit::SetVisible().
Referenced by UpdateAI().
|
private |
References Creature::DespawnOrUnsummon(), EndPath(), Movement::MoveSpline::Finalized(), GetNextWayPoint(), GetScript(), Unit::GetVictim(), GetWPCount(), HasEscortState(), Unit::HasUnitState(), IsEscortInvokerInRange(), Unit::IsInCombat(), mCurrentWPID, CreatureAI::me, mEscortInvokerCheckTimer, mEscortQuestID, mForcedPaused, mOOCReached, Unit::movespline, mRun, mWPPauseTimer, mWPReached, SmartScript::ProcessEventsFor(), RemoveEscortState(), ResumePath(), SetRun(), SMART_ESCORT_ESCORTING, SMART_ESCORT_PAUSED, SMART_ESCORT_RETURNING, SMART_EVENT_DEATH, SMART_EVENT_WAYPOINT_RESUMED, StopPath(), and UNIT_STATE_NOT_MOVE.
Referenced by UpdateAI().
|
private |
Referenced by CheckConditions(), and SmartAI().
|
private |
Referenced by CheckConditions(), and SmartAI().
|
private |
Referenced by AttackStart(), SetAutoAttack(), SmartAI(), and UpdateAI().
|
private |
Referenced by AttackStart(), CanCombatMove(), MoveAway(), SetCombatMove(), and SmartAI().
|
private |
Referenced by EndPath(), OnCharmed(), SmartAI(), and StartPath().
|
private |
Referenced by CanRespawn(), SetCanRespawn(), and SmartAI().
|
private |
Referenced by EndPath(), GenerateWayPointArray(), GetNextWayPoint(), MovepointReached(), PausePath(), SmartAI(), StopPath(), and UpdatePath().
|
private |
Referenced by EndPath(), JustRespawned(), SetDespawnTime(), SmartAI(), StartDespawn(), and UpdateDespawn().
|
private |
Referenced by JustRespawned(), SetDespawnTime(), SmartAI(), and UpdateDespawn().
|
private |
Referenced by SmartAI(), and UpdatePath().
|
private |
Referenced by EndPath(), SmartAI(), and StartPath().
uint32 SmartAI::mEscortQuestID |
Referenced by EndPath(), SmartAI(), StopPath(), and UpdatePath().
|
private |
Referenced by AddEscortState(), HasEscortState(), IsEscorted(), JustRespawned(), RemoveEscortState(), and SmartAI().
|
private |
Referenced by EnterEvadeMode(), SetEvadeDisabled(), and SmartAI().
|
private |
Referenced by EnterEvadeMode(), JustRespawned(), SetFollow(), SmartAI(), and StopFollow().
|
private |
Referenced by JustRespawned(), SetFollow(), SmartAI(), and UpdateAI().
|
private |
Referenced by JustRespawned(), SetFollow(), SmartAI(), StopFollow(), and UpdateAI().
|
private |
Referenced by JustRespawned(), SetFollow(), SmartAI(), StopFollow(), and UpdateAI().
|
private |
Referenced by JustRespawned(), SetFollow(), SmartAI(), and StopFollow().
|
private |
Referenced by JustRespawned(), SetFollow(), SmartAI(), and StopFollow().
|
private |
Referenced by EnterEvadeMode(), JustRespawned(), SetFollow(), SmartAI(), and StopFollow().
|
private |
Referenced by EnterEvadeMode(), JustRespawned(), SetFollow(), StopFollow(), and UpdateAI().
|
private |
Referenced by PausePath(), SmartAI(), and UpdatePath().
|
private |
Referenced by DamageTaken(), SetInvincibilityHpLevel(), and SmartAI().
|
private |
Referenced by IsAIControlled(), OnCharmed(), and SmartAI().
|
private |
Referenced by InitializeAI(), JustReachedHome(), JustRespawned(), and SmartAI().
|
private |
Referenced by EndPath(), GetNextWayPoint(), MovepointReached(), ResumePath(), and SmartAI().
|
private |
Referenced by MovepointReached(), SmartAI(), and UpdatePath().
|
private |
Referenced by AttackStart(), EndPath(), EnterEvadeMode(), MovepointReached(), OnCharmed(), PausePath(), ResumePath(), SetCombatMove(), SetFollow(), SetRun(), SmartAI(), and UpdatePath().
|
private |
Referenced by GetScript().
|
private |
Referenced by EndPath(), GenerateWayPointArray(), GetNextWayPoint(), GetWPCount(), LoadPath(), PausePath(), SmartAI(), and StartPath().
|
private |
Referenced by EndPath(), PausePath(), SetWPPauseTimer(), SmartAI(), and UpdatePath().
|
private |
Referenced by MovepointReached(), PausePath(), SmartAI(), and UpdatePath().