summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-12-14 19:35:17 +0300
committerAndrei Karas <akaras@inbox.ru>2018-12-14 23:52:47 +0300
commitc79927b6879f07784ceb19a606483acc791dea80 (patch)
treeed6a8d860fafbc15874364b5765bbc81acdd0d80 /src/map/script.c
parent16f3fe4fd1eeaa27ad093ea70b0a26054096bdb0 (diff)
downloadhercules-c79927b6879f07784ceb19a606483acc791dea80.tar.gz
hercules-c79927b6879f07784ceb19a606483acc791dea80.tar.bz2
hercules-c79927b6879f07784ceb19a606483acc791dea80.tar.xz
hercules-c79927b6879f07784ceb19a606483acc791dea80.zip
Add script command expandInventory
This command allow adjust inventory size to positive or negative value.
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 36b316320..8dadf6d57 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -24884,6 +24884,16 @@ static BUILDIN(expandInventoryResult)
return true;
}
+// adjust player inventory size to given value positive or negative
+static BUILDIN(expandInventory)
+{
+ struct map_session_data *sd = script_rid2sd(st);
+ if (sd == NULL)
+ return false;
+ script_pushint(st, pc->expandInventory(sd, script_getnum(st, 2)));
+ return true;
+}
+
/**
* Adds a built-in script function.
*
@@ -25626,6 +25636,7 @@ static void script_parse_builtin(void)
BUILDIN_DEF(enchantitem, "iii"),
BUILDIN_DEF(expandInventoryAck, "i?"),
BUILDIN_DEF(expandInventoryResult, "i"),
+ BUILDIN_DEF(expandInventory, "i"),
};
int i, len = ARRAYLENGTH(BUILDIN);
RECREATE(script->buildin, char *, script->buildin_count + len); // Pre-alloc to speed up