# Unit Manipulates Inventory

Grammarunit manipulates item
FlagsNative | Event

This event fires when a unit performs the specified action on the specified inventory item. Use “Triggering Inventory Item” to get the inventory item, “Triggering Inventory Item Container” to get the container the item resides in, “Triggering Inventory Item Slot” to get the slot the item occupies, “Triggering Inventory Item Target Point” to get the point targeted by the action, and “Triggering Inventory Item Target Unit” to get the unit targeted by the action.

# Arguments

  • unitref [ unit ] — Unit
  • int [ preset::InventoryManipulation ] — Manipulates
  • unitref [ unit ] — Item

Returns — void

native void TriggerAddEventUnitInventoryChange(
	trigger t,
	unitref u,
	int inChangeType,
	unitref inItem,
);

# Event parameters

Category: Unit / Items

# Examples

# mods/warcoop/warclassic.sc2mod

WarClassic.galaxy

// L497
TriggerAddEventUnitInventoryChange(libGAw3_gt_EVENT_PLAYER_UNIT_DROP_ITEM, null, c_unitInventoryChangeDrops, null)
// L541
TriggerAddEventUnitInventoryChange(libGAw3_gt_EVENT_PLAYER_UNIT_PICKUP_ITEM, null, c_unitInventoryChangePicksUp, null)
// L585
TriggerAddEventUnitInventoryChange(libGAw3_gt_EVENT_PLAYER_UNIT_USE_ITEM, null, c_unitInventoryChangeUses, null)
// L727
TriggerAddEventUnitInventoryChange(libGAw3_gt_EVENT_PLAYER_UNIT_PAWN_ITEM, null, c_unitInventoryChangeSells, null)

# mods/warcoop/warclassicsystem.sc2mod

WarClassicSystem.galaxy

// L551
TriggerAddEventUnitInventoryChange(libGAwX_gt_SuppressInvisibilitywhenUsingItems, null, c_unitInventoryChangeUses, null)