-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathLavaRising.sk
More file actions
531 lines (473 loc) · 21.8 KB
/
Copy pathLavaRising.sk
File metadata and controls
531 lines (473 loc) · 21.8 KB
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
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
#
# LavaRising.sk
# By BaeFell
# (c) All Rights Reserved
#
# /lavarising setup
# select 2 points
# /lavarising movepoint 1 down
# /lavarising movepoint 2 up
# /lavarising setarena <name>
# /lavarising setspawn <name>
options:
P: &c&lLava Rising &7»&e
command /runtest:
trigger:
if skUnity_Is_Staff(player) is false:
message "{@P} You don't have permission to do that"
stop
set {_baefell} to "BaeFell" parsed as player
set {_consuela} to "nylhus" parsed as player
make {_baefell} execute command "game select lava"
make {_baefell} execute command "map 1"
make {_baefell} execute command "ready"
make {_consuela} execute command "map 1"
make {_consuela} execute command "ready"
wait 1 second
make {_baefell} execute command "game start"
on load:
GameManager_Register_Game("lava", "Lava Rising", script)
#GameManager_Register_Vote("lava", "map", "office", "Office")
GameManager_Register_Vote("lava", "map", "forest", "Forest")
#GameManager_Register_Vote("lava", "map", "highrise", "High Rise")
#GameManager_Register_Vote("lava", "mode", "extreme", "Extreme Height")
#GameManager_Register_Vote("lava", "mode", "spontanious", "Spontanious Lava")
#GameManager_Register_Vote("lava", "mode", "extreme", "Extreme Modifiers")
#GameManager_Register_Vote("lava", "mode", "fast", "Fast Rising")
delete {lavarising::luck::*}
set {lavarising::luck::good::steak} to 16 steak
set {lavarising::luck::good::chicken} to 16 cooked chicken
set {lavarising::luck::good::carrots} to 16 carrots
set {lavarising::luck::good::item-helmet} to "item:netherite helmet:diamond helmet:iron helmet:gold helmet"
set {lavarising::luck::good::item-chestplate} to "item:netherite chestplate:diamond chestplate:iron chestplate:gold chestplate"
set {lavarising::luck::good::item-leggings} to "item:netherite leggings:diamond leggings:iron leggings:gold leggings"
set {lavarising::luck::good::item-boots} to "item:netherite boots:diamond boots:iron boots:gold boots"
set {lavarising::luck::good::item-sword} to "item:netherite sword:diamond sword:iron sword:stone sword"
set {lavarising::luck::good::item-axe} to "item:netherite axe:diamond axe:iron axe:stone axe"
set {lavarising::luck::good::item-shovel} to "item:netherite shovel:diamond shovel:iron shovel:stone shovel"
set {lavarising::luck::good::item-pickaxe} to "item:netherite pickaxe:diamond pickaxe:iron pickaxe:stone pickaxe"
set {lavarising::luck::good::enchant-helmet} to "enchant:helmet:aqua affinity:blast protection:curse of binding:fire protection:mending:projectile protection:protection:respiration:thorns:unbreaking"
set {lavarising::luck::good::enchant-chestplate} to "enchant:chestplate:blast protection:curse of binding:fire protection:mending:projectile protection:protection:thorns:unbreaking"
set {lavarising::luck::good::enchant-leggings} to "enchant:leggings:blast protection:curse of binding:fire protection:mending:projectile protection:protection:swift sneak:thorns:unbreaking"
set {lavarising::luck::good::enchant-boots} to "enchant:boots:blast protection:curse of binding:depth strider:feather falling:fire protection:frost walker:soul speed:mending:projectile protection:protection:thorns:unbreaking"
set {lavarising::luck::good::blocks-1} to 32 cobblestone
set {lavarising::luck::good::blocks-2} to 32 deepslate
set {lavarising::luck::good::blocks-3} to 6 obsidian
set {lavarising::luck::good::blocks-4} to 64 dirt
set {lavarising::luck::bad::lava} to "block:lava"
set {lavarising::luck::bad::cage} to "cage"
set {lavarising::luck::bad::item} to "tool:air"
set {lavarising::luck::bad::bad-blocks-1} to 32 oak leaves
set {lavarising::luck::bad::bad-blocks-2} to 32 oak planks
set {lavarising::luck::bad::bad-blocks-3} to 12 oak logs
set {lavarising::luck::chests::none} to 1
set {lavarising::luck::chests::supporter} to 3
set {lavarising::luck::chests::moderator} to 3
set {lavarising::luck::chests::admin} to 3
delete {lavarising::setup::*}
delete {lavarising::alive::*}
on command:
if GameManager_Check_Starting(player, command, arguments, "lava") is true:
set {lavarising::currentarena} to GameManager_Get_Winning_Key("map")
set {lavarising::pvp} to false
set {lavarising::setup::status} to "playing"
# Lava Rising is starting
loop all players:
teleport loop-player to {lavarising::game::arena::%{lavarising::currentarena}%::spawn}
if {lobby::players::%uuid of loop-player%} is set:
set {lavarising::alive::%loop-value%} to loop-value
set gamemode of loop-player to adventure
else:
message "{@P} Even though you're not playing, you've been teleported to the arena to spectate." to loop-player
set gamemode of loop-player to spectator
if skUnity_Get_Rank(loop-player) is "none":
give 1 of stone pickaxe to loop-player
give 1 of stone axe to loop-player
give 1 of stone shovel to loop-player
else if skUnity_Get_Rank(loop-player) is "supporter" or "moderator":
give 1 of iron pickaxe to loop-player
give 1 of iron axe to loop-player
give 1 of iron shovel to loop-player
else if skUnity_Get_Rank(loop-player) is "admin":
give 1 of diamond pickaxe to loop-player
give 1 of diamond axe to loop-player
give 1 of diamond shovel to loop-player
set {_item} to ender chest
set name of {_item} to "&e&lLUCKY BLOCK!"
set lore of {_item} to "&aPlace me and break me for some good luck... or &cbad luck..."
set metadata value "luckyblock" of {_item} to "true"
give loop-player 1 of {_item}
#loop {lobby::players::*}:
#set {lavarising::alive::%loop-value%} to loop-value
#set gamemode of player to adventure
#teleport loop-value to {lavarising::game::spawn}
#teleport loop-value to {lavarising::game::arena::%{lavarising::currentarena}%::spawn}
# 10 seconds from when this detected to when the game starts
LavaRising_Set_Arena_WorldBorder({lavarising::currentarena})
wait 10 seconds
GameManager_Set_Game_Status("playing")
loop {lobby::players::*}:
broadcast "setting %loop-value% to survival"
set gamemode of loop-value to survival
LavaRising_Start_LuckyBlocks()
LavaRising_Lava({lavarising::game::arena::%{lavarising::currentarena}%::miny})
on join:
if GameManager_Is_Game("lava") is true:
if {lavarising::setup::status} is "playing":
set gamemode of player to spectator
teleport player to {lavarising::game::arena::%{lavarising::currentarena}%::spawn}
on respawn:
if GameManager_Is_Game("lava") is true:
wait 1 second
extinguish player
heal player
if {lavarising::setup::status} is "playing":
set gamemode of player to spectator
teleport player to {lavarising::game::arena::%{lavarising::currentarena}%::spawn}
else:
GameManager_Teleport_To_Spawn(player)
on death:
if GameManager_Is_Game("lava") is true:
extinguish victim
heal victim
set death message to ""
if {lavarising::alive::%victim%} is not set:
stop
if {lavarising::setup::status} is "ended":
delete {lavarising::alive::%victim%}
stop
if victim is player:
delete {lavarising::alive::%victim%}
broadcast "{@P} %victim% has died!"
LavaRising_Check_Ended()
function LavaRising_Check_Ended():
if size of {lavarising::alive::*} is 1:
set {_true} to true
if {lavarising::stop} is set:
set {_true} to true
if {_true} is set:
LavaRising_Reset_Arena_WorldBorder({lavarising::currentarena})
set {lavarising::setup::status} to "ended"
loop {lavarising::alive::*}:
set {_winner} to loop-value
GameManager_Game_Ended({_winner})
wait 2 seconds
LavaRising_Reset_Arena()
wait 2 seconds
delete {lavarising::currentarena}
function LavaRising_Lava(y: integer):
if {lavarising::setup::status} is "ended":
stop
if {_y} is greater than or equal to {lavarising::game::arena::%{lavarising::currentarena}%::maxy}:
set {lavarising::pvp} to true
broadcast "{@P} PvP has now been &aenabled! &eFight to the death!"
stop
LavaRising_Rise_Lava({_y})
function LavaRising_Rise_Lava(y: integer):
wait 1 second
if {lavarising::setup::status} is "ended":
stop
add 1 to {_y}
send action bar "{@P} The lava is at &c%{_y}%!" to all players
set {_point1} to {lavarising::game::arena::%{lavarising::currentarena}%::point1}
set y coord of {_point1} to {_y}
set {_point2} to {lavarising::game::arena::%{lavarising::currentarena}%::point2}
set y coord of {_point2} to {_y}
loop blocks within {_point1} and {_point2}:
if loop-block is air or water:
set loop-block to lava
LavaRising_Lava({_y})
function LavaRising_Start_LuckyBlocks():
while {lavarising::setup::status} is not "ended":
loop all players:
if {lavarising::setup::status} is "ended":
stop
chance of 45%:
set {_rank} to skUnity_Get_Rank(loop-player)
set {_count} to random integer between 1 and {lavarising::luck::chests::%{_rank}%}
set {_item} to ender chest
set name of {_item} to "&e&lLUCKY BLOCK!"
set lore of {_item} to "&aPlace me and break me for some good luck... or &cbad luck..."
set metadata value "luckyblock" of {_item} to "true"
give loop-player {_count} of {_item}
send "{@P} You've been given &a%{_count}% &e&lLUCKY BLOCKS!" to loop-player
wait 15 seconds
on place of ender chest:
if GameManager_Is_Game("lava") is true:
if tool of player is an ender chest:
if name of tool of player is "&e&lLUCKY BLOCK!":
set {lavarising::luckyblocks::%event-location%} to event-location
on place:
if GameManager_Is_Game("lava") is true:
set {_y} to {lavarising::game::arena::%{lavarising::currentarena}%::maxy} + 1
if y coord of event-location is greater than or equal to {_y}:
message "{@P} You're at the max height! You've gotta try and survive up here!"
cancel event
on right click on ender chest:
if GameManager_Is_Game("lava") is true:
if {lavarising::luckyblocks::%event-location%} is set:
delete {lavarising::luckyblocks::%event-location%}
# good luck
if chance of 85%:
message "{@P} You've recieved some good luck..."
set {_diamondchance} to random integer between 1 and 5
loop {_diamondchance} times:
set {_item} to random element out of {lavarising::luck::good::*}
if {_item} starts with "enchant":
set {_splititem::*} to {_item} split at ":"
set {_playeritemtype} to {_splititem::2}
if {_splititem::2} is "helmet":
set {_playeritem} to helmet of player
else if {_splititem::2} is "chestplate":
set {_playeritem} to chestplate of player
else if {_splititem::2} is "leggings":
set {_playeritem} to leggings of player
else if {_splititem::2} is "boots":
set {_playeritem} to boots of player
if {_playeritem} is not set:
continue loop
delete {_splititem::1}
delete {_splititem::2}
set {_enchantamount} to random integer between 1 and 2
loop {_enchantamount} times:
set {_enchant} to random element out of {_splititem::*} parsed as enchantment
set {_enchantlevel} to random integer between 1 and 5
enchant {_playeritem} with {_enchant}
set enchantment level of {_enchant} on {_playeritem} to {_enchantlevel}
message "{@P} Enchantment &a%{_enchant}% %{_enchantlevel}% &eapplied to your &a%{_playeritem}%"
if {_playeritemtype} is "helmet":
set helmet of player to {_playeritem}
else if {_playeritemtype} is "chestplate":
set chestplate of player to {_playeritem}
else if {_playeritemtype} is "leggings":
set leggings of player to {_playeritem}
else if {_playeritemtype} is "boots":
set boots of player to {_playeritem}
else if {_item} starts with "item":
set {_splititem::*} to {_item} split at ":"
delete {_splititem::1}
set {_item} to random element out of {_splititem::*}
drop ({_item} parsed as item) at event-location
message "{@P} &a%{_item}% &edropped!"
else:
drop {_item} at event-location
message "{@P} &a%{_item}% &edropped!"
else:
message "{@P} &cOuh oh! You've got bad luck..."
set {_item} to random element out of {lavarising::luck::bad::*}
if {_item} is "cage":
set {_loc} to location of player
subtract 1 from y coord of {_loc}
if block at {_loc} is not barrier:
set block at {_loc} to gold block
subtract 1 from x coord of {_loc}
if block at {_loc} is not barrier:
set block at {_loc} to gold block
subtract 1 from z coord of {_loc}
if block at {_loc} is not barrier:
set block at {_loc} to gold block
add 1 to x coord of {_loc}
if block at {_loc} is not barrier:
set block at {_loc} to gold block
add 1 to x coord of {_loc}
if block at {_loc} is not barrier:
set block at {_loc} to gold block
add 1 to z coord of {_loc}
if block at {_loc} is not barrier:
set block at {_loc} to gold block
add 1 to z coord of {_loc}
if block at {_loc} is not barrier:
set block at {_loc} to gold block
subtract 1 from x coord of {_loc}
if block at {_loc} is not barrier:
set block at {_loc} to gold block
subtract 1 from x coord of {_loc}
if block at {_loc} is not barrier:
set block at {_loc} to gold block
add 1 to y coord of {_loc}
if block at {_loc} is not barrier:
set block at {_loc} to iron bar
add 1 to x coord of {_loc}
if block at {_loc} is not barrier:
set block at {_loc} to iron bar
add 1 to x coord of {_loc}
if block at {_loc} is not barrier:
set block at {_loc} to iron bar
subtract 1 from z coord of {_loc}
if block at {_loc} is not barrier:
set block at {_loc} to iron bar
subtract 1 from z coord of {_loc}
if block at {_loc} is not barrier:
set block at {_loc} to iron bar
subtract 1 from x coord of {_loc}
if block at {_loc} is not barrier:
set block at {_loc} to iron bar
subtract 1 from x coord of {_loc}
if block at {_loc} is not barrier:
set block at {_loc} to iron bar
add 1 to z coord of {_loc}
if block at {_loc} is not barrier:
set block at {_loc} to iron bar
loop 2 times:
add 1 to z coord of {_loc}
add 1 to y coord of {_loc}
if block at {_loc} is not barrier:
set block at {_loc} to iron bar
add 1 to x coord of {_loc}
if block at {_loc} is not barrier:
set block at {_loc} to iron bar
add 1 to x coord of {_loc}
if block at {_loc} is not barrier:
set block at {_loc} to iron bar
subtract 1 from z coord of {_loc}
if block at {_loc} is not barrier:
set block at {_loc} to iron bar
subtract 1 from z coord of {_loc}
if block at {_loc} is not barrier:
set block at {_loc} to iron bar
subtract 1 from x coord of {_loc}
if block at {_loc} is not barrier:
set block at {_loc} to iron bar
subtract 1 from x coord of {_loc}
if block at {_loc} is not barrier:
set block at {_loc} to iron bar
add 1 to z coord of {_loc}
if block at {_loc} is not barrier:
set block at {_loc} to iron bar
set block 25 blocks above location of player to anvil
set block 26 blocks above location of player to anvil
message "{@P} &c&lWhat's that above you..."
else if {_item} is "lava":
set event-block to lava
message "{@P} &c&lThat lucky block turned to lava!"
else if {_item} is "tool:air":
set tool of player to air
message "{@P} &c&lYour tool was destroyed!"
on right click on ender chest:
if GameManager_Is_Game("lava") is true:
cancel event
function LavaRising_Reset_Arena():
LavaRising_Reset_Specific_Arena({lavarising::currentarena})
function LavaRising_Reset_Specific_Arena(arena: string):
delete {lavarising::luckyblocks::*}
delete {lavarising::stop}
loop blocks within {lavarising::game::arena::%{_arena}%::point1} and {lavarising::game::arena::%{_arena}%::point2}:
add 1 to {_c}
if {_c} is 10000:
wait 1 second
if {lavarising::game::arena::%{_arena}%::locs::%location of loop-block%} is not set:
set loop-block to air
else:
if {lavarising::game::arena::%{_arena}%::locs::%location of loop-block%} is peony or top-half peony:
set loop-block to air
else:
set loop-block to {lavarising::game::arena::%{_arena}%::locs::%location of loop-block%}
LavaRising_Reset_Arena_WorldBorder({_arena})
loop all players:
extinguish loop-player
heal loop-player
clear inventory of loop-player
function LavaRising_Get_Midpoint(arena: string) :: location:
set {_midpoint} to {lavarising::game::arena::%{_arena}%::point1}
set x coord of {_midpoint} to x coord of {lavarising::game::arena::%{_arena}%::point1} + x coord of {lavarising::game::arena::%{_arena}%::point2}
set x coord of {_midpoint} to x coord of {_midpoint} / 2
set z coord of {_midpoint} to z coord of {lavarising::game::arena::%{_arena}%::point1} + z coord of {lavarising::game::arena::%{_arena}%::point2}
set z coord of {_midpoint} to z coord of {_midpoint} / 2
return {_midpoint}
function LavaRising_Set_Arena_WorldBorder(arena: string):
set {_loc} to {lavarising::game::arena::%{_arena}%::point1}
set {_world} to world of {_loc}
set {_centre} to LavaRising_Get_Midpoint({_arena})
{_world}.getWorldBorder().setCenter(x coord of {_centre}, z coord of {_centre})
set {_bordersize} to difference between x coord of {lavarising::game::arena::%{_arena}%::point1} and x coord of {lavarising::game::arena::%{_arena}%::point2}
{_world}.getWorldBorder().setSize({_bordersize} + 1)
function LavaRising_Reset_Arena_WorldBorder(arena: string):
set {_loc} to {lavarising::game::arena::%{_arena}%::point1}
set {_world} to world of {_loc}
{_world}.getWorldBorder().setSize(30000000)
command /lavarising [<text>] [<text>] [<text>]:
trigger:
if GameManager_Is_Staff(player) is false:
message "{@P} You don't have permission to do that"
stop
if arg 1 is "setup":
if {lavarising::setup::%uuid of player%} is not set:
set {lavarising::setup::%uuid of player%} to true
message "{@P} &aEnabled &esetup mode. &aLeft click &eto set &epoint 1 &eand &aright click &eto set &apoint 2"
else:
delete {lavarising::setup::%uuid of player%}
message "{@P} &aDisabled &esetup mode."
else if arg 1 is "setspawn":
if arg 2 is set:
set {lavarising::game::arena::%arg 2%::spawn} to location of player
message "{@P} Set the spawn point to &a%location of player%"
else:
message "{@P} Which arena do you want to set the spawn point of?"
else if arg 1 is "setarena":
if arg 3 is "movepoints":
make player execute command "lavarising movepoint 1 down"
make player execute command "lavarising movepoint 2 up"
if arg 2 is not set:
message "{@P} Which arena do you want to set the spawn point of?"
stop
set {lavarising::game::arena::%arg 2%::point1} to {lavarising::game::point1}
set {lavarising::game::arena::%arg 2%::point2} to {lavarising::game::point2}
if y coord of {lavarising::game::arena::%arg 2%::point1} is greater than y coord of {lavarising::game::arena::%arg 2%::point2}:
set {lavarising::game::arena::%arg 2%::maxy} to y coord of {lavarising::game::arena::%arg 2%::point1}
set {lavarising::game::arena::%arg 2%::miny} to y coord of {lavarising::game::arena::%arg 2%::point2}
else:
set {lavarising::game::arena::%arg 2%::maxy} to y coord of {lavarising::game::arena::%arg 2%::point2}
set {lavarising::game::arena::%arg 2%::miny} to y coord of {lavarising::game::arena::%arg 2%::point1}
message "{@P} Clearing any previous arena data for &a%arg 2%"
delete {lavarising::game::arena::%arg 2%::locs::*}
message "{@P} Setting up the &aLava Rising &earena: &a%arg 2%"
set {_c} to 0
loop blocks within {lavarising::game::point1} and {lavarising::game::point2}:
if loop-block is not air or black stained glass:
add 1 to {_c}
set {lavarising::game::arena::%arg 2%::locs::%location of loop-block%} to type of loop-block
if {_c} is 5000:
wait 1 second
message "{@P} Sorry... just waiting 1 second. "
message "{@P} Processed: &a%size of {lavarising::game::arena::%arg 2%::locs::*}%"
message "{@P} Last y-coord: &a%y coord of location of loop-block%"
set {_c} to 0
message "{@P} The &aLava Rising &earena &e%arg 2% has been setup!"
message "{@P} Total size: &e%size of {lavarising::game::arena::%arg 2%::locs::*}%"
else if arg 1 is "movepoint":
if arg 3 is "up":
set y coord of {lavarising::game::point%arg 2%} to 320
else:
set y coord of {lavarising::game::point%arg 2%} to -64
message "{@P} Set &ay-coord &eof &apoint %arg 2% &eto &a%y coord of {lavarising::game::point%arg 2%}%"
else if arg 1 is "reset":
set {_time} to now
message "{@P} Resetting the &aLava Rising &earena"
LavaRising_Reset_Arena()
set {_diff} to difference between {_time} and now
message "{@P} The &aLava Rising &earena has been &eRESET!"
message "{@P} Time taken: &a%{_diff}%"
else if arg 1 is "spawn":
teleport player to {lavarising::game::arena::%arg 2%::spawn}
message "{@P} You've been teleported to &aspawn"
on left click:
if {lavarising::setup::%uuid of player%} is set:
set {lavarising::game::point1} to event-location
message "{@P} Set the point 1 to &a%event-location%"
cancel event
on right click:
if {lavarising::setup::%uuid of player%} is set:
set {lavarising::game::point2} to event-location
message "{@P} Set the point 2 to &a%event-location%"
cancel event
on hunger level change:
if GameManager_Is_Game("lava") is true:
cancel event
on damage:
if GameManager_Is_Game("lava") is true:
if attacker is player:
if victim is player:
if {lavarising::pvp} is false:
cancel event
else:
message "{@P} PvP isn't enabled until the top level!" to attacker