# Progressions

```csharp
using Databrain.Stats;

public StatsProgression : DataObject {}
```

The StatsProgression lets you easily create player- or item progressions with a custom progression curve.

<div align="left"><figure><img src="/files/BBbk5KNCYGRG2F8C5N1L" alt=""><figcaption></figcaption></figure></div>

| Progression Curve | The actual progression curve.                                                                                                           |
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| Max Level         | Set the max level.                                                                                                                      |
| Max XP            | Set the max xp points.                                                                                                                  |
| On Level Up       | The event which gets called on level up.                                                                                                |
| On XP Added       | The event which gets called on xp points added.                                                                                         |
| Level Up Logic    | <p><mark style="background-color:orange;">Only when Logic add-on is installed.</mark><br>The logic which gets executed on level up.</p> |

## Level Icons

<div align="left"><figure><img src="/files/DR4BQnYCp4BrcdJj2URI" alt=""><figcaption></figcaption></figure></div>

For each progression you can also set custom level icons.&#x20;

1. Simply go to the level icons tab and click on "import from folder".
2. Select a folder where your images are. Please make sure that your images are named nummerically (1.png, 2.png, 3.png)
3. You can then get the current level icon through the API.

## API

### ResetXP

Set the XP back to zero.

### GetLevelIcon

Return the current level icon as a sprite.

### GetCurrentLevel

Get the current progression level.

### GetCurrentXP

Get the current XP points.

### AddXP

Add XP points. If xp points reaches new level, then the OnLevelUp event gets called.


---

# 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://giantgrey.gitbook.io/databrain/add-ons/stats/progressions.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.
