30#define FLIGHT_TRAVEL_UPDATE 100
31#define TIMEDIFF_NEXT_WP 250
32#define SKIP_SPLINE_POINT_DISTANCE_SQ (40.f * 40.f)
33#define PLAYER_FLIGHT_SPEED 32.0f
84 if (currentNodeId == end)
86 TC_LOG_DEBUG(
"movement.flightpath",
"FlightPathMovementGenerator::DoReset: trying to start a flypath from the end point. {}", owner->
GetDebugInfo());
91 init.
Path().reserve(end - currentNodeId + 1);
94 for (
uint32 i = currentNodeId; i != end; ++i)
115 bool departureEvent =
true;
139 departureEvent = !departureEvent;
196 if (
_path[itr]->ContinentID != curMapId)
220 for (
uint32 src = 0, dst = 1; dst < taxi.size(); src = dst++)
223 sObjectMgr->GetTaxiPath(taxi[src], taxi[dst], path, cost);
232 bool passedPreviousSegmentProximityCheck =
false;
233 for (
uint32 i = 0; i < nodes.size(); ++i)
241 passedPreviousSegmentProximityCheck =
true;
242 _path.push_back(nodes[i]);
279 TC_LOG_DEBUG(
"maps.script",
"FlightPathMovementGenerator::DoEventIfAny: taxi {} event {} of node {} of path {} for player {}", departure ?
"departure" :
"arrival", eventid, node->
NodeIndex, node->
PathID, owner->
GetName());
291 ASSERT(nodeCount,
"FlightPathMovementGenerator::InitEndGridInfo() called with empty _path");
317 TC_LOG_DEBUG(
"movement.flightpath",
"FlightPathMovementGenerator::PreloadEndGrid: unable to determine map to preload flightmaster grid");
322 if (index >=
_path.size())
325 return _path[index]->PathID;
330 std::stringstream sstr;
331 sstr << std::boolalpha
335 <<
" Path Size: " <<
_path.size()
DB2Storage< TaxiNodesEntry > sTaxiNodesStore("TaxiNodes.db2", &TaxiNodesLoadInfo::Instance)
TaxiPathNodesByPath sTaxiPathNodesByPath
DB2Storage< TaxiPathEntry > sTaxiPathStore("TaxiPath.db2", &TaxiPathLoadInfo::Instance)
std::vector< TaxiPathNodeEntry const * > TaxiPathNodeList
@ TAXI_PATH_NODE_FLAG_TELEPORT
@ TAXI_PATH_NODE_FLAG_STOP
#define PLAYER_FLIGHT_SPEED
bool IsNodeIncludedInShortenedPath(TaxiPathNodeEntry const *p1, TaxiPathNodeEntry const *p2)
#define SKIP_SPLINE_POINT_DISTANCE_SQ
#define TC_LOG_DEBUG(filterType__, message__,...)
@ MOTION_PRIORITY_HIGHEST
@ MOVEMENTGENERATOR_FLAG_INITIALIZATION_PENDING
@ MOVEMENTGENERATOR_FLAG_DEACTIVATED
@ MOVEMENTGENERATOR_FLAG_FINALIZED
@ MOVEMENTGENERATOR_FLAG_INFORM_ENABLED
@ MOVEMENTGENERATOR_FLAG_INITIALIZED
std::optional< T > Optional
Optional helper class to wrap optional values within.
@ PLAYER_FLAGS_TAXI_BENCHMARK
@ UNIT_FLAG_REMOVE_CLIENT_CONTROL
uint32 GetPathAtMapEnd() const
float _endGridY
Y coord of last node location.
bool DoUpdate(Player *, uint32)
bool GetResetPosition(Unit *owner, float &x, float &y, float &z) override
uint32 _preloadTargetNode
node index where preloading starts
std::string GetDebugInfo() const override
void DoInitialize(Player *)
void DoDeactivate(Player *)
void DoEventIfAny(Player *owner, TaxiPathNodeEntry const *node, bool departure)
void DoFinalize(Player *, bool, bool)
MovementGeneratorType GetMovementGeneratorType() const override
void SetCurrentNodeAfterTeleport()
void LoadPath(Player *owner, uint32 startNode=0)
void PreloadEndGrid(Player *owner)
float _endGridX
X coord of last node location.
std::deque< TaxiNodeChangeInfo > _pointsForPathSwitch
node indexes and costs where TaxiPath changes
uint32 _endMapId
map Id of last node location
uint32 GetPathId(size_t index) const
FlightPathMovementGenerator(Optional< float > speed, Optional< Scripting::v2::ActionResultSetter< MovementStopReason > > &&scriptResult)
void LoadGrid(float x, float y)
void SetScriptResult(MovementStopReason reason)
void AddFlag(uint16 const flag)
Optional< Scripting::v2::ActionResultSetter< MovementStopReason > > ScriptResult
void RemoveFlag(uint16 const flag)
virtual std::string GetDebugInfo() const
void SetWalk(bool enable)
void SetFirstPointId(int32 pointId)
void SetVelocity(float velocity)
virtual std::string GetDebugInfo() const
uint32 GetCurrentNode() const
std::deque< uint32 > const & GetPath() const
FactionTemplateEntry const * GetFlightMasterFactionTemplate() const
uint32 NextTaxiDestination()
void ClearTaxiDestinations()
bool ModifyMoney(int64 amount, bool sendError=true)
void RemovePlayerFlag(PlayerFlags flags)
float GetReputationPriceDiscount(Creature const *creature) const
void SetFallInformation(uint32 time, float z)
void UpdateCriteria(CriteriaType type, uint64 miscValue1=0, uint64 miscValue2=0, uint64 miscValue3=0, WorldObject *ref=nullptr)
bool TeleportTo(uint32 mapid, float x, float y, float z, float orientation, TeleportToOptions options=TELE_TO_NONE, Optional< uint32 > instanceId={}, uint32 teleportSpellId=0)
std::string GetDebugInfo() const override
std::unique_ptr< Movement::MoveSpline > movespline
void SetUnitFlag(UnitFlags flags)
void RemoveUnitFlag(UnitFlags flags)
void CombatStopWithPets(bool includingCast=false)
std::string const & GetName() const
TC_GAME_API void Trigger(uint32 gameEventId, WorldObject *source, WorldObject *target)
constexpr float GetPositionX() const
constexpr float GetPositionY() const
constexpr float GetOrientation() const
constexpr float GetPositionZ() const