# Christmas Present

{% hint style="warning" %}
There is expected that rewards are created, yet! To create rewards, check this tutorial: [How to create Reward](https://wiki.innouniq.com/plugins/thecore/configuration/centralized-reward-repository)
{% endhint %}

## How to create Christmas Present <a href="#how-to-create-reward" id="how-to-create-reward"></a>

There are two options how to create ChristmasPresent. By in-game **UI** or **Manually** in the confiuration file. Both have some restrictions, so if you want use some advanced methods you will need to use combination of them.

### **Using in-game UI**

I recommend to watch SettingUp Tutorial to ScavengerHunt.

{% embed url="<https://youtu.be/FK_LnRMi-JA>" %}

{% embed url="<https://youtu.be/MIaRfaPd66s>" %}

{% hint style="info" %}
To open **SetUp UI** type `/ScavengerHunt SetUp`
{% endhint %}

{% hint style="info" %}
To open **Settings UI** type `/ScavengerHunt Settings`
{% endhint %}

### **Manually in the file**

Configuration file `ChristmasPresent.yml` is located at main folder of ScavengerHunt plugin.

#### **Template for the one Christmas Present**

```yaml
PRESENT_1:
  Name:
    EN: Purple Present
  Description:
    EN: First present you need!
  Hint:
    EN: []
  Rarity: EPIC
  Icon:
    Material: SKULL_ITEM
    MaterialData: 3
    SkullData: eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZTllMzlkOTFjMDRjMzBjYzFmNTMwZmVlNzk4ZWVkMjc5ZGRlNjBmOTVjMmUxZDE1NWMwZmRkMzYxZDA5NjJlZCJ9fX0=
    CustomModelData: 0
    Enchantment: false
    Color: 255:255:255
    ItemFlagList:
    - HIDE_ENCHANTS
    - HIDE_ATTRIBUTES
  Condition:
    DateTimeRange:
      Active: false
      Start: 01.12.2023 00:00
      End: 02.12.2023 00:00
  Reward:
    List:
    - RewardKey_1
    ChoiceType: QUICK__ALL
  VisibilityZone: 5
  Requirement:
    CollectedPresent:
      Count: 1
  Particle:
    Active: true
    TickDelay: 13
    Data:
      Effect: SPELL_WITCH
      Amount: 35
  Grinch:
    Loot:
      Probability: 35.0
```

### Explanation of variables

#### Name, Description and Hint support multi-localization

```yaml
Name:
  EN: "Purple present"
  SK: "Fialový darček"
```

#### Rarity

Rarity is not required to use, but you can differ what present has higher value. Also you can create requirements using Rarity. (E.g. Collect 3 EPIC Presents.)

If you want to change rarity names of create more/less rarities. Edit `CustomValue.yml` , `GUI.yml` and `Localization` file.

#### Icon

Setting up icon is recommended through in-game UI. It is used at Album, Locations and Admin UI for better recognition between each other presents.

#### Condition

To increase rarity and also activity on your server, you can place a condition when is able to find Christmas Present. Players have to visit server and find egg in specified date-time range. Before and after this range, Present won't be able to find.&#x20;

#### Requirements

Before finding that present, player has to meet requirements. If player meets requiremenets, present is spawned at location. You can combine these three requirements as you wish.

Examples:

Player has to find specified Egg.

```yaml
Requirement:
  CollectedPresent:
    Key: "PRESENT_1" #Key of the present.
```

Player has to find at least one Present.

```yaml
Requirement:
  CollectedPresent:
    Count: 1
```

Player has to find at least 2 presents from COMMON rarity and one EPIC.

```yaml
Requirement:
  CollectedPresent:
    RarityCount:
    - "COMMON:2"
    - "EPIC"
```

#### PlayTime Requirement

To prevent abuse from fake accounts claiming rewards from presents or to enhance the gameplay experience, you can require players to spend a specified amount of time on your server before being able to find Christmas present.

Types of Restriction:

* `Total` - Total time spent on the server.
  * Example: Player has to play for at least 5 Days(7200 Minutes) to be able to find present.
* `Today` - Today's time spent on the server. Probably most used
  * Example: Player has to play for at least 30 Minutes **that day** to be able to find present..
* `Session` -  Time spent on the server since player logged in.
  * Example: Player has to be **online** for at least 30 Minutes to be able to find present..

<pre class="language-yaml"><code class="lang-yaml"><strong>Requirement:
</strong>  PlayTime:
    TotalMinute: 0
    TodayMinute: 0
    SessionMinute: 0
</code></pre>

{% hint style="warning" %}
To disable PlayTime Requirement, keep all values to `0`.
{% endhint %}

#### VisibilityZone

How near(in blocks) has to be player to spawn present.

```yaml
VisibilityZone: 20
```

#### Particle

Particles are spawning around the spawned Christmas Present. You can keep them active or disable them. Also you can change Effect, Color, Speed and Amount.

```yaml
Particle:
  Active: true
  TickDelay: 13 #How fast particles are spawned. (20 ticks = 1 second)
  Data:
    Effect: SPELL_WITCH
    Amount: 35
    Speed: 1.0 #Optional, Default 1.0
    Color: "255:255:255" #Optional, Default White
    Offest: #Optional, Offset from Christmas Present's location. (Vector)
      X: .5
      Y: .5
      Z: .5
```

#### Reward

Choice Types:

* `NONE` - No reward is given to player at claiming the Present.
* `QUICK_ALL` - All assigned rewards are given to player
* `QUICK_CHANCE` - One reward is selected from assigned list by probability

Example for **probability**. `DiamondTools` has 90% chance, `MoneyPocket` has 10% chance to win.&#x20;

{% hint style="danger" %}
Summary of probability at assinged rewards has to be **100.0**! Otherwise, system won't work correctly!
{% endhint %}

```yaml
Reward:
  List:
  - DiamondTools:90.0
  - MoneyPocket:10.0
  ChoiceType: QUICK_CHANCE
```

#### Grinch

Set the probability of the Grinch swiping a present.

```yaml
Grinch:
  Loot:
    Probability: 35.0 #Percentage ratio. Allowed range <O;100>
```

{% hint style="danger" %}
Plugin **Grinch** must be installed on the server!
{% endhint %}

### Testing the Christmas Present

At **detail** of the Christmas Present, at **bottom** of the UI, there is a `Redstone Dust`. By clicking on it, you can **test** the claiming. All Rewards assigned to this present will be given to you. (No Database query/update will be executed.)

{% hint style="info" %}
Available through **Settings** and **Christmas Present Repository**.
{% endhint %}

## Finally

After successful setting up of the presents, you need to reload the plugin to load new rewards.

{% hint style="info" %}
To reload the whole plugin type `/ScavengerHunt Reload`
{% endhint %}
