# 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="https://2348672745-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIoqF5QAgQsqxrjmTIKpE%2Fuploads%2FJWUPRYrjvyVMZLz0uZsc%2FstatsProgression.png?alt=media&#x26;token=b5e02d02-efad-4036-9e58-baf49b1cf2b8" 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="https://2348672745-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIoqF5QAgQsqxrjmTIKpE%2Fuploads%2FR3Frbx1pffK8AmiWaxy9%2FstatsProgressionIcons.png?alt=media&#x26;token=d45ce774-2d49-4a28-a317-9807f1393cab" 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.
