40#if TRINITY_COMPILER == TRINITY_COMPILER_GNU
41#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
51 static std::vector<ChatCommand> wpCommandTable =
60 static std::vector<ChatCommand> commandTable =
90 char* path_number =
nullptr;
94 path_number = strtok((
char*)args,
" ");
108 uint32 maxpathid = result->Fetch()->GetInt32();
109 pathid = maxpathid+1;
114 pathid = atoi(path_number);
121 handler->
PSendSysMessage(
"%s%s|r",
"|cffff33ff",
"Current creature haven't loaded path.");
131 nodeId = (*result)[0].GetUInt32() + 1;
158 handler->
PSendSysMessage(
"%s%s%u%s%u%s|r",
"|cff00ff00",
"PathID: |r|cff00ffff", pathid,
"|r|cff00ff00: Waypoint |r|cff00ffff", nodeId,
"|r|cff00ff00 created. ");
168 char* path_number =
nullptr;
171 path_number = strtok((
char*)args,
" ");
190 handler->
PSendSysMessage(
"%s%s|r",
"|cffff33ff",
"You want to load path to a waypoint? Aren't you?");
195 pathid = atoi(path_number);
199 handler->
PSendSysMessage(
"%s%s|r",
"|cffff33ff",
"No valid path number provided.");
251 handler->
PSendSysMessage(
"%s%s|r|cff00ffff%u|r",
"|cff00ff00",
"Loading Path: ",
id);
263 handler->
PSendSysMessage(
"%s%s|r",
"|cff33ffff",
"You must select a target.");
270 handler->
PSendSysMessage(
"%s%s|r",
"|cffff33ff",
"Target is not saved to DB.");
275 if (!addon || addon->
PathId == 0)
277 handler->
PSendSysMessage(
"%s%s|r",
"|cffff33ff",
"Target does not have a loaded path.");
306 char* show_str = strtok((
char*)args,
" ");
312 std::string show = show_str;
322 handler->
SendSysMessage(
"|cffff33ffERROR: You must select a waypoint.|r");
329 handler->
PSendSysMessage(
"|cff00ff00Path does not exist or target has no path|r");
337 handler->
PSendSysMessage(
"|cff00ff00Path does not exist or target has no path|r");
344 handler->
PSendSysMessage(
"|cff00ff00DEBUG: .wp modify del, PathId: |r|cff00ffff%u|r, NodeId: |r|cff00ffff%u|r", path->
Id, node->
Id);
356 else if (show ==
"move")
358 handler->
PSendSysMessage(
"|cff00ff00DEBUG: .wp move, PathId: |r|cff00ffff%u|r, NodeId: |r|cff00ffff%u|r", path->
Id, node->
Id);
379 char* show_str = strtok((
char*)args,
" ");
384 char* guid_str = strtok((
char*)
nullptr,
" ");
412 pathid = Trinity::StringTo<uint32>(guid_str).value_or(0);
415 std::string show = show_str;
432 handler->
PSendSysMessage(
"|cff00ff00Path does not exist or target has no path|r");
440 handler->
PSendSysMessage(
"|cff00ff00Path does not exist or target has no path|r");
446 handler->
PSendSysMessage(
"|cff00ff00Show info: Path Id: |r|cff00ffff%u|r", path->
Id);
449 handler->
PSendSysMessage(
"|cff00ff00Show info: Node Id: |r|cff00ffff%u|r", node->
Id);
450 handler->
PSendSysMessage(
"|cff00ff00Show info: Node Delay: |r|cff00ffff%u|r", node->
Id);
454 else if (show ==
"on")
459 handler->
PSendSysMessage(
"|cff00ff00Path does not exist: id %u|r", pathid);
463 if (path->
Nodes.empty())
465 handler->
PSendSysMessage(
"|cff00ff00Path does not have any nodes: id %u|r", pathid);
478 handler->
SendSysMessage(
"|cff00ff00Path with id %u is already showing.|r", pathid);
482 handler->
SendSysMessage(
"|cff00ff00Showing path with id %u.|r", pathid);
485 else if (show ==
"off")
490 handler->
PSendSysMessage(
"|cff00ff00Path does not exist: id %u|r", pathid);
500 handler->
PSendSysMessage(
"|cffff33ffDEBUG: .wp show - no valid command found|r");
std::shared_ptr< PreparedResultSet > PreparedQueryResult
DatabaseWorkerPool< WorldDatabaseConnection > WorldDatabase
Accessor to the world database.
@ LANG_WAYPOINT_CREATSELECTED
@ LANG_WAYPOINT_VP_ALLREMOVED
@ LANG_WAYPOINT_VP_SELECT
std::optional< T > Optional
Optional helper class to wrap optional values within.
Role Based Access Control related classes definition.
constexpr std::underlying_type< E >::type AsUnderlyingType(E enumValue)
@ WORLD_INS_CREATURE_ADDON
@ WORLD_SEL_CREATURE_ADDON_BY_GUID
@ WORLD_INS_WAYPOINT_PATH_NODE
@ WORLD_UPD_CREATURE_MOVEMENT_TYPE
@ WORLD_UPD_CREATURE_ADDON_PATH
@ WORLD_DEL_CREATURE_ADDON
@ WORLD_SEL_WAYPOINT_PATH_NODE_MAX_NODEID
@ WORLD_SEL_WAYPOINT_PATH_NODE_MAX_PATHID
void PSendSysMessage(const char *fmt, Args &&... args)
Creature * getSelectedCreature()
void SetSentErrorMessage(bool val)
Player * GetPlayer() const
virtual void SendSysMessage(std::string_view str, bool escapeCharacters=false)
void UpdateCurrentWaypointInfo(uint32 nodeId, uint32 pathId)
uint32 GetWaypointPathId() const
ObjectGuid::LowType GetSpawnId() const
void SetDefaultMovementType(MovementGeneratorType mgt)
void LoadPath(uint32 pathid)
constexpr std::underlying_type_t< T > AsUnderlyingType() const
static ObjectGuid GetGUID(Object const *o)
void setFloat(const uint8 index, const float value)
void setUInt8(const uint8 index, const uint8 value)
void setUInt32(const uint8 index, const uint32 value)
void setUInt64(const uint8 index, const uint64 value)
virtual void Say(std::string_view text, Language language, WorldObject const *target=nullptr)
MotionMaster * GetMotionMaster()
uint32 GetDisplayId() const
static bool HandleWpShowCommand(ChatHandler *handler, char const *args)
static bool HandleWpAddCommand(ChatHandler *handler, char const *args)
static bool HandleWpUnLoadCommand(ChatHandler *handler, char const *)
static bool HandleWpLoadCommand(ChatHandler *handler, char const *args)
std::vector< ChatCommand > GetCommands() const override
static bool HandleWpModifyCommand(ChatHandler *handler, char const *args)
static bool HandleWpReloadCommand(ChatHandler *handler, char const *args)
void AddSC_wp_commandscript()
@ RBAC_PERM_COMMAND_WP_SHOW
@ RBAC_PERM_COMMAND_WP_MODIFY
@ RBAC_PERM_COMMAND_WP_UNLOAD
@ RBAC_PERM_COMMAND_WP_LOAD
@ RBAC_PERM_COMMAND_WP_ADD
@ RBAC_PERM_COMMAND_WP_RELOAD
constexpr float GetPositionX() const
constexpr float GetPositionY() const
constexpr void GetPosition(float &x, float &y) const
constexpr float GetOrientation() const
constexpr float GetPositionZ() const
std::vector< WaypointNode > Nodes
EnumFlag< WaypointPathFlags > Flags
WaypointMoveType MoveType