![]() |
AzerothCore 3.3.5a
OpenSource WoW Emulator
|
#include "WaypointMovementGenerator.h"
Public Member Functions | |
| WaypointMovementGenerator (uint32 pathId=0, bool repeating=true, PathSource pathSource=PathSource::WAYPOINT_MGR) | |
| WaypointMovementGenerator (WaypointPath &path, bool repeating=true) | |
| ~WaypointMovementGenerator () | |
| void | DoInitialize (Creature *) |
| void | DoFinalize (Creature *) |
| void | DoReset (Creature *) |
| bool | DoUpdate (Creature *, uint32 diff) |
| void | unitSpeedChanged () override |
| void | Pause (uint32 timer=0) override |
| void | Resume (uint32 overrideTimer=0) override |
| bool | GetResetPosition (float &x, float &y, float &z) override |
| MovementGeneratorType | GetMovementGeneratorType () override |
Public Member Functions inherited from MovementGeneratorMedium< Creature, WaypointMovementGenerator< Creature > > | |
| void | Initialize (Unit *u) override |
| void | Finalize (Unit *u) override |
| void | Reset (Unit *u) override |
| bool | Update (Unit *u, uint32 time_diff) override |
Public Member Functions inherited from MovementGenerator | |
| virtual | ~MovementGenerator () |
| virtual uint32 | GetSplineId () const |
Public Member Functions inherited from PathMovementBase< T, P > | |
| PathMovementBase () | |
| PathMovementBase (P path) | |
| virtual | ~PathMovementBase () |
| uint32 | GetCurrentNode () const |
Private Member Functions | |
| void | ProcessWaypointArrival (Creature *, WaypointNode const &) |
| void | StartMove (Creature *, bool relaunch=false) |
| bool | IsAllowedToMove (Creature *) const |
| void | UpdateWaypointState (Creature *, WaypointNode const &) |
Private Attributes | |
| uint32 | _lastSplineId |
| uint32 | _pathId |
| int32 | _waypointDelay |
| std::optional< int32 > | _pauseTime |
| bool | _waypointReached |
| bool | _recalculateSpeed |
| bool | _repeating |
| bool | _loadedFromDB |
| bool | _stalled |
| bool | _hasBeenStalled |
| bool | _done |
| PathSource | _pathSource |
| bool | _smoothSplineLaunched |
| int32 | _lastPassedSplineIdx |
Additional Inherited Members | |
Protected Attributes inherited from PathMovementBase< T, P > | |
| P | i_path |
| uint32 | i_currentNode |
|
explicit |
|
explicit |
|
inline |
| void WaypointMovementGenerator< Creature >::DoFinalize | ( | Creature * | creature | ) |
References Unit::ClearUnitState(), UNIT_STATE_ROAMING, and UNIT_STATE_ROAMING_MOVE.
| void WaypointMovementGenerator< Creature >::DoInitialize | ( | Creature * | creature | ) |
References Unit::AddUnitState(), Creature::AI(), creatureData, Creature::GetCreatureData(), Object::GetGUID(), WorldObject::GetName(), Creature::GetWaypointPath(), LOG_ERROR, SMART_WAYPOINT_MGR, sSmartWaypointMgr, sWaypointMgr, ObjectGuid::ToString(), UNIT_STATE_ROAMING, UNIT_STATE_ROAMING_MOVE, Creature::UpdateCurrentWaypointInfo(), and WAYPOINT_MGR.
| void WaypointMovementGenerator< Creature >::DoReset | ( | Creature * | creature | ) |
References Unit::IsStopped(), and Unit::StopMoving().
| bool WaypointMovementGenerator< Creature >::DoUpdate | ( | Creature * | creature, |
| uint32 | diff | ||
| ) |
References Creature::AI(), Unit::ClearUnitState(), Movement::MoveSpline::currentPathIdx(), WaypointNode::Delay, WaypointNode::EventChance, WaypointNode::EventId, Movement::MoveSpline::Finalized(), Movement::MoveSpline::GetId(), WorldObject::GetMap(), Position::GetPosition(), Unit::GetTransGUID(), Unit::HasUnitMovementFlag(), WaypointNode::Id, Unit::IsAlive(), MOVEMENTFLAG_ONTRANSPORT, Unit::movespline, WaypointNode::Orientation, Map::ScriptsStart(), Unit::SetFacingTo(), Creature::SetHomePosition(), Unit::StopMoving(), sWaypointScripts, UNIT_STATE_ROAMING_MOVE, Creature::UpdateCurrentWaypointInfo(), UpdateHomePosition(), Creature::UpdateWaypointID(), urand(), and WAYPOINT_MOTION_TYPE.
|
inlineoverridevirtual |
|
overridevirtual |
Reimplemented from MovementGenerator.
References ASSERT, WaypointNode::X, WaypointNode::Y, and WaypointNode::Z.
|
private |
References Unit::HasUnitState(), Creature::IsMovementPreventedByCasting(), and UNIT_STATE_NOT_MOVE.
|
overridevirtual |
Reimplemented from MovementGenerator.
|
private |
References Creature::AI(), Unit::ClearUnitState(), WaypointNode::Delay, WaypointNode::EventChance, WaypointNode::EventId, Unit::GetCharmerOrOwner(), Object::GetGUID(), WorldObject::GetMap(), WaypointNode::Id, LOG_DEBUG, Map::ScriptsStart(), sWaypointScripts, ObjectGuid::ToString(), Unit::ToTempSummon(), UNIT_STATE_ROAMING_MOVE, Creature::UpdateCurrentWaypointInfo(), UpdateHomePosition(), Creature::UpdateWaypointID(), urand(), and WAYPOINT_MOTION_TYPE.
|
overridevirtual |
Reimplemented from MovementGenerator.
|
private |
If the creature is on transport, we assume waypoints set in DB are already transport offsets
References Unit::AddUnitState(), Creature::AI(), Creature::CanFly(), WaypointNode::Delay, Movement::MoveSplineInit::DisableTransportPathTransformations(), Movement::MoveSpline::FinalDestination(), Movement::MoveSpline::Finalized(), Movement::MoveSpline::GetId(), Position::GetPosition(), Unit::GetTransGUID(), Ground, Unit::HasUnitMovementFlag(), Hover, WaypointNode::Id, Unit::IsAlive(), Creature::IsFormationLeader(), Creature::IsFormationLeaderMoveAllowed(), Movement::MoveSplineInit::Launch(), MOVEMENTFLAG_ONTRANSPORT, Unit::movespline, Movement::MoveSplineInit::MoveTo(), WaypointNode::MoveType, WaypointNode::Orientation, Movement::MoveSplineInit::Path(), PositionToVector3(), Movement::MoveSplineInit::SetAnimation(), Movement::MoveSplineInit::SetFacing(), Movement::MoveSplineInit::SetFirstPointId(), Movement::MoveSplineInit::SetFly(), Movement::MoveSplineInit::SetSmooth(), Movement::MoveSplineInit::SetVelocity(), Movement::MoveSplineInit::SetWalk(), Creature::SignalFormationMovement(), WaypointNode::SmoothTransition, WaypointNode::SplinePoints, UNIT_STATE_ROAMING_MOVE, WaypointNode::Velocity, WAYPOINT_MOVE_TYPE_LAND, WAYPOINT_MOVE_TYPE_RUN, WAYPOINT_MOVE_TYPE_TAKEOFF, WAYPOINT_MOVE_TYPE_WALK, WaypointNode::X, WaypointNode::Y, and WaypointNode::Z.
|
inlineoverridevirtual |
Reimplemented from MovementGenerator.
|
private |
References Movement::MoveSpline::Finalized(), Movement::MoveSpline::GetId(), and Unit::movespline.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |