summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
authorL0ne_W0lf <L0ne_W0lf@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-03-24 03:49:39 +0000
committerL0ne_W0lf <L0ne_W0lf@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-03-24 03:49:39 +0000
commitfbb2cecd2f8fbdf6fa212f157fa7d946e6751a79 (patch)
treea5a22d9704b6ea61958094dd264e60a4d8b04bcd /src/map/clif.c
parentcd855784481681184a9ea7b161cd9ba60ae3c872 (diff)
downloadhercules-fbb2cecd2f8fbdf6fa212f157fa7d946e6751a79.tar.gz
hercules-fbb2cecd2f8fbdf6fa212f157fa7d946e6751a79.tar.bz2
hercules-fbb2cecd2f8fbdf6fa212f157fa7d946e6751a79.tar.xz
hercules-fbb2cecd2f8fbdf6fa212f157fa7d946e6751a79.zip
* Implemented NPC_TALK (Credit to SnakeDrak and Daegaladh)
- Also added in the ability to use '@npctalkc' as a GM command. - Added supporting information to the databases. - Sneaking in a fix to the Refined Ballista. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14270 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 1d8c2e752..7d14ac446 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -7381,6 +7381,29 @@ void clif_specialeffect_single(struct block_list* bl, int type, int fd)
WFIFOSET(fd,10);
}
+/******************************************************
+ * W.<packet> W.<LENGTH> L.<ID> L.<COLOR> S.<TEXT>
+ * Mob/NPC Color Talk [SnakeDrak]
+ ******************************************************/
+int clif_messagecolor(struct block_list* bl, unsigned long color, const char* msg)
+{
+ unsigned short msg_len = strlen(msg) + 1;
+ uint8 buf[256];
+ color = (color & 0x0000FF) << 16 | (color & 0x00FF00) | (color & 0xFF0000) >> 16; // RGB to BGR
+
+ nullpo_retr(0, bl);
+
+ WBUFW(buf,0) = 0x2C1;
+ WBUFW(buf,2) = msg_len + 12;
+ WBUFL(buf,4) = bl->id;
+ WBUFL(buf,8) = color;
+ memcpy(WBUFP(buf,12), msg, msg_len);
+
+ clif_send(buf, WBUFW(buf,2), bl, AREA_CHAT_WOC);
+
+ return 0;
+}
+
// messages (from mobs/npcs) [Valaris]
int clif_message(struct block_list* bl, const char* msg)
{