unfortunately ... hercules' clif->colormes is badly coded
if you really need it, you have to create another one ==> 'clif->colormes2'
src/map/clif.c | 15 +++++++++++++++ src/map/clif.h | 1 + 2 files changed, 16 insertions(+)diff --git a/src/map/clif.c b/src/map/clif.cindex d9acf07..146e7a3 100644--- a/src/map/clif.c+++ b/src/map/clif.c@@ -8385,6 +8385,20 @@ int clif_colormes(int fd, enum clif_colors color, const char* msg) { return 0; } +int clif_colormes2(int fd, unsigned int color, const char* msg) {+ size_t msg_len = strlen(msg) + 1;++ WFIFOHEAD(fd,msg_len + 12);+ WFIFOW(fd,0) = 0x2C1;+ WFIFOW(fd,2) = msg_len + 12;+ WFIFOL(fd,4) = 0;+ WFIFOL(fd,8) = (color & 0x0000FF) << 16 | (color & 0x00FF00) | (color & 0xFF0000) >> 16;;+ safestrncpy((char*)WFIFOP(fd,12), msg, msg_len);+ WFIFOSET(fd, msg_len + 12);++ return 0;+}+ /// Monster/NPC color chat [SnakeDrak] (ZC_NPC_CHAT). /// 02c1 <packet len>.W <id>.L <color>.L <message>.?B void clif_messagecolor(struct block_list* bl, unsigned int color, const char* msg) {@@ -18835,6 +18849,7 @@ void clif_defaults(void) { clif->messageln = clif_displaymessage2; clif->messages = clif_displaymessage_sprintf; clif->colormes = clif_colormes;+ clif->colormes2 = clif_colormes2; clif->process_message = clif_process_message; clif->wisexin = clif_wisexin; clif->wisall = clif_wisall;diff --git a/src/map/clif.h b/src/map/clif.hindex e4de51a..291997d 100644--- a/src/map/clif.h+++ b/src/map/clif.h@@ -817,6 +817,7 @@ struct clif_interface { /* message+s(printf) */ void (*messages) (const int fd, const char *mes, ...) __attribute__((format(printf, 2, 3))); int (*colormes) (int fd, enum clif_colors color, const char* msg);+ int (*colormes2) (int fd, unsigned int color, const char* msg); bool (*process_message) (struct map_session_data *sd, int format, char **name_, size_t *namelen_, char **message_, size_t *messagelen_); void (*wisexin) (struct map_session_data *sd,int type,int flag); void (*wisall) (struct map_session_data *sd,int type,int flag);then you can do as the format
Code:
clif->colormes2( sd->fd, <color code>, "<message>" );
example like
Code:
clif->colormes2( sd->fd, 0xFF0000, "Red Light" );