# Damage Types

Damage types classify the kind of damage an ability deals. They are split into **Main Damage Types** and **Secondary Damage Types**, each serving a different purpose in the damage pipeline.

## Main Damage Types

Main damage types represent the broad category of damage. They are used in the damage scaling system — stats can provide scaling bonuses based on main damage type.

Create them in **Combat > Formulas > Main Damage Types**.

Examples: Physical, Magical, True, Environmental.

When a damage effect has a main damage type assigned, the damage scaling calculator iterates all stats on the caster and checks for matching damage type scaling entries. This is how a stat like "Spell Power" can increase Magical damage but not Physical damage.

## Secondary Damage Types

Secondary damage types provide finer classification within a main type. They are **optional** — a damage effect can have a main type without a secondary type. Secondary types allow for more precise scaling and categorization.

Create them in **Combat > Formulas > Secondary Damage Types**.

Examples: Fire, Frost, Nature, Lightning, Poison, Holy, Shadow, Blunt, Slash, Pierce.

Secondary types let you create specialized stats like "Fire Damage Bonus" that only affects Fire-typed abilities, or resistances that reduce specific elemental damage.

## How Damage Scaling Works

Stats can define damage type scaling entries that link a stat to damage types. Each scaling entry specifies:

| Field              | Description                                                                                                                                  |
| ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------- |
| Damage Type        | Which damage type this scaling applies to.                                                                                                   |
| Scaling Mode       | **Flat** (add fixed amount per stat point), **Percentage** (add percentage per stat point), **Formula** (custom nCalc formula), or **None**. |
| Flat Scaling       | For Flat mode: damage bonus per point of this stat.                                                                                          |
| Percentage Scaling | For Percentage mode: percentage bonus per point of this stat.                                                                                |
| Scaling Formula    | For Formula mode: a formula entry for custom scaling logic.                                                                                  |

For example, a "Strength" stat might have a Flat scaling of 0.5 for Physical damage — meaning every point of Strength adds 0.5 to Physical damage abilities.

## Damage Calculation Flow

When a damage effect executes:

1. Start with **Base Damage** × **Stack Multiplier**.
2. If a **Calculation Formula** is set, evaluate it with caster/target stats as variables.
3. If a **Main Damage Type** is set, apply damage type scaling from all caster stats that have scaling for that type.
4. If **Status Condition Modifiers** are configured, apply bonus damage based on active statuses on the target (flat or percentage, optionally per-stack).
5. The final damage is applied to the **Target Stat** (typically Health).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sparkframework.dev/documentation/user-guide/plugins/combat/damage-types.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
