> 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/grouped-effects-and-usage.md).

# Grouped Effects & Usage

### Grouped Effects

A grouped effect bundles multiple effects together so they all fire **at the same time**, sharing a single chance roll and cooldown. If the chance roll fails, none of the effects in the group fire.

***

### Format

```
GROUP chance=CHANCE cooldown=COOLDOWN | EFFECT1 | EFFECT2 | EFFECT3
```

* `GROUP` is the keyword that starts the group
* `chance` and `cooldown` are optional, same as regular effects
* Each effect in the group is separated by `|`
* Child effects **do not** have their own chance or cooldown — those belong to the group

***

### Basic Example

```
GROUP | ATTACK:FREEZE:3 target=victim | ATTACK:MESSAGE:{&bFrozen!} target=victim
```

Both effects fire together every time. No shared chance or cooldown set.

***

### With Chance and Cooldown

```
GROUP chance=30 cooldown=10 | ATTACK:FREEZE:5 target=victim | ATTACK:MESSAGE:{&bYou have been frozen!} target=victim | ATTACK:MESSAGE:{&cWatch out!} target=attacker
```

* 30% chance to trigger the whole group
* Once triggered, 10 second cooldown before it can trigger again
* All 3 effects fire together when the group activates

***

### Critical Strike Example

A classic critical strike combo — chance to deal bonus damage, freeze the enemy, and send messages to both players:

```
GROUP chance=20 cooldown=5 | ATTACK:INCREASE_DAMAGE:100 target=attacker | ATTACK:FREEZE:3 target=victim | ATTACK:MESSAGE:{&4Critical Strike!} target=victim | ATTACK:MESSAGE:{&6You landed a critical hit!} target=attacker
```

***

### Thorns Combo Example

When hit, 40% chance to reflect damage and send a warning:

```
GROUP chance=40 cooldown=8 | DEFENSE:REMOVE_HEALTH:15 target=attacker | DEFENSE:FIRE:3 target=attacker | DEFENSE:MESSAGE:{&cYou triggered my thorns!} target=attacker
```

***

### Mixed Triggers in a Group

Child effects in a group **must** match the trigger context. ATTACK effects only fire on ATTACK triggers, DEFENSE effects only on DEFENSE triggers. Mixing them in one group means only the matching ones will fire depending on what triggered the group.

> It is recommended to keep all child effects in a group using the same trigger to avoid confusion.

***

### Key Rules

| Rule                                             | Detail                                                     |
| ------------------------------------------------ | ---------------------------------------------------------- |
| Chance is shared                                 | One roll decides if the whole group fires                  |
| Cooldown is shared                               | One cooldown timer for the whole group                     |
| Child effects have no individual chance/cooldown | Those fields are ignored on children                       |
| Children can have their own target               | Each child can target `attacker` or `victim` independently |
| Groups cannot be nested                          | You cannot put a group inside a group                      |

***

### In-Game UI

When using `/agx create` or `/agx edit`, grouped effects can be created through the **Effect List** screen:

1. Click **Add Grouped Effect**
2. Set the group's shared chance and cooldown
3. Add child effects one by one using the child effect editor
4. Each child supports its own type, key, value, and target
5. Save the group — it appears as a single entry in the effect list

***

### Full Config Example

json

```json
"effects": [
  "ATTACK:INCREASE_DAMAGE:50",
  "ATTACK:FIRE:3 target=victim",
  "GROUP chance=25 cooldown=8 | ATTACK:INCREASE_DAMAGE:150 | ATTACK:FREEZE:5 target=victim | ATTACK:MESSAGE:{&4CRITICAL! &bFreezing you!} target=victim | ATTACK:MESSAGE:{&6Critical hit landed!} target=attacker"
]
```
