diff options
author | Haru <haru@dotalux.com> | 2019-05-06 00:19:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-06 00:19:06 +0200 |
commit | 574801d93c55b5ac41f9bdbd660f747f1c5aaa76 (patch) | |
tree | 473c9ada31454ae62f73215ade30687cd61a3b4e /src/map/script.c | |
parent | 31f47be4b26e69d2880e12530d021ce6c8c802ea (diff) | |
parent | 86a3d6ce9b259baf29d7cc05a8e75aa2b1e3ac24 (diff) | |
download | hercules-574801d93c55b5ac41f9bdbd660f747f1c5aaa76.tar.gz hercules-574801d93c55b5ac41f9bdbd660f747f1c5aaa76.tar.bz2 hercules-574801d93c55b5ac41f9bdbd660f747f1c5aaa76.tar.xz hercules-574801d93c55b5ac41f9bdbd660f747f1c5aaa76.zip |
Merge pull request #2446 from hemagx/refinery_ui_update
Implement Refinery ui and Refine code refactor
Diffstat (limited to 'src/map/script.c')
-rw-r--r-- | src/map/script.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/map/script.c b/src/map/script.c index 4fb24708b..5843ac292 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -52,6 +52,7 @@ #include "map/pet.h" #include "map/pet.h" #include "map/quest.h" +#include "map/refine.h" #include "map/skill.h" #include "map/status.h" #include "map/status.h" @@ -9505,7 +9506,7 @@ static BUILDIN(getequippercentrefinery) if (i >= 0 && sd->status.inventory[i].nameid != 0 && sd->status.inventory[i].refine < MAX_REFINE) script_pushint(st, - status->get_refine_chance(itemdb_wlv(sd->status.inventory[i].nameid), (int) sd->status.inventory[i].refine, (enum refine_chance_type) type)); + refine->get_refine_chance(itemdb_wlv(sd->status.inventory[i].nameid), (int) sd->status.inventory[i].refine, (enum refine_chance_type) type)); else script_pushint(st, 0); @@ -25285,6 +25286,25 @@ static BUILDIN(closeroulette) return true; } +static BUILDIN(openrefineryui) +{ + struct map_session_data *sd = script_rid2sd(st); + + if (sd == NULL) { + script_pushint(st, 0); + return true; + } + + if (battle_config.enable_refinery_ui == 0) { + script_pushint(st, 0); + return true; + } + + clif->OpenRefineryUI(sd); + script_pushint(st, 1); + return true; +} + /** * Adds a built-in script function. * @@ -26038,6 +26058,7 @@ static void script_parse_builtin(void) BUILDIN_DEF(getInventorySize, ""), BUILDIN_DEF(closeroulette, ""), + BUILDIN_DEF(openrefineryui, ""), }; int i, len = ARRAYLENGTH(BUILDIN); RECREATE(script->buildin, char *, script->buildin_count + len); // Pre-alloc to speed up |