Data/Items

## Introduction

Units have the **Stats: Item** field, from which a valid entry makes them pickable by Inventory type abilities. **Item** **data** is what lies inside that **Stats: Item** field. Once picked up the Unit becomes hidden (as **hidden** filter) and its **Item data** becomes at play with its abilities, given behaviors/weapons and flags. You can visually see that Item on the UI of the holding unit (when selected). Units inside the inventory can also interact with the carrying unit via periodic Buff on the item unit that uses a Search Area effect with 0 arc and 0 radius. This allows for validations that are not possible otherwise.

* Just like transport abilities, even if the transported unit is hidden, its wireframe is displayed and still represents that unit. Same goes for the unit item; The item unit is hidden, but its Item data displays. For example, if the unit item had life regen in negative leading to its death before being picked up, it still suffers the same faith while being in the inventory. The Item data related to it will disappear on its death.
* Do not attempt to morph the Unit once picked up. This is very crashy (tested).
* In Warcraft 3, Goblin Merchant structures use the Interact ability to connect to the item holder. They have the Pawn ability to be able to refund an item, and the Train ability to sell items directly into the Hero's inventory.
* Be advised that building a periodic Search to Issue Order to grab an item unit (suppose you want the AI to auto-grab items) will require the search effect to exclude "Hidden" filters, as a test revealed that the Search will try to grab items from the holding unit's own inventory, thus conducting to failure to "Take".
* Power Up Items do require the container unit to have an Inventory ability, but essentially ignore any requirements from its info pannel.
* If an item could be used and have an Item Container as the same time, clicking it will priotize the container open/close toggling. To use it, have a secondary Item Container inside which it can be put and used (putting an item in its own inventory doesn't work, this was wisely programmed).
* A unit sharing an inventory and pawn ability may pick items. If however, the pawn ability is disabled, the items will sell for nothing and will prevent other units from giving the item to this unit's inventory. This seems to be a bug.

## Description (raw)

Stored "**Item**" which is usable/movable/droppable. Requires the container unit to have the Inventory ability.

## Items: Sub Types (Classes)

* Ability
* Generic
* Instant
* Power Up
* Target

## Common Fields

### (None): Charge

Operates exactly as **Cost** in abilities does, while having the unique ability to trigger the item's death according to **Basic: Flags**.

* Mainly used for items that are usable/generate an effect.

### (None): Group Cooldown Link

(Unsure) If the item should have an ability with a cooldown in it, string that links it to other items having a cooldown as well.

### Basic: Carry Behavior

Behavior(s) given to the holding (container) unit when the Item is carried.

### Basic: Carry Weapons

Weapon(s)/Turret(s) given to the holding (container) unit when the Item is carried.

### Basic: Class

Class data associated to the item that allows it to be contained by an Inventory slot/Item Containers bag that have a specific Class entry.

* As the "Test Inventory" ability made Blizzard shows, think of it as an Helmet slot, a Wrist Band slot, a glove part. It is some kind of filter for an item to fit at the right place, to the liking of the modder.
* Blizzard made Bag items into "Bag" Class, which means that even Bags can be filtered.

### Basic: Container

Entry for the Item Containers data. Used to specialize its slots (appearence, class requirement, etc.) the same way the Inventory ability does.

* This is for items that are to be a "bag" type of item. Most of the time, generic sub type is used because of its passive quality.

### Basic: Equip Behaviors

Behavior(s) given to the holding (container) unit when the Item is carried. Will not work if the holding Inventory ability has its **Can Apply Equip Behavior** flag disabled or/and the flag Equip on Item Containers slot field.

### Basic: Equip Weapons

Weapon(s)/Turret(s) given to the holding (container) unit when the Item is carried. Will not work if the holding Inventory ability has its **Can Apply Equip Behavior** flag disabled or/and the flag Equip on Item Containers slot field.

### Basic: Face

Mini Icon for the item when viewed on the Inventory UI.

### Basic: Flags

Some of those flags can will be overrided by the Inventory ability flags.

* **Can Drop:** Prevent the item back from being put back on the floor or handed over to another unit.
* **Destroy When Depleted:** If the cost should reach 0, the item is destroyed. If there is no cost, this flag doesn't trigger.
* **Drop On Death:** Enables the item to drop on the floor upon its holding unit's death.
* **Enabled While Dead:** (Unsure) Allows the item to still give the bonus even if the holding unit is dead
* **Include In Loot Item Pool:** Allows Loot data to randomly drop this item, according to its accepted level.
* **Use Item Charge:** Links to the **Stats: Stock Charge** field of the Item's unit data. Used by Power Up items in Warcraft 3 mods. This field is useful to fix a problem with Ability items that burns the item on cancelling the approach phase. Further more, you can use this field to allow stacks of items on a single spot.
* **Use Item Group Cooldown Link:** (Unknown/Untested).

### Basic: Level

Attributes a level to the item. This level can monitored for random loots compatibility with the level.

### Basic: Requirement

(Unknown) Seems to be a requirement for the item, but broken in appearences. As far as tested, this doesn't prevent from using the item for any matter. It's not used either in Warcraft 3, at all.

## Related

* Units
* Loot
* Item Classes
* Item Containers
* Inventory
* Pawn
* Train
* Interact
* Iterate Inventory
* Load Container
* Unit Inventory Is Full
* Unit Inventory Contains Item