summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2019-04-25 22:16:29 +0300
committerAndrei Karas <akaras@inbox.ru>2019-05-05 22:24:25 +0300
commit884225977fed41c3ad24cbc0b446480de6fc3cd3 (patch)
treeee5f2ed56904da88e56594c4abe109d67f6af51c
parent3cde52381fe5ea8643e6b78393384df0cae696e1 (diff)
downloadhercules-884225977fed41c3ad24cbc0b446480de6fc3cd3.tar.gz
hercules-884225977fed41c3ad24cbc0b446480de6fc3cd3.tar.bz2
hercules-884225977fed41c3ad24cbc0b446480de6fc3cd3.tar.xz
hercules-884225977fed41c3ad24cbc0b446480de6fc3cd3.zip
Add script function for close roulette window
New script function: closeroulette()
-rw-r--r--doc/script_commands.txt7
-rw-r--r--src/map/script.c12
2 files changed, 19 insertions, 0 deletions
diff --git a/doc/script_commands.txt b/doc/script_commands.txt
index cc49a9c0f..4d8053da0 100644
--- a/doc/script_commands.txt
+++ b/doc/script_commands.txt
@@ -10456,3 +10456,10 @@ Invisible for players, because current implimentation using title id only.
Works for 20180207 main clients, 20171129 re clients, 20171130 zero clients
---------------------------------------
+
+*closeroulette()
+
+Force close roulette window.
+Works for 20141008 main clients, 20140903 re, any zero.
+
+---------------------------------------
diff --git a/src/map/script.c b/src/map/script.c
index 80489dfac..4fb24708b 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -25275,6 +25275,16 @@ static BUILDIN(getInventorySize)
return true;
}
+// force close roulette window if it opened
+static BUILDIN(closeroulette)
+{
+ struct map_session_data *sd = script_rid2sd(st);
+ if (sd == NULL)
+ return false;
+ clif->roulette_close(sd);
+ return true;
+}
+
/**
* Adds a built-in script function.
*
@@ -26026,6 +26036,8 @@ static void script_parse_builtin(void)
BUILDIN_DEF(expandInventoryResult, "i"),
BUILDIN_DEF(expandInventory, "i"),
BUILDIN_DEF(getInventorySize, ""),
+
+ BUILDIN_DEF(closeroulette, ""),
};
int i, len = ARRAYLENGTH(BUILDIN);
RECREATE(script->buildin, char *, script->buildin_count + len); // Pre-alloc to speed up