Date: 2017/03/30 16:57:51 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
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
ShiftEvents:
type: world
debug: true
events:
on server start:
- yaml 'load:scripts/config.yml' 'id:config'
on weather rains:
- determine cancelled
on player changes food level:
- determine cancelled
on player walks:
- if <queue.list.contains_any_text[Starting$]> {
- determine cancelled
}
- if !<player.location.sub[0,0.1,0].material.is_solid> && !<player.location.sub[0,0.1,0].material.contains_text[water]> {
- flag <player> falling:!
}
on player damaged:
- if !<queue.list.contains_any_text[Ingame$]> {
- determine cancelled
}
on player steps on air:
- if !<player.has_flag[falling]> {
- flag <player> falling:<context.previous_location.add[0,1.1,0]>
}
on block set on fire:
- determine cancelled
on entity explodes:
- determine li@
on player clicks with NightcrawlerTear:
- if <queue.list.contains_any_text[Waiting$|Pregame$|Starting$]> {
- queue clear
}
- take i@NightcrawlerTear quantity:1 from:<player.inventory>
- teleport <player> <player.flag[falling].as_location>
- flag <player> falling:!
on player clicks with Berserker1Bud:
- if <queue.list.contains_any_text[Waiting$|Pregame$|Starting$]> {
- queue clear
}
- if <player.has_flag[Berserkercooldown]> {
- narrate "<&c>This item is on cooldown and can be used in <player.flag[Berserkercooldown].expiration> seconds!"
- queue clear
}
- define damage <s@Config.yaml_key[kitvariables.Berserker.Lvl1Damage]>
- if <player.health.is[OR_LESS].than[<def[damage]>]> {
- narrate "<&c>You don<&sq>t have enough health to activate this item!"
- queue clear
}
- hurt <def[damage]> <player>
- cast strength d:<s@Config.yaml_key[kitvariables.Berserker.Lvl1StrengthTime]> p:2
- take i@Berserker1Bud quantity:1 from:<player.inventory>
- flag <player> Berserkercooldown duration:30s
on player clicks with Berserker2Bud:
- if <queue.list.contains_any_text[Waiting$|Pregame$|Starting$]> {
- queue clear
}
- if <player.has_flag[Berserkercooldown]> {
- narrate "<&c>This item is on cooldown and can be used in <player.flag[Berserkercooldown].expiration> seconds!"
- queue clear
}
- define damage <s@Config.yaml_key[kitvariables.Berserker.Lvl2Damage]>
- if <player.health.is[OR_LESS].than[<def[damage]>]> {
- narrate "<&c>You don<&sq>t have enough health to activate this item!"
- queue clear
}
- hurt <def[damage]> <player>
- cast strength d:<s@Config.yaml_key[kitvariables.Berserker.Lvl2StrengthTime]> p:2
- take i@Berserker2Bud quantity:1 from:<player.inventory>
- flag <player> Berserkercooldown duration:30s
on player clicks with Berserker3Bud:
- if <queue.list.contains_any_text[Waiting$|Pregame$|Starting$]> {
- queue clear
}
- if <player.has_flag[Berserkercooldown]> {
- narrate "<&c>This item is on cooldown and can be used in <player.flag[Berserkercooldown].expiration> seconds!"
- queue clear
}
- define damage <s@Config.yaml_key[kitvariables.Berserker.Lvl3Damage]>
- if <player.health.is[OR_LESS].than[<def[damage]>]> {
- narrate "<&c>You don<&sq>t have enough health to activate this item!"
- queue clear
}
- hurt <def[damage]> <player>
- cast strength d:<s@Config.yaml_key[kitvariables.Berserker.Lvl3StrengthTime]> p:2
- take i@Berserker3Bud quantity:1 from:<player.inventory>
- flag <player> Berserkercooldown duration:30s
on player left clicks block with AngelBeacon:
- if <queue.list.contains_any_text[Waiting$|Pregame$|Starting$]> {
- queue clear
}
- if !<s@Config.list_keys.contains[materials.<context.material.bukkit_enum>]> {
- narrate "<&c>You can<&sq>t place a beacon there!"
- queue clear
}
- modifyblock <context.location> beacon
- take i@AngelBeacon quantity:1 from:<player.inventory>
- flag <player> placedbeacons:+:1
### NOTE A CUBOID OF RADIUS 3 AROUND THAT BLOCK!!! ###
on player clicks with AngelFlower:
- if <queue.list.contains_any_text[Waiting$|Pregame$|Starting$]> {
- queue clear
}
- if <player.health.is[EQUALS].to[<player.health.max>]> {
- narrate "<&c>Your health is already full!"
}
- heal <player>
- take i@AngelFlower quantity:1 from:<player.inventory>
on player damaged by void:
- determine passively cancelled
- teleport <player> <s@Config.yaml_key[spawns.<server.flag[spawns].as_list.find[<player.name>]>]>
- heal <player>
- announce "<&c><player.name> <&6>was knocked into the void by <&c><KILLER PLAYER><&6>!"
### DETERMINE KILLER ###
on player killed:
- determine passively cancelled
- teleport <player> <s@Config.yaml_key[spawns.<server.flag[spawns].as_list.find[<player.name>]>]>
- heal <player>
- announce "<&c><player.name> <&6>was killed by <&c><KILLER PLAYER><&6>!"
### DETERMINE KILLER ###
on player clicks KitSelector in inventory:
- determine passively cancelled
- inventory open d:in@KitSelectorGUI
on player clicks with KitSelector:
- inventory open d:in@KitSelectorGUI
on player clicks Filler in KitSelectorGUI:
- determine cancelled
on player clicks in KitSelectorGUI:
- determine passively cancelled
- choose <context.item.material.name>:
- case "stone_sword":
- flag player GUIItem:Swordsman
- inventory open d:in@LevelGUI
- case "iron_pickaxe":
- flag player GUIItem:Miner
- inventory open d:in@LevelGUI
- case "bow":
- flag player GUIItem:Archer
- inventory open d:in@LevelGUI
- case "splash_potion":
- flag player GUIItem:Rogue
- inventory open d:in@LevelGUI
- case "gold_ingot":
- flag player GUIItem:Capitalist
- inventory open d:in@LevelGUI
- case "ghast_tear":
- flag player GUIItem:Nightcrawler
- inventory open d:in@LevelGUI
- case "beacon":
- flag player GUIItem:Angel
- inventory open d:in@LevelGUI
- case "red_dye":
- flag player GUIItem:Berserker
- inventory open d:in@LevelGUI
- case "firework":
- flag player GUIItem:Demoman
- inventory open d:in@LevelGUI
on player breaks block:
- if <context.location.is_within[gardenspawn]> {
- determine cancelled
}
- if !<s@Config.list_keys.contains[materials.<context.material.bukkit_enum>]> {
- determine cancelled
}
- determine passively cancelled
- modifyblock <context.location> bedrock
- define bonus '<player.item_in_hand.enchantments.level[LOOT_BONUS_BLOCKS]||0>'
- define quantity '<util.random.int[<s@Config.yaml_key[materials.<context.material>.minq>]>].to[<s@Config.yaml_key[materials.<context.material>.maxq>].add_int[<def[bonus]>]>'
- give <s@Config.yaml_key[materials.<context.material.bukkit_enum>.reward]> quantity:<def[quantity]>
- if !<s@Config.list_keys.contains[materials.<context.material>.bonus]> {
- give <s@Config.yaml_key[materials.<context.material.bukkit_enum>.bonus]> quantity:1
}
- flag <player> alltimeoresmined:+:1
- dait <s@Config.yaml_key[BlockRegen.<context.material>]>
- modifyblock <context.location> <context.material>
on player breaks quartz_ore:
- determine passively cancelled
- flag player score:+:1
- playsound <server.list_online_players> sound:BLOCK_NOTE_PLING volume:1.2 pitch:2
on player changes soil into dirt:
- determine cancelled
on player clicks in LevelGUI:
- determine passively cancelled
- choose <context.slot>:
- case "1":
- if !<player.flag[<player.flag[GUIItem]>].is[OR_MORE].than[1]> {
- narrate "<&c>You do not have this kit unlocked!"
- inventory close d:in@LevelGUI
- queue clear
}
- inventory clear
- foreach <s@Config.list_keys[kititems.<player.flag[GUIItem]>.<player.flag[<player.flag[GUIItem]>]>]> {
- give <s@Config.yaml_key[kititems.<player.flag[GUIItem]>.<player.flag[<player.flag[GUIItem]>]>.<def[loop_index]>.item]> quantity:<s@Config.yaml_key[kititems.<player.flag[GUIItem]>.<player.flag[<player.flag[GUIItem]>]>.<def[loop_index]>.quantity]> to:<player.inventory> slot:<def[loop_index]> unlimit_stack_size
}
- give i@KitSelector quantity:1 to:<player.inventory> slot:9
- inventory close d:in@LevelGUI
- case "2":
- if !<player.flag[<player.flag[GUIItem]>].is[OR_MORE].than[1]> {
- narrate "<&c>You do not have this kit unlocked!"
- inventory close d:in@LevelGUI
- queue clear
}
- inventory clear
- foreach <s@Config.list_keys[kititems.<player.flag[GUIItem]>.<player.flag[<player.flag[GUIItem]>]>]> {
- give <s@Config.yaml_key[kititems.<player.flag[GUIItem]>.<player.flag[<player.flag[GUIItem]>]>.<def[loop_index]>.item]> quantity:<s@Config.yaml_key[kititems.<player.flag[GUIItem]>.<player.flag[<player.flag[GUIItem]>]>.<def[loop_index]>.quantity]> to:<player.inventory> slot:<def[loop_index]> unlimit_stack_size
}
- give i@KitSelector quantity:1 to:<player.inventory> slot:9
- inventory close d:in@LevelGUI
- case "10":
- if !<player.flag[<player.flag[GUIItem]>].is[OR_MORE].than[1]> {
- narrate "<&c>You do not have this kit unlocked!"
- inventory close d:in@LevelGUI
- queue clear
}
- inventory clear
- foreach <s@Config.list_keys[kititems.<player.flag[GUIItem]>.<player.flag[<player.flag[GUIItem]>]>]> {
- give <s@Config.yaml_key[kititems.<player.flag[GUIItem]>.<player.flag[<player.flag[GUIItem]>]>.<def[loop_index]>.item]> quantity:<s@Config.yaml_key[kititems.<player.flag[GUIItem]>.<player.flag[<player.flag[GUIItem]>]>.<def[loop_index]>.quantity]> to:<player.inventory> slot:<def[loop_index]> unlimit_stack_size
}
- give i@KitSelector quantity:1 to:<player.inventory> slot:9
- inventory close d:in@LevelGUI
- case "11":
- if !<player.flag[<player.flag[GUIItem]>].is[OR_MORE].than[1]> {
- narrate "<&c>You do not have this kit unlocked!"
- inventory close d:in@LevelGUI
- queue clear
}
- inventory clear
- foreach <s@Config.list_keys[kititems.<player.flag[GUIItem]>.<player.flag[<player.flag[GUIItem]>]>]> {
- give <s@Config.yaml_key[kititems.<player.flag[GUIItem]>.<player.flag[<player.flag[GUIItem]>]>.<def[loop_index]>.item]> quantity:<s@Config.yaml_key[kititems.<player.flag[GUIItem]>.<player.flag[<player.flag[GUIItem]>]>.<def[loop_index]>.quantity]> to:<player.inventory> slot:<def[loop_index]> unlimit_stack_size
}
- give i@KitSelector quantity:1 to:<player.inventory> slot:9
- inventory close d:in@LevelGUI
- case "19":
- if !<player.flag[<player.flag[GUIItem]>].is[OR_MORE].than[1]> {
- narrate "<&c>You do not have this kit unlocked!"
- inventory close d:in@LevelGUI
- queue clear
}
- inventory clear
- foreach <s@Config.list_keys[kititems.<player.flag[GUIItem]>.<player.flag[<player.flag[GUIItem]>]>]> {
- give <s@Config.yaml_key[kititems.<player.flag[GUIItem]>.<player.flag[<player.flag[GUIItem]>]>.<def[loop_index]>.item]> quantity:<s@Config.yaml_key[kititems.<player.flag[GUIItem]>.<player.flag[<player.flag[GUIItem]>]>.<def[loop_index]>.quantity]> to:<player.inventory> slot:<def[loop_index]> unlimit_stack_size
}
- give i@KitSelector quantity:1 to:<player.inventory> slot:9
- inventory close d:in@LevelGUI
- case "20":
- if !<player.flag[<player.flag[GUIItem]>].is[OR_MORE].than[1]> {
- narrate "<&c>You do not have this kit unlocked!"
- inventory close d:in@LevelGUI
- queue clear
}
- inventory clear
- foreach <s@Config.list_keys[kititems.<player.flag[GUIItem]>.<player.flag[<player.flag[GUIItem]>]>]> {
- give <s@Config.yaml_key[kititems.<player.flag[GUIItem]>.<player.flag[<player.flag[GUIItem]>]>.<def[loop_index]>.item]> quantity:<s@Config.yaml_key[kititems.<player.flag[GUIItem]>.<player.flag[<player.flag[GUIItem]>]>.<def[loop_index]>.quantity]> to:<player.inventory> slot:<def[loop_index]> unlimit_stack_size
}
- give i@KitSelector quantity:1 to:<player.inventory> slot:9
- inventory close d:in@LevelGUI
- case "8":
- inventory open d:in@KitSelectorGUI
- case "9":
- inventory open d:in@KitSelectorGUI
- case "17":
- inventory open d:in@KitSelectorGUI
- case "18":
- inventory open d:in@KitSelectorGUI
- case "26":
- inventory open d:in@KitSelectorGUI
- case "27":
- inventory open d:in@KitSelectorGUI
- case "5":
- case "14":
- case "23":
on player join:
- if <server.flag[spawns].as_list.size.is[OR_MORE].than[<s@Config.yaml_key[maxplayers].as_int>]> {
- narrate "<&c>This server is currently full. Please try another one!"
- adjust <player> send_to:server@lobby
}
- if <server.flag[spawns].as_list.size.is[OR_MORE].than[<s@Config.yaml_key[premiumplayers].as_int>]> && !<player.has_flag[premium]> {
- narrate "<&c>This server is currently full. Purchase a rank to gain premium access to full servers!"
- adjust <player> send_to:server@lobby
}
- if <server.has_flag[nonewjoins]> && !<server.flag[rejoin].as_list.contains_text[<player.name>]> {
- narrate "<&c>The game has progressed too far. To prevent Play Point abuse no new players may join.<&nl><&c><&l>Please try another server!"
- adjust <player> send_to:server@lobby
}
- announce "<&e>[<&a>+<&e>] <&b><&l><player.name><&r> <&7>joined."
- if !<queue.list.contains_any_text[Waiting$|Pregame$|Starting$|Ingame$|Postgame$]> {
- run s@Waiting$ instantly
}
- if <queue.list.contains_any_text[Waiting$|Pregame$]> || !<server.flag[spawns].as_list.contains_text[<player.name>]> {
- sidebar add "values:<&e> <player.flag[score]><&c> <player.flag[kills]><&b> <player.name>" "players:<player>" per_player
- flag server spawns:->:<player.name>
- teleport <player> <s@Config.yaml_key[spawns.pregame]>
- inventory clear
- give i@KitSelector to:<player.inventory> slot:1
- flag player kills:0
- flag player score:0
- queue clear
}
- inventory set d:<player.inventory> o:<s@Config.yaml_key[rejoininventories.<player.name>].as_list>
- teleport <player> <s@Config.yaml_key[spawns.<server.flag[spawns].as_list.find[<def[player]>]>]>
on player quit:
- announce "<&e>[<&c>-<&e>] <&b><&l><player.name><&r> <&7>left."
- if <player.has_flag[premium]> {
- flag server rejoin:->:<player.name> duration:5m
- yaml 'id:config' set 'rejoininventories.<player.name>:<player.inventory.list_contents>'
}
- if !<server.flag[rejoin].as_list.contains_text[<player.name>]> || null {
- flag server spawns:<-:<player.name>
- sidebar remove "lines:<sidebar.lines.as_list.find[<player.name>]>
}
- if <queue.list.contains_any_text[Ingame$]> && <server.list_online_players.size.is[EQUALS].to[0]> {
- ^run s@Postgame$ instantly
}
on player logs in for the first time:
- flag <player> alltimekills:0
- flag <player> alltimeswordkills:0
- flag <player> alltimebowkills:0
- flag <player> alltimeoresmined:0
- flag <player> alltimedeaths:0
- flag <player> alltimepoints:0
- flag <player> alltimewins:0
- flag <player> alltimelosses:0
- flag <player> solokills:0
- flag <player> solodeaths:0
- flag <player> solopoints:0
- flag <player> solowins:0
- flag <player> sololosses:0
- flag <player> Swordsman:1
- flag <player> Miner:0
- flag <player> Archer:0
- flag <player> Rogue:0
- flag <player> Capitalist:0
- flag <player> Nightcrawler:0
- flag <player> Angel:0
- flag <player> Berserker:0
- flag <player> Demoman:0
cuboids:
- note cu@14,146,23,world|-19,120,-15,world as:gardenspawn