diff options
author | Andrei Karas <akaras@inbox.ru> | 2018-11-27 05:40:22 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2018-12-12 21:18:06 +0300 |
commit | eaeebdc9ddaa62488a58885c6a20b43d67e43d4a (patch) | |
tree | 7cf6150c1685d087d9fcfdbccd75de477264bf46 /src/map/script.c | |
parent | 5c29241d2d4bc43184faeedd7c1ffe3af8753fc9 (diff) | |
download | hercules-eaeebdc9ddaa62488a58885c6a20b43d67e43d4a.tar.gz hercules-eaeebdc9ddaa62488a58885c6a20b43d67e43d4a.tar.bz2 hercules-eaeebdc9ddaa62488a58885c6a20b43d67e43d4a.tar.xz hercules-eaeebdc9ddaa62488a58885c6a20b43d67e43d4a.zip |
Add script command servicemessage.
This command will show colored message in chat. This message will
be not logged to file and will be not visible over head.
Diffstat (limited to 'src/map/script.c')
-rw-r--r-- | src/map/script.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/map/script.c b/src/map/script.c index 4760fd4a0..52c0cf75c 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -15678,6 +15678,29 @@ static BUILDIN(message) return true; } +static BUILDIN(servicemessage) +{ + struct map_session_data *sd = NULL; + + if (script_hasdata(st, 4)) { + if (script_isstringtype(st, 4)) + sd = script->nick2sd(st, script_getstr(st, 4)); + else + sd = script->id2sd(st, script_getnum(st, 4)); + } else { + sd = script->rid2sd(st); + } + + if (sd == NULL) + return true; + + const char *message = script_getstr(st, 2); + const int color = script_getnum(st, 3); + clif->serviceMessageColor(sd, color, message); + + return true; +} + /*========================================== * npctalk (sends message to surrounding area) * usage: npctalk("<message>"{, "<npc name>"{, <show_name>}}); @@ -25244,6 +25267,7 @@ static void script_parse_builtin(void) BUILDIN_DEF2(atcommand,"charcommand","s"), // [MouseJstr] BUILDIN_DEF(movenpc,"sii?"), // [MouseJstr] BUILDIN_DEF(message,"vs"), // [MouseJstr] + BUILDIN_DEF(servicemessage, "si?"), BUILDIN_DEF(npctalk,"s??"), // [Valaris][Murilo BiO] BUILDIN_DEF(mobcount,"ss"), BUILDIN_DEF(getlook,"i"), |