28#define FLIGHT_TRAVEL_UPDATE 100
29#define TIMEDIFF_NEXT_WP 250
30#define SKIP_SPLINE_POINT_DISTANCE_SQ (40.f * 40.f)
31#define PLAYER_FLIGHT_SPEED 32.0f
65 bool returnValue =
DoReset(owner);
80 if (currentNodeId == end)
82 TC_LOG_DEBUG(
"movement.flightpath",
"FlightPathMovementGenerator::DoReset: trying to start a flypath from the end point. {}", owner->
GetDebugInfo());
89 for (
uint32 i = currentNodeId; i != end; ++i)
91 G3D::Vector3 vertice(
_path[i]->Loc.X,
_path[i]->Loc.Y,
_path[i]->Loc.Z);
92 init.
Path().push_back(vertice);
110 bool departureEvent =
true;
134 departureEvent = !departureEvent;
188 if (
_path[itr]->ContinentID != curMapId)
205 for (
uint32 src = 0, dst = 1; dst < taxi.size(); src = dst++)
208 sObjectMgr->GetTaxiPath(taxi[src], taxi[dst], path, cost);
217 bool passedPreviousSegmentProximityCheck =
false;
218 for (
uint32 i = 0; i < nodes.size(); ++i)
225 passedPreviousSegmentProximityCheck =
true;
226 _path.push_back(nodes[i]);
249 if (
_path[i]->ContinentID != map0)
263 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());
275 ASSERT(nodeCount,
"FlightPathMovementGenerator::InitEndGridInfo() called with empty _path");
297 TC_LOG_DEBUG(
"movement.flightpath",
"FlightPathMovementGenerator::PreloadEndGrid: unable to determine map to preload flightmaster grid");
302 if (index >=
_path.size())
305 return _path[index]->PathID;
310 std::stringstream sstr;
311 sstr << std::boolalpha
315 <<
" Path Size: " <<
_path.size()
@ ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_TRAVELLING
TaxiPathNodesByPath sTaxiPathNodesByPath
DBCStorage< TaxiNodesEntry > sTaxiNodesStore(TaxiNodesEntryfmt)
std::vector< TaxiPathNodeEntry const * > TaxiPathNodeList
#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
ScriptMapMap sEventScripts
@ PLAYER_FLAGS_TAXI_BENCHMARK
@ UNIT_FLAG_REMOVE_CLIENT_CONTROL
uint32 GetPathAtMapEnd() const
float _endGridY
X coord of last node location.
bool DoUpdate(Player *, uint32)
bool GetResetPosition(Unit *owner, float &x, float &y, float &z) override
FlightPathMovementGenerator(uint32 startNode=0)
uint32 _preloadTargetNode
map Id of last node location
std::string GetDebugInfo() const override
void DoDeactivate(Player *)
void DoEventIfAny(Player *owner, TaxiPathNodeEntry const *node, bool departure)
void DoFinalize(Player *, bool, bool)
MovementGeneratorType GetMovementGeneratorType() const override
void SetCurrentNodeAfterTeleport()
std::deque< TaxiNodeChangeInfo > _pointsForPathSwitch
bool DoInitialize(Player *)
uint32 _endMapId
Y coord of last node location.
uint32 GetPathId(size_t index) const
void LoadPath(Player *owner)
void ScriptsStart(std::map< uint32, std::multimap< uint32, ScriptInfo > > const &scripts, uint32 id, Object *source, Object *target)
Put scripts in the execution queue.
void LoadGrid(float x, float y)
void AddFlag(uint16 const flag)
void RemoveFlag(uint16 const flag)
virtual std::string GetDebugInfo() const
void SetFirstPointId(int32 pointId)
void SetVelocity(float velocity)
int32 currentPathIdx() const
void RemoveFlag(uint16 index, uint32 oldFlag)
virtual std::string GetDebugInfo() const
uint32 GetCurrentNode() const
std::deque< uint32 > const & GetPath() const
FactionTemplateEntry const * GetFlightMasterFactionTemplate() const
uint32 NextTaxiDestination()
uint32 GetTaxiDestination() const
void ClearTaxiDestinations()
void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1=0, uint32 miscValue2=0, WorldObject *ref=nullptr)
bool ModifyMoney(int32 amount, bool sendError=true)
float GetReputationPriceDiscount(Creature const *creature) const
void SetFallInformation(uint32 time, float z)
bool TeleportTo(uint32 mapid, float x, float y, float z, float orientation, uint32 options=0)
std::string GetDebugInfo() const override
Movement::MoveSpline * movespline
void StopMoving(bool force=false)
void SetUnitFlag(UnitFlags flags)
void RemoveUnitFlag(UnitFlags flags)
void CombatStopWithPets(bool includingCast=false)
std::string const & GetName() const
float GetPositionZ() const
float GetOrientation() const
float GetPositionX() const
float GetPositionY() const