# Prices Option

Prices option is a little complex, so I introduce it on a separate page.

**This option is optional, if you didn't add this, this means spin price is free.**

## Item Price <a href="#item-price" id="item-price"></a>

You can set item as price, should use Item Format at [this](https://ultimateshop.superiormc.cn/base/item-format) page.

**Example:**

```yaml
    1:
      material: APPLE
      name: 'Magic Apple'
      custom-model-data: 5
      apply: [1,2]
      amount: 10
      placeholder: 'Magic Apple x10'
```

## Item Match - Require MythicChanger <a href="#item-match-require-mythicchanger" id="item-match-require-mythicchanger"></a>

Item Match has those options:

* match-rule: Determine the match rule of the price item.

For more info, please view [this page](https://spintowin.superiormc.cn/features/custom-item-match-method).

**Example:**

```yaml
    1:
      match-item:
        items:
          - 'ender_pearl'
        has-name: true
      apply: [1,2]
      amount: 10
      placeholder: 'Any named Ender Peral x10'
```

## Hook Economy&#x20;

Hook economy has those options:

* economy-plugin: What plugin you want this price economy hook into, for now, **SpinToWin** supports `Vault, GamePoints, PlayerPoints, CoinsEngine, UltraEconomy`.
* economy-type: If economy plugin is multi-currency economy plugin, you have to type currency name here.

**Example:**

```yaml
  1:
    economy-plugin: Vault
    # If you set Economy plugin to CoinsEngine, then:
    # economy-plugin: CoinsEngine
    # economy-type: Coin
    # Yeah, you need add economy-type option here because its a multi-currency plugin.
    # For this, players will always cost 5$.
    amount: 5
    placeholder: '$5'
    apply: [1,2,3]
```

## Vanilla Economy

Vanilla economy has those options:

* economy-type: Supports `exp, levels`.

**Example:**

```yaml
  1:
    economy-type: levels
    # In this example, player will cost different levels with different flip times.
    placeholders:
      3: '10 Levels'
      4: '20 Levels'
    cost: [10,20]
    apply: [3,4]
```

## Custom <a href="#custom" id="custom"></a>

* match-placeholder: The PlaceholderAPI placeholder value we will check in this price.
* amount: The placeholder value must be greater than the amount you set here.
* take-actions: The action will execute after price is cost.

```yaml
    1:
      match-placeholder: '%player_health%'
      placeholder: 'Health x1'
      apply: [1,2]
      amount: 10
      take-actions:
        1:
          type: message
          message: 'I steal your one health!'
```

## Free

Just set `free: true` here.

## General Options

Those options can be used in the 4 types of price. **All of them are optional.**

* amount: The amount of items or economy price values. Like `1`. If not set, plugin will set amount to 1.
* placeholder: Price display name at spin button. Like `Stone x5`. If not set, plugin will use default placeholder content that provided by language file.
* placeholders: Format is `apply times: placeholder content`.

  Copy

  ```yaml
  placeholders:
    1: 'Stone x2'
    2: 'Stone x5'
  ```
* start-apply: The number of usage times that price start applies. It is a number, if spin times more than this number, this price will be applied. `start-apply` is only work with `amount` option, does not support `cost` option.
* apply: The number of usage times that this price applies. It is an array, should be like `[1,2,3]`, this means that this price applies to your first, second, and third time spin. If not set, the plugin will automatically consider the ID of the price as the applicable times. (Added in 2.0.0)
* cost: Little same as amount, but this option corresponds to the number of times the apply option is applied one by one. Like `[10,20,30]`. If not set, plugin will use `amount` option value. (Added in 2.0.0)
* conditions: Players must meet certain conditions to use this price. You should write this option like this format:

  ```yaml
  conditions:
    <Times>:
      - <Conditions>
  ```

  For example:

  ```yaml
  conditions:
    1:
      1:
        type: permission
        permission: 'group.default'
    2:
      1:
        type: world
        world: 'world'
      2:
        type: permission
        permission: 'group.default'
  ```

  You can also write this option like this format, this format means players should always meet those conditions, whatever the spin times.

  ```yaml
  conditions:
    1:
      type: permission
      permission: 'hi.hi'
  ```

  Each condition id section should use **Condition Format**, for more info, please view [Format](https://spintowin.superiormc.cn/info/format) page.

### About apply and start-apply feature:

If you set reserve option to false in a UI config:

* Spin times = All rewards in spin UI - Claimed rewards in spin UI.

If you set reserve option to true in a UI config:

* Spin times always = 1 (before 2.3.0)
* Spin times = Spin button click times. **(after 2.3.0, and you set check-permission-limit option in config.yml to true, otherwise its same as before 2.3.0)**

**Warn: after you enable reserve option in UI config, all rewards will not disappear after player has claimed, and players can get them unlimited times.**
