summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorAsheraf <acheraf1998@gmail.com>2017-12-09 01:13:36 +0000
committerAsheraf <acheraf1998@gmail.com>2017-12-11 13:54:19 +0000
commitea8dbdb04470859abe00eabc39990ee23adb398e (patch)
tree67ba090542d323a54e34bb02e344b64e486daffb /src/map/script.c
parent85b71be7fd1134de6b45f9510006b84dc39975ac (diff)
downloadhercules-ea8dbdb04470859abe00eabc39990ee23adb398e.tar.gz
hercules-ea8dbdb04470859abe00eabc39990ee23adb398e.tar.bz2
hercules-ea8dbdb04470859abe00eabc39990ee23adb398e.tar.xz
hercules-ea8dbdb04470859abe00eabc39990ee23adb398e.zip
Add support for packet ZC_PROGRESS_ACTOR
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 7f7aba183..44a819ec5 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -21570,7 +21570,29 @@ BUILDIN(progressbar)
clif->progressbar(sd, (unsigned int)strtoul(color, (char **)NULL, 0), second);
return true;
}
+BUILDIN(progressbar_unit)
+{
+ const char *color = script_getstr(st, 2);
+ uint32 second = script_getnum(st, 3);
+
+ if (script_hasdata(st, 4)) {
+ struct block_list *bl = map->id2bl(script_getnum(st, 4));
+ if (bl == NULL) {
+ ShowWarning("buildin_progressbar_unit: Error in finding object with given GID %d!\n", script_getnum(st, 4));
+ return true;
+ }
+ clif->progressbar_unit(bl, (unsigned int)strtoul(color, (char **)NULL, 0), second);
+ } else {
+ struct map_session_data *sd = script->rid2sd(st);
+
+ if (sd == NULL)
+ return false;
+
+ clif->progressbar_unit(&sd->bl, (unsigned int)strtoul(color, (char **)NULL, 0), second);
+ }
+ return true;
+}
BUILDIN(pushpc)
{
uint8 dir;
@@ -24405,6 +24427,7 @@ void script_parse_builtin(void) {
BUILDIN_DEF(setfont,"i"),
BUILDIN_DEF(areamobuseskill,"siiiiviiiii"),
BUILDIN_DEF(progressbar,"si"),
+ BUILDIN_DEF(progressbar_unit,"si?"),
BUILDIN_DEF(pushpc,"ii"),
BUILDIN_DEF(buyingstore,"i"),
BUILDIN_DEF(searchstores,"ii"),