merge in
https://github.com/HerculesWS/Hercules/commit/19d83e65e83887a9f15353e626eaab57d7f86a74
finally ...
erm, I just saw messagecolor script command
wait wait ... not finish yet ...
hmm impossible, it require player to refresh the client
#include <stdio.h>#include <stdlib.h>#include <string.h>#include "map/pc.h"#include "map/script.h"#include "common/HPMi.h"#include "common/socket.h"#include "common/strlib.h"#include "common/HPMDataCheck.h"HPExport struct hplugin_info pinfo = { "messagecolor", SERVER_TYPE_MAP, "0.1", HPM_VERSION,};BUILDIN(messagecolor) { TBL_PC *sd = NULL; if (script_isstringtype(st,2)) sd = script->nick2sd(st, script_getstr(st,2)); else sd = script->id2sd(st, script_getnum(st,2)); if ( sd ) { const char *message = script_getstr(st,3); unsigned short msg_len = strlen( message ) +1; int color = script_getnum(st,4); WFIFOHEAD( sd->fd, msg_len + 12 ); WFIFOW( sd->fd, 0 ) = 0x2C1; WFIFOW( sd->fd, 2 ) = msg_len + 12; WFIFOL( sd->fd, 4 ) = sd->bl.id; WFIFOL( sd->fd, 8 ) = RGB2BGR(color); safestrncpy( (char*)WFIFOP( sd->fd,12 ), message, msg_len ); WFIFOL( sd->fd, 4 ) = -sd->bl.id; WFIFOSET( sd->fd, msg_len + 12 ); } return true;}HPExport void plugin_init (void) { addScriptCommand( "messagecolor", "vsi", messagecolor );}looks doesn't work ?
Code:
prontera,159,185,5 script kjdsfkshfs 1_F_MARIA,{ messagecolor getcharid(3), "test yellow", C_YELLOW; end;}
try @fontcolor bluethen type something
click on the npc again, then it shows up
the
sd->fontcolor_tid seems to have something to do it here