diff options
Diffstat (limited to 'npc')
-rw-r--r-- | npc/functions/inventoryplace.txt | 30 | ||||
-rw-r--r-- | npc/scripts.conf | 13 |
2 files changed, 37 insertions, 6 deletions
diff --git a/npc/functions/inventoryplace.txt b/npc/functions/inventoryplace.txt new file mode 100644 index 00000000..a084f2e9 --- /dev/null +++ b/npc/functions/inventoryplace.txt @@ -0,0 +1,30 @@ +// Evol functions. +// Author: +// Reid +// Description: +// Check if the player have enough place on his inventory to accept new items. +// Variables: +// @item = Item ID. +// @count = Number of items. +// @iteminfo = Item information type. (See doc for list of item's types) +// @countitem = Count item's number. + +function script InventoryPlace { + + getinventorylist; + set @iteminfo, getiteminfo(@item,2); + set @countitem, countitem(@item); + + if (checkweight("@item", "@count") == 0) goto l_Warn; + if ((@iteminfo < 4) && (@countitem == 0) && (@inventorylist_count < 100)) return; + if ((@iteminfo < 4) && (@countitem > 0)) return; + if (@inventorylist_count + @count <= 100) return; + +l_Warm: + mesn "Narrator"; + mes col(l("It looks like you can't carry anything else for now."), 9); + next; + mes col(l("You should come back when you'll have some free space."), 9); + + close; +}
\ No newline at end of file diff --git a/npc/scripts.conf b/npc/scripts.conf index ce998205..aa86089b 100644 --- a/npc/scripts.conf +++ b/npc/scripts.conf @@ -1,15 +1,16 @@ // This is the main script import file -// Maps +// Maps specific scripts import: npc/_import.txt -// Item Functions -npc: npc/items/poisonedwater.txt -npc: npc/items/poisonedblobime.txt +// Item functions npc: npc/items/croconut.txt npc: npc/items/oldbook.txt +npc: npc/items/poisonedblobime.txt +npc: npc/items/poisonedwater.txt -// Script Functions +// Script functions npc: npc/functions/clientversion.txt -npc: npc/functions/savepoint.txt +npc: npc/functions/inventoryplace.txt npc: npc/functions/sailordialogue.txt +npc: npc/functions/savepoint.txt |