Macro APITriggers
Item Drop Found
Runs when an item appears during a run.
- Category
- Loot
- Runs when
- An item drops.
- Summary
- Runs when an item appears during a run.
- Version
- 1
Events
- system-item-drop
Lua Example
if ctx.itemDrop.item.upgrade ~= nil and ctx.itemDrop.item.upgrade.isUpgradeForEquippedSlot then
return loot.equipItem(ctx.itemDrop.item)
end
if ctx.itemDrop.item.rarity == "junk" then
return loot.salvageItem(ctx.itemDrop.item)
end
return loot.keepItem(ctx.itemDrop.item)ctx Fields
| Trigger | Path | Type | Label | Description |
|---|---|---|---|---|
| Item Drop Found | ctx.itemDrop.timelineItemDropId | id | Item drop id | The item drop row id when the runtime can expose it before commit. |
| Item Drop Found | ctx.itemDrop.timelineEventId | id | Source event | The game event where the item appeared. |
| Item Drop Found | ctx.itemDrop.item.itemDefinitionKey | string | Drop item definition | The dropped item's definition key. |
| Item Drop Found | ctx.itemDrop.item.categoryKey | string | Drop item category | The dropped item's category key. |
| Item Drop Found | ctx.itemDrop.item.categoryFilterGroup | string | Drop item filter group | The dropped item's broad filter group. |
| Item Drop Found | ctx.itemDrop.item.rarity | string | Drop item rarity | The dropped item's rarity. |
| Item Drop Found | ctx.itemDrop.item.quantity | number | Drop item quantity | The dropped stack quantity. |
| Item Drop Found | ctx.itemDrop.item.itemLevel | number | Drop item level | The dropped item's required level. |
| Item Drop Found | ctx.itemDrop.item.dropLevel | number | Drop level | The level used to generate the item. |
| Item Drop Found | ctx.itemDrop.item.vendorValueCopper | number | Drop vendor value | The stack's vendor value in copper. |
| Item Drop Found | ctx.itemDrop.item.tags[] | array | Drop item tags | Affix group and tag labels on the dropped item. |
| Item Drop Found | ctx.itemDrop.item.isEquippable | boolean | Drop item equippable | Whether the dropped item can be equipped. |
| Item Drop Found | ctx.itemDrop.item.upgrade.slot | string | Drop upgrade slot | The equipped slot the dropped item was compared against; two-slot item types use the weaker occupied slot, or an empty slot first. |
| Item Drop Found | ctx.itemDrop.item.upgrade.isUpgradeForEquippedSlot | boolean | Drop upgrade | True when the dropped item's raw stat total is greater than the compared equipped slot, or the slot is empty. |
| Item Drop Found | ctx.itemDrop.item.upgrade.statDeltas.maxLife | number | Drop upgrade stat delta | A stat delta versus the compared equipped slot; other stat keys are available beside maxLife. |
| Item Drop Found | ctx.itemDrop.item.affixes[].key | string | Drop affix key | A rolled affix key on the dropped item. |
| Item Drop Found | ctx.itemDrop.item.affixes[].type | string | Drop affix type | Whether the rolled affix is a prefix or suffix. |
| Item Drop Found | ctx.itemDrop.item.affixes[].name | string | Drop affix name | The rolled affix display name. |
| Item Drop Found | ctx.itemDrop.item.affixes[].equipLevelRequired | number | Drop affix level | The level required by the rolled affix. |
| Item Drop Found | ctx.itemDrop.item.affixes[].modifiers[].stat | string | Drop affix modifier stat | The stat changed by a rolled affix modifier. |
| Item Drop Found | ctx.itemDrop.item.affixes[].modifiers[].op | string | Drop affix modifier op | The operation used by a rolled affix modifier. |
| Item Drop Found | ctx.itemDrop.item.affixes[].modifiers[].value | number | Drop affix modifier value | The numeric value of a rolled affix modifier. |
| Item Drop Found | ctx.itemDrop.item.implicitModifiers[].stat | string | Drop implicit modifier stat | The stat changed by a base implicit modifier. |
| Item Drop Found | ctx.itemDrop.item.implicitModifiers[].op | string | Drop implicit modifier op | The operation used by a base implicit modifier. |
| Item Drop Found | ctx.itemDrop.item.implicitModifiers[].value | number | Drop implicit modifier value | The numeric value of a base implicit modifier. |
| Item Drop Found | ctx.itemDrop.item.isUnique | boolean | Drop is unique | True when the dropped item is an Uncommon Rare. |
| Item Drop Found | ctx.itemDrop.item.uniqueImplicitModifiers[].stat | string | Drop unique implicit stat | The stat changed by a unique implicit modifier. |
| Item Drop Found | ctx.itemDrop.item.uniqueImplicitModifiers[].op | string | Drop unique implicit op | The operation used by a unique implicit modifier. |
| Item Drop Found | ctx.itemDrop.item.uniqueImplicitModifiers[].value | number | Drop unique implicit value | The numeric value of a unique implicit modifier. |
| Item Drop Found | ctx.itemDrop.item.timelineEventId | id | Drop item event | The timeline event id to pass back to drop item actions. |
| Item Drop Found | ctx.player.level | number | Player level | The player level used for this macro run. |
| Item Drop Found | ctx.player.currencyCopper | number | Currency | The player currency carried in copper. |
| Item Drop Found | ctx.player.bag.usedSlots | number | Bag used | The number of backpack slots currently occupied. |
| Item Drop Found | ctx.player.bag.maxSlots | number | Bag capacity | The current backpack capacity including equipped bag bonuses. |
| Item Drop Found | ctx.player.bag.freeSlots | number | Bag free | The number of free backpack slots remaining. |
| Item Drop Found | ctx.player.derivedStats.maxLife | number | Derived stat | A derived stat value; other stat keys are available beside maxLife. |
| Item Drop Found | ctx.player.equipment.mainHand.itemDefinitionKey | string | Equipped item | An equipped item definition key. Replace mainHand with another equipment slot as needed. |
| Item Drop Found | ctx.player.equipment.mainHand.rarity | string | Equipped item rarity | The rarity of an equipped item. |
| Item Drop Found | ctx.player.equipment.mainHand.itemLevel | number | Equipped item level | The required level of an equipped item. |
| Item Drop Found | ctx.player.equipment.mainHand.dropLevel | number | Equipped drop level | The drop level used to generate an equipped item. |
| Item Drop Found | ctx.player.equipment.mainHand.stats.maxLife | number | Equipped item stat | A stat contribution from an equipped item; other stat keys are available beside maxLife. |
| Item Drop Found | ctx.player.equipment.mainHand.affixes[].key | string | Equipped affix | A rolled affix key on an equipped item. |
Blocks
| Block | Category | Summary |
|---|---|---|
| If item is rare | Rules | Checks whether the current item rarity is rare. |
| If item is weapon | Rules | Checks whether the current item category is weapon. |
| Keep item | Loot | Moves the current item into your inventory. |
| Leave item | Loot | Skips the current item without picking it up. |
| Salvage item | Loot | Converts the current item into crafting materials. |
| Sell item | Loot | Converts the current item into its vendor value. |
| Equip item | Loot | Moves the current item into a legal equipment slot when possible, otherwise keeps it. |
| Continue | Flow | Returns continue to the Storyteller. |
| Pause | Flow | Returns pause to the Storyteller. |