Uncommon Rares
Macro APITriggers

Damage Received

Runs when the player takes damage.

Category
Combat
Runs when
Damage is received.
Summary
Runs when the player takes damage.
Version
1

Events

  • system-combat-mob-attack

Lua Example

print("Life ratio", ctx.combat.currentLifeRatio)

ctx Fields

TriggerPathTypeLabelDescription
Damage Receivedctx.combat.currentLifeRationumberLife ratioCurrent life divided by maximum life after damage.
Damage Receivedctx.combat.timelineEventIdidSource eventTimeline event where damage appeared.
Damage Receivedctx.player.levelnumberPlayer levelThe player level used for this macro run.
Damage Receivedctx.player.currencyCoppernumberCurrencyThe player currency carried in copper.
Damage Receivedctx.player.bag.usedSlotsnumberBag usedThe number of backpack slots currently occupied.
Damage Receivedctx.player.bag.maxSlotsnumberBag capacityThe current backpack capacity including equipped bag bonuses.
Damage Receivedctx.player.bag.freeSlotsnumberBag freeThe number of free backpack slots remaining.
Damage Receivedctx.player.derivedStats.maxLifenumberDerived statA derived stat value; other stat keys are available beside maxLife.
Damage Receivedctx.player.equipment.mainHand.itemDefinitionKeystringEquipped itemAn equipped item definition key. Replace mainHand with another equipment slot as needed.
Damage Receivedctx.player.equipment.mainHand.raritystringEquipped item rarityThe rarity of an equipped item.
Damage Receivedctx.player.equipment.mainHand.itemLevelnumberEquipped item levelThe required level of an equipped item.
Damage Receivedctx.player.equipment.mainHand.dropLevelnumberEquipped drop levelThe drop level used to generate an equipped item.
Damage Receivedctx.player.equipment.mainHand.stats.maxLifenumberEquipped item statA stat contribution from an equipped item; other stat keys are available beside maxLife.
Damage Receivedctx.player.equipment.mainHand.affixes[].keystringEquipped affixA rolled affix key on an equipped item.

Blocks

BlockCategorySummary
ContinueFlowReturns continue to the Storyteller.
PauseFlowReturns pause to the Storyteller.