63 {
65 {
67 return true;
68 }
69
71
72
75 if (!player || !target)
76 {
78 return true;
79 }
80
81 bool useStraightPath = false;
82 bool useRaycast = false;
83 if (param)
84 {
85 auto paramValue = param.value();
86 if (paramValue.starts_with("true"))
87 {
88 useStraightPath = true;
89 }
90
91 if (paramValue.starts_with("line") || paramValue.starts_with("ray") || paramValue.starts_with("raycast"))
92 {
93 useRaycast = true;
94 }
95 }
96
97
98 float x, y, z;
100
101
103 path.SetUseStraightPath(useStraightPath);
104 path.SetUseRaycast(useRaycast);
105 bool result = path.CalculatePath(x, y, z, false);
106
109 handler->
PSendSysMessage(
"Building: {}", useStraightPath ?
"StraightPath" : useRaycast ?
"Raycast" :
"SmoothPath");
110 handler->
PSendSysMessage(
"Result: {} - Length: {} - Type: {}", (result ?
"true" :
"false"), pointPath.size(), path.GetPathType());
111
112 G3D::Vector3 const& start = path.GetStartPosition();
113 G3D::Vector3 const& end = path.GetEndPosition();
114 G3D::Vector3 const& actualEnd = path.GetActualEndPosition();
115
116 handler->
PSendSysMessage(
"StartPosition ({}, {}, {})", start.x, start.y, start.z);
117 handler->
PSendSysMessage(
"EndPosition ({}, {}, {})", end.x, end.y, end.z);
118 handler->
PSendSysMessage(
"ActualEndPosition ({}, {}, {})", actualEnd.x, actualEnd.y, actualEnd.z);
119
122
123 for (auto i : pointPath)
125
126 return true;
127 }
#define VISUAL_WAYPOINT
Definition: MotionMaster.h:32
@ TEMPSUMMON_TIMED_DESPAWN
Definition: Object.h:47
std::vector< Vector3 > PointsArray
Definition: MoveSplineInitArgs.h:28
Unit * getSelectedUnit() const
Definition: Chat.cpp:388
TempSummon * SummonCreature(uint32 id, const Position &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0, SummonPropertiesEntry const *properties=nullptr, bool visibleBySummonerOnly=false) const
Definition: Object.cpp:2355
std::string const & GetName() const
Definition: Object.h:458
bool IsGameMaster() const
Definition: Player.h:1158
Definition: PathGenerator.h:60