OscarScorp Posted August 27, 2015 Group: Members Topic Count: 62 Topics Per Day: 0.02 Content Count: 217 Reputation: 16 Joined: 01/28/15 Last Seen: February 25, 2022 Share Posted August 27, 2015 Hello everyone, I need help finding a way for a Script NPC to detect if an item is Rental. Reason: I need an NPC who separates cards from equipment, but I don't want to let players separate cards from Rental equipments. If you need more information, please comment. Thanks in advance. Quote Link to comment Share on other sites More sharing options...
anacondaq Posted August 27, 2015 Group: Members Topic Count: 42 Topics Per Day: 0.01 Content Count: 1096 Reputation: 348 Joined: 02/26/12 Last Seen: May 30, 2023 Share Posted August 27, 2015 *getinventorylist {<char_id>}; 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_bound[] - whether it is bound to the character @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'. getinventorylist; @inventorylist_expire[] - expire time (Unix time stamp). 0 means never expires. Quote Link to comment Share on other sites More sharing options...
OscarScorp Posted September 18, 2015 Group: Members Topic Count: 62 Topics Per Day: 0.02 Content Count: 217 Reputation: 16 Joined: 01/28/15 Last Seen: February 25, 2022 Author Share Posted September 18, 2015 Sorry for very late reply, wasn't able to test it until now. That worked, thanks a lot Anacondaqq! Quote Link to comment Share on other sites More sharing options...
Question
OscarScorp
Hello everyone,
I need help finding a way for a Script NPC to detect if an item is Rental.
Reason: I need an NPC who separates cards from equipment, but I don't want to let players separate cards from Rental equipments.
If you need more information, please comment.
Thanks in advance.
Link to comment
Share on other sites
2 answers 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.