> For the complete documentation index, see [llms.txt](https://horizons-cite-plugin.gitbook.io/horizons-cite-plugin/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://horizons-cite-plugin.gitbook.io/horizons-cite-plugin/apis/skript.md).

# Skript

Documentation complète de toutes les syntaxes Skript disponibles pour interagir avec le plugin Horizons.

***

## 📑 Table des matières

1. [Expressions](#-expressions)
   * [Équipes](#équipes)
   * [Shops](#shops)
   * [Marché Noir](#marché-noir)
   * [Price Scope](#price-scope)
   * [Challenges](#challenges)
   * [Scores Alternatifs](#scores-alternatifs)
2. [Effets](#-effets)
   * [Gestion des équipes](#gestion-des-équipes)
   * [Gestion des scores](#gestion-des-scores)
   * [Gestion des price scopes](#gestion-des-price-scopes)
   * [Gestion des challenges](#gestion-des-challenges)
3. [Conditions](#-conditions)
   * [Vérifications d'équipes](#vérifications-déquipes)
   * [Vérifications de shops](#vérifications-de-shops)
   * [Vérifications de challenges](#vérifications-de-challenges)
4. [Événements](#-événements)
5. [Exemples](#-exemples)

***

## 📖 Expressions

### Équipes

#### Informations de base

| Syntaxe                     | Description                                      |
| --------------------------- | ------------------------------------------------ |
| `team of %player%`          | Obtient l'équipe d'un joueur                     |
| `%player%'s team`           | Alias                                            |
| `all teams`                 | Liste toutes les équipes disponibles             |
| `all teams sorted by score` | Liste les équipes triées par score (décroissant) |

#### Propriétés d'équipe

| Syntaxe                         | Description                           |
| ------------------------------- | ------------------------------------- |
| `score of team %string%`        | Obtient le score d'une équipe         |
| `team %string%'s score`         | Alias                                 |
| `display name of team %string%` | Obtient le nom d'affichage            |
| `team %string%'s display name`  | Alias                                 |
| `prefix of team %string%`       | Obtient le préfixe coloré             |
| `team %string%'s prefix`        | Alias                                 |
| `members of team %string%`      | Obtient la liste des membres en ligne |
| `team %string%'s members`       | Alias                                 |

***

### Shops

> **Note** : Les IDs de shop sont au format `fichier::npcId` (ex: `minerals::miner`)

| Syntaxe                                                            | Description                     | Retour                               |
| ------------------------------------------------------------------ | ------------------------------- | ------------------------------------ |
| `items of shop %string%`                                           | Liste les items d'un shop       | Liste de strings (noms de matériaux) |
| `shop %string%'s items`                                            | Alias                           |                                      |
| `price of %string% in shop %string%`                               | Prix d'un item dans un shop     | Nombre décimal                       |
| `price of %string% in shop %string% for team %string%`             | Prix pour une équipe spécifique | Nombre décimal                       |
| `price of custom item %string% in shop %string%`                   | Prix d'un item custom           | Nombre décimal                       |
| `price of custom item %string% in shop %string% for team %string%` | Prix custom pour une équipe     | Nombre décimal                       |
| `price trend of %string% in shop %string%`                         | Tendance du prix                | "up", "down", ou "stable"            |

***

### Marché Noir

| Syntaxe                                      | Description                      | Retour           |
| -------------------------------------------- | -------------------------------- | ---------------- |
| `items of black market %string%`             | Liste les items d'un marché noir | Liste de strings |
| `black market %string%'s items`              | Alias                            |                  |
| `price of %string% in black market %string%` | Prix d'un item au marché noir    | Nombre entier    |

***

### Price Scope

Le scope détermine si les prix sont partagés globalement (`global`) ou par équipe (`per_team`).

| Syntaxe                                    | Description              | Retour                  |
| ------------------------------------------ | ------------------------ | ----------------------- |
| `price scope of %string% in shop %string%` | Scope effectif d'un item | "global" ou "per\_team" |
| `price scope of shop %string%`             | Scope d'un shop          | "global" ou "per\_team" |
| `shop %string%'s price scope`              | Alias                    |                         |

***

### Challenges

#### Informations générales

| Syntaxe                              | Description                                           |
| ------------------------------------ | ----------------------------------------------------- |
| `all challenges`                     | Liste tous les challenges                             |
| `all %string% challenges`            | Liste les challenges d'un type (PLAYER, TEAM, GLOBAL) |
| `name of challenge %string%`         | Nom d'affichage d'un challenge                        |
| `description of challenge %string%`  | Description d'un challenge                            |
| `target value of challenge %string%` | Valeur cible d'un challenge                           |
| `type of challenge %string%`         | Type d'un challenge                                   |

#### Progression

| Syntaxe                                       | Description                      |
| --------------------------------------------- | -------------------------------- |
| `progress of challenge %string% for %player%` | Progression actuelle d'un joueur |

#### Variables d'événement

| Syntaxe                   | Description                               |
| ------------------------- | ----------------------------------------- |
| `event-challenge`         | L'ID du challenge dans un événement       |
| `event-first-completion`  | Booléen indiquant une première complétion |
| `event-previous-progress` | Progression avant mise à jour             |
| `event-new-progress`      | Nouvelle progression                      |
| `event-progress-added`    | Quantité de progression ajoutée           |

***

### Scores Alternatifs

| Syntaxe                               | Description                   |
| ------------------------------------- | ----------------------------- |
| `alt score %string% of %player%`      | Score alternatif d'un joueur  |
| `%player%'s alt score %string%`       | Alias                         |
| `alt score %string% of team %string%` | Score alternatif d'une équipe |
| `team %string%'s alt score %string%`  | Alias                         |

***

## ⚡ Effets

### Gestion des équipes

```python
# Attribuer un joueur à une équipe
set team of %player% to %string%

# Retirer un joueur de son équipe
remove %player% from [their] team

# Créer une nouvelle équipe
create team %string% with prefix %string% and display name %string%

# Supprimer une équipe
remove team %string%

# Modifier le préfixe d'une équipe
set prefix of team %string% to %string%

# Modifier le nom d'affichage d'une équipe
set display name of team %string% to %string%
```

### Gestion des scores

```python
# Définir le score
set score of team %string% to %number%

# Ajouter des points
add %number% to score of team %string%

# Retirer des points
remove %number% from score of team %string%
```

### Gestion des price scopes

```python
# Définir le scope d'un item spécifique
set price scope of %string% in shop %string% to %string%
# Exemple: set price scope of "DIAMOND" in shop "minerals::miner" to "per_team"

# Définir le scope d'un shop entier
set price scope of shop %string% to %string%
# Exemple: set price scope of shop "minerals::miner" to "global"
```

### Gestion des challenges

```python
# Marquer un challenge comme complété
complete challenge %string% for %player%

# Faire progresser un challenge
progress challenge %string% for %player% by %number%

# Réinitialiser la progression
reset challenge %string% progress for %player%
```

***

## ✅ Conditions

### Vérifications d'équipes

#### Existence et appartenance

```python
# Vérifier si une équipe existe
team %string% exists

# Vérifier si un joueur est dans une équipe spécifique
%player% is in team %string%

# Vérifier si un joueur a une équipe
%player% has a team
```

#### Comparaisons de score

```python
# Égalité
score of team %string% is %number%
score of team %string% is equal to %number%

# Supériorité
score of team %string% is greater than %number%
score of team %string% is more than %number%

# Infériorité
score of team %string% is less than %number%

# Supérieur ou égal
score of team %string% is greater than or equal to %number%

# Inférieur ou égal
score of team %string% is less than or equal to %number%

# Comparaison entre équipes
score of team %string% is greater than score of team %string%
score of team %string% is less than score of team %string%
```

***

### Vérifications de shops

```python
# Vérifier si un shop existe
shop %string% exists

# Vérifier si un marché noir existe
black market %string% exists
blackmarket %string% exists
```

***

### Vérifications de challenges

#### Existence et état

```python
# Vérifier si un challenge existe
challenge %string% exists

# Vérifier si un joueur a complété un challenge
challenge %string% is completed for %player%
%player% has completed challenge %string%

# Vérifier si un challenge est disponible (pas en cooldown)
challenge %string% is available for %player%

# Vérifier si un challenge peut être complété
challenge %string% can be completed by %player%
```

#### Comparaisons de progression

```python
# Égalité
progress of challenge %string% for %player% is %number%

# Supériorité
progress of challenge %string% for %player% is greater than %number%

# Infériorité
progress of challenge %string% for %player% is less than %number%

# Supérieur ou égal
progress of challenge %string% for %player% is greater than or equal to %number%

# Inférieur ou égal
progress of challenge %string% for %player% is less than or equal to %number%
```

***

## 🎯 Événements

### Challenge Complete

Déclenché quand un joueur complète un challenge.

```python
on challenge complete:
on challenge completed:
on challenge %string% complete:    # Pour un challenge spécifique
on challenge %string% completed:
```

**Variables disponibles :**

* `event-challenge` — L'ID du challenge
* `event-first-completion` — `true` si c'est la première complétion
* `player` — Le joueur qui a complété

### Challenge Progress

Déclenché quand la progression d'un challenge est mise à jour.

```python
on challenge progress:
on challenge progress update:
on challenge %string% progress:    # Pour un challenge spécifique
on challenge %string% progress update:
```

**Variables disponibles :**

* `event-challenge` — L'ID du challenge
* `event-previous-progress` — Progression avant
* `event-new-progress` — Nouvelle progression
* `event-progress-added` — Montant ajouté
* `player` — Le joueur concerné

***

## 💡 Exemples

### Gérer les équipes

```python
command /myteam:
    trigger:
        if player has a team:
            set {_team} to team of player
            set {_score} to score of team {_team}
            send "&aVotre équipe: &e%{_team}%"
            send "&aScore: &e%{_score}% points"
        else:
            send "&cVous n'êtes dans aucune équipe!"
```

### Consulter les prix d'un shop

```python
command /checkprice <text>:
    trigger:
        set {_item} to arg-1
        set {_shop} to "minerals::miner"
        
        if shop {_shop} exists:
            set {_price} to price of {_item} in shop {_shop}
            set {_trend} to price trend of {_item} in shop {_shop}
            
            if {_price} is not -1:
                send "&6Prix de %{_item}%: &e%{_price}% points"
                send "&6Tendance: &e%{_trend}%"
            else:
                send "&cItem non trouvé dans ce shop!"
        else:
            send "&cShop introuvable!"
```

### Gérer les scopes de prix

```python
command /togglescope <text>:
    permission: admin.shop
    trigger:
        set {_shop} to arg-1
        set {_current} to price scope of shop {_shop}
        
        if {_current} is "global":
            set price scope of shop {_shop} to "per_team"
            send "&aScope changé en PER_TEAM"
        else:
            set price scope of shop {_shop} to "global"
            send "&aScope changé en GLOBAL"
```

### Récompenser lors de la complétion d'un challenge

```python
on challenge complete:
    if event-first-completion is true:
        broadcast "&6%player% est le premier à terminer %event-challenge%!"
        add 100 to score of team (team of player)
    else:
        add 25 to score of team (team of player)
        send "&aChallenge terminé! +25 points pour votre équipe"
```

### Afficher le classement des équipes

```python
command /classement:
    trigger:
        send "&6=== Classement des équipes ==="
        set {_teams::*} to all teams sorted by score
        set {_rank} to 1
        loop {_teams::*}:
            set {_score} to score of team loop-value
            set {_prefix} to prefix of team loop-value
            send "&e#%{_rank}% %{_prefix}%%loop-value% &7- &f%{_score}% points"
            add 1 to {_rank}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://horizons-cite-plugin.gitbook.io/horizons-cite-plugin/apis/skript.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
