From 9d582035fc69ffd706077add90e9276550b49565 Mon Sep 17 00:00:00 2001 From: kisuka Date: Tue, 23 Oct 2018 16:52:46 -0700 Subject: Added countnameditem script command. Signed-off-by: Haru --- doc/script_commands.txt | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'doc/script_commands.txt') diff --git a/doc/script_commands.txt b/doc/script_commands.txt index 4812a2cf2..66b6cff90 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -5340,6 +5340,30 @@ Check getitem2() to understand the arguments of the function. --------------------------------------- +*countnameditem(, "") +*countnameditem(, ) +*countnameditem("", "") +*countnameditem("", ) + +This function will return the number of signed items for the specified item ID +that the invoking character has in their inventory. + + mes("[Item Checker]"); + if (countnameditem(Apple) > 0) { + mes("You have an apple with your name on it!"); + } else { + mes("You do not have an apple with your name on it."); + } + next(); + mes("[Item Checker]"); + mesf("You have %d apples with John's name on it!", countnameditem(Apple, "John")); + close(); + +Like getnameditem(), this function will also accept an 'english name' from the +database as an argument. + +--------------------------------------- + *groupranditem() Returns the item_id of a random item picked from the item container specified. There -- cgit v1.2.3-60-g2f50