summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-11-15 13:28:43 +0300
committerAndrei Karas <akaras@inbox.ru>2014-11-15 13:29:41 +0300
commit8fe6b497e0bce5999973321fbde89ff080647c8b (patch)
tree1c43748e06994dc83e3026d293192aa94cbf4036 /src/map
parent8b0242f57a9e1f335ebe20745253e8b0e4e501f1 (diff)
downloadevol-hercules-8fe6b497e0bce5999973321fbde89ff080647c8b.tar.gz
evol-hercules-8fe6b497e0bce5999973321fbde89ff080647c8b.tar.bz2
evol-hercules-8fe6b497e0bce5999973321fbde89ff080647c8b.tar.xz
evol-hercules-8fe6b497e0bce5999973321fbde89ff080647c8b.zip
map: add functions to send npc command.
Diffstat (limited to 'src/map')
-rw-r--r--src/map/send.c48
-rw-r--r--src/map/send.h10
2 files changed, 58 insertions, 0 deletions
diff --git a/src/map/send.c b/src/map/send.c
new file mode 100644
index 0000000..9218a21
--- /dev/null
+++ b/src/map/send.c
@@ -0,0 +1,48 @@
+// Copyright (c) Copyright (c) Hercules Dev Team, licensed under GNU GPL.
+// Copyright (c) 2014 Evol developers
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "../../../common/HPMi.h"
+#include "../../../common/malloc.h"
+#include "../../../common/mmo.h"
+#include "../../../common/socket.h"
+#include "../../../common/strlib.h"
+#include "../../../map/pc.h"
+
+#include "map/send.h"
+
+void send_npccommand (struct map_session_data *sd, int npcId, int cmd)
+{
+ if (!sd)
+ return;
+
+ int fd = sd->fd;
+ WFIFOHEAD (fd, 16);
+ WFIFOW (fd, 0) = 0xB00;
+ WFIFOL (fd, 2) = npcId;
+ WFIFOW (fd, 6) = cmd;
+ WFIFOL (fd, 8) = 0;
+ WFIFOW (fd, 12) = 0;
+ WFIFOW (fd, 14) = 0;
+ WFIFOSET (fd, 16);
+}
+
+// 0 - get client lang
+void send_npccommand2 (struct map_session_data *sd, int npcId, int cmd, int id, int x, int y)
+{
+ if (!sd)
+ return;
+
+ int fd = sd->fd;
+ WFIFOHEAD (fd, 16);
+ WFIFOW (fd, 0) = 0xB00;
+ WFIFOL (fd, 2) = npcId;
+ WFIFOW (fd, 6) = cmd;
+ WFIFOL (fd, 8) = id;
+ WFIFOW (fd, 12) = x;
+ WFIFOW (fd, 14) = y;
+ WFIFOSET (fd, 16);
+}
diff --git a/src/map/send.h b/src/map/send.h
new file mode 100644
index 0000000..6a324b9
--- /dev/null
+++ b/src/map/send.h
@@ -0,0 +1,10 @@
+// Copyright (c) Copyright (c) Hercules Dev Team, licensed under GNU GPL.
+// Copyright (c) 2014 Evol developers
+
+#ifndef EVOL_MAP_PC
+#define EVOL_MAP_PC
+
+void send_npccommand (struct map_session_data *sd, int npcId, int cmd);
+void send_npccommand2 (struct map_session_data *sd, int npcId, int cmd, int id, int x, int y);
+
+#endif // EVOL_MAP_PC