# Create Inventory Item
Grammar — Create one itemType item in the inventory of u
Flags —Native
|Action
Creaters an item in a unit’s inventory. Use the “Last Created Inventory Item” function to refer to the created item.
# Arguments
unit
— Unitstring
[ gamelink::Unit ] — Item Type
Returns — void
native unit UnitInventoryCreate(
unit inUnit,
string itemType,
);
# Related
Category: Unit / Items
- [F] —
void
— Create Inventory Item — ( UnitInventoryCreate ) - [F] —
void
— Add Item To Inventory — ( UnitInventoryAdd ) - [F] —
unit
— Last Created Inventory Item — ( UnitInventoryLastCreated ) - [F] —
unit
— Inventory Item Carried — ( UnitInventoryItem ) - [F] —
unit
— Inventory Item Carrier — ( UnitInventoryUnit ) - [F] —
int
— Inventory Item Container — ( UnitInventoryContainer ) - [F] —
int
— Inventory Item Slot — ( UnitInventorySlot ) - [F] —
int
— Inventory Item Index — ( UnitInventoryIndex ) - [F] —
int
— Inventory Item Count — ( UnitInventoryCount ) - [F] —
unitgroup
— Inventory Items Carried — ( UnitInventoryGroup ) - [F] —
void
— Open Inventory Container — ( UnitInventoryContainerOpen ) - [F] —
void
— Move Inventory Item — ( UnitInventoryMove ) - [F] —
void
— Remove Inventory Item — ( UnitInventoryRemove ) - [F] —
void
— Unit Acquires Powerup — ( TriggerAddEventUnitPowerup ) - [F] —
unit
— Triggering Powerup — ( EventUnitPowerupUnit ) - [F] —
void
— Unit Manipulates Inventory — ( TriggerAddEventUnitInventoryChange ) - [F] —
int
[ preset::InventoryManipulation ] — Triggering Inventory Manipulation — ( EventUnitInventoryChange ) - [F] —
unit
— Triggering Inventory Item — ( EventUnitInventoryItem ) - [F] —
int
— Triggering Inventory Item Container — ( EventUnitInventoryItemContainer ) - [F] —
int
— Triggering Inventory Item Slot — ( EventUnitInventoryItemSlot ) - [F] —
point
— Triggering Inventory Item Target Point — ( EventUnitInventoryItemTargetPoint ) - [F] —
unit
— Triggering Inventory Item Target Unit — ( EventUnitInventoryItemTargetUnit )
# Examples
# mods/warcoop/warclassicsystem.sc2mod
// L471
UnitInventoryCreate(lv_target, UnitGetType(lv_item))
// L1441
UnitInventoryCreate(lv_caster, lv_itemType)
# mods/warcoop/warcoopdata.sc2mod
// L1759
UnitInventoryCreate(lp_hero, lv_item)
# mods/warcoop/warmeleeai.sc2mod
// L646
UnitInventoryCreate(u,c_IT_PotionofHealingAI)
// L647
UnitInventoryCreate(u,c_IT_PotionofManaAI)
// L648
UnitInventoryCreate(u,c_IT_ScrollofRegenerationAI)
// L649
UnitInventoryCreate(u,c_IT_ScrollofTownPortalAI)