UPDATED command:
Script.c:
find
/*========================================== * Displays a message for the player only (like system messages like "you got an apple" ) *------------------------------------------*/BUILDIN(dispbottom){ TBL_PC *sd=script->rid2sd(st); const char *message; message=script_getstr(st,2); if(sd) clif_disp_onlyself(sd,message,(int)strlen(message)); return true;}
put after
/*========================================== * Coloured DispBottom [By Dastgir] *------------------------------------------*/BUILDIN(dispbottom2){ TBL_PC *sd=script_rid2sd(st); const char *message; unsigned long color; message=script_getstr(st,3); color=strtoul(script_getstr(st,2),NULL,0); if(sd) clif->colormes_e(sd,color,message); return 0;}
then find
Code:
BUILDIN_DEF(dispbottom,"s"), //added from jA [Lupus]
put after
Code:
BUILDIN_DEF(dispbottom2,"ss"),
Clif.h:
find
int (*colormes) (int fd, enum clif_colors color, const char* msg);
put after
int (*colormes_e) (struct map_session_data * sd,unsigned long color1, const char* msg); //[By Dastgir]
Clif.c:
find
Code:
// Modification of clif_messagecolor to send colored messages to players to chat log only (doesn't display overhead)/// 02c1 <packet len>.W <id>.L <color>.L <message>.?Bint clif_colormes(int fd, enum clif_colors 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_table[color]; safestrncpy((char*)WFIFOP(fd,12), msg, msg_len); WFIFOSET(fd, msg_len + 12); return 0;}
put after
// [By Dastgir]int clif_colormes_e(struct map_session_data * sd,unsigned long color1, const char* msg) { unsigned short msg_len = strlen(msg) + 1; WFIFOHEAD(sd->fd,msg_len + 12); WFIFOW(sd->fd,0) = 0x2C1; WFIFOW(sd->fd,2) = msg_len + 12; WFIFOL(sd->fd,4) = 0; WFIFOL(sd->fd,8) = (color1&0x0000FF) << 16 | (color1&0x00FF00) | (color1&0xFF0000) >> 16; // RGB -> BGR safestrncpy((char*)WFIFOP(sd->fd,12), msg, msg_len); clif_send(WFIFOP(sd->fd,0), WFIFOW(sd->fd,2), &sd->bl, SELF); return 0;}
then find
clif->colormes = clif_colormes;
put after
clif->colormes_e = clif_colormes_e;
recompile and be happy. syntax is the same.
Code:
dispbottom2 "0x0000FF","Hello"; // Will send message Hello in blue to player