# 🔋 Leveling

## About

**Leveling** is the primary way for the pets to earn [Aspect Points](https://nightexpress.gitbook.io/combatpets/features/pet-aspects) to upgrade their [Stats](https://nightexpress.gitbook.io/combatpets/features/pet-attributes).

Global leveling settings located in the `leveling.yml` config file.

## Features

* ✅ **Downgrade**. Allows XP go negative and therefore downgrade pet level.
* ✅ **Disable Worlds**. Worlds, where mobs produces no XP for pets.
* ✅ **Death Penalty**. Set XP % to remove from pet on death.
* ✅ **Abuse Protection**. Prevent XP drop from mobs spawned by eggs, spawners, etc.
* ✅ **XP Table**. Create custom XP tables with **MythicMobs** support.
* ✅ **XP Drop Chance**. Set XP drop chance for custom XP tables.
* ✅ **Initial XP**. Set initial amount of XP requried for the next level based on [Pet Tier](https://nightexpress.gitbook.io/combatpets/features/pet-tiers).
* ✅ **XP Modifier**. Set XP modifier used to calculate required XP based on previous level's value and [Pet Tier](https://nightexpress.gitbook.io/combatpets/features/pet-tiers).
* ✅ **Max Level**. Set max. possible level based on [Pet Tier](https://nightexpress.gitbook.io/combatpets/features/pet-tiers).

## Details

* Final XP amount depends on the damage dealt by the pet. 30% damage of total health = 30% of XP amount.

## Setup Tips

### Toggle Feature

To enable or disable the **Leveling** feature, go to the `config.yml` and set `Features` -> `Leveling` on `false` or `true`

### Disable XP Tables

You can disable usage of custom XP tables by setting the `Use_Custom_XP_Table` setting on `false` in the `leveling.yml`.

This will use "natural" XP amount dropped by killed mobs.

{% hint style="info" %}
Amount of dropped XP orbs is reduced by amount gained by the pet.
{% endhint %}

### Creating XP Tables

You can create your own XP tables for **specific mobs** in the `leveling.yml` -> `XPSources` section.

You can use [Vanilla](https://minecraft.wiki/w/Java_Edition_data_values#Entities) mob names (2nd column) or **MythicMobs** ones (all in lower case).

```yaml
XPSources:
  mythic_mobs: # Table identifier. Must be unique!
    Amount: # Amount of dropped XP.
      Min: 30
      Max: 70
    Chance: 70.0 # Chance to drop XP.
    Mobs:
    - skeletonking
    - skeletal_minion
  monsters:
    Amount:
      Min: 20
      Max: 60
    Chance: 50.0
    Mobs:
    - zombie
    - spider
    - skeleton
```

### Disable Death Penalty

To disable XP death penalty, go to the `leveling.yml` and set the `Death_XP_Loss` on `0`.

### Disable Downgrade

To disable the **Downgrade** feature, go to the `leveling.yml` and set the `Downgrade_Allowed` on `false`.

### Set Max Level

To edit max. level for **all pets** of **specific tier**, go to the [Pet Tier](https://nightexpress.gitbook.io/combatpets/features/pet-tiers) configuration(s) and edit the `Leveling` -> `Max_Level` value.

### Set Initial XP & Modifier

To edit initial XP amount and XP modifier for **all pets** of **specific tier**, go to the [Pet Tier](https://nightexpress.gitbook.io/combatpets/features/pet-tiers) configuration(s) and edit the `Leveling` -> `Start_Exp` and `XPModifier` values.


---

# 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://nightexpress.gitbook.io/combatpets/features/leveling.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.
