summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-08-23 20:55:41 +0300
committerAndrei Karas <akaras@inbox.ru>2018-08-23 20:55:41 +0300
commit27c7f333121f99ec13acf669db21fecd53b315ec (patch)
tree0c3b3b6df5973dc70ba4cb9db8055a4bc36ccce7 /src
parentdfd6225e667744753c7bfab94d87fcdbcf3fc93b (diff)
downloadhercules-27c7f333121f99ec13acf669db21fecd53b315ec.tar.gz
hercules-27c7f333121f99ec13acf669db21fecd53b315ec.tar.bz2
hercules-27c7f333121f99ec13acf669db21fecd53b315ec.tar.xz
hercules-27c7f333121f99ec13acf669db21fecd53b315ec.zip
Add script command msgtable and msgtable2.
New script commands: msgtable msgId [, color] msgtable2 msgId, param [, color]
Diffstat (limited to 'src')
-rw-r--r--src/map/script.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 846075c0e..61059b811 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -24655,6 +24655,44 @@ static BUILDIN(openstylist)
return true;
}
+static BUILDIN(msgtable)
+{
+ struct map_session_data *sd = script_rid2sd(st);
+ if (sd == NULL)
+ return false;
+
+ const enum clif_messages msgId = script_getnum(st, 2);
+ if (script_hasdata(st, 3)) {
+ clif->msgtable_color(sd, msgId, script_getnum(st, 3));
+ } else {
+ clif->msgtable(sd, msgId);
+ }
+
+ return true;
+}
+
+static BUILDIN(msgtable2)
+{
+ struct map_session_data *sd = script_rid2sd(st);
+ if (sd == NULL)
+ return false;
+
+ const enum clif_messages msgId = script_getnum(st, 2);
+ if (script_isstringtype(st, 3)) {
+ const char *value = script_getstr(st, 3);
+ if (script_hasdata(st, 4)) {
+ clif->msgtable_str_color(sd, msgId, value, script_getnum(st, 4));
+ } else {
+ clif->msgtable_str(sd, msgId, value);
+ }
+ } else {
+ const int value = script_getnum(st, 3);
+ clif->msgtable_num(sd, msgId, value);
+ }
+
+ return true;
+}
+
/**
* Adds a built-in script function.
*
@@ -25231,6 +25269,8 @@ static void script_parse_builtin(void)
BUILDIN_DEF(buyingstore,"i"),
BUILDIN_DEF(searchstores,"ii"),
BUILDIN_DEF(showdigit,"i?"),
+ BUILDIN_DEF(msgtable, "i?"),
+ BUILDIN_DEF(msgtable2, "iv?"),
// WoE SE
BUILDIN_DEF(agitstart2,""),
BUILDIN_DEF(agitend2,""),