> For the complete documentation index, see [llms.txt](https://humble-development.gitbook.io/advancedgearx/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://humble-development.gitbook.io/advancedgearx/documentation/triggers.md).

# Trigger & Targets

Triggers

| Trigger | When it fires                              | Wearer role | Notes                                                                                                                                       |
| ------- | ------------------------------------------ | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| ATTACK  | Wearer deals damage to another entity      | attacker    | The entity being hit is the victim.                                                                                                         |
| DEFENSE | Wearer receives damage from another entity | victim      | The entity that hit them is the attacker. For weapons, fires when holding the weapon and taking damage.                                     |
| BUFF    | Passive — no combat required               | wearer      | Applied when the full armor set is equipped or weapon is held. Removed on unequip or weapon switch. No target or chance/cooldown supported. |

Targets

| Target     | Who it refers to            | When to specify                                                                |
| ---------- | --------------------------- | ------------------------------------------------------------------------------ |
| `attacker` | The entity dealing damage   | Use when you want the effect on the one hitting, e.g. heal yourself on attack. |
| `victim`   | The entity receiving damage | Use when you want the effect on the one being hit, e.g. set enemy on fire.     |

Default targets by trigger + key

| Trigger | Effect key        | Default target                    |
| ------- | ----------------- | --------------------------------- |
| ATTACK  | `INCREASE_DAMAGE` | attacker                          |
| ATTACK  | all other keys    | victim                            |
| DEFENSE | `HEAL`            | victim (you, the one getting hit) |
| DEFENSE | all other keys    | victim                            |
| BUFF    | all keys          | wearer (fixed, cannot be changed) |

Practical examples

| Goal                                             | DSL                                                                       |
| ------------------------------------------------ | ------------------------------------------------------------------------- |
| Set enemy on fire when you attack                | `ATTACK:FIRE:5 target=victim`target=victim is the default, can be omitted |
| Send yourself a message when you attack          | `ATTACK:MESSAGE:{&6You struck hard!} target=attacker`                     |
| Heal yourself when you get hit                   | `DEFENSE:HEAL:10 target=victim`victim on DEFENSE = you, the one being hit |
| Thorns — damage attacker when hit                | `DEFENSE:REMOVE_HEALTH:5 target=attacker`                                 |
| Warn your attacker when they hit you             | `DEFENSE:MESSAGE:{&cBig mistake!} target=attacker`                        |
| Passively boost max health while wearing the set | `BUFF:HEALTH_BOOST:50`                                                    |
