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
82 if (currentNodeId == end)
84 TC_LOG_DEBUG(
"movement.flightpath",
"FlightPathMovementGenerator::DoReset: trying to start a flypath from the end point. {}", owner->
GetDebugInfo());
91 for (
uint32 i = currentNodeId; i != end; ++i)
93 G3D::Vector3 vertice(
_path[i]->Loc.X,
_path[i]->Loc.Y,
_path[i]->Loc.Z);
94 init.
Path().push_back(vertice);
114 bool departureEvent =
true;
138 departureEvent = !departureEvent;
192 if (
_path[itr]->ContinentID != curMapId)
216 for (
uint32 src = 0, dst = 1; dst < taxi.size(); src = dst++)
219 sObjectMgr->GetTaxiPath(taxi[src], taxi[dst], path, cost);
228 bool passedPreviousSegmentProximityCheck =
false;
229 for (
uint32 i = 0; i < nodes.size(); ++i)
237 passedPreviousSegmentProximityCheck =
true;
238 _path.push_back(nodes[i]);
275 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());
287 ASSERT(nodeCount,
"FlightPathMovementGenerator::InitEndGridInfo() called with empty _path");
313 TC_LOG_DEBUG(
"movement.flightpath",
"FlightPathMovementGenerator::PreloadEndGrid: unable to determine map to preload flightmaster grid");
318 if (index >=
_path.size())
321 return _path[index]->PathID;
326 std::stringstream sstr;
327 sstr << std::boolalpha
331 <<
" 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__,...)
@ MOTION_PRIORITY_HIGHEST
@ MOVEMENTGENERATOR_FLAG_INITIALIZATION_PENDING
@ MOVEMENTGENERATOR_FLAG_DEACTIVATED
@ MOVEMENTGENERATOR_FLAG_FINALIZED
@ MOVEMENTGENERATOR_FLAG_INFORM_ENABLED
@ MOVEMENTGENERATOR_FLAG_INITIALIZED
@ 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
FlightPathMovementGenerator()
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
void LoadGrid(float x, float y)
void AddFlag(uint16 const flag)
void RemoveFlag(uint16 const flag)
virtual std::string GetDebugInfo() const
void SetWalk(bool enable)
void SetFirstPointId(int32 pointId)
void SetVelocity(float velocity)
std::vector< TaxiPathNodeEntry const * > _path
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)
bool TeleportTo(uint32 mapid, float x, float y, float z, float orientation, TeleportToOptions options=TELE_TO_NONE, Optional< uint32 > instanceId={})
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)
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