> 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/monster/monsterskillelement.md).

# MonsterSkillElement

Atomic building blocks for monster skills. Each Element defines one effect: damage/heal over a stat, a status change, a summon, a forced teleport, a buff nullification, and so on. Up to 5 Elements are chained inside a Skill Unit.

## File Location

```
Data/Monster/MonsterSkillElement.xml
```

Loaded once at GameServer startup. Changes require a restart.

## Dependencies

| Referenced by                                                  | Purpose                                       |
| -------------------------------------------------------------- | --------------------------------------------- |
| [MonsterSkillUnit.xml](/docs/data/monster/monsterskillunit.md) | Each Unit chains up to 5 Elements by `Number` |

| Depends on                       | Purpose                                                                                 |
| -------------------------------- | --------------------------------------------------------------------------------------- |
| [Skill.txt](/docs/data/skill.md) | `NullifiedSkill` references skill indices (buff cancel, tether skill, paired effect id) |

## Schema

```xml
<MonsterSkillElement>
    <Element Number="..." Name="..."
             Type="..." SuccessRate="..."
             ContinuanceTime="..."
             IncAndDecType="..." IncAndDecValue="..."
             NullifiedSkill="..."
             CharacterClass="..." CharacterLevel="..." />
</MonsterSkillElement>
```

## Attributes

| Attribute         | Type       | Effect                                                                                                                       |
| ----------------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `Number`          | int        | Unique Element ID (0-99). Values outside this range are ignored.                                                             |
| `Name`            | string     | Human-readable label. Not used by logic.                                                                                     |
| `Type`            | int        | Effect category (see Effect Types).                                                                                          |
| `SuccessRate`     | int        | Percent chance the effect applies on hit (0-100). Rolled per target per Element.                                             |
| `ContinuanceTime` | int        | Duration in seconds for timed effects. `-1` or `*` means "indefinite" where the Type supports it. Ignored for instant Types. |
| `IncAndDecType`   | int or `*` | Stat modifier mode (see IncAndDecType Values). `*` stores -1 (none).                                                         |
| `IncAndDecValue`  | int or `*` | Magnitude paired with `IncAndDecType`. `*` stores -1. Also reused as a secondary parameter for some Types (see Type notes).  |
| `NullifiedSkill`  | int or `*` | Skill ID tied to the effect (buff to cancel, tether skill ID, or paired message ID). `*` stores -1.                          |
| `CharacterClass`  | int        | Loaded but not read by the skill pipeline. No class filter is applied. Keep `0`.                                             |
| `CharacterLevel`  | int        | Loaded but not read by the skill pipeline. No level gate is applied. Keep `0`.                                               |

## Effect Types

| Type | Name           | Behavior                                                                                                                                                                                                                                                                                                   |
| ---- | -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 0    | Stun           | Adds the stun effect for `ContinuanceTime` seconds. Blocked by Iron Defense buffs on the target. `SuccessRate` has the target's stun resistance subtracted before the roll.                                                                                                                                |
| 1    | Move           | Placeholder. The handler is empty - no movement debuff is applied by this Type directly.                                                                                                                                                                                                                   |
| 2    | HP             | Damage or heal based on `IncAndDecType`. Percent modes scale against current Life. Cycle modes write a periodic tick into the target for `ContinuanceTime` seconds.                                                                                                                                        |
| 3    | MP             | Same math as Type 2 against Mana.                                                                                                                                                                                                                                                                          |
| 4    | AG             | Same math as Type 2 against BP (AG).                                                                                                                                                                                                                                                                       |
| 5    | Defense        | Modifies the target's defense; value and duration are stored on the target and consumed over `ContinuanceTime`.                                                                                                                                                                                            |
| 6    | Attack         | Modifies the target's physical damage; stored and consumed over `ContinuanceTime`.                                                                                                                                                                                                                         |
| 7    | Durability     | Reduces durability on a randomly selected equipment slot (users only).                                                                                                                                                                                                                                     |
| 8    | Summon         | Respawns the target monster (the Element caller resurrects / repositions an allied monster). `IncAndDecValue` is the random placement radius (defaults to 10 if `*` or <0).                                                                                                                                |
| 9    | Push           | If `NullifiedSkill` < 1, knocks the target back by `IncAndDecValue` tiles (default 3). Otherwise queues a delayed tether message with `NullifiedSkill` as the skill ID.                                                                                                                                    |
| 10   | Stat Energy    | Placeholder - handler is empty.                                                                                                                                                                                                                                                                            |
| 11   | Stat Strength  | Placeholder - handler is empty.                                                                                                                                                                                                                                                                            |
| 12   | Stat Dexterity | Placeholder - handler is empty.                                                                                                                                                                                                                                                                            |
| 13   | Stat Vitality  | Placeholder - handler is empty.                                                                                                                                                                                                                                                                            |
| 14   | Remove Skill   | Strips a specific buff from the user. Supports Greater Damage and Greater Defense; `NullifiedSkill` must be that skill's ID.                                                                                                                                                                               |
| 15   | Resist Skill   | Stores a resist entry on the caster keyed to `NullifiedSkill` for `ContinuanceTime` seconds.                                                                                                                                                                                                               |
| 16   | Immune Skill   | Stores an immunity entry on the caster and applies a physical-damage immunity effect for `ContinuanceTime` seconds.                                                                                                                                                                                        |
| 17   | Teleport Skill | Teleports the caster to a random free tile within 5 tiles. Cancelled if caster is stunned or no valid tile exists.                                                                                                                                                                                         |
| 18   | Double HP      | Queues two delayed self-messages 400ms and 1000ms out. Used for boss phase effects.                                                                                                                                                                                                                        |
| 19   | Poison         | If `NullifiedSkill` < 1, adds poison for `IncAndDecValue` seconds (subject to target poison resistance). Otherwise queues a delayed message with `NullifiedSkill` as the skill ID and `IncAndDecValue` as the duration.                                                                                    |
| 20   | Normal Attack  | Runs a melee attack against the target. If `IncAndDecType` / `IncAndDecValue` are set, acts as an item-gate: target is instantly killed unless item `GET_ITEM(IncAndDecType, IncAndDecValue)` is equipped in slot 9, 10, or 11. With `NullifiedSkill` >= 1, queues a delayed message instead of attacking. |
| 21   | Berserk        | Applies monster physical and magical damage immunity for `ContinuanceTime` seconds (or indefinite if `-1`) and stores the berserk duration on the target.                                                                                                                                                  |

## IncAndDecType Values

Used by Types 2, 3, 4, 5, 6, 7 to decide how `IncAndDecValue` is applied. Cycle variants also set up a per-tick apply driven by `ContinuanceTime`.

| Value | Mode                    | Meaning                                                 |
| ----- | ----------------------- | ------------------------------------------------------- |
| 0     | None                    | No stat modification. Paired with `IncAndDecValue="*"`. |
| 1     | Percent Increase        | Adds `IncAndDecValue` percent of the base stat.         |
| 2     | Percent Decrease        | Subtracts `IncAndDecValue` percent of the base stat.    |
| 11    | Constant Increase       | Adds `IncAndDecValue` flat.                             |
| 12    | Constant Decrease       | Subtracts `IncAndDecValue` flat.                        |
| 100   | Cycle Percent           | Periodic percentage change baseline.                    |
| 101   | Cycle Percent Increase  | Periodic percent heal tick.                             |
| 102   | Cycle Percent Decrease  | Periodic percent damage tick.                           |
| 110   | Cycle Constant          | Periodic flat change baseline.                          |
| 111   | Cycle Constant Increase | Periodic flat heal tick.                                |
| 112   | Cycle Constant Decrease | Periodic flat damage tick.                              |

Any other value leaves the stat unchanged.

## Important Behavior

* Only 100 Element slots exist (`Number` 0-99). Entries outside this range are dropped silently.
* Stun resistance: for Type 0 the formula is `roll = rand(0..99); if roll > SuccessRate - ResistStunRate then fail`.
* `SuccessRate` is rolled independently per Element per target; a Unit with three Elements can partly succeed.
* `CharacterClass` and `CharacterLevel` are parsed but not consulted by the current pipeline. Do not rely on them as filters.
* `Name` is stored but never compared - any string works.
* Types 1, 10, 11, 12, 13 are stubs in the engine. Setting them has no effect.
* Types 14, 15, 16 use `NullifiedSkill` as the skill ID to cancel, resist, or immunize against.
* Type 20 (Normal Attack) doubles as a gear-check: fill `IncAndDecType` / `IncAndDecValue` with an ItemKind / Index pair to instakill players who do not have that item equipped in weapon or shield slots.

## Examples

{% tabs %}
{% tab title="Stun" %}

```xml
<Element Number="1" Name="Monster Stun"
         Type="0" SuccessRate="50" ContinuanceTime="3"
         IncAndDecType="*" IncAndDecValue="*"
         NullifiedSkill="*"
         CharacterClass="0" CharacterLevel="0"/>
```

50% chance to stun the target for 3 seconds. Stun resistance reduces the roll.
{% endtab %}

{% tab title="Percent MP Drain" %}

```xml
<Element Number="3" Name="MP Drain"
         Type="3" SuccessRate="50" ContinuanceTime="10"
         IncAndDecType="2" IncAndDecValue="50"
         NullifiedSkill="*"
         CharacterClass="0" CharacterLevel="0"/>
```

50% chance to drain 50% of the target's current Mana. `ContinuanceTime` is only used when paired with a cycle `IncAndDecType`.
{% endtab %}

{% tab title="Poison over time" %}

```xml
<Element Number="27" Name="Poison"
         Type="19" SuccessRate="100" ContinuanceTime="10"
         IncAndDecType="*" IncAndDecValue="10"
         NullifiedSkill="800"
         CharacterClass="0" CharacterLevel="0"/>
```

Paired with a monster skill tether (NullifiedSkill 800). `IncAndDecValue` is the poison duration in seconds passed to the target.
{% endtab %}

{% tab title="Defense Debuff" %}

```xml
<Element Number="8" Name="Defense Down"
         Type="2" SuccessRate="30" ContinuanceTime="10"
         IncAndDecType="112" IncAndDecValue="10"
         NullifiedSkill="*"
         CharacterClass="0" CharacterLevel="0"/>
```

30% chance; applies a 10-point cycle decrease tick to Life over 10 seconds. Cycle constant decrease is a DoT.
{% endtab %}
{% endtabs %}

## Common Issues

* **Element never fires** - `SuccessRate` is rolled per target; low values combined with stun resist can drop effective chance to zero.
* **Stat Element has no effect** - the Type is one of the stub Types (1, 10-13). Pick a live Type.
* **"Nullify" does nothing** - Type 14 only handles Greater Damage and Greater Defense. Other buffs are not supported.
* **Push goes the wrong distance** - set `IncAndDecValue` to the tile count. Default is 3 tiles when `*` or <1.
* **Class filter not working** - `CharacterClass` / `CharacterLevel` are ignored by the pipeline. TODO: verify whether a future gate uses these.
* **Element number too high** - IDs must be 0-99. Higher numbers are dropped at load.
