aboutsummaryrefslogtreecommitdiffstats
path: root/docs/configuration/creating-a-quest.md
blob: 6e3b7283bc12dab96d0d17583a70011d67cbd722 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
---
title: Creating a quest
parent: Configuration
nav_order: 2
---

# Creating a quest
{: .no_toc }

Each file inside the `quests` subfolder represents a
single quest. The **name** of the file represents the **quest id** and
must be alphanumeric (excluding the .yml extension).

{: .note }
An example can be seen in the [default
configuration](https://github.com/LMBishop/Quests/blob/master/bukkit/src/main/resources/resources/bukkit/quests/example1.yml).

## Table of contents
{: .no_toc .text-delta }

1. TOC
{:toc}

## Quest ID

The quest ID is the name of the file (excluding .yml extension) and must
alphanumeric and unique. This ID is used as the reference in commands,
players' quest progress file and in placeholders.

## Tasks

  
*`tasks`*

Tasks are the objectives the player must do to complete the quest.
Simalar to quest IDs, there are task IDs. They can be identical to the
quest ID but must be unique to each other.

For help on adding the tasks, refer to [task configuration
layout](Task_configuration_layout "wikilink")

## Display

  
*`display`*

This is the item which will be shown to the player in the quest GUI.

### Name

  
*`display.name`*

The name of the item. This is also the name used in chat messages.

``` yaml
display:
  name: "&cExample I (Single Task)"
```

### Normal lore

  
*`display.lore-normal`*

The lore (description) of the item as seen if the quest is not started.

``` yaml
display:
  ...
  lore-normal:
    - "&cThis category is designed to show you the different"
    - "&cattributes a quest can have."
    - ""
    - "&7This quest requires you to:"
    - "&7 - Break &f30 blocks&7."
    - ""
    - "&7Rewards:"
    - "&7 - &f10 &7diamonds."
```

### Started lore

  
*`display.lore-started`*

The lore (description) of the item **appended to `lore-normal`** if the
quest is started. This is a good place to put progression details. To
get the progression of a player in a task, write `{TASKID:progress}` and
replace `TASKID` with the ID of the task you want to get the progress
for. Alternatively, you can write `{TASKID:complete}` to get if the task
is complete.

``` yaml
display:
  ...
  lore-started:
    - ""
    - "&7Your current progression:"
    - "&7 - &f{mining:progress}&7/30 blocks broken."
```

### Type

  
*`display.type`*

The type (material name) of item.

``` yaml
display:
  ...
  type: "WOODEN_PICKAXE"
```

## Rewards

  
*`rewards`*

**Optional.** This is a list of commands which will be executed when the
player completes the quest. You can use `{player}` and the players name
will be substituted in place.

``` yaml
rewards:
  - "give {player} diamond 10"
```

## Start commands

  
*`startcommands`*

**Optional.** This is a list of commands which will be executed when the
player starts the quest. You can use `{player}` and the player's name
will be substituted in place.

``` yaml
startcommands:
  - "broadcast {player} has started a quest"
```

## Start string

  
*`startstring`*

**Optional.** This is a list of messages which will be sent to the
player when they start the quest. This is useful for telling the player
their objectives.

``` yaml
startstring:
 - " &8- &7You must break 30 blocks."
```

## Reward string

  
*`rewardstring`*

**Optional.** This is a list of messages which will be sent to the
player when they complete the quest. This is useful for telling the
player their rewards.

``` yaml
rewardstring:
 - " &8- &7You have received 10 dimaonds."
```

## Placeholders

  
*`placeholders`*

**Optional.** This is a set of placeholders which can be accessed using
PlaceholderAPI. To get the progression of a player in a task, write
`{TASKID:progress}` and replace `TASKID` with the ID of the task you
want to get the progress for. Alternatively, you can write
`{TASKID:complete}` to get if the task is complete.

``` yaml
placeholders:
  description: "&7Break &f30 blocks &7of any type."
  progress: " &8- &f{mining:progress}&7/30 broken"
```

These placeholders will be called using PlaceholderAPI. See [quest
progress in scoreboard](Quest_progress_in_scoreboard "wikilink") for a
guide which utilises this feature.

## Options

  
*`options`*

This section defines quest-specific options.

### Category

  
*`options.category`*

**Optional.** The category the quest will be in. You should put the ID
of the category here.

``` yaml
options:
  ...
  category: "example"
```

### Requirements

  
*`options.requires`*

**Optional.** List of Quest IDs the player must complete before being
able to start this quest.

``` yaml
options:
  ...
  requires:
   - "quest-id"
```

### Permission required

  
*`options.permission-required`*

**Optional.** Whether or not the quest should require a permission to
start. The permission will be `quests.quest.<id>`.

``` yaml
options:
  ...
  permission-required: false
```

### Cancellable

  
*`options.cancellable`*

**Optional.** Whether or not this quest can be cancelled. If global or
local quest autostart is enabled, or is cancelling quests is disabled,
then this option is ignored.

``` yaml
options:
  ...
  cancellable: false
```

### Counts towards limit

  
*`options.counts-towards-limit`*

**Optional.** Whether or not this quest counts towards the players quest
started limit. If global quest autostart is enabled, this will have no
effect as quest limits are disabled.

``` yaml
options:
  ...
  counts-towards-limit: false
```

### Repeatable

  
*`options.repeatable`*

**Optional.** Whether or not the quest can be replayed.

``` yaml
options:
  ...
  repeatable: false
```

### Cooldown

  
*`options.cooldown`*

**Optional.** Whether ot not the quest is placed on cooldown or is
immediately replayable.

``` yaml
options:
  ...
  cooldown:
    enabled: true
    time: 1440     # minutes
```

### Time limit

  
*`options.time-limit`*

**Optional.** Whether or not this quest has a time limit to complete it.
If the time limit is reached, the quest will be cancelled and progress
reset.

``` yaml
options:
  ...
  time-limit:
    enabled: true
    time: 1440     # minutes
```

### Sort order

  
*`options.sort-order`*

**Optional.** How the plugin sorts the quests in the GUI, lower numbers
come first.

``` yaml
options:
  ...
  sort-order: 1
```

### Autostart

  
*`options.autostart`*

**Optional.** Whether or not the quest should automatically be started.
This is similar to enabling quest autostart for the entire plugin, but
specific only to this quest, meaning it cannot be cancelled and counts
towards the players quest started limit.

See [§ counts towards
limit](Creating_a_quest#Counts_towards_limit "wikilink") if you do not
want autostart quests to count towards the quest started limit.

``` yaml
options:
  ...
  autostart: true
```

### Completed display

  
*`options.completed-display`*

**Optional.** The display item this quest should take if it is
completed. This accepts the standard ItemStack definition format
described in [Defining items](Defining_items "wikilink"). If this option
is not specified, the display item [defined in the main
config.yml](gui-configuration#quest-completed-display "wikilink") will
be used.

``` yaml
options:
  ...
  completed-display:
    type: "STEAK"
```

### Cooldown display

  
*`options.cooldown-display`*

**Optional.** The display item this quest should take if it is on
cooldown. This accepts the standard ItemStack definition format
described in [Defining items](Defining_items "wikilink"). If this option
is not specified, the display item [defined in the main
config.yml](gui-configuration#quest-cooldown-display "wikilink") will be
used.

``` yaml
options:
  ...
  cooldown-display:
    type: "STEAK"
```

### Permission display

  
*`options.permission-display`*

**Optional.** The display item this quest should take if the player does
not have permission to start it. This accepts the standard ItemStack
definition format described in [Defining
items](Defining_items "wikilink"). If this option is not specified, the
display item [defined in the main
config.yml](gui-configuration#quest-permission-display "wikilink") will
be used.

``` yaml
options:
  ...
  permission-display:
    type: "STEAK"
```

### Locked display

  
*`options.locked-display`*

**Optional.** The display item this quest should take if the player has
not unlocked it. This accepts the standard ItemStack definition format
described in [Defining items](Defining_items "wikilink"). If this option
is not specified, the display item [defined in the main
config.yml](gui-configuration#quest-locked-display "wikilink") will be
used.

``` yaml
options:
  ...
  locked-display:
    type: "STEAK"
```