Skip to content

Inventory

getInventoryByType function

Syntax:

lua
Inventory|nil getInventoryByType( Character|Actor owner, int|string inventoryType )
IDInventory Type
0Backpack
1Equipment
2ShortcutBar
3Recipes
4PlaceableInventory
5CraftingQueue
6Feats
7Emotes
8CraftingArtisanInventory
9CraftingArtisanRecipeInventory
10SiegeWeaponCounterWeightInventory
11WeaponInventory
12PetInventory
13CraftingIngredientsInventory
14DismantlerInventory
15Spells
16VisualIllusionSource
17VisualIllusionTarget
18VisualIllusionResult
19GolemParts
20Workorders
21Patrons

GetAllItems function

Syntax:

lua
table<Item> Inventory:GetAllItems()

GetItemByIndex function

Syntax:

lua
Item|nil Inventory:GetItemByIndex( int index )

GetItemById function

Syntax:

lua
Item|nil Inventory:GetItemById( int templateId )

HasItem function

Syntax:

lua
bool Inventory:HasItem( int templateId [, int quantity = 1 ] )

CountItems function

Syntax:

lua
int Inventory:CountItems( int templateId )

SpawnItem function

Syntax:

lua
Item, int Inventory:SpawnItem( int templateId )

DeleteItem function

Syntax:

lua
bool Inventory:DeleteItem( int templateId [, int quantity = 1 ] )

MoveItems function

Syntax:

lua
bool Inventory:MoveItems( Inventory target, int templateId [, int quantity = 1 ] )

GetItemIndex function

Syntax:

lua
int Inventory:GetItemIndex( Item item )

FindItemById function

Syntax:

lua
int Inventory:FindItemById( int templateId [, int startIndex = 0 ] )

DropItem function

Syntax:

lua
void Inventory:DropItem( int index, Character invokingPlayer )