Date: 2017/12/30 18:31:29 UTC-08: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
gpa_com_skularr_mythicmobs_builds_cmd:
type: command
debug: false
name: mobstructures
allowed help:
- determine <player.has_permission[sku.mobstructures]||<player.is_op||<context.server>>>
description: 'Reloads all buildable structures for mob summoning.'
usage: /mobstructures
script:
- if !<player.has_permission[sku.mobstructures]> {
- if !<player.is_op||<context.server>> {
- queue clear
}
}
- define prefix '[<&3>Mob Structures<&f>] '
- narrate '<def[prefix]><&r><&c>Now reloading all mob structures!'
- define time '<server.current_time_millis>'
- flag server 'gpa.com.skularr.mythicmobs.structures:!'
- if !<server.list_worlds.contains[structure_data]> {
- if <server.list_plugins.contains[pl@VoidGenerator]> {
- createworld structure_data g:VoidGenerator worldtype:NORMAL environment:NORMAL
}
else {
- createworld structure_data worldtype:NORMAL environment:NORMAL
}
}
- define structure_list '<s@gpa_com_skularr_mythicmobs_data.list_keys[structures]>'
- define loc 'l@0,0,0,structure_data'
- foreach <def[structure_list]> {
- define count <def[loop_index]>
- define structure '<def[value]>'
- define max_y '<s@gpa_com_skularr_mythicmobs_data.list_keys[structures.<def[value]>.layers].size>'
- repeat <def[max_y]> {
- define layer <def[value]>
- inject s@gpa_com_skularr_mythicmobs_builds interpreter instantly
- inject s@gpa_com_skularr_mythicmobs_builds block_builder instantly
}
- define cuboid 'cu@<def[loc]>|<def[loc].add[<def[max_x].sub[1]>,<def[max_y].sub[1]>,<def[max_z].sub[1]>]>'
- flag server 'gpa.com.skularr.mythicmobs.structures.<def[structure]>:<def[cuboid].as_cuboid.blocks.parse[material]>'
- wait 1t
}
- ~modifyblock <cu@l@0,0,0,structure_data|l@16,0,16,structure_data> m@bedrock no_physics
- ~modifyblock <cu@l@0,1,0,structure_data|l@16,2,16,structure_data> m@dirt no_physics
- ~modifyblock <cu@l@0,3,0,structure_data|l@16,3,16,structure_data> m@grass no_physics
- ~modifyblock <cu@l@0,4,0,structure_data|l@16,16,16,structure_data> m@air no_physics
- narrate '<def[prefix]><&r><&a>It took <server.current_time_millis.sub[<def[time]>]>ms to reload all structures, with <def[count].div[20].mul[1000].round_down>ms being used to reduce immediate lag.'
- narrate '<def[prefix]><&r><&c>We<&sq>re going to load some build data for the structures, give us a moment please.'
- define time '<server.current_time_millis>'
- foreach <def[structure_list]> {
- define structure '<def[value]>'
- define mat '<s@gpa_com_skularr_mythicmobs_data.list_keys[structures.<def[structure]>.triggers].parse[as_material].parse[replace[@].with[_]].deduplicate||m@stone>'
- foreach <def[mat]> {
- flag server 'gpa.com.skularr.mythicmobs.structures.triggers.<def[value]>:->:<def[structure]>'
}
}
- narrate '<def[prefix]><&r><&a>It took <server.current_time_millis.sub[<def[time]>]>ms to load all related data!'
- narrate '<def[prefix]><&r><&f>All set!'
gpa_com_skularr_mythicmobs_data:
type: yaml data
structures:
overworld_1:
triggers:
allium:
- '-2,-1,-2@2,3,2'
layer_size: '5x5'
layers:
1: 5:stone_brick;3:stone_brick+grass*3+stone_brick;5:stone_brick
2: 1:stone_brick;1:cobblestone_stairs,1;1:air;1:cobblestone_stairs;1:stone_brick;1:cobblestone_stairs,3;3:air;1:cobblestone_stairs,3;1:air*2+allium+air*2;1:cobblestone_stairs,2;3:air;1:cobblestone_stairs,2;1:stone_brick;1:cobblestone_stairs,1;1:air;1:cobblestone_stairs;1:stone_brick
3: 1:stone_brick;3:air;1:stone_brick;15:air;1:stone_brick;3:air;1:stone_brick
4: 1:stone_brick;1:cobblestone_stairs,5;1:air;1:cobblestone_stairs,4;1:stone_brick;1:cobblestone_stairs,7;3:air;1:cobblestone_stairs,7;5:air;1:cobblestone_stairs,6;3:air;1:cobblestone_stairs,6;1:stone_brick;1:cobblestone_stairs,5;1:air;1:cobblestone_stairs,4;1:stone_brick
5: 5:stone_brick;3:stone_brick+air*3+stone_brick;5:stone_brick
action:
- playeffect <def[loc].center.sub[0,1.5,0]> 'effect:FIREWORKS_SPARK' 'data:0.2' 'quantity:30' 'offset:0.1,0,0.1'
- narrate '<&c>This does nothing!'
- flag server 'gpa.com.skularr.mythicmobs.structures.time:->:<server.current_time_millis.sub[<def[time]>]>'
- narrate 'It took <server.current_time_millis.sub[<def[time]>]>ms to run this for structure <&dq><def[structure]><&dq>.'
- narrate 'The total average to generate a structure is <server.flag[gpa.com.skularr.mythicmobs.structures.time].as_list.average.round_to[3]>ms. The total number of trials is <server.flag[gpa.com.skularr.mythicmobs.structures.time].as_list.size>.'
nether_1:
triggers:
brewing_stand:
- '-2,-1,-2@2,3,2'
layer_size: '5x5'
layers:
1: 25:nether_brick
2: 1:nether_brick;1:quartz_stairs,1;1:air;1:quartz_stairs;1:nether_brick;1:quartz_stairs,3;3:air;1:quartz_stairs,3;1:air*2+brewing_stand+air*2;1:quartz_stairs,2;3:air;1:quartz_stairs,2;1:nether_brick;1:quartz_stairs,1;1:air;1:quartz_stairs;1:nether_brick
3: 1:nether_brick;3:air;1:nether_brick;15:air;1:nether_brick;3:air;1:nether_brick
4: 1:nether_brick;1:quartz_stairs,5;1:air;1:quartz_stairs,4;1:nether_brick;1:quartz_stairs,7;3:air;1:quartz_stairs,7;5:air;1:quartz_stairs,6;3:air;1:quartz_stairs,6;1:nether_brick;1:quartz_stairs,5;1:air;1:quartz_stairs,4;1:nether_brick
5: 5:nether_brick;3:nether_brick+air*3+nether_brick;5:nether_brick
action:
- playeffect <def[loc].center.sub[0,1.5,0]> 'effect:FIREWORKS_SPARK' 'data:0.2' 'quantity:30' 'offset:0.1,0,0.1'
- narrate '<&c>This does nothing!'
- flag server 'gpa.com.skularr.mythicmobs.structures.time:->:<server.current_time_millis.sub[<def[time]>]>'
- narrate 'It took <server.current_time_millis.sub[<def[time]>]>ms to run this for structure <&dq><def[structure]><&dq>.'
- narrate 'The total average to generate a structure is <server.flag[gpa.com.skularr.mythicmobs.structures.time].as_list.average.round_to[3]>ms. The total number of trials is <server.flag[gpa.com.skularr.mythicmobs.structures.time].as_list.size>.'
the_end_1:
triggers:
'end_rod,1':
- '-2,-1,-2@2,3,2'
layer_size: '5x5'
layers:
1: 25:end_bricks
2: 1:end_bricks;1:purpur_stairs,1;1:air;1:purpur_stairs;1:end_bricks;1:purpur_stairs,3;3:air;1:purpur_stairs,3;1:air*2+end_rod,1+air*2;1:purpur_stairs,2;3:air;1:purpur_stairs,2;1:end_bricks;1:purpur_stairs,1;1:air;1:purpur_stairs;1:end_bricks
3: 1:end_bricks;3:air;1:end_bricks;15:air;1:end_bricks;3:air;1:end_bricks
4: 1:end_bricks;1:purpur_stairs,5;1:air;1:purpur_stairs,4;1:end_bricks;1:purpur_stairs,7;3:air;1:purpur_stairs,7;5:air;1:purpur_stairs,6;3:air;1:purpur_stairs,6;1:end_bricks;1:purpur_stairs,5;1:air;1:purpur_stairs,4;1:end_bricks
5: 5:end_bricks;3:end_bricks+air*3+end_bricks;5:end_bricks
action:
- playeffect <def[loc].center.sub[0,1.5,0]> 'effect:FIREWORKS_SPARK' 'data:0.2' 'quantity:30' 'offset:0.1,0,0.1'
- narrate '<&c>This does nothing!'
- flag server 'gpa.com.skularr.mythicmobs.structures.time:->:<server.current_time_millis.sub[<def[time]>]>'
- narrate 'It took <server.current_time_millis.sub[<def[time]>]>ms to run this for structure <&dq><def[structure]><&dq>.'
- narrate 'The total average to generate a structure is <server.flag[gpa.com.skularr.mythicmobs.structures.time].as_list.average.round_to[3]>ms. The total number of trials is <server.flag[gpa.com.skularr.mythicmobs.structures.time].as_list.size>.'
interpreter:
- define tile_choose '<s@gpa_com_skularr_mythicmobs_data.yaml_key[structures.<def[structure]||overworld_stonebrick>.layers.<def[layer]||1>]>'
- define tile_list 'li@'
- foreach <def[tile_choose].split[;]> {
- define tile_data '<def[value]>'
- repeat <def[value].before[:]> {
- foreach <def[tile_data].after[:].split[+]> {
- define tile_internal '<def[value]>'
- if <def[tile_internal].contains_text[*]> {
- repeat <def[tile_internal].after[*]> {
- define tile_list '<def[tile_list].include[<def[tile_internal].before[*]>]>'
}
- foreach next
}
- define tile_list '<def[tile_list].include[<def[value]>]>'
}
}
}
- define tile_list '<def[tile_list].parse[as_material]>'
block_builder:
- define newx '-1'
- define newy '<def[layer].sub[1]>'
- define newz '0'
- define max_x '<s@gpa_com_skularr_mythicmobs_data.yaml_key[structures.<def[structure]||overworld_stonebrick>.layer_size].before[x]>'
- define max_z '<s@gpa_com_skularr_mythicmobs_data.yaml_key[structures.<def[structure]||overworld_stonebrick>.layer_size].after[x]>'
- foreach <def[tile_list]> {
- define block <def[value]>
- define newx '<def[newx].add[1]>'
- if <def[newx]> == <def[max_x]> && <def[newz]> != <def[max_z]> {
- define newx '0'
- define newz '<def[newz].add[1]>'
}
else if <def[newx]> == <def[max_x]> && <def[newz]> == <def[max_z]> {
- define newx '0'
- define newz '0'
- define newy '<def[newy].add[1]>'
}
- ~modifyblock '<def[loc].add[<def[newx]>,<def[newy]>,<def[newz]>]>' <def[block]> no_physics
}
block_reader:
- define newx '-1'
- define newy '<def[layer].sub[1]>'
- define newz '0'
- define max_x '<s@gpa_com_skularr_mythicmobs_data.yaml_key[structures.<def[structure]||overworld_stonebrick>.layer_size].before[x]>'
- define max_z '<s@gpa_com_skularr_mythicmobs_data.yaml_key[structures.<def[structure]||overworld_stonebrick>.layer_size].after[x]>'
- define compare_list 'li@'
- repeat <def[max_x].mul[<def[max_z]>]> {
- define newx '<def[newx].add[1]>'
- if <def[newx]> == <def[max_x]> && <def[newz]> != <def[max_z]> {
- define newx '0'
- define newz '<def[newz].add[1]>'
}
else if <def[newx]> == <def[max_x]> && <def[newz]> == <def[max_z]> {
- define newx '0'
- define newz '0'
- define newy '<def[newy].add[1]>'
}
- define compare_list '<def[compare_list].include[l@<def[loc].x.add[<def[newx]>]>,<def[loc].y.add[<def[newy]>]>,<def[loc].z.add[<def[newz]>]>,<def[loc].world.name>]>'
}
gpa_com_skularr_mythicmobs_builds:
type: world
debug: false
events:
on player places block:
- define time '<server.current_time_millis>'
- define mat '<context.material.replace[@].with[_]>'
- define gcsmst 'gpa.com.skularr.mythicmobs.structures.triggers.<def[mat]>'
- if !<server.has_flag[<def[gcsmst]>]> {
- queue clear
}
- foreach <server.flag[<def[gcsmst]>].as_list> {
- define structure '<def[value]>'
- define loc '<context.location>'
- define key 'structures.<def[structure]||overworld_stonebrick>'
- define trigger_offsets '<s@gpa_com_skularr_mythicmobs_data.yaml_key[<def[key]>.triggers.<context.material.substring[3]>].as_list>'
- foreach <def[trigger_offsets]> {
- define offset '<def[value].split[@]>'
- define cuboid 'cu@<def[loc].add[<def[offset].get[1]>]>|<def[loc].add[<def[offset].get[2]>]>'
- if <def[cuboid].blocks.parse[material]> == <server.flag[gpa.com.skularr.mythicmobs.structures.<def[structure]>]> {
- define match 'true'
- foreach stop
}
}
- if <def[match]||false> {
- inject locally 'structures.<def[structure]>.action' instantly
- foreach stop
}
}
#- choose <context.material>:
# - case m@allium:
# - define structure 'overworld_1'
# - define cuboid 'cu@<context.location.sub[2,1,2]>|<context.location.add[2,3,2]>'
# - if <def[cuboid].blocks.parse[material]> != <server.flag[gpa.com.skularr.mythicmobs.structures.<def[structure]>]> {
# - queue clear
# }
#- repeat 5 {
# - define layer '<def[value]>'
# - define placed_tiles 'cu@<def[loc].add[0,<def[value].sub[1]>,0]>|<def[loc].add[4,<def[value].sub[1]>,4]>'
# - define placed_tiles '<def[placed_tiles].as_cuboid>'
# - inject locally 'block_reader' instantly
# - if <def[compare_list].parse[material]> != <server.flag[gpa.com.skularr.mythicmobs.structures.<def[structure]>.<def[layer]>].split[$]> {
# - queue clear
# }
#}
# - playeffect <context.location.center.sub[0,1,0]> 'effect:FIREWORKS_SPARK' 'data:0.2' 'quantity:30' 'offset:0.1,0,0.1'
# - narrate '<&c>This does nothing!'
# - narrate 'It took <server.current_time_millis.sub[<def[time]>]>ms to run this'
gpa_com_skularr_mythicmobs_dontdamage:
type: world
debug: false
events:
on player damages entity:
- if <context.damager.is_player||false> && <context.entity.mythicmob.internal_name.starts_with[PLND_]||false> {
- determine cancelled
}
gpa_com_skularr_mythicmobs_portal_evts:
type: world
debug: false
events:
on player breaks iron_block:
- inject locally 'events.on player breaks beacon' instantly
on player breaks beacon:
- if <context.location.cuboids.find_all_partial[gpa_com_skularr_mythicmobs_portal_cuboid_].is_empty> {
- queue clear
}
- determine cancelled
on player right clicks beacon:
- inject locally 'events.on player breaks beacon' instantly
gpa_com_skularr_mythicmobs_portal_task:
type: task
debug: false
definitions: uuid
speed: 0
register:
- define mob '<def[uuid].as_entity||null>'
- if <def[mob]> == null {
- queue clear
}
- define cuboid 'cu@<def[mob].location.block.sub[1,2,1]>|<def[mob].location.block.add[1,-1,1]>'
- note <def[cuboid]> 'as:gpa_com_skularr_mythicmobs_portal_cuboid_<def[uuid]>'
deregister:
- note remove 'as:gpa_com_skularr_mythicmobs_portal_cuboid_<def[uuid]>'
gpa_com_skularr_mythicmobs_dict_cmd:
type: command
name: mobdictionary
alises:
- mobdict
description: 'Displays information about the custom mobs.'
usage: /mobdictionary <<>list|entry_name<>> (page)
tab complete:
- define s '<context.raw_args.to_list.count[ ]>'
- if <def[s]> == 0 {
- determine <li@list.include[<s@gpa_com_skularr_mythicmobs_dict_cmd.list_keys[data.mobs]>].filter[starts_with[<context.args.get[1]||>]]>
}
data:
mobs:
vexel:
1:
- 'A zombie with levels. It's also extra tough; maybe you shouldn<&sq>t let it level up.'