# Rewards

## Start

First, you need to know that the rewards can be configured in the $$config.yml$$. If you have opened the config.yml, you can scroll down to the "Rewards" section.

## Creating a new Reward

### The permission

The rewards are located below the "Rewards.permissions" section. The rewards you can configure with DeluxeCombat are completely permission based. That means, if we want to create a new reward, we need a new permission. You can choose whatever permission you want but please remember that you can use each permission just once.

```
Rewards:
  
  # Give players rewards for killing animals or players
  
  # If you have e.g 'permission.one' you will get a diamond
  # If you have e.g 'permission.two' you will get 100 money
  # You can add as many permissions / commands as you want
  # Dont use dots. '-' will be replaced with a dot
  # So 'permission-one' is actually 'permission.one'
  permissions:
    
    // We have choosen the permission: "permission.one"
    permission-one:
    // We start here!
```

**NOTE:** You have to replace every dot (.) in the permission with a "-". That means, if you want that players with the permission "permission.one" can get this reward, you have to insert it in the config.yml with "permission-one".

### The options

The configuration of a new reward consists of 4 parts. First, the permission we have talked about above. Then **kill\_mode, chance** and **cmds**.

#### kill\_mode

The kill mode describes, in which situation the reward can be achieved. You can choose between following kill modes:

| Kill Mode         | Description                                       | Placeholder |
| ----------------- | ------------------------------------------------- | ----------- |
| PLAYER            | Reward for killing a player                       | %victim%    |
| ANIMAL            | Reward for killing an animal                      | %animal%    |
| MONSTER           | Reward for killing a monster                      | %monster%   |
| BOTH              | Reward for killing a monster/animal               | %entity%    |
| BOUNTY            | Reward for killing a player with an active bounty | %victim%    |
| KILLSTREAK\_BREAK | Reward for killing a player with a kill streak    | %victim%    |

**Killmode: PLAYER / BOUNTY**

```
Rewards:
  permissions:
    permission-one:
      kill_mode: "PLAYER"
```

**Killmode: ANIMAL / MONSTER / BOTH**

For those kill modes, you can have additional options such as entity type and entity name. If you are configuring those, you can restrict the reward to those options.

```
Rewards:
  permissions:
    permission-one:
      /*  In this example, we only want the reward to be achieved if the player
       *  kills an chicken with the name "&6Chicken MC Nugget"
       */ Colorcodes are supported!
      kill_mode: "ANIMAL:CHICKEN:&6Chicken MC Nugget"
```

Another example:

```
Rewards:
  permissions:
    permission-one:
      // In this example, we only want the reward to be achieved if the player
      // kills a creeper
      kill_mode: "MONSTER:CREEPER"
```

Another example:

```
Rewards:
  permissions:
    permission-one:
      // In this example, we only want the reward to be achieved if the player
      // kills any monster
      kill_mode: "MONSTER"
```

**Killmode: KILLSTREAK\_BREAK**

```
Rewards:
  permissions:
    permission-one:
      // Killstreak break, when the player has an killstreak of 10
      kill_mode: "KILLSTREAK_BREAK:10"
```

#### chance

The chance describes with which chance the reward will get executed. 100% will execute the reward everytime the kill mode gets triggered. 1% only in 1 out of 100 etc.

```
Rewards:
  permissions:
  
    permission-one:
      kill_mode: "PLAYER"
      // Chance of 50% to get this reward
      chance: 50
```

#### cmds

The cmds are the actions that get executed when achieving the reward. Following actions can be used:

| Action      | Description                                |
| ----------- | ------------------------------------------ |
| \[CMD]      | Will execute a command from the console    |
| \[TITLE]    | Will send a title message to the player    |
| \[SUBTITLE] | Will send a subtitle message to the player |
| \[MSG]      | Will send a chat message to the player     |
| \[SOUND]    | Will play a sound to the player            |

```
Rewards:
  permissions:
    permission-one:
      kill_mode: "PLAYER"
      chance: 50
      cmds:
      - "[TITLE] &c&l+1 Kill"
      - "[SUBTITLE] &7You have killed &4%victim%&7!"
      - "[MSG] &eYou have killed &c%victim% &ewith a chance of &c50%&e!"
      - "[CMD] give %player% diamond 1"
      // [SOUND] Sound, Volume, Pitch
      - "[SOUND] ENTITY_PLAYER_LEVELUP, 2f, 1f"
```

### Having multiple rewards

In this example, we have 3 different rewards setup:

```
Rewards:
  permissions:
    permission-one:
      kill_mode: "PLAYER"
      chance: 50
      cmds:
      - "[TITLE] &c&l+1 Kill"
      - "[SUBTITLE] &7You have killed &4%victim%&7!"
      - "[MSG] &eYou have killed &c%victim% &ewith a chance of &c50%&e!"
      - "[CMD] give %player% diamond 1"
      - "[SOUND] ENTITY_PLAYER_LEVELUP, 2f, 1f"
    permission-two:
      kill_mode: "MONSTER:ENDER_DRAGON:&5Dragon"
      chance: 100
      cmds:
      - "[MSG] &eYou have killed the enderdragon: &5%monster%"
      - "[CMD] give %player% diamond 32"
      - "[SOUND] ENTITY_PLAYER_LEVELUP, 2f, 1f"
    permission-three:
      kill_mode: "KILLSTREAK_BREAK:15"
      chance: 100
      cmds:
      - "[MSG] &eYDamn! You have denied the killstreak of &c%victim%&e!"
      - "[CMD] give %player% beacon 64"
      - "[SOUND] ENTITY_PLAYER_LEVELUP, 2f, 1f"
```
