Date: 2018/09/07 15:05:12 UTC-07:00
Type: Denizen Script
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
questsys_gui:
type: inventory
debug: false
inventory: CHEST
title: '<proc[questsys_gui_proc].context[title]> Quests'
size: 54
definitions:
b: 'i@black_stained_glass_pane[display_name=&ss0]'
t: 'i@magenta_stained_glass_pane[display_name=<proc[questsys_gui_proc].context[title]>
Quests;lore=|&ss7&ssoTotal of <proc[questsys_gui_proc].context[size]>
quest<tern[<proc[questsys_gui_proc].context[size].is[EQUALS].to[1].not>]:s||> in this
category&dot|&ssfPage <player.flag[questsys.inv.page]||1>]'
c: 'i@orange_stained_glass_pane[display_name=&ss6&sslView Completed Quests;lore=&ss7Click to
view your complieted quests˙nbt=questsys_gui/0]'
a: 'i@lime_stained_glass_pane[display_name=&ssa&sslView Active Quests;lore=&ss7Click to view
your active quests˙nbt=questsys_gui/1]'
i: 'i@red_stained_glass_pane[display_name=&ssc&sslView Inactive Quests;lore=&ss7Click to view
your inactive quests˙nbt=questsys_gui/2]'
p: 'i@cyan_stained_glass_pane[display_name=&ssf&sslPrevious Page;lore=&ss7Click to go back to
page <player.flag[questsys.inv.page].sub[1]>;nbt=questsys_gui/3]'
n: 'i@light_blue_stained_glass_pane[display_name=&ssf&sslNext Page;lore=&ss7Click to go to page
<player.flag[questsys.inv.page].add[1]>;nbt=questsys_gui/4]'
procedural items:
- define list li@
# 0 = completed, 1 = active, 2 = inactive
- if <player.flag[questsys.inv.category]||0> == 1 {
- define baseitem beacon
- define nc <&b><&n>
- define lc <&7>
- define qlist <player.flag[questsys.quests.active].as_list||li@>
- define showobj true
}
else if <player.flag[questsys.inv.category]||0> == 2 {
- define baseitem chest
- define nc <&c><&n>
- define lc <&8>
- define qlist <s@questsys_data.list_keys.exclude[<player.flag[questsys.quests.active].as_list.include[<player.flag[questsys.quests.completed].as_list>].include[debug|type]||li@debug|type>]>
- define showstart true
}
else {
- define baseitem sea_lantern
- define nc <&a><&n>
- define lc <&f>
- define qlist <player.flag[questsys.quests.completed].as_list||li@>
- define showrepeats true
- define showsobj true
}
- foreach <def[qlist].get[<player.flag[questsys.inv.page].mul[36].sub[35]||1>].to[<player.flag[questsys.inv.page].mul[36]||36>]||li@> {
- define lore 'li@|%lc%<proc[gpa_gpu_line_wrap].context[<s@questsys_data.yaml_key[%value%.description]||You
should report this to an admin&dot>|42|5].separated_by[|]>'
- define nbt li@questsys_id/<def[value]>
- if <s@questsys_data.yaml_key[%value%.repeats]||false> && <def[showrepeats]||false> {
- define lore '%lore%||&ss7Repeated <player.flag[questsys.quests.repeat.%value%]||1>
time<tern[<player.flag[questsys.quests.repeat.%value%].is[EQUALS].to[1].not||false>]:s||>'
}
- if <def[showobj]||false> {
- define lore '%lore%||&ssf&sslCurrent objective&co|<proc[gpa_gpu_line_wrap].context[<s@questsys_data.yaml_key[%value%.objective.<player.flag[questsys.quests.obj.%value%]||1>.description]>|42|7].separated_by[|]>'
}
- if <def[showstart]||false> {
- define lore '%lore%||<proc[gpa_gpu_line_wrap].context[&ss4<s@questsys_data.yaml_key[%value%.start_condition]||&ss4It&sqs
a secret&dot&dot&dot>|42|10].separated_by[|]>'
}
- if <s@questsys_data.list_keys[%value%.special_objectives].contains_any[<player.flag[questsys.quests.sobj.%value%].as_list||-1>]>
&& <def[showsobj]||false> {
- define nbt '%nbt%|questsys_gui/5'
}
- define list '<def[list].include[i@%baseitem%[display_name=%nc%<s@questsys_data.yaml_key[%value%.name].unescaped||Invalid
Quest&exc>;lore=%lore%;nbt=%nbt%]]>'
}
- determine %list%
slots:
- '[b] [b] [b] [b] [t] [b] [b] [b] [b]'
- '[] [] [] [] [] [] [] [] []'
- '[] [] [] [] [] [] [] [] []'
- '[] [] [] [] [] [] [] [] []'
- '[] [] [] [] [] [] [] [] []'
- '[b] [<proc[questsys_gui_proc].context[pageback]>] [b] [c] [a] [i] [b] [<proc[questsys_gui_proc].context[pagenext]>] [b]'
questsys_gui_sobj:
type: inventory
debug: false
inventory: CHEST
title: '<&5><&n>Special Objectives'
size: 45
definitions:
b: 'i@black_stained_glass_pane[display_name=&ss0]'
p: 'i@magenta_stained_glass_pane[display_name=&ss2&sslQuest&co&ssr
&ssa&ssl<s@questsys_data.yaml_key[<player.flag[questsys.inv.quest]||-1>.name]||&ss4&ssl???>]'
c: 'i@lime_stained_glass_pane[display_name=&ssa&sslBack to Completed Quests Page;lore=&ss7Click
to go back to your completed quests˙nbt=questsys_gui/0]'
procedural items:
- define list li@
- foreach <player.flag[questsys.quests.sobj.<player.flag[questsys.inv.quest]||-1>].as_list.deduplicate.numerical||li@> {
- define list '<def[list].include[i@totem[display_name=&ssd&sslSpecial Objective
&ns%value%;lore=|<proc[gpa_gpu_line_wrap].context[&ss7<s@questsys_data.yaml_key[<player.flag[questsys.inv.quest]>.special_objectives.%value%]||&sscInvalid&exc>|42|10].separated_by[|]>]]>'
}
- determine %list%
slots:
- '[b] [b] [b] [b] [p] [b] [b] [b] [b]'
- '[] [] [] [] [] [] [] [] []'
- '[] [] [] [] [] [] [] [] []'
- '[] [] [] [] [] [] [] [] []'
- '[b] [b] [b] [b] [c] [b] [b] [b] [b]'
questsys_gui_proc:
type: procedure
debug: false
script:
- if %1% == 'title' {
- if <player.flag[questsys.inv.category]||0> == 1 {
- determine <&a><&n>Active
}
else if <player.flag[questsys.inv.category]||0> == 2 {
- determine <&c><&n>Inactive
}
else {
- determine <&6><&n>Completed
}
}
- if %1% == 'pageback' {
- if <player.flag[questsys.inv.page]||1> > 1 {
- determine p
}
- determine b
}
- if %1% == 'pagenext' {
- if <player.flag[questsys.inv.category]||0> == 1 {
- define qlist '<player.flag[questsys.quests.active].as_list||li@>'
}
else if <player.flag[questsys.inv.category]||0> == 2 {
- define qlist '<s@questsys_data.list_keys.exclude[<player.flag[questsys.quests.active].as_list.include[<player.flag[questsys.quests.completed].as_list>].include[debug|type]||li@debug|type>]||li@>'
}
else {
- define qlist '<player.flag[questsys.quests.completed].as_list||li@>'
}
- if <player.flag[questsys.inv.page]||1> < <def[qlist].size.div[36].round_up> {
- determine n
}
- determine b
}
- if %1% == 'size' {
- if <player.flag[questsys.inv.category]||0> == 1 {
- determine <player.flag[questsys.quests.active].as_list.size||0>
}
else if <player.flag[questsys.inv.category]||0> == 2 {
- determine <s@questsys_data.list_keys.exclude[<player.flag[questsys.quests.active].as_list.include[<player.flag[questsys.quests.completed].as_list>].include[debug|type]||li@debug|type>].size||0>
}
else {
- determine <player.flag[questsys.quests.completed].as_list.size||0>
}
}
- determine null
questsys_gui_evts:
type: world
debug: false
events:
on player clicks in questsys_gui_sobj:
- inject locally 'events.on player clicks in questsys_gui'
on player clicks in questsys_gui:
- determine passively cancelled
- define nbt '<context.item.nbt[questsys_gui]||-1>'
- if %nbt% >= 0 && %nbt% <= 2 {
- flag player questsys.inv.category:%nbt%
- flag player questsys.inv.page:1
- inventory open d:in@questsys_gui
- queue clear
}
- if %nbt% == 3 || %nbt% == 4 {
- flag player questsys.inv.page:<tern[<def[nbt].is[EQUALS].to[3]>]:+||->:1
- inventory open d:in@questsys_gui
- queue clear
}
- if %nbt% == 5 {
- if <context.item.nbt[questsys_id]||null> != null {
- flag player questsys.inv.quest:<context.item.nbt[questsys_id]>
- inventory open d:in@questsys_gui_sobj
}
}
questsys_data:
type: yaml data
debug: false
0:
name: 'example quest'
description: 'example'
start_condition: 'Talk to the &sscWatcher&ss4.'
script: skuquest0_explorespawn
objectives:
1:
description: 'do something'
2:
description: 'do another'
3:
description: 'final task'
special_objectives:
1:
description: 'test'
repeats: true
repeat_delay: 24h