Skip to content

Commit

Permalink
add conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
Malfrador committed Oct 27, 2024
1 parent 8769f70 commit 83f6b4c
Showing 1 changed file with 237 additions and 73 deletions.
310 changes: 237 additions & 73 deletions src/content/docs/QuestsXL/conditions.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,117 +3,281 @@ title: Conditions
sidebar_position: 3
---

## Active Quest
``active_quest``
# Conditions

Überprüft ob der Spieler eine bestimmte Quest aktiv hat.
## active_quest
Checks if the player has the specified quest active.

* **id:** Die ID der Quest
#### Parameters:

## Completed Quest
``completed_quest``
| Parameter | Description | Default | Required |
|-----------|-------------|---------|----------|
| `id` | The ID of the quest. | | true |

Überprüft ob der Spieler eine bestimmte Quest abgeschlossen hat.
```yaml
'active_quest: id=example_quest'
```

* **id:** Die ID der Quest
```yaml
active_quest:
id: example_quest
```
## Event State
``event_state``
## completed_quest
Checks if the player has the specified quest completed.
Überprüft den Status eines Events.
#### Parameters:
* **id:** Die ID des Events
* **state:** Der Status des Events. ``ACTIVE``, ``COMPLETED``, ``NOT_STARTED``, ``DISABLED``
| Parameter | Description | Default | Required |
|-----------|-------------|---------|----------|
## Global Score
``global_score``
```yaml
'completed_quest: id=example_quest'
```

Überprüft den Wert eines globalen Scores.
```yaml
completed_quest:
id: example_quest
```
* **score:** Die ID des Scores
* **value:** Der Wert des Scores. Default: 1
## event_state
Checks if the specified event is in the specified state.
## Group Size
``group_size``
#### Parameters:
Überprüft die Gruppengröße des Spielers.
| Parameter | Description | Default | Required |
|-----------|-------------|---------|----------|
| `id` | The ID of the event. | | true |
| `state` | The state the event should be in. One of `active`, `inactive`, `completed` or `disabled` | active | false |

* **min:** Die minimale Gruppengröße.
* **max:** Die maximale Gruppengröße.
```yaml
'event_state: id=example_event; state=active'
```

## Inventory
:::caution Nicht implementiert
ItemsXL ist noch nicht so weit :/
:::
``inventory``
```yaml
event_state:
id: example_event
state: active
```

## Inverted
``inverted``
## global_score
Checks if a certain global score is larger or equal to a value. Global scores are server-wide.

Invertiert die Bedingung.
#### Parameters:

* **InvertedConditions:** Die Bedingungen. Keine Kurzschreibweise möglich.
| Parameter | Description | Default | Required |
|-----------|-------------|---------|----------|
| `score` | The name of the global score. | | true |
| `value` | The value the score should be larger or equal to. | 1 | false |

## Job Level
``job_level``
```yaml
'global_score: score=example_score; value=5'
```

Überprüft das Level eines Berufs.
```yaml
global_score:
score: example_score
value: 5
```

* **job:** Der Name des Berufs
* **level:** Das Minimallevel des Berufs
## group_size
Checks if the player's current group is between min and max group size. Requires Aergia to be installed.

## Level
``level``
Überprüft das Level des Spielers.
#### Parameters:

* **level:** Das Minimallevel des Spielers
| Parameter | Description | Default | Required |
|-----------|-------------|---------|----------|
| `max` | The maximum group size. | 5 | false |
| `min` | The minimum group size. | 1 | false |

## Location
``location``
```yaml
'group_size: min=2; max=5'
```

Überprüft ob der Spieler oder das Event sich an einer bestimmten Position befinden.
```yaml
group_size:
min: 2
max: 5
```

* **QLocation**
* **range:** Maximaldistanz zur Location
## inventory_contains
Checks if the player has the specified item in their inventory. Supports both Materials and Hephaestus items.

## Looking at
``looking_at``
#### Parameters:

Überprüft ob der Spieler auf eine bestimmte Position oder einen Block schaut.
| Parameter | Description | Default | Required |
|-----------|-------------|---------|----------|
| `amount` | The amount of the item. | | false |
| `item` | The Hephaestus item to check for. | | false |
| `material` | The material of the item. | | false |

* **block:** Der Block auf den der Spieler schaut. Optional.
* **QLocation** Nur wenn kein Block angegeben ist.
* **accuracy:** Maximaldistanz zur Location. Nur wenn kein Block angegeben ist.
```yaml
'inventory_contains: material=diamond_ore; amount=5'
```

## Permission
``permission``
```yaml
inventory_contains:
item: 'erethon:hoe' # Needs to be quoted due to the colon
amount: 1
```

Überprüft ob der Spieler eine bestimmte Permission hat.
## inverted
This condition is successful if all of its conditions are not successful.

* **permission:** Die Permission-Node
#### Parameters:

## Player Score
``player_score``
| Parameter | Description | Default | Required |
|-----------|-------------|---------|----------|
| `conditions` | A list of conditions that must not be successful for this condition to be successful. | | true |

Überprüft den Wert eines Spieler-Scores.
```yaml
<no short syntax>
```

* **score:** Die ID des Scores
* **value:** Der Wert des Scores.
```yaml
inverted:
conditions:
- event_state: id=example; state=disabled
```

## Region
``region``
## job_level
Checks if a player has a certain level in a job. Requires JobsXL to be installed.

Überprüft ob der Spieler oder das Event sich in einer bestimmten Region befinden.
#### Parameters:

* **region:** Die ID der Region
| Parameter | Description | Default | Required |
|-----------|-------------|---------|----------|

## Time
``time``
```yaml
job_level: job=Miner; level=5
```

Überprüft die (echte) Zeit.
```yaml
job_level:
job: Miner
level: 5
```

## location
Checks if the player is within a certain range of a location.

#### Parameters:

| Parameter | Description | Default | Required |
|-----------|-------------|---------|----------|
| `location` | The location the player has to be in range of. QLocation | | true |
| `range` | The radius the player has to be in. | 1 | false |

```yaml
'location: x=192; y=64; y=20; radius=10'
```

```yaml
location:
x: 192
y: 64
z: 20
radius: 10
```

## looking_at
Checks if the player is looking at a certain location or block.

#### Parameters:

| Parameter | Description | Default | Required |
|-----------|-------------|---------|----------|
| `accuracy` | The accuracy the player has to be looking at the location. | 1 | false |
| `block` | The block the player has to be looking at. Can be used together with location | | false |
| `location` | The location the player has to be looking at. QLocation | | false |

```yaml
'looking_at: x=192; y=64; y=20; accuracy=1'
```

```yaml
looking_at:
block: DIAMOND_BLOCK
```

## permission
Checks if the player has a certain permission.

#### Parameters:

| Parameter | Description | Default | Required |
|-----------|-------------|---------|----------|
| `permission` | The permission the player has to have. | | true |

```yaml
'permission: permission=questsxl.test'
```

```yaml
permission:
permission: questsxl.test
```

## player_score
Checks if a player has at least a certain score. Per-player

#### Parameters:

| Parameter | Description | Default | Required |
|-----------|-------------|---------|----------|
| `score` | The name of the score. | | true |
| `value` | The value the score should be larger or equal to. | 1 | false |

```yaml
player_score: score=score_name; value=5
```

```yaml
player_score:
score: score_name
value: 5
```

## region
Checks if the player is in a certain region. QXL-Region, not Faction-Region!

#### Parameters:

| Parameter | Description | Default | Required |
|-----------|-------------|---------|----------|
| `region` | The ID of the region. | | true |

```yaml
'region: region=region_id'
```

```yaml
region:
region: region_id
```

## time
Checks if the current time is between min and max time.

#### Parameters:

| Parameter | Description | Default | Required |
|-----------|-------------|---------|----------|
| `maxHour` | The maximum hour. | | false |
| `maxMinute` | The maximum minute. | | false |
| `minHour` | The minimum hour. | | false |
| `minMinute` | The minimum minute. | | false |

```yaml
'time: minHour=18; minMinute=0; maxHour=20; maxMinute=0' #18:00 - 20:00
```

```yaml
time:
minHour: 18
minMinute: 0
maxHour: 20
maxMinute: 0
timeZone: ECT
```

* **minHour:** Die minimale Stunde.
* **minMinute:** Die minimale Minute.
* **maxHour:** Die maximale Stunde.
* **maxMinute:** Die maximale Minute.
* **timeZone:** Die Zeitzone. Default: ``ECT``

0 comments on commit 83f6b4c

Please sign in to comment.