summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 7e4f6b825..749b3d068 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -18861,6 +18861,47 @@ void clif_selectcart(struct map_session_data *sd)
#endif
}
+/// Starts navigation to the given target on client side
+void clif_navigate_to(struct map_session_data *sd, const char* mapname, uint16 x, uint16 y, uint8 flag, bool hideWindow, uint16 mob_id)
+{
+#if PACKETVER >= 20111010
+ int fd;
+
+ nullpo_retv(sd);
+ nullpo_retv(mapname);
+ fd = sd->fd;
+ WFIFOHEAD(fd, 27);
+ WFIFOW(fd, 0) = 0x8e2;
+
+ // How detailed will our navigation be?
+ if (mob_id > 0) {
+ x = 0;
+ y = 0;
+ WFIFOB(fd, 2) = 3; // monster with destination field
+ } else if (x > 0 && y > 0) {
+ WFIFOB(fd, 2) = 0; // with coordinates
+ } else {
+ x = 0;
+ y = 0;
+ WFIFOB(fd, 2) = 1; // without coordinates(will fail if you are already on the map)
+ }
+
+ // Which services can be used for transportation?
+ WFIFOB(fd, 3) = flag;
+ // If this flag is set, the navigation window will not be opened up
+ WFIFOB(fd, 4) = hideWindow;
+ // Target map
+ safestrncpy((char*)WFIFOP(fd, 5), mapname, MAP_NAME_LENGTH_EXT);
+ // Target x
+ WFIFOW(fd, 21) = x;
+ // Target y
+ WFIFOW(fd, 23) = y;
+ // Target monster ID
+ WFIFOW(fd, 25) = mob_id;
+ WFIFOSET(fd, 27);
+#endif
+}
+
/**
* Returns the name of the given bl, in a client-friendly format.
*
@@ -19704,6 +19745,7 @@ void clif_defaults(void) {
clif->selectcart = clif_selectcart;
/* */
clif->isdisguised = clif_isdisguised;
+ clif->navigate_to = clif_navigate_to;
clif->bl_type = clif_bl_type;
/*------------------------