65 {
67 {
69 return true;
70 }
71
73
74
77 if (!player || !target)
78 {
80 return true;
81 }
82
83 bool useStraightPath = false;
84 bool useRaycast = false;
85 if (param)
86 {
87 auto paramValue = param.value();
88 if (paramValue.starts_with("true"))
89 {
90 useStraightPath = true;
91 }
92
93 if (paramValue.starts_with("line") || paramValue.starts_with("ray") || paramValue.starts_with("raycast"))
94 {
95 useRaycast = true;
96 }
97 }
98
99
100 float x, y, z;
102
103
105 path.SetUseStraightPath(useStraightPath);
106 path.SetUseRaycast(useRaycast);
107 bool result = path.CalculatePath(x, y, z, false);
108
111 handler->
PSendSysMessage(
"Building: %s", useStraightPath ?
"StraightPath" : useRaycast ?
"Raycast" :
"SmoothPath");
113
114 G3D::Vector3 const& start = path.GetStartPosition();
115 G3D::Vector3 const& end = path.GetEndPosition();
116 G3D::Vector3 const& actualEnd = path.GetActualEndPosition();
117
118 handler->
PSendSysMessage(
"StartPosition (%.3f, %.3f, %.3f)", start.x, start.y, start.z);
119 handler->
PSendSysMessage(
"EndPosition (%.3f, %.3f, %.3f)", end.x, end.y, end.z);
120 handler->
PSendSysMessage(
"ActualEndPosition (%.3f, %.3f, %.3f)", actualEnd.x, actualEnd.y, actualEnd.z);
121
124
125 for (auto i : pointPath)
127
128 return true;
129 }
@ TEMPSUMMON_TIMED_DESPAWN
Definition: Object.h:44
#define VISUAL_WAYPOINT
Definition: MotionMaster.h:32
std::string StringFormatFmt(std::string_view fmt, Args &&... args)
Definition: StringFormat.h:44
std::vector< Vector3 > PointsArray
Definition: MoveSplineInitArgs.h:28
Unit * getSelectedUnit() const
Definition: Chat.cpp:313
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:2318
std::string const & GetName() const
Definition: Object.h:446
bool IsGameMaster() const
Definition: Player.h:1136
Definition: PathGenerator.h:60