Introduction
This component provides inventory for a merchant/vendor

Fields#
| Name | Description |
|---|---|
| Allow Buyback | Allow items sold to Merchant to be bought back |
| Stocking Mode | Stocking Mode to use |
| Stock Ids | List of ids for stocking |
| Stock List | List of Reference Infos for stocking |
| Random Stock | List of entries for random stocking |
| Limited Currency | Limit the amount of funds the Merchant has |
| Merchant Plugins | List of plugins |
| Player Sell Discount | Discount to apply when selling to player |
| Player Buy Discount | Discount to apply when buying from player |
| Register | Place in the Tool Registry so it can be found easily by other components |
| Registry Key | Key to associate with this instance |
| Auto Convert Funds | Automatically convert funds when added/removed |
| Plugins | List of plugins |
| Source | Determine if source is a Direct Reference or in the Tool Registry |
| Stats Key | Key used to find source |
| On Recipe Learned | Event raised when a recipe is learned |
| On Craft Queue Added | Event raised when an item enters crafting queue |
| On Craft Queue Removed | Event raised when an item exists crafting queue |
| On Equipment Change | Event raised whenever item equip status changed |
| On Shutdown | Event raised when system shuts down |
| On Initialized | Event raised when system is initialized |
| On Theme Changed | Event raised whenever the active theme changes |
| Ignore Limits | Ignore item & category limits |
| Display Name | Name of the creature or object attached |
| Color | Color associated with this object |
| Broadcast Messages | Broadcast message to 'GDTK_Inventory' channel |
| On Funds Changed | Event raised when funds are added or removed |
| On Item Added | Event raised when an item is added to inventory |
| On Item Removed | Event raised when an item is removed from inventory |
| On Inventory Changed | Event raised when any inventory change occurs |
| On Item Count Changed | Event raised whenever item count changes |
| On Weight Changed | Event raised when total weight changes |
| On Display Name Changed | Event raised when Display Name changes |
| On Color Changed | Event raised when Color changes |
Properties#
| Name | Description |
|---|---|
| info | Information about this object |
| items | Gets a list of all stocked items |
| activeTheme | Gets/Sets the active theme |
| anyUnholsteredItems | Gets if any equipped items that can be holstered are not |
| busy | True if the system is currently loading or saving data. |
| craftingQueue | Gets a list of all items in the Crafting Queue |
| equippedItems | Gets a list of all currently equipped items |
| initialized | Gets if the object has been initialized |
| knownRecipies | Gets a list of all Recipes known to this object |
| quickSlots | Gets a list of all Quick Slots for this object |
| remoteStats | Gets the Stat Source bound to this object (Requires GDTK: Stats) |
| statSource | Gets the Item Stat Source |
| totalFunds | Gets the total value of all non-premium funds |
| totalFundsWeight | Gets the total weight of all non-premium funds |
| totalWeight | Gets the total weight of all items and funds |
| actor | Gets reference to the associated actor |
| color | Color associated with this object |
| displayName | Name of the creature or object attached |
| instanceId | Get the id of this instance of the object |
| itemContainer | Gets the item container |
| statIds | List of all Stat Ids |
| totalItemWeight | Gets the total weight of all items in the container |
Methods#
| Name | Description |
|---|---|
| AvailableStock | Get the number of an item available in stock |
| BuyFromPlayer | Buy item from player (using Count Select settings) |
| CanBuyFromPlayer | Checks if a certain number of an item can be bought from player |
| CanSellToPlayer | Checks if a certain number of item can be sold to player |
| GetBuyBackCount | Gets the number of an item that can be bought back by player |
| GetBuyFromPlayerMaxCount | Gets the maximum number of an item that can be bought from player |
| GetBuyFromPlayerTotal | Gets the total cost to buy a specific number of an item from player |
| GetSellToPlayerMaxCount | Gets the maximum number of an item that can be sold to player |
| GetSellToPlayerTotal | Gets the total cost to sell a specific number of an item to player |
| RemoveStock | Removes a specific number of an item from stock |
| Restock | Restock items in vendor |
| SellToPlayer | Sells item to player (using Count Select settings) |
| AddFunds | Add non-preimum funds to inventory |
| AddFundsPremium | Add preimum funds to inventory |
| AutoConvertFunds | Automaticaly convert non-preimum funds to use the lowest possible count |
| CanCraft | Check if a Recipe can be crafted |
| CanCraftInstantly | Check if a Recipe can be crafted instantly |
| ClearFunds | Remove all funds |
| Craft | Craft a Recipe |
| DataLoad | Loads data from a specified file |
| DataLoadJSON | Loads JSON data from a JSON string |
| DataLoadJSONFile | Loads JSON data from a specified file |
| DataSave | Saves data to a specified file |
| DataSaveJSON | Saves JSON data to a specified file |
| GetCurrencyCount | Get the current count of a currency in inventory |
| GetEquippedItem | Get the item currently equipped to a Equip Slot |
| GetEquippedItemByGroup | Get the item currently equipped to a group name |
| GetEquipSlotClient | Get the EquipSlotClient associated with an EquipSlot |
| GetEquipSlotClientsByGroup | Get all EquipSlotClients associated with a group |
| GetHolsterSlotClient | Get the HolsterSlotClient associated with an HolsterSlot |
| GetItemByInstanceId | Get an item by its instance id |
| GetItemCategory | Get an Item Category |
| GetPremiumFunds | Get count of premium funds in inventory |
| GetQuickSlot | Get a Quick Slot |
| Initialize | Initialize the object |
| IsRecipeKnown | Get if a Recipe is known to this inventory |
| IsTrue | Check if an expression is true |
| ItemTotalCount | Get the total count of an item in inventory |
| LearnRecipe | Add recipe to known list by id |
| RegisterEquipClient | Register an EquipClient for this inventory |
| RegisterHolsterClient | Register an HolsterClient for this inventory |
| RemoveFunds | Remove non-premium funds from inventory |
| RemoveItem | Remove item from inventory |
| RemoveItemByInstance | Remove item from inventory |
| Shutdown | Shutdown object and remove all subscriptions |
| ToggleWindowById | Open/Close a window by id |
| UpdateSetBonus | Update Item Set Bonus values |
| AddItem | Add an item to the container |
| AddItems | Add a list of items item to the container |
| GetStatValue | Get the value of a stat |
| RefreshActor | Attempt to find actor for component |
| ReplaceItem | Replace an existing item with a new one |
| RunPluginCommand | Run a plugin on an item |