diff options
author | Emistry Haoyan <equinox1991@gmail.com> | 2018-10-02 22:41:53 +0800 |
---|---|---|
committer | Emistry Haoyan <equinox1991@gmail.com> | 2018-10-05 01:33:05 +0800 |
commit | d7bbebdf8526667b288223c8adc2d110204814c5 (patch) | |
tree | 0a044119b50b06b3199aadc53e935bcc784cd1ff /src/map | |
parent | 852c13305f67948531bd0277eb1922dbd02b1f26 (diff) | |
download | hercules-d7bbebdf8526667b288223c8adc2d110204814c5.tar.gz hercules-d7bbebdf8526667b288223c8adc2d110204814c5.tar.bz2 hercules-d7bbebdf8526667b288223c8adc2d110204814c5.tar.xz hercules-d7bbebdf8526667b288223c8adc2d110204814c5.zip |
Implement status reduction script command.
- for stat reduction support.
- return the amount of status point required to increase a status.
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/script.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/map/script.c b/src/map/script.c index b787d0138..b2f1120f1 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -9809,6 +9809,25 @@ static BUILDIN(statusup2) return true; } + +/*========================================== +* Returns the number of stat points needed to change the specified stat by val. +* needed_status_point(<type>,<val>{,<char id>}); [secretdataz] +*------------------------------------------*/ +static BUILDIN(needed_status_point) +{ + int type = script_getnum(st, 2); + int val = script_getnum(st, 3);; + struct map_session_data *sd = script->rid2sd(st); + + if (sd == NULL) + script_pushint(st, 0); + else + script_pushint(st, pc->need_status_point(sd, type, val)); + + return true; +} + /// See 'doc/item_bonus.txt' /// /// bonus <bonus type>,<val1>; @@ -25048,6 +25067,7 @@ static void script_parse_builtin(void) BUILDIN_DEF(downrefitem,"i?"), BUILDIN_DEF(statusup,"i"), BUILDIN_DEF(statusup2,"ii"), + BUILDIN_DEF(needed_status_point,"ii?"), BUILDIN_DEF(bonus,"iv"), BUILDIN_DEF2(bonus,"bonus2","ivi"), BUILDIN_DEF2(bonus,"bonus3","ivii"), |