> For the complete documentation index, see [llms.txt](https://axiomemu.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://axiomemu.gitbook.io/docs/data/plugins/monsteraffix.md).

# MonsterAffix

Path of Exile / Diablo style monster modifiers - tiers, affix pools, stat deltas, on-hit procs, tick and death mechanics, loot affixes and bags, and the client visuals that mark them

MonsterAffix makes open-world monsters roll a **rarity tier** (Magic / Rare / Champion) and one to four **affixes** when they spawn. An affix can scale the monster's own stats, add an on-hit proc (freeze, poison, stun, bleed, silence, knockback), give it a passive (thorns, damage absorb, shield, immunities), a timed or ground mechanic (frenzy, phasing, burning ground, frost bombs), a pack mechanic (leader aura, healer, guardian), a death mechanic (explosion, splitting, ghost) or a guaranteed reward (jewels, Box of Kundun, a bonus item with chosen options). Every roll is visible to players: tier-coloured HP bar and ground ring, tier or affix names in front of the monster name, one icon per affix with a hover tooltip, body tint, glow, size change and aura.

The goal is to make open maps worth roaming instead of parking on one spot. Arena / spot-farm servers can blacklist those maps or disable the plugin.

## File Location

```
Data/Plugins/World/MonsterAffix.xml
```

Loot affixes and the Champion tier also use shipped item bags in `Data/EventItemBag/`:

| Index       | File                                                       | Used by                                                            |
| ----------- | ---------------------------------------------------------- | ------------------------------------------------------------------ |
| `201`       | `201 - Affix Jewels.xml`                                   | Jeweller affix, Champion tier bag                                  |
| `202`       | `202 - Affix Chaos.xml`                                    | Chaos-touched affix                                                |
| `204`-`208` | `204 - Affix Golden 1.xml` .. `208 - Affix Golden 5.xml`   | Golden affix: Box of Kundun +1 to +5, picked by monster level      |
| `209`       | `209 - Affix Jewels 2.xml`                                 | Champion tier bag from monster level 100 (2 jewels)                |
| `210`-`215` | `210 - Affix Courier 1.xml` .. `215 - Affix Courier 6.xml` | Courier affix: event entry parts +1 to +6, picked by monster level |

Each bag has its `<Bag Index="...">` row in `Data/EventItemBagManager.xml`. Index `203` is not used. Index `200` is the chaos mix reward bag, not an affix bag.

Client side, the affix icons are an AxUi atlas: `Data/Interface/UI/atlas/affix.png` + `affix.xml`, sprite names `affix/<slug>`. To add icons, use `Tools\AtlasPacker` (see [Tools](/docs/tools/tools.md)): `AtlasPacker.exe -unpack <client>\Data\Interface\UI\atlas\affix.xml MyIcons`, add your PNGs to `MyIcons` (keep `default.png`), then `AtlasPacker.exe MyIcons affix affix -out <client>\Data\Interface\UI\atlas`.

## Dependencies

| Depends On                                              | Purpose                                                                                                                               |
| ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| [Monster.xml](/docs/data/monster/monster.md)            | Base stats every percentage is applied to; `Index` values for the class list                                                          |
| [MonsterSetBase](/docs/data/monster/monstersetbase.md)  | Only MonsterSetBase spawns roll when `ExcludeNonMsb="1"`                                                                              |
| [CustomMonster](/docs/data/plugins/custommonster.md)    | Applied first; affix percentages scale the *post-CustomMonster* values                                                                |
| [EventItemBag](/docs/data/eventitembag.md)              | `DropBag` and `<LevelBag>` indices                                                                                                    |
| [ItemOptionRate.xml](/docs/data/item/itemoptionrate.md) | Option rows used by bonus items (`LevelIdx`, `LuckIdx`, `ExcIdx` ...). Rows `60`-`62` are shipped for affixes                         |
| [MapManager.xml](/docs/data/mapmanager.md)              | Map ids for the map list                                                                                                              |
| Client                                                  | Receives the affix table at login (game-data-sync). **GameServer and client must be deployed together** when the table layout changes |

## How It Loads

* Read once at startup, again on the FeatureManager reload and on the GM command `/affixreload`.
* Monsters that already exist keep their current roll; the new table applies to the next spawn or respawn.
* Clients cache the table at login. After a reload, players relog to see new names, icons or tooltips. Server-side behaviour changes take effect immediately.
* A missing file, `Enabled="0"`, no tiers or no affixes = plugin off. Nothing rolls, nothing is sent to clients, HP bars look vanilla.

## Schema

```xml
<MonsterAffix Enabled="1" RerollOnRespawn="1" Debug="0" ChildRewards="0"
              ItemRateAffectsExc="0" NameStyle="1" CCImmunitySeconds="10" LootLevelScale="20">
  <Rules ExcludeNpc="1" ExcludeNonMsb="1" AllowDungeon="1" ExcludeAttackTypeGte100="0" MinLevel="1" MaxLevel="400"/>

  <Maps Mode="blacklist">
    <Map Id="6"/>
  </Maps>

  <Classes Mode="blacklist">
    <Class Id="161"/>
  </Classes>

  <Tiers>
    <Tier Id="3" Name="Champion" Chance="1000" AffixMin="3" AffixMax="4" BarColor="230,70,160" Ring="1"
          Glow="1" GlowColor="230,70,160" Bright="100" ScaleBonus="6" BarWidth="150"
          ItemRate="150" ExpRate="150" ZenDrop="300" ExtraRolls="2" DropBag="201" DropLevelBonus="15">
      <LevelBag MinLevel="100" MaxLevel="400" Bag="209"/>
    </Tier>
  </Tiers>

  <Affixes>
    <Affix Id="11" Name="Frozen" Weight="90" Life="20" ItemRate="10" ExpRate="10"
           Mechanic="ICE_PROC" M1="35" M2="4" Tint="170,240,255" Aura="2"
           Icon="affix/frozen" Desc="Hits may freeze you (Ice resistance helps)."/>
  </Affixes>
</MonsterAffix>
```

Every attribute has a default, so an `<Affix>` line only needs what it changes.

## Root

| Attribute            | Type | Default | Effect                                                                                                                                                                                                                                                          |
| -------------------- | ---- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Enabled`            | 0/1  | 1       | Master switch                                                                                                                                                                                                                                                   |
| `RerollOnRespawn`    | 0/1  | 1       | `1` = every respawn rolls again (a spot keeps changing). `0` = a monster keeps the tier and affixes it rolled the first time, until restart                                                                                                                     |
| `Debug`              | 0/1  | 0       | Writes one GameServer log line per roll, proc, tick and death mechanic, prefixed `[MonsterAffix]`. Use it while tuning, turn it off in production                                                                                                               |
| `ChildRewards`       | 0/1  | 0       | `0` = monsters spawned by affixes (split copies, summons, guardians, illusions, ghosts) give no experience, zen or loot. In MU more monsters means more experience, so paid adds would be a reward, not a threat. Illusion copies never pay, whatever this says |
| `ItemRateAffectsExc` | 0/1  | 0       | `0` = `ItemRate` only raises how often an item drops. `1` = it also multiplies the map's excellent and ancient drop chance. Extra rolls still each roll the map's own excellent chance                                                                          |
| `NameStyle`          | 0-2  | 1       | HP bar name line. `0` = affix names + monster name, `1` = tier name + monster name, `2` = tier + affixes + monster name                                                                                                                                         |
| `CCImmunitySeconds`  | int  | 10      | After an affix stun or silence lands, that player cannot be hard-CC'd by affixes again for this many seconds                                                                                                                                                    |
| `LootLevelScale`     | %    | 0       | Share of the monster level added to the bonus item pool level. Shipped `20`: a level 110 Champion rolls 110 + 22 + 15 = item level about 147                                                                                                                    |

## Rules

| Attribute                 | Type | Default | Effect                                                                                                                               |
| ------------------------- | ---- | ------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| `ExcludeNpc`              | 0/1  | 1       | NPCs never roll                                                                                                                      |
| `ExcludeNonMsb`           | 0/1  | 1       | Only monsters placed by MonsterSetBase roll. Skips invasion, event, boss-spawned and summoned monsters. Leave on unless you know why |
| `AllowDungeon`            | 0/1  | 1       | `1` = Dungeon plugin monsters roll even with `ExcludeNonMsb="1"`. Map and class lists still apply                                    |
| `ExcludeAttackTypeGte100` | 0/1  | 0       | `1` = casters (Monster.xml `AttackType` 100 and above) never roll                                                                    |
| `MinLevel` / `MaxLevel`   | int  | 1 / 400 | Monster level band that may roll at all                                                                                              |

Player summons and children spawned by affixes never roll, regardless of these rules.

## Maps and Classes

Both lists share one shape:

| Attribute                 | Effect                                                                                                              |
| ------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| `Mode`                    | `blacklist` (listed ids never roll, everything else may) or `whitelist` (only listed ids roll). Default `blacklist` |
| `<Map Id>` / `<Class Id>` | Map number / Monster.xml `Index`                                                                                    |

The shipped blacklist covers Arena, Devil Square, Blood Castle, Chaos Castle, Kalima, Valley of Loren (Castle Siege), Crywolf, Kanturu, Barracks / Refuge, Illusion Temple, Raklion, Santa Village, Vulcanus, Duel Arena, Doppelganger and Loren Market, plus Castle Siege gates / statues / guards / mercenaries, Kundun, Erohim, Selupan, the golden invasion classes and the Imperial Guardian bosses. Add your farm maps to the map list if you want them plain.

## Tiers

Rolled first, **highest `Id` first**, so a rare tier is never shadowed by a common one. Tier ids are `1`-`3`; other ids are skipped with a log warning.

| Attribute                           | Type        | Default | Effect                                                                                            |
| ----------------------------------- | ----------- | ------- | ------------------------------------------------------------------------------------------------- |
| `Id`                                | 1-3         | -       | Tier number. 1 = Magic, 2 = Rare, 3 = Champion by convention                                      |
| `Name`                              | string (31) | `Tier`  | Shown on the HP bar (with `NameStyle` 1 or 2) and in `/affixinfo`                                 |
| `Chance`                            | int         | 0       | Chance per 10 000 spawns. `1000` = 10%. Tiers are tested in order 3, 2, 1, each with its own roll |
| `AffixMin` / `AffixMax`             | 1-4         | 1 / 1   | How many affixes this tier gets, rolled evenly in that range                                      |
| `BarColor`                          | `r,g,b`     | white   | One colour per tier: HP bar fill, its rim, the name line and the ground ring                      |
| `Ring`                              | 0/1         | 1       | `1` = tier-coloured circle under the monster                                                      |
| `Glow`                              | 0/1         | 0       | `1` = golden-monster style chrome pass on the body                                                |
| `GlowColor`                         | `r,g,b`     | white   | Chrome colour when `Glow="1"`. Keep it the same as `BarColor`                                     |
| `Bright`                            | %           | 100     | Chrome brightness when `Glow="1"`                                                                 |
| `ScaleBonus`                        | signed %    | 0       | Model size change, added to the affixes' own `Scale`                                              |
| `BarWidth`                          | %           | 100     | HP bar width relative to the stock bar. `150` = one and a half times                              |
| `ItemRate`                          | +%          | 0       | Item drop chance bonus for every monster of this tier, added to the affixes' own                  |
| `ExpRate`                           | +%          | 0       | Experience bonus for every monster of this tier                                                   |
| `ZenDrop`                           | %           | 0       | Guaranteed zen pile on every death, % of the normal zen amount (summed with affix `ZenDrop`)      |
| `ExtraRolls`                        | int         | 0       | Extra vanilla loot rolls on every death (summed with affix `ExtraRolls`, total capped at 10)      |
| `DropBag`                           | int         | -1      | EventItemBag dropped on **every** death of this tier. `-1` = none                                 |
| `DropLevelBonus`                    | int         | 0       | The monster's normal item drop is rolled this many monster levels higher                          |
| `<LevelBag MinLevel MaxLevel Bag/>` | child rows  | -       | Tier bag picked by monster level. The first row that fits wins over `DropBag`. Max 6 rows         |

**Shipped tiers:**

| Tier     | Chance | Affixes | Rewards                                                                                                                                          |
| -------- | ------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| Magic    | `1000` | 1       | +30% drop and exp, drop rolled 5 levels higher                                                                                                   |
| Rare     | `1000` | 2-3     | +80% drop and exp, 1 extra roll, zen pile 100%, drop 10 levels higher, half-bright chrome                                                        |
| Champion | `1000` | 3-4     | +150% drop and exp, 2 extra rolls, zen pile 300%, drop 15 levels higher, full chrome, bag `201` on every kill (bag `209` from monster level 100) |

{% hint style="warning" %}
All three shipped tiers use `Chance="1000"`. Because each tier rolls in turn (3, then 2, then 1), about 10% of eligible spawns become Champion, 9% Rare and 8% Magic - roughly one monster in four is affixed. Lower the chances for a slower server (see the Conservative example below).
{% endhint %}

{% hint style="info" %}
**Rarity pays, affixes threaten.** Put the payout on the tier, not on individual affixes. If reward lives on a few "loot" affixes, players learn to skip every dangerous combination that did not roll them. With tier rewards a Champion is worth killing whatever it rolled; affix-level `ItemRate` / `ExpRate` should stay small flavour (the shipped file mostly uses 10-20), with Greedy / Generous / Wise and the loot affixes as deliberate spikes.
{% endhint %}

{% hint style="info" %}
A roll that lands a tier but finds no eligible affix (level band, `MinTier`, clashes) falls back to a plain monster. Keep every tier a few affixes to choose from at every level band you want covered.
{% endhint %}

## Affixes

After the tier, affixes are drawn by `Weight` from the pool of affixes that fit. An affix is left out when:

* its `Weight` is `0`, its `MinTier` is above the rolled tier, or the monster level is outside `MinLevel` / `MaxLevel`
* it is a bonus excellent or ancient item affix and the monster is below level 25
* the monster already has the same affix, or another affix with the same `Mechanic`
* the monster already has a loot affix and this is a loot affix too (one loot affix per monster)
* it clashes with one already rolled: `ENRAGE` + `FRENZIED`, `SHIELDED` + `MOLTEN_BARRIER`, `PACK_LEADER` + `HASTENING`, `WARDED` + `SUMMONER` or `PHASING`, `DESECRATOR` + `FROSTBOMB`

### Identity and eligibility

| Attribute               | Type        | Default | Effect                                                                                                    |
| ----------------------- | ----------- | ------- | --------------------------------------------------------------------------------------------------------- |
| `Id`                    | 1-255       | -       | Unique id. Referenced by the GM command and stored per monster. Duplicates are skipped with a log warning |
| `Name`                  | string (31) | `Affix` | Prefixed to the monster name with `NameStyle` 0 or 2: "Frozen Brutal Bull Fighter"                        |
| `Weight`                | int         | 100     | Relative draw weight inside the eligible pool. `0` disables the affix without deleting it                 |
| `MinLevel` / `MaxLevel` | int         | 1 / 400 | Monster level band                                                                                        |
| `MinTier`               | 1-3         | 1       | Lowest tier that may roll it. Use `3` for Champion-only affixes                                           |

### Stat deltas

All are **signed percentages of the monster's own value** after Monster.xml, the global multipliers and CustomMonster have been applied. Several affixes on one monster add their percentages together before applying. There are no flat numbers, so an affix is as strong on a level 3 monster as on a level 300 one.

| Attribute                               | Effect                                                                             | Notes                                                                        |
| --------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
| `Life`                                  | Max life                                                                           | Total never below -90%                                                       |
| `Damage`                                | Physical damage min and max                                                        | Total never below -90%                                                       |
| `Defense`                               | Defense                                                                            | Total never below -100%                                                      |
| `AttackRate`                            | Attack success rate (hit chance)                                                   | Total never below -90%                                                       |
| `DefenseRate`                           | Defense success rate (how hard it is to hit)                                       | Total never below -100%                                                      |
| `AttackSpeed`                           | Attack delay. **Negative = faster**                                                | Total never below -80%; result never below 100 ms                            |
| `MoveSpeed`                             | Movement delay. **Negative = faster**                                              | Total never below -80%; result never below 100 ms                            |
| `IgnoreDef` / `DoubleDmg` / `TripleDmg` | Chance % added to the monster's own ignore-defense, double and triple damage rates | A monster hit gets at most one of the three, so stacked rates never multiply |
| `CritImmune`                            | `1` = critical, excellent, double and ignore-defense hits never land on it         |                                                                              |
| `ItemRate`                              | Item drop chance bonus                                                             | `100` = double chance                                                        |
| `MoneyRate`                             | Zen amount bonus                                                                   | `200` = triple zen                                                           |
| `ExpRate`                               | Experience bonus (solo, party, master)                                             | `100` = double experience                                                    |

### Loot

| Attribute                           | Default | Effect                                                                                                                                                                                                          |
| ----------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `DropBag`                           | -1      | EventItemBag index dropped on death for the top-damage player. `-1` = none                                                                                                                                      |
| `<LevelBag MinLevel MaxLevel Bag/>` | -       | Child rows: bag picked by monster level, wins over `DropBag`. Max 6 rows                                                                                                                                        |
| `ZenDrop`                           | 0       | Guaranteed zen pile on **every** death, as % of the monster's normal zen amount. `200` = a pile worth two normal drops. Independent of the vanilla zen roll                                                     |
| `ExtraRolls`                        | 0       | Extra runs of the monster's normal loot roll on death. Each run is its own chance with every bonus applied. `2` = three chances instead of one. Max 10. Not "N guaranteed items" - use `DropBag` for fixed loot |
| `Loot`                              | auto    | `1` = loot affix: keeps its glow on a glowing tier, never tints the body, only one per monster. Set automatically when the affix drops a bag or a bonus item                                                    |

**Bonus item.** These attributes make the plugin drop one extra item next to the monster's own untouched roll. The item is picked from a level pool: monster level + `LootLevelScale` % + tier `DropLevelBonus` + affix `DropLevelBonus`, item levels -4..+2 around it.

| Attribute                                      | Default | Effect                                                                                                                      |
| ---------------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------- |
| `ForceDrop`                                    | 0       | `1` = drop the bonus item                                                                                                   |
| `LevelIdx` / `SkillIdx` / `LuckIdx` / `JoLIdx` | -1      | [ItemOptionRate.xml](/docs/data/item/itemoptionrate.md) row for that option. `-1` = common-drop row `0`                     |
| `ExcIdx`                                       | -1      | Row of excellent option counts. Makes the item excellent (monster level 25+, 380 items allowed)                             |
| `SocketIdx`                                    | -1      | Row of socket counts. Makes it a socket item (needs a socket item in the level pool)                                        |
| `ForceSet`                                     | 0       | `1` = an ancient item from the pool's level band instead (monster level 25+). Option rows default to ItemOptionRate row `2` |
| `Harmony`                                      | 0       | `1` = add a random Jewel of Harmony option valid for the item and its +level                                                |
| `DropTop`                                      | 0       | `1` = best of several pool picks (highest item level)                                                                       |
| `DropLevelBonus`                               | 0       | Pool rolled this many monster levels higher                                                                                 |

### Mechanic and parameters

`Mechanic` is one of the names below; `M1`..`M4` are its parameters. Unused parameters are ignored. An unknown name skips that affix with a log warning.

Threat damage from mechanics is always a share of the **victim's** max life (% or per-mille), for the same reason stats are percentages.

| Mechanic               | Parameters                                                                                    | What players see                                                   |
| ---------------------- | --------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ |
| `NONE`                 |                                                                                               | Stat-only affix                                                    |
| `ICE_PROC`             | M1 chance %, M2 duration s                                                                    | Frozen: slowed. Rolls against the player's **Ice** resistance      |
| `POISON_PROC`          | M1 chance %, M2 duration s, M3 % life per tick                                                | Poisoned. Rolls against **Poison** resistance                      |
| `STUN_PROC`            | M1 chance %, M2 duration s                                                                    | Cannot move. Rolls against **Lightning** resistance                |
| `BLIND_PROC`           | M1 chance %, M2 duration s, M3 attack rate reduction %                                        | Hit chance reduced. No resistance check                            |
| `RANDOM_DEBUFF`        | M1 chance %, M2 duration s                                                                    | Random ice / poison / blind / curse                                |
| `BLEEDING` / `BURNING` | M1 chance %, M2 duration s, M3 per-mille of victim life per second                            | Damage over time                                                   |
| `SILENCING`            | M1 chance %, M2 duration s                                                                    | Skills blocked, plain attacks only                                 |
| `DISPELLER`            | M1 chance %                                                                                   | Strips one buff                                                    |
| `GALE`                 | M1 chance %                                                                                   | Knockback                                                          |
| `WORMHOLE`             | M1 chance %, M2 min tiles, M3 max tiles                                                       | Throws the player away                                             |
| `BANISHING`            | M1 chance %                                                                                   | Warps the player to the map's respawn gate                         |
| `CULLING`              | M1 % of victim life added per 10% life the victim is missing                                  | Hits harder on low-life players                                    |
| `ARCING`               | M1 radius around the victim, M2 % of life                                                     | Each hit also strikes everyone near the victim                     |
| `CORROSIVE`            | M1 armour durability loss multiplier                                                          | Armour wears out faster                                            |
| `PIERCING`             |                                                                                               | Hits skip wing absorb and Soul Barrier                             |
| `THORNS`               | M1 reflect %, M2 max reflect per hit in per-mille of the attacker's life (default 15)         | Part of every hit comes back on the attacker one tick later        |
| `ABSORB`               | M1 % of every hit absorbed (default 50)                                                       | Every hit deals only the rest                                      |
| `HEXPROOF`             |                                                                                               | Immune to freeze, poison, stun, sleep, curses and damage over time |
| `MIRRORED`             |                                                                                               | Freeze / poison / stun cast on it lands on the caster              |
| `TEMPORAL`             | M1 radius, M2 absorb % (default 99)                                                           | Hits from outside the bubble are absorbed (min 1 damage)           |
| `OUTNUMBERED`          | M1 % less damage per extra attacker (last 3 s), M2 cap %                                      | Tougher against groups                                             |
| `BOUND`                | M1 radius, M2 % of each hit                                                                   | That share is moved onto a nearby monster                          |
| `CURSE_ATTACKER`       | M1 chance %, M2 duration s, M3 `0` = lesser damage / `1` = lesser defense, M4 value %         | Debuff on the player who hit it                                    |
| `CHARGED`              | M1 chance % when hit, M2 radius, M3 % of life                                                 | Zaps everyone close                                                |
| `REGEN`                | M1 % max life per tick, M2 tick ms                                                            | HP bar climbs back                                                 |
| `VAMPIRIC`             | M1 % of dealt damage healed, M2 floor per hit in per-mille of its own life (default 5)        | Its bar climbs when it hits                                        |
| `MANA_BURN`            | M1 % of dealt damage drained (never less than 3% of mana)                                     | Mana drops, then stamina once mana is empty                        |
| `ENRAGE`               | M1 life threshold %, M2 +damage %, M3 -attack delay %, M4 `1` = grows smoothly with life lost | Turns red, hits harder and faster                                  |
| `FRENZIED`             | M1 period ms, M2 active ms, M3 +damage %, M4 damage taken -%                                  | Frenzy every few seconds                                           |
| `PHASING`              | M1 period ms, M2 invulnerable ms                                                              | Cannot be hurt while phased out                                    |
| `SHIELDED`             | M1 hits absorbed, M2 reduction % on those hits                                                | First N hits taken are mostly absorbed                             |
| `MOLTEN_BARRIER`       | M1 pool % of its life, M2 absorb %, M3 blast % of victim life, M4 radius                      | Barrier soaks damage, then explodes. Back after 10 s               |
| `EXPLODE`              | M1 % of each victim's max life, M2 radius tiles, M3 fuse ms                                   | Warning ring, then a blast at the corpse                           |
| `SPLIT`                | M1 count, M2 class (`-1` = same), M3 life %                                                   | Copies spawn at the corpse, already aggro'd                        |
| `REVENANT`             | M1 seconds                                                                                    | An invulnerable ghost fights on after death                        |
| `SUMMONER`             | M1 class (`-1` = same), M2 count per wave, M3 interval ms, M4 max alive                       | Reinforcements while fighting                                      |
| `WARDED`               | M1 guardians, M2 guardian life %                                                              | Cannot be hurt while a guardian lives                              |
| `ILLUSIONIST`          | M1 copies, M2 copy lifetime ms, M3 cooldown ms                                                | Short-lived copies that give nothing                               |
| `BLINK`                | M1 cooldown ms, M2 min distance tiles                                                         | Teleports next to a far target                                     |
| `VORTEX`               | M1 cooldown ms, M2 min distance                                                               | Pulls a far target next to it                                      |
| `HUNTER`               | M1 view range %                                                                               | Sees further and ignores the monster leash                         |
| `QUAKING`              | M1 interval ms, M2 radius, M3 % of life, M4 stun s                                            | Ground stomp                                                       |
| `DESECRATOR`           | M1 interval ms, M2 pool seconds, M3 per-mille of life per second                              | Burning ground under the player                                    |
| `FROSTBOMB`            | M1 interval ms, M2 radius, M3 % of life, M4 freeze s                                          | Mark on the ground, blast 2 s later                                |
| `VINED`                | M1 radius, M2 tick ms, M3 per-mille of life per stack, M4 max stacks                          | Standing still stacks damage; walk 3 tiles to clear                |
| `SIPHONING`            | M1 safe inner radius, M2 outer radius, M3 % mana per s, M4 per-mille life per s               | Drain ring; right next to it is safe                               |
| `WITHERING`            | M1 radius, M2 potion heal % while inside                                                      | Potions heal less nearby                                           |
| `PACK_LEADER`          | M1 radius tiles, M2 minion +damage %, M3 minion +defense %, M4 minion ignore-defense %        | Nearby plain monsters are stronger until it dies                   |
| `HASTENING`            | M1 radius, M2 minion speed %                                                                  | Nearby plain monsters are faster                                   |
| `GUARDIAN`             | M1 period ms, M2 radius, M3 ms of invulnerability                                             | Pulses invulnerability onto nearby monsters                        |
| `MENDER`               | M1 radius, M2 tick ms, M3 % of life                                                           | Heals nearby monsters                                              |
| `SOUL_EATER`           | M1 radius, M2 +damage % per nearby death, M3 max stacks                                       | Grows stronger as monsters die near it                             |
| `BLESSED`              | M1 % life + mana restored, M2 radius                                                          | Restores the killer and nearby party on death                      |
| `HERALD`               | M1 cooldown minutes per map (default 30)                                                      | Spawn is announced on the map; only one alive per map              |

`PACK_LEADER` and `HASTENING` only buff plain monsters, never another Magic / Rare / Champion. Thorns reflect is a real monster hit, so a monster that is both Frozen and Thorned can freeze the player through the reflect.

### Client visuals

| Attribute            | Type         | Default       | Effect                                                                                                                                                                                                                                                                                                                                                     |
| -------------------- | ------------ | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Tint`               | `r,g,b`      | `255,255,255` | Body tint. Pure white = no tint                                                                                                                                                                                                                                                                                                                            |
| `TintPrio`           | int          | by mechanic   | The body shows **one** tint: the highest `TintPrio` among its affixes. `0` = never tints. Loot affixes default to `0`                                                                                                                                                                                                                                      |
| `Glow` / `GlowColor` | 0/1, `r,g,b` | 0 / white     | Chrome overlay, same pass as the golden monsters                                                                                                                                                                                                                                                                                                           |
| `Scale`              | signed %     | 0             | Model size, added to the tier's `ScaleBonus`                                                                                                                                                                                                                                                                                                               |
| `Aura`               | 0-15         | 0             | `0` none, `1` fire, `2` frost breath, `3` flare orbit, `4` stone shell, `5` skulls, `6` ward shell + ring, `7` charge shell (only while its shield or barrier is up), `8` banner ring, `9` rift sparks, `10` summon circle, `11` time bubble, `12` siphon ring, `13` vines, `14` withering haze, `15` loot sparkle. Shells and rings take the affix `Tint` |
| `Icon`               | sprite name  |               | Atlas sprite drawn above the HP bar, e.g. `affix/frozen`. Missing sprite falls back to `affix/default`                                                                                                                                                                                                                                                     |
| `Desc`               | string (95)  |               | Tooltip text when the player hovers the icon                                                                                                                                                                                                                                                                                                               |

Bright red is reserved for the enraged / frenzied state. Aura effects are attached to the monster and removed when it dies, leaves the viewport or respawns plain.

## Important Behavior

* **Boot population rolls too.** The plugin sweeps every monster that spawned before it loaded, so the first server start already shows affixed monsters. The log prints `Boot sweep: N monsters checked, M rolled an affix tier.`
* **Respawn re-rolls.** A spot is never a fixed set of elites. Set `RerollOnRespawn="0"` if you want persistent named monsters instead.
* **Stats are restored before a re-roll.** Percentages never compound across respawns.
* **Passives apply on the first AI tick after the roll**, not at the exact spawn moment. The gap is well under a second.
* **Procs use the player's resistances.** A 255 resistance makes the player immune to that proc. Blind has no resistance.
* **Children never pay by default.** Explosion, split, summon, guardian, illusion and ghost children never roll affixes, never respawn, and are removed 10 minutes after spawn or shortly after death. With `ChildRewards="0"` they give no experience, zen or loot.
* **Summoner and Blinker only act while the monster is engaged** (has a target). Automata-driven monsters (Kanturu / Raklion style) never enter that state, so those affixes are inert on them. `AttackSpeed` and `MoveSpeed` also do nothing on automata monsters.
* **Pack Leader picks minions among the monsters spawned around it** (same spot). It does not buff monsters from far-away spots even if they wander within the radius.
* **Drops and experience multiply the existing chain.** `ItemRate="100"` doubles whatever the map, account level, bonus manager and catch-up already produce.
* **Loot bags and bonus items drop for the top-damage player**, like every other monster drop. The bag itself decides item, count and fireworks.
* **Extra drops are spread out.** Bag drops, bonus items, extra rolls and the zen pile land on free tiles within 1-2 tiles of the corpse instead of stacking on it; the normal vanilla roll stays on the corpse tile.
* **Affix rolls travel with the monster's viewport packet**, so a player walking into range sees the roll immediately. Enrage re-sends it so the bar and tint switch to red for everyone.
* **Nothing is persisted.** A server restart re-rolls the world.

## GM and Debug Commands

| Where             | Command                       | Effect                                                                                            |
| ----------------- | ----------------------------- | ------------------------------------------------------------------------------------------------- |
| In-game chat (GM) | `/affix <tier> <id[,id,...]>` | Force a tier and up to four affix ids on the nearest monster within 6 tiles. `/affix 0` strips it |
| In-game chat (GM) | `/affixinfo`                  | Print the nearest monster's live stats, affixes, flags and counters                               |
| In-game chat (GM) | `/affixreload`                | Re-read the XML                                                                                   |
| Client chat       | `$affix`                      | Print the selected monster's affix state as the client sees it                                    |
| Client chat       | `$affix table`                | Print the affix table the client received                                                         |

## Examples

{% tabs %}
{% tab title="Conservative (low-rate server)" %}

```xml
<Tiers>
  <Tier Id="1" Name="Magic"    Chance="400" AffixMin="1" AffixMax="1" BarColor="90,150,255" Glow="0" BarWidth="100" ItemRate="30" ExpRate="30"/>
  <Tier Id="2" Name="Rare"     Chance="100" AffixMin="2" AffixMax="2" BarColor="255,215,70" Glow="1" GlowColor="255,215,70" Bright="50" BarWidth="125" ItemRate="80" ExpRate="80" ExtraRolls="1"/>
  <Tier Id="3" Name="Champion" Chance="20"  AffixMin="3" AffixMax="3" BarColor="230,70,160" Glow="1" GlowColor="230,70,160" ScaleBonus="6" BarWidth="150" ItemRate="150" ExpRate="150" ExtraRolls="2" DropBag="201"/>
</Tiers>
```

Roughly one in 20 spawns is affixed. Keep `ItemRate` / `ExpRate` on stat affixes at 10-20 so elites are worth fighting but not the only thing worth fighting.
{% endtab %}

{% tab title="Elite hunting event" %}

```xml
<MonsterAffix Enabled="1" RerollOnRespawn="1">
  <Tiers>
    <Tier Id="1" Name="Magic"    Chance="2000" .../>
    <Tier Id="2" Name="Rare"     Chance="1500" .../>
    <Tier Id="3" Name="Champion" Chance="1000" .../>
  </Tiers>
```

Raise the chances for a weekend, `/affixreload`, and lower them again afterwards. Respawns pick up the new rates within one regen cycle.
{% endtab %}

{% tab title="Named permanent elites" %}

```xml
<MonsterAffix Enabled="1" RerollOnRespawn="0">
  <Maps Mode="whitelist">
    <Map Id="8"/>   <!-- Tarkan only -->
  </Maps>
```

With re-roll off, whatever rolled at boot stays. Players learn where "the Frozen Bloody Wolf" lives. Restart the server to shuffle.
{% endtab %}

{% tab title="Custom loot affix" %}
Create `Data/EventItemBag/216 - Affix Wings.xml`, add `<Bag Index="216" ItemIndex="*" ItemLevel="*" MonsterClass="*" SpecialValue="*"/>` to `Data/EventItemBagManager.xml`, then:

```xml
<Affix Id="91" Name="Winged" Weight="5" MinLevel="80" MinTier="3" Life="80"
       DropBag="216" Glow="1" GlowColor="90,255,110" Aura="15"
       Icon="affix/default" Desc="Carries a pair of wings."/>
```

Champion-only, weight 5 against the pool, with the loot sparkle so players can spot it. Indices `200`-`215` are already used by shipped bags, so start custom bags at `216`. Affix ids `1`-`90` are used by the shipped file.
{% endtab %}
{% endtabs %}

## Common Issues

* **No monster ever has an affix** - `Enabled="0"`, no `<Tier>` with `Chance` above 0, or the map is blacklisted. The startup log says `Loaded N tiers, M affixes` when the plugin is on.
* **Too many affixed monsters** - the shipped tiers all use `Chance="1000"` (about one spawn in four). Lower them.
* **Boot sweep shows `M` = 0** - check the map and class lists and the `Rules` level band.
* **Client shows plain bars / no names for affixed monsters** - client and GameServer are from different builds. Deploy both together.
* **Names, icons or tooltips are stale after editing the XML** - the client caches the table at login. Relog.
* **Icon shows the default star** - `Icon` sprite name is not in `Data/Interface/UI/atlas/affix.xml`. Regenerate the atlas or use an existing name.
* **Unknown Mechanic warning in the log** - the `Mechanic` value is misspelled; that affix is skipped, the rest load.
* **A Champion tier never appears** - `Chance` is per 10 000, not percent. `60` is 0.6%.
* **Summoner / Blinker never trigger** - the monster is automata-driven or never engaged you. Both need an active target.
* **Volatile did not hurt anyone** - nobody stood within `M2` tiles when the fuse ended. The warning ring and blast always play; the damage needs proximity.
* **Elite dropped nothing special** - stat affixes only change *chances*; only `DropBag`, `<LevelBag>` and `ForceDrop` / `ForceSet` guarantee a drop. Check the bag file exists and the `EventItemBagManager.xml` row is present.
* **Split copies or summons give no experience** - expected with `ChildRewards="0"`.
* **Monster still glows after respawning plain** - fixed client build required; older clients kept auras across the same object slot.
