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

# SkillTweaks

Per-skill overrides for attack-speed scaling and mounted-cast usability

The SkillTweaks plugin applies per-skill overrides on top of the engine defaults. It currently controls two things: how attack speed affects a skill's cast delay (multi-hit balance), and whether a skill can be cast while riding a mount. Skills not listed use engine defaults for every attribute.

{% hint style="info" %}
This plugin was previously named **SkillSpeedScale** and only did speed scaling. It now also carries the mounted-cast override, using one config file and one license gate. The config file and root node were renamed accordingly.
{% endhint %}

## File Location

```
Data/Plugins/Characters/SkillTweaks.xml
```

## Dependencies

| Depends On                                   | Purpose                                                                                                                                        |
| -------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| [Common.dat](/docs/gameserver/common-dat.md) | Uses global timing values from the Skill Timing / Attack Speed block: `MaxAttackSpeed`, `BaseSkillDelay`, `SpeedGrowthFactor`, `MinSkillDelay` |
| [Skill.txt](/docs/data/skill.md)             | References skill IDs (Index) from the skill database. Skills with `Delay > 0` in Skill.txt use fixed cooldowns and ignore speed scaling.       |

## Configuration Structure

```xml
<SkillTweaks>
    <Skill Index="238" Name="Chaotic Diseier" SpeedScale="0.55" MinDelay="200" />
    <Skill Index="9" Name="Evil Spirit" SpeedScale="1.0" MinDelay="50" />
    <Skill Index="236" Name="Flame Strike" Mounted="allow" />
</SkillTweaks>
```

Each `<Skill>` entry overrides the default behavior for one skill. All attributes are optional — set only the ones you want to change.

## Attributes

| Attribute    | Type   | Default  | Range        | Description                                                                                         |
| ------------ | ------ | -------- | ------------ | --------------------------------------------------------------------------------------------------- |
| `Index`      | int    | Required | 0-299        | Skill ID from Skill.txt. Use the **base** skill ID — master-tree upgrades inherit it automatically. |
| `Name`       | string | Optional | -            | Skill name for readability (not used by server, documentation only)                                 |
| `SpeedScale` | float  | 1.0      | 0.0-3.0      | How much attack speed affects this skill's delay (see below)                                        |
| `MinDelay`   | int    | 0        | 0+           | Per-skill minimum delay in milliseconds (0 = use global MinSkillDelay)                              |
| `MaxDelay`   | int    | 0        | 0+           | Per-skill maximum delay cap in milliseconds (0 = no cap)                                            |
| `Mounted`    | string | (unset)  | allow / deny | Override mounted-cast usability for ALL classes (see below). Unset = engine default rules.          |

### SpeedScale Values Explained

The `SpeedScale` attribute controls how much the character's attack speed stat affects the skill's casting delay:

| Value | Effect                                       | Use Case                                                        |
| ----- | -------------------------------------------- | --------------------------------------------------------------- |
| `0.0` | Speed has **NO effect** (fixed delay)        | Utility skills like Teleport that shouldn't be spammable        |
| `0.5` | Speed has **HALF effect** (nerfed)           | Multi-hit skills that become overpowered at high speed          |
| `1.0` | **Normal** speed scaling (default)           | Balanced single-hit skills                                      |
| `1.5` | Speed has **150% effect** (buffed)           | Underpowered skills that need speed scaling boost               |
| `2.0` | Speed has **DOUBLE effect** (heavily buffed) | Skills that should benefit greatly from attack speed investment |

{% hint style="info" %}
**Skills NOT listed in this config file default to `SpeedScale="1.0"` (normal speed scaling).**
{% endhint %}

### Mounted Values Explained

The `Mounted` attribute overrides whether a skill is castable while riding a mount (Uniria, Dinorant, Dark Horse, Fenrir, or a rideable custom pet). It wins over the engine's default rules for every class.

| Value   | Effect                                                                                                                 |
| ------- | ---------------------------------------------------------------------------------------------------------------------- |
| (unset) | **Engine default rules** apply (vanilla parity, see below)                                                             |
| `allow` | Skill is **always castable** while mounted, for every class — overrides the weapon-skill block and the melee whitelist |
| `deny`  | Skill is **never castable** while mounted, for every class                                                             |

**Engine default rules** (used when `Mounted` is unset):

* **Any class**: the plain weapon skills (Defense … Slash) and Power Slash are blocked while mounted.
* **Non-melee-cast classes** (Wizard, Elf, Summoner): cast everything else freely while mounted.
* **Melee-cast classes** (Dark Knight, Magic Gladiator, Dark Lord, Rage Fighter): only these skills are usable while mounted — Death Stab, Impale, Fire Breath, Fire Slash, Force, Fire Burst, Earthquake, Electric Spark, Fire Blast, Plasma Storm, Fire Scream, Chaotic Diseier.

{% hint style="info" %}
The override is enforced identically on the server and the client — a skill that can't be cast while mounted is also grayed out on the hotbar. There is no client patch: the flag is delivered at login through [Game Data Sync](/docs/data/game-data-sync.md). A `Mounted` change (like a `SpeedScale` change) re-syncs to each player on their **next login**.
{% endhint %}

## Timing Formula

The plugin modifies the skill delay calculation formula used by the server:

### Step-by-Step Calculation

```
1. If skill has Delay > 0 in Skill.txt -> return that delay (fixed cooldown, no speed scaling)
2. Get character's attack/magic speed (physical skills use PhysiSpeed, magic skills use MagicSpeed)
3. Cap speed: speed = min(speed, MaxAttackSpeed)
4. Apply per-skill scaling: effectiveSpeed = speed * SpeedScale
5. Calculate raw delay: rawDelay = BaseSkillDelay * 1000 / (1000 + effectiveSpeed * SpeedGrowthFactor)
6. Apply max cap: if MaxDelay > 0 then rawDelay = min(rawDelay, MaxDelay)
7. Apply min floor: finalDelay = max(rawDelay, MinDelay or global MinSkillDelay)
```

### Default Global Values

These live in the Skill Timing / Attack Speed block of [Common.dat](/docs/gameserver/common-dat.md):

| Global Setting      | Default | Purpose                                             |
| ------------------- | ------- | --------------------------------------------------- |
| `MaxAttackSpeed`    | 290     | Maximum effective speed before formula (0 = no cap) |
| `BaseSkillDelay`    | 1000 ms | Starting delay at speed 0                           |
| `SpeedGrowthFactor` | 23      | APS gain per speed point (higher = faster scaling)  |
| `MinSkillDelay`     | 100 ms  | Absolute minimum delay floor                        |

{% hint style="info" %}
The actual values in your server's config file may differ. These are the shipped defaults from Common.dat.
{% endhint %}

### Formula Example

**Chaotic Diseier** with `SpeedScale="0.55"`, `MinDelay="200"` (using defaults BaseSkillDelay=1000, SpeedGrowthFactor=23, MaxAttackSpeed=290):

**Low-speed character (speed = 200):**

```
effectiveSpeed = 200 * 0.55 = 110
rawDelay = 1000 * 1000 / (1000 + 110 * 23) = 1000000 / 3530 = 283 ms
finalDelay = max(283, 200) = 283 ms
```

**High-speed character (speed = 290, capped):**

```
effectiveSpeed = 290 * 0.55 = 159
rawDelay = 1000 * 1000 / (1000 + 159 * 23) = 1000000 / 4657 = 214 ms
finalDelay = max(214, 200) = 214 ms
```

**Compare to normal scaling (`SpeedScale="1.0"`) at speed 290:**

```
effectiveSpeed = 290 * 1.0 = 290
rawDelay = 1000 * 1000 / (1000 + 290 * 23) = 1000000 / 7670 = 130 ms
finalDelay = max(130, 100) = 130 ms
```

By reducing `SpeedScale` to 0.55, the skill casts at 214 ms instead of 130 ms at max speed, preventing spam of this powerful multi-hit AoE.

## Important Behavior

{% hint style="info" %}
**Use the base skill ID**: For skills with master-tree upgrades, configure the **base** skill's `Index`. The upgrades inherit the base skill's tweaks automatically (both speed and mounted override), so you don't list each upgrade level separately.
{% endhint %}

{% hint style="info" %}
**Skills with Fixed Delay**: If a skill has a non-zero `Delay` value in `Skill.txt`, that delay is used as a **fixed cooldown** and attack speed scaling is **completely ignored**. Only skills with `Delay=0` in Skill.txt are affected by the speed scaling formula. (The `Mounted` override still applies regardless of `Delay`.)
{% endhint %}

{% hint style="info" %}
**Per-Skill Overrides**: The `MinDelay` attribute in this config **overrides** the global `MinSkillDelay` from [Common.dat](/docs/gameserver/common-dat.md) for the specified skill only.
{% endhint %}

{% hint style="info" %}
**Clamping**: Invalid `SpeedScale` values are automatically clamped:

* Values below 0.0 → clamped to 0.0
* Values above 3.0 → clamped to 3.0

An invalid `Mounted` value (anything other than `allow`/`deny`) is logged and treated as unset (engine default).
{% endhint %}

{% hint style="info" %}
**Physical vs Magic Skills**: Physical skills (melee attacks, bow skills) use **PhysiSpeed** for timing calculations, while magic skills use **MagicSpeed**. This means the same character may have different casting speeds for different skill types based on their equipment and stats.
{% endhint %}

{% hint style="info" %}
**Reload Support**: Configuration can be reloaded at runtime using the `/reload plugins` GM command or the "Reload: Skill Tweaks" menu item without restarting the server. A changed `Mounted` value re-syncs to players on their next login.
{% endhint %}

{% hint style="warning" %}
**Negative Values Ignored**: Negative values for `MinDelay` or `MaxDelay` are treated as 0 (use global/no cap).
{% endhint %}

## Common Use Cases

### Multi-Hit Skills - Nerf Speed Scaling

Multi-target or multi-hit skills become overpowered when spammed at high attack speed:

```xml
<!-- Evil Spirit: 10-target AoE -->
<Skill Index="9" Name="Evil Spirit" SpeedScale="0.5" MinDelay="350" />

<!-- Chaotic Diseier: 2-hit directional AoE -->
<Skill Index="238" Name="Chaotic Diseier" SpeedScale="0.55" MinDelay="200" />

<!-- Chain Lightning: Multi-target chain -->
<Skill Index="215" Name="Chain Lightning" SpeedScale="0.5" MinDelay="400" />
```

By reducing `SpeedScale` below 1.0, these skills remain powerful but can't be spammed continuously.

### Mounted-Cast Overrides

Allow a skill the default rules would block, or deny one they would allow:

```xml
<!-- Let a normally-blocked skill be cast from the saddle -->
<Skill Index="236" Name="Flame Strike" Mounted="allow" />

<!-- Stop a normally-allowed skill from being cast while mounted -->
<Skill Index="230" Name="Lightning Shock" Mounted="deny" />

<!-- Attributes stack: tune speed AND mounted usability at once -->
<Skill Index="60" Name="Force" SpeedScale="0.2" MinDelay="600" Mounted="deny" />
```

### Utility Skills - Fixed Delay

Teleport and buff skills should have fixed delays regardless of attack speed:

```xml
<!-- Teleport: Should not be spammable -->
<Skill Index="6" Name="Teleport" SpeedScale="0.0" MinDelay="1000" />

<!-- Soul Barrier: Defensive buff -->
<Skill Index="16" Name="Soul Barrier" SpeedScale="0.0" MinDelay="500" />
```

Setting `SpeedScale="0.0"` makes attack speed completely ineffective, using only the `MinDelay` value.

## Examples

{% tabs %}
{% tab title="Balanced Multi-Hit" %}

```xml
<SkillTweaks>
    <!-- Multi-hit skills nerfed to 50-60% speed scaling -->
    <Skill Index="78" Name="Fire Scream" SpeedScale="0.5" MinDelay="350" />
    <Skill Index="237" Name="Gigantic Storm" SpeedScale="0.5" MinDelay="400" />
    <Skill Index="238" Name="Chaotic Diseier" SpeedScale="0.55" MinDelay="200" />
    <Skill Index="215" Name="Chain Lightning" SpeedScale="0.5" MinDelay="400" />
    <Skill Index="230" Name="Lightning Shock" SpeedScale="0.5" MinDelay="350" />
</SkillTweaks>
```

{% endtab %}

{% tab title="Mounted Overrides" %}

```xml
<SkillTweaks>
    <!-- Loosen the saddle: allow extra melee skills while mounted -->
    <Skill Index="42" Name="Rageful Blow" Mounted="allow" />
    <Skill Index="41" Name="Twisting Slash" Mounted="allow" />

    <!-- Tighten: forbid a skill the defaults would allow -->
    <Skill Index="230" Name="Lightning Shock" Mounted="deny" />
</SkillTweaks>
```

{% endtab %}

{% tab title="Mixed Balance" %}

```xml
<SkillTweaks>
    <!-- Multi-hit AoE: nerfed speed -->
    <Skill Index="9" Name="Evil Spirit" SpeedScale="0.5" MinDelay="350" />

    <!-- Underpowered skill: buffed speed -->
    <Skill Index="41" Name="Twisting Slash" SpeedScale="1.5" MinDelay="50" />

    <!-- Utility: fixed delay -->
    <Skill Index="6" Name="Teleport" SpeedScale="0.0" MinDelay="1000" />

    <!-- Channeled skill: nerf speed and block while mounted -->
    <Skill Index="60" Name="Force" SpeedScale="0.2" MinDelay="600" Mounted="deny" />
</SkillTweaks>
```

{% endtab %}
{% endtabs %}

## Common Issues

{% hint style="danger" %}
**Skills Still Too Fast**: If a skill is still being spammed at high speed, check:

1. Is the skill's `Index` correct? Verify against Skill.txt
2. Is the config file loaded? Check server logs for "SkillTweaks" entries
3. Try increasing `MinDelay` or decreasing `SpeedScale` further
   {% endhint %}

{% hint style="warning" %}
**Mounted Override Not Taking Effect**: The `Mounted` flag re-syncs to a player only on their **next login**. Have the affected player relog after a reload. Also confirm you used the **base** skill `Index` (upgrades inherit it), and check the log for an "invalid Mounted value" warning.
{% endhint %}

{% hint style="warning" %}
**Config Not Reloading**: Use `/reload plugins` command. If issues persist, restart the GameServer. Check logs for XML parsing errors.
{% endhint %}

## Finding Skill IDs

Skill IDs (`Index` attribute) come from [Skill.txt](/docs/data/skill.md). Each line represents a skill:

```
// Format: Index   Name   ...other attributes...
0    Energy Ball
1    Poison
...
238  Chaotic Diseier
```

Alternatively, check in-game or in the client's skill data.

## Related Configurations

* [Common.dat](/docs/gameserver/common-dat.md): Global attack speed settings (`MaxAttackSpeed`, `BaseSkillDelay`, `SpeedGrowthFactor`, `MinSkillDelay`)
* [Skill.txt](/docs/data/skill.md): Base skill definitions, IDs, and fixed delays (Delay column)
* [Game Data Sync](/docs/data/game-data-sync.md): delivers the per-skill speed and mounted-override data to clients at login

## Reload Command

```
/reload plugins
```

This command reloads all plugin configurations including SkillTweaks.xml without restarting the server. Mounted-cast changes take effect for each player on their next login.
