Skip to main content

Creating and Adding Items

Learn how to create item objects and add them to your rotation system using Aurora's Item Handler.

Basic Item Creation

The simplest way to create an item is using the NewItem function with an item ID:

local healthPotion = Aurora.ItemHandler.NewItem(33447)

This creates a new item object with all the necessary properties automatically populated from the game's item database.

Creating Items with Payload

For more control over item behavior, you can provide a payload table with additional parameters:

local trinket = Aurora.ItemHandler.NewItem(12345)

Multiple Item IDs

You can create an item that automatically selects the highest usable version from multiple item IDs:

-- Will use the highest level health potion available
local healthPotion = Aurora.ItemHandler.NewItem({33447, 33448, 33449})

The system will iterate through the array from highest to lowest index and select the first usable item.

Adding Items to Armory

Manual Addition

You can manually populate the armory with specific items:

local items = {
trinket = Aurora.ItemHandler.NewItem(12345), -- Trinket
hpot = Aurora.ItemHandler.NewItem(33447), -- Health Potion
hpot2 = Aurora.ItemHandler.NewItem(22829) -- Super Healing Potion
}