Uncommon Rares
Macro APITriggers

Loot Container Found

Runs when a container appears during a run.

Category
Loot
Runs when
A container can be opened.
Summary
Runs when a container appears during a run.
Version
1

Events

  • system-loot-container-found

Lua Example

local opened = loot.openContainer(ctx.lootContainer.timelineEventId)

for _, item in ipairs(opened.items) do
  loot.keepItem(item)
end

print("Container", ctx.lootContainer.containerTypeKey)

ctx Fields

TriggerPathTypeLabelDescription
Loot Container Foundctx.lootContainer.containerTypeKeystringContainer typeThe kind of container that was found.
Loot Container Foundctx.lootContainer.timelineEventIdidSource eventThe game event where the container appeared.
Loot Container Foundctx.lootContainer.locationKeystringRegionThe area where the container was found.
Loot Container Foundloot.openContainer(...).items[].itemDefinitionKeystringLoot item definitionThe generated item's definition key.
Loot Container Foundloot.openContainer(...).items[].categoryKeystringLoot item categoryThe generated item's category key.
Loot Container Foundloot.openContainer(...).items[].categoryFilterGroupstringLoot item filter groupThe generated item's broad filter group.
Loot Container Foundloot.openContainer(...).items[].raritystringLoot item rarityThe generated item's rarity.
Loot Container Foundloot.openContainer(...).items[].quantitynumberLoot item quantityThe generated stack quantity.
Loot Container Foundloot.openContainer(...).items[].itemLevelnumberLoot item levelThe generated item's required level.
Loot Container Foundloot.openContainer(...).items[].dropLevelnumberLoot drop levelThe level used to generate the item.
Loot Container Foundloot.openContainer(...).items[].vendorValueCoppernumberLoot vendor valueThe stack's vendor value in copper.
Loot Container Foundloot.openContainer(...).items[].tags[]arrayLoot item tagsAffix group and tag labels on the generated item.
Loot Container Foundloot.openContainer(...).items[].isEquippablebooleanLoot item equippableWhether the generated item can be equipped.
Loot Container Foundloot.openContainer(...).items[].upgrade.slotstringLoot upgrade slotThe equipped slot the generated item was compared against; two-slot item types use the weaker occupied slot, or an empty slot first.
Loot Container Foundloot.openContainer(...).items[].upgrade.isUpgradeForEquippedSlotbooleanLoot upgradeTrue when the generated item's raw stat total is greater than the compared equipped slot, or the slot is empty.
Loot Container Foundloot.openContainer(...).items[].upgrade.statDeltas.maxLifenumberLoot upgrade stat deltaA stat delta versus the compared equipped slot; other stat keys are available beside maxLife.
Loot Container Foundloot.openContainer(...).items[].affixes[].keystringLoot affix keyA rolled affix key on the generated item.
Loot Container Foundloot.openContainer(...).items[].affixes[].typestringLoot affix typeWhether the rolled affix is a prefix or suffix.
Loot Container Foundloot.openContainer(...).items[].affixes[].namestringLoot affix nameThe rolled affix display name.
Loot Container Foundloot.openContainer(...).items[].affixes[].equipLevelRequirednumberLoot affix levelThe level required by the rolled affix.
Loot Container Foundloot.openContainer(...).items[].affixes[].modifiers[].statstringLoot affix modifier statThe stat changed by a rolled affix modifier.
Loot Container Foundloot.openContainer(...).items[].affixes[].modifiers[].opstringLoot affix modifier opThe operation used by a rolled affix modifier.
Loot Container Foundloot.openContainer(...).items[].affixes[].modifiers[].valuenumberLoot affix modifier valueThe numeric value of a rolled affix modifier.
Loot Container Foundloot.openContainer(...).items[].implicitModifiers[].statstringLoot implicit modifier statThe stat changed by a base implicit modifier.
Loot Container Foundloot.openContainer(...).items[].implicitModifiers[].opstringLoot implicit modifier opThe operation used by a base implicit modifier.
Loot Container Foundloot.openContainer(...).items[].implicitModifiers[].valuenumberLoot implicit modifier valueThe numeric value of a base implicit modifier.
Loot Container Foundloot.openContainer(...).items[].isUniquebooleanLoot is uniqueTrue when the generated item is an Uncommon Rare.
Loot Container Foundloot.openContainer(...).items[].uniqueImplicitModifiers[].statstringLoot unique implicit statThe stat changed by a unique implicit modifier.
Loot Container Foundloot.openContainer(...).items[].uniqueImplicitModifiers[].opstringLoot unique implicit opThe operation used by a unique implicit modifier.
Loot Container Foundloot.openContainer(...).items[].uniqueImplicitModifiers[].valuenumberLoot unique implicit valueThe numeric value of a unique implicit modifier.
Loot Container Foundloot.openContainer(...).items[].timelineEventIdidLoot item eventThe timeline event id to pass back to loot item actions.
Loot Container Foundctx.player.levelnumberPlayer levelThe player level used for this macro run.
Loot Container Foundctx.player.currencyCoppernumberCurrencyThe player currency carried in copper.
Loot Container Foundctx.player.bag.usedSlotsnumberBag usedThe number of backpack slots currently occupied.
Loot Container Foundctx.player.bag.maxSlotsnumberBag capacityThe current backpack capacity including equipped bag bonuses.
Loot Container Foundctx.player.bag.freeSlotsnumberBag freeThe number of free backpack slots remaining.
Loot Container Foundctx.player.derivedStats.maxLifenumberDerived statA derived stat value; other stat keys are available beside maxLife.
Loot Container Foundctx.player.equipment.mainHand.itemDefinitionKeystringEquipped itemAn equipped item definition key. Replace mainHand with another equipment slot as needed.
Loot Container Foundctx.player.equipment.mainHand.raritystringEquipped item rarityThe rarity of an equipped item.
Loot Container Foundctx.player.equipment.mainHand.itemLevelnumberEquipped item levelThe required level of an equipped item.
Loot Container Foundctx.player.equipment.mainHand.dropLevelnumberEquipped drop levelThe drop level used to generate an equipped item.
Loot Container Foundctx.player.equipment.mainHand.stats.maxLifenumberEquipped item statA stat contribution from an equipped item; other stat keys are available beside maxLife.
Loot Container Foundctx.player.equipment.mainHand.affixes[].keystringEquipped affixA rolled affix key on an equipped item.

Blocks

BlockCategorySummary
Open containerContainerOpens the container found by the event.
Check each itemLootLoops over each item generated by Open container.
If item is rareRulesChecks whether the current item rarity is rare.
If item is weaponRulesChecks whether the current item category is weapon.
Keep itemLootMoves the current item into your inventory.
Leave itemLootSkips the current item without picking it up.
Sell itemLootConverts the current item into its vendor value.
Equip itemLootMoves the current item into a legal equipment slot when possible, otherwise keeps it.
ContinueFlowReturns continue to the Storyteller.
PauseFlowReturns pause to the Storyteller.