MojoMojo Posted June 1, 2012 Group: Members Topic Count: 50 Topics Per Day: 0.01 Content Count: 114 Reputation: 1 Joined: 03/07/12 Last Seen: January 17, 2015 Share Posted June 1, 2012 (edited) How can i do a script that read the number of slots and the cards attached to them in an equipment in my inventory? (selected by the player) Example: In my inventory there are a Knife with 1 Fabre card 1 Skeleton Worker card, 1 hydra card and 1 andre card. The NPC must read that there are 4 cards and save their respective IDs. Help plz? Edited June 1, 2012 by MojoMojo Quote Link to comment Share on other sites More sharing options...
LCDTheOG Posted June 2, 2012 Group: Members Topic Count: 11 Topics Per Day: 0.00 Content Count: 222 Reputation: 35 Joined: 12/13/11 Last Seen: December 18, 2022 Share Posted June 2, 2012 *getinventorylist; This command sets a bunch of arrays with a complete list of whatever the invoking character has in their inventory, including all the data needed to 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_refine[] - for how much it is refined. @inventorylist_identify[] - whether it is identified. @inventorylist_attribute[] - whether it is broken. @inventorylist_card1[] - These four arrays contain card data for the items. @inventorylist_card2[] These data slots are also used to store names @inventorylist_card3[] inscribed on the items, so you can explicitly check @inventorylist_card4[] if the character owns an item 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. 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 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 @inventorylist_count to go through these arrays, and not 'getarraysize', because the arrays are not automatically cleared between runs of 'getinventorylist'. Pulled from trunk/doc/script_commands.txt >_> Quote Link to comment Share on other sites More sharing options...
Question
MojoMojo
How can i do a script that read the number of slots and the cards attached to them in an equipment in my inventory? (selected by the player)
Example:
In my inventory there are a Knife with 1 Fabre card 1 Skeleton Worker card, 1 hydra card and 1 andre card.
The NPC must read that there are 4 cards and save their respective IDs.
Help plz?
Edited by MojoMojoLink to comment
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.