From 8fe6b497e0bce5999973321fbde89ff080647c8b Mon Sep 17 00:00:00 2001
From: Andrei Karas <akaras@inbox.ru>
Date: Sat, 15 Nov 2014 13:28:43 +0300
Subject: map: add functions to send npc command.

---
 src/map/send.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)
 create mode 100644 src/map/send.c

(limited to 'src/map/send.c')

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);
+}
-- 
cgit v1.2.3-70-g09d2