diff options
author | Jesusaves <cpntb1@ymail.com> | 2021-07-07 20:36:00 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2021-07-07 20:36:00 -0300 |
commit | 6967b9e0b63d19141d4f59b7933a960ac81916d0 (patch) | |
tree | 8ecd9cd2461f3598cb7faece71eb77162aa4ef2a /npc/functions/inventoryplace.txt | |
parent | 9877fd4ad81120af8e63e96d5d429092014dc017 (diff) | |
parent | 046c659193e1ca8bd13478678d1277df8bf9395c (diff) | |
download | serverdata-6967b9e0b63d19141d4f59b7933a960ac81916d0.tar.gz serverdata-6967b9e0b63d19141d4f59b7933a960ac81916d0.tar.bz2 serverdata-6967b9e0b63d19141d4f59b7933a960ac81916d0.tar.xz serverdata-6967b9e0b63d19141d4f59b7933a960ac81916d0.zip |
Merge branch 'master' into legacy
Override all files with 'master' version.
This version is meant to preserve git history as requested by bjorn.
Diffstat (limited to 'npc/functions/inventoryplace.txt')
-rw-r--r-- | npc/functions/inventoryplace.txt | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/npc/functions/inventoryplace.txt b/npc/functions/inventoryplace.txt new file mode 100644 index 00000000..76cdad21 --- /dev/null +++ b/npc/functions/inventoryplace.txt @@ -0,0 +1,36 @@ +// Evol functions. +// Authors: +// Qwerty Dragon +// Reid +// Description: +// Check if the player have enough place on his inventory to accept new items with arguments: +// getarg(even numbers) item ID, +// getarg(odd numbers) number of items, + +function script inventoryplace { + + .@argc = getargcount(); + + if (.@argc % 2 != 0) + { + Exception("inventoryplace: Wrong argument count.", RB_SPEECH|RB_ISFATAL|RB_PLEASEREPORT|RB_DEBUGMES); + } + + for (.@i = .@j = 0; .@i < .@argc; .@i += 2) + { + setarray .@item[.@j], getarg(.@i); + setarray .@amount[.@j], getarg(.@i + 1); + ++.@j; + } + + if (!checkweight2(.@item, .@amount)) + { + narrator S_FIRST_BLANK_LINE, + l("It looks like you can't carry anything else for now."), + l("You should come back when you have some free space."); + + close; + } + + return true; +} |