From 467327c8169d0c952cec53535f9f2189d85baa53 Mon Sep 17 00:00:00 2001 From: GmOcean Date: Sun, 23 Nov 2014 23:07:15 -1000 Subject: Added Commands to script_commands.txt and script.c --- doc/script_commands.txt | 103 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 100 insertions(+), 3 deletions(-) (limited to 'doc/script_commands.txt') diff --git a/doc/script_commands.txt b/doc/script_commands.txt index ec8274716..a67e74899 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -2944,7 +2944,7 @@ recreate these items perfectly if they are destroyed. Here's what you get: @inventorylist_id[] - array of item ids. @inventorylist_amount[] - their corresponding item amounts. -@inventorylist_equip[] - whether the item is equipped or not. +@inventorylist_equip[] - will return the slot item is equipped on, if at all. @inventorylist_refine[] - for how much it is refined. @inventorylist_identify[] - whether it is identified. @inventorylist_attribute[] - whether it is broken. @@ -2955,8 +2955,8 @@ recreate these items perfectly if they are destroyed. Here's what you get: made by a specific craftsman. @inventorylist_expire[] - expire time (Unix time stamp). 0 means never expires. -@inventorylist_count - the number of items in these lists. @inventorylist_bound - whether it is an account bounded item or not. +@inventorylist_count - the number of items in these lists. This could be handy to save/restore a character's inventory, since no other command returns such a complete set of data, and could also be the @@ -2973,6 +2973,42 @@ runs of 'getinventorylist'. --------------------------------------- +*getcartinventorylist; + +This command sets a bunch of arrays with a complete list of whatever the +invoking character has in its cart_inventory, including all the data needed to +recreate these items perfectly if they are destroyed. Here's what you get: + +@cartinventorylist_id[] - array of item ids. +@cartinventorylist_amount[] - their corresponding item amounts. +@cartinventorylist_refine[] - for how much it is refined. +@cartinventorylist_identify[] - whether it is identified. +@cartinventorylist_attribute[] - whether it is broken. +@cartinventorylist_card1[] - These four arrays contain card data for the +@cartinventorylist_card2[] items. These data slots are also used to store +@cartinventorylist_card3[] names inscribed on the items, so you can +@cartinventorylist_card4[] explicitly check if the character owns an item + made by a specific craftsman. +@cartinventorylist_expire[] - expire time (Unix time stamp). 0 means never + expires. +@cartinventorylist_bound - whether it is an account bounded item or not. +@cartinventorylist_count - the number of items in these lists. + +This could be handy to save/restore a character's cart_inventory, since no +other command returns such a complete set of data, and could also be the +only way to correctly handle an NPC trader for carded and named items who +could resell them - since NPC objects cannot own items, so they have to +store item data in variables and recreate the items. + +Notice that the variables this command generates are all temporary, +attached to the character, and integer. + +Be sure to use @cartinventorylist_count to go through these arrays, and not +'getarraysize', because the arrays are not automatically cleared between +runs of 'getcartinventorylist'. + +--------------------------------------- + *cardscnt() This function will return the number of cards inserted into the weapon @@ -4809,6 +4845,41 @@ Example: --------------------------------------- +*checkbound({,{,{,{,{,{,{,}}}}}}}); + +This command allows you to check whether or not the attached player has the specified bound item in their inventory. + +Valid bound types are: + 1 - Account Bound + 2 - Guild Bound + 3 - Party Bound + 4 - Character Bound + +Optional Parameters: + refine - checks to see if the item is refined to the given number. + attribute - whether the item is broken (1) or not (0) + card 1,2,3,4 - checks to see if the specified cards are compounded on the item as well. + +Example: + // This will check if you have a bound (any type) 1205 (Cutter). + if (checkbound(1205)) { + mes "You have a bound Cutter"; + close; + } else { + mes "You do not have a bound Cutter"; + close; + } + + // This will check if you have a 'guild_bound' +7 1205 (Cutter). + if (checkbound(1205, 2, 7)) { + mes "You have a +7 guild_bound Cutter."; + close; + } else { + mes "You don't have the required item."; + close; + } +--------------------------------------- + *getnameditem ,; *getnameditem "",; @@ -5208,6 +5279,7 @@ like storage or cart. --------------------------------------- *equip ; +*equip2 ,,,,,,{,}; *autoequip ,