-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemple.lua
More file actions
809 lines (704 loc) · 35 KB
/
temple.lua
File metadata and controls
809 lines (704 loc) · 35 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
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
local world = World:new('survival3'); --temple world
local ts = AI:new("Temple Sentinel", "AI", "dergamir"); --temple ai
local templechest1 = Location:new(world, -30856.0, 36.0, 34877.0); --loot chest
local templechest2 = Location:new(world, -30854.0, 36.0, 34877.0); --loot chest
local templechest3 = Location:new(world, -30852.0, 36.0, 34877.0); --loot chest
local templechest4 = Location:new(world, -30850.0, 36.0, 34881.0); --loot chest
local templechest5 = Location:new(world, -30852.0, 36.0, 34881.0); --loot chest
local templechest6 = Location:new(world, -30854.0, 36.0, 34881.0); --loot chest
local templechest7 = Location:new(world, -30848.0, 36.0, 34881.0); --loot chest
local templechest8 = Location:new(world, -30846.0, 36.0, 34880.0); --loot chest
local templechest9 = Location:new(world, -30846.0, 36.0, 34878.0); --loot chest
local templechest10 = Location:new(world, -30848.0, 36.0, 34877.0); --loot chest
local emerald = Location:new(world, -30856.0, 36.0, 34881.0); --loot chest
local templesound = Location:new(world, -30869.0, 24.0, 34885.0); --temple sound source
local templesound2 = Location:new(world, -30838.0, 26.0, 34837.0); --temple sound source
local templesound3 = Location:new(world, -30807.0, 20.0, 34847.0); --temple sound source
local worldsound = Location:new(world, -30838.0, 26.0, 34837.0); --temple sound source
local templespawnsound = Location:new(world, 19475.0, 73.0, -20780.0); --temple sound source
local temple_tp_out = Location:new(world, -30936.610, 207.0, 35071.649); --outside temple drop
local templelightning1 = Location:new("survival3", -30871.0, 25.0, 34893.0); --charged creeper trap
local templelightningE = Location:new("survival3", -30809.0, 19.0, 34846.0); --emerald lightning
local temple_tp_out2 = Location:new(world, -30887.924, 12.0, 34816.526); --lava drop trap
local tlight1 = Location:new("survival3", -30853.0, 84.0, 34909.0); -- enter lightning 1
local tlight2 = Location:new("survival3", -30853.0, 84.0, 34865.0); -- enter lightning 2
local tlight3 = Location:new("survival3", -30897.0, 84.0, 34865.0); -- enter lightning 3
local tlight4 = Location:new("survival3", -30897.0, 84.0, 34909.0); -- enter lightning 4
local tlight5 = Location:new("survival3", -30811.0, 123.0, 34959.0); -- enter lightning 5
local tlight6 = Location:new("survival3", -30828.0, 116.0, 34868.0); -- enter lightning 6
local tlight7 = Location:new("survival3", -30908.0, 103.0, 34814.0); -- enter lightning 7
local tlightF = Location:new("survival3", -30847.0, 17.0, 34836.0); -- failed head selection
local trapL1 = Location:new("survival3", -30792.0, 10.0, 34833.0); -- trap lightning 1
local trapL2 = Location:new("survival3", -30792.0, 11.0, 34834.0); -- trap lightning 2
local trapL3 = Location:new("survival3", -30791.0, 11.0, 34834.0); -- trap lightning 3
local trapL4 = Location:new("survival3", -30791.0, 10.0, 34833.0); -- trap lightning 4
local trapL5 = Location:new("survival3", -30791.0, 11.0, 34832.0); -- trap lightning 5
local trapL6 = Location:new("survival3", -30792.0, 11.0, 34831.0); -- trap lightning 6
local trapL7 = Location:new("survival3", -30791.0, 12.0, 34830.0); -- trap lightning 7
local trapL8 = Location:new("survival3", -30793.0, 12.0, 34831.0); -- trap lightning 8
local trapL9 = Location:new("survival3", -30789.0, 11.0, 34833.0); -- trap lightning 9
local trapL10 = Location:new("survival3", -30789.0, 11.0, 34832.0); -- trap lightning 10
local trapL11 = Location:new("survival3", -30790.0, 10.0, 34831.0); -- trap lightning 11
local trapL12 = Location:new("survival3", -30787.0, 10.0, 34833.0); -- trap lightning 12
local trapL13 = Location:new("survival3", -30787.0, 11.0, 34831.0); -- trap lightning 13
local chest1sign = Location:new(world, -30860.0, 37.0, 34881.0); -- sign for chest 1
local chest2sign = Location:new(world, -30861.0, 37.0, 34881.0); -- sign for chest 2
local chest3sign = Location:new(world, -30862.0, 37.0, 34881.0); -- sign for chest 3
local chest4sign = Location:new(world, -30863.0, 37.0, 34881.0); -- sign for chest 4
local chest5sign = Location:new(world, -30864.0, 37.0, 34881.0); -- sign for chest 5
local chest6sign = Location:new(world, -30865.0, 37.0, 34881.0); -- sign for chest 6
local chest7sign = Location:new(world, -30866.0, 37.0, 34881.0); -- sign for chest 7
local chest8sign = Location:new(world, -30867.0, 37.0, 34881.0); -- sign for chest 8
local chest9sign = Location:new(world, -30868.0, 37.0, 34881.0); -- sign for chest 9
local chest10sign = Location:new(world, -30869.0, 37.0, 34881.0); -- sign for chest 10
local tentersign = Location:new(world, -30859.0, 37.0, 34879.0); -- sign for temple entrance
local tfentersign = Location:new(world, -30859.0, 37.0, 34881.0); -- sign for final tunnel
local tchest1sign = Location:new(world, -30859.0, 37.0, 34877.0); -- sign for trap chest 1
local tchest2sign = Location:new(world, -30860.0, 37.0, 34877.0); -- sign for trap chest 2
local tchest3sign = Location:new(world, -30861.0, 37.0, 34877.0); -- sign for trap chest 3
local tchest4sign = Location:new(world, -30862.0, 37.0, 34877.0); -- sign for trap chest 4
local tchest5sign = Location:new(world, -30863.0, 37.0, 34877.0); -- sign for trap chest 5
local tchest6sign = Location:new(world, -30864.0, 37.0, 34877.0); -- sign for trap chest 6
local tchest7sign = Location:new(world, -30865.0, 37.0, 34877.0); -- sign for kill chests
local tmob1sign = Location:new(world, -30866.0, 37.0, 34877.0); -- sign for mob trap 1
local tmob2sign = Location:new(world, -30867.0, 37.0, 34877.0); -- sign for mob trap 1
local tfireball1sign = Location:new(world, -30868.0, 37.0, 34877.0); -- sign for fireball trap 1
local tfireball2sign = Location:new(world, -30869.0, 37.0, 34877.0); -- sign for fireball trap 2
local tlightning1sign = Location:new(world, -30870.0, 37.0, 34877.0); -- sign for lightning trap 1
local twithersign = Location:new(world, -30871.0, 37.0, 34877.0); -- sign for wither trap
local tconfussign = Location:new(world, -30872.0, 37.0, 34877.0); -- sign for confusion trap
local tblind1sign = Location:new(world, -30873.0, 37.0, 34877.0); -- sign for blind trap
local tblind2sign = Location:new(world, -30874.0, 37.0, 34877.0); -- sign for blind trap
local tdragonsign = Location:new(world, -30874.0, 37.0, 34878.0); -- sign for dragon scare
local ttntsign = Location:new(world, -30874.0, 37.0, 34879.0); -- sign for tnt scare
local taarowsign = Location:new(world, -30874.0, 37.0, 34880.0); -- sign for tnt scare
local tlava1sign = Location:new(world, -30870.0, 37.0, 34881.0); -- sign for lava 1 trap
local tlava2sign = Location:new(world, -30871.0, 37.0, 34881.0); -- sign for lava 2 trap
local tendsign = Location:new(world, -30872.0, 37.0, 34881.0); -- sign for end trap
local tdebsign = Location:new(world, -30873.0, 37.0, 34881.0); -- sign for deb trap
local tepasssign = Location:new(world, -30874.0, 37.0, 34881.0); -- sign for deb trap
local spawn_catch = Location:new(world, 19549.456, 72.0, -20790.600);
spawn_catch:setYaw(-144.2);
spawn_catch:setPitch(0.4);
local etp = Location:new(world, -30806.207, 16.0, 34850.754);
etp:setYaw(-137.8);
etp:setPitch(16.5);
-------------------------------------------
---------------Welcome-----------------
-------------------------------------------
function temple_welcome(data)
local player = Player:new(data.player);
if not player:hasPermission("runsafe.temple.found") then
ts:speak( player.name .. " has uncovered the Temple Of The Unknown.");
player:sendMessage("&4[D] &bTemple Sentinel&f: Dark magic readings have been rising since you're arrival..");
player:sendEvent("achievement.templeunknown");
player:addPermission("runsafe.temple.found");
worldsound:playSound('ENTITY_WITHER_SPAWN', 10000, 0.5);
tlight1:lightningStrike();
tlight2:lightningStrike();
tlight3:lightningStrike();
tlight4:lightningStrike();
tlight5:lightningStrike();
tlight6:lightningStrike();
tlight7:lightningStrike();
tlight8:lightningStrike();
tentersign:setSign('Latest', 'Explorer:', '', player.name);
end
end
function temple_door_remove(data)
local player = Player:new(data.player);
EventEngine.player.removePotionEffects(player.name, 'NIGHT_VISION');
end
function panic_room(data)
local player = Player:new(data.player);
if player:hasPermission("runsafe.toybox.mode") then
EventEngine.player.addPotionEffect(player.name, 'NIGHT_VISION', 1000, 1000);
else
player:teleport(spawn_catch);
player:sendTitle("", "&4&k0&cNobody likes a nosy player :] &4&k0&c");
player:playSound('ENTITY_SHULKER_AMBIENT', 1, 0.1);
end
end
function temple_wither_troll(data)
local player = Player:new(data.player);
worldsound:playSound('ENTITY_WITHER_SPAWN', 10000, 3);
templespawnsound:playSound('ENTITY_WITHER_SPAWN', 10000, 3);
end
registerHook("REGION_ENTER", "temple_welcome", "survival3-temple");
registerHook("REGION_ENTER", "temple_door_remove", "survival3-temple_start");
registerHook("REGION_ENTER", "temple_door_remove", "survival3-temple_clear1");
registerHook("REGION_ENTER", "temple_door_remove", "survival3-temple_clear2");
registerHook("REGION_ENTER", "temple_door_remove", "survival3-temple_clear3");
registerHook("REGION_ENTER", "temple_door_remove", "survival3-temple_clear4");
registerHook("REGION_ENTER", "temple_door_remove", "survival3-temple_clear5");
registerHook("REGION_ENTER", "temple_door_remove", "survival3-temple_clear6");
registerHook("REGION_ENTER", "temple_door_remove", "survival3-temple_clear7");
registerHook("REGION_ENTER", "temple_door_remove", "survival3-temple_clear8");
registerHook("REGION_ENTER", "temple_door_remove", "survival3-temple_clear9");
registerHook("REGION_ENTER", "temple_door_remove", "survival3-temple_clear10");
registerHook("REGION_ENTER", "temple_door_remove", "survival3-temple_clear11");
registerHook("REGION_ENTER", "temple_door_remove", "survival3-temple_clear12");
registerHook("REGION_ENTER", "temple_door_remove", "survival3-temple_clear13");
registerHook("REGION_ENTER", "temple_door_remove", "survival3-temple_clear14");
registerHook("REGION_ENTER", "panic_room", "survival3-temple_panicroom");
registerHook("INTERACT", "temple_wither_troll", 143, "survival3", -30859.0, 36.0, 34879.0);
-------------------------------------------
---------------Loot Chests-----------------
-------------------------------------------
function templechest_1(data)
local player = Player:new(data.player);
templechest1:cloneChestToPlayer(player.name);
player:closeInventory();
chest1sign:setSign('Last Player', 'Looted:', '', player.name);
end
function templechest_2(data)
local player = Player:new(data.player);
templechest2:cloneChestToPlayer(player.name);
player:closeInventory();
chest2sign:setSign('Last Player', 'Looted:', '', player.name);
end
function templechest_3(data)
local player = Player:new(data.player);
templechest3:cloneChestToPlayer(player.name);
player:closeInventory();
chest3sign:setSign('Last Player', 'Looted:', '', player.name);
end
function templechest_4(data)
local player = Player:new(data.player);
templechest4:cloneChestToPlayer(player.name);
player:closeInventory();
chest4sign:setSign('Last Player', 'Looted:', '', player.name);
end
function templechest_5(data)
local player = Player:new(data.player);
templechest5:cloneChestToPlayer(player.name);
player:closeInventory();
chest5sign:setSign('Last Player', 'Looted:', '', player.name);
end
function templechest_6(data)
local player = Player:new(data.player);
templechest6:cloneChestToPlayer(player.name);
player:closeInventory();
chest6sign:setSign('Last Player', 'Looted:', '', player.name);
end
function templechest_7(data)
local player = Player:new(data.player);
templechest7:cloneChestToPlayer(player.name);
player:closeInventory();
chest7sign:setSign('Last Player', 'Looted:', '', player.name);
end
function templechest_8(data)
local player = Player:new(data.player);
templechest8:cloneChestToPlayer(player.name);
player:closeInventory();
chest8sign:setSign('Last Player', 'Looted:', '', player.name);
end
function templechest_9(data)
local player = Player:new(data.player);
templechest9:cloneChestToPlayer(player.name);
player:closeInventory();
chest9sign:setSign('Last Player', 'Looted:', '', player.name);
end
function templechest_10(data)
local player = Player:new(data.player);
templechest10:cloneChestToPlayer(player.name);
player:closeInventory();
chest10sign:setSign('Last Player', 'Looted:', '', player.name);
end
registerHook("INTERACT", "templechest_1", 146, "survival3", -30849.0, 22.0, 34882.0);
registerHook("INTERACT", "templechest_2", 146, "survival3", -30855.0, 13.0, 34877.0);
registerHook("INTERACT", "templechest_3", 146, "survival3", -30851.0, 5.0, 34890.0);
registerHook("INTERACT", "templechest_4", 146, "survival3", -30879.0, 20.0, 34908.0);
registerHook("INTERACT", "templechest_5", 146, "survival3", -30891.0, 12.0, 34817.0);
registerHook("INTERACT", "templechest_6", 146, "survival3", -30854.0, 5.0, 34879.0);
registerHook("INTERACT", "templechest_7", 54, "survival3", -30875.0, 20.0, 34864.0);
registerHook("INTERACT", "templechest_8", 54, "survival3", -30859.0, 7.0, 34871.0);
registerHook("INTERACT", "templechest_9", 54, "survival3", -30839.0, 6.0, 34865.0);
registerHook("INTERACT", "templechest_10", 54, "survival3", -30816.0, 31.0, 34911.0);
-------------------------------------------
---------------Bait Chests-----------------
-------------------------------------------
function templechest_bite(data)
local player = Player:new(data.player);
player:closeInventory();
tchest1sign:setSign('', 'Lastest Victim:', '', player.name);
player:setHealth(5);
end
function templechest_bite2(data)
local player = Player:new(data.player);
player:closeInventory();
tchest2sign:setSign('', 'Lastest Victim:', '', player.name);
player:setHealth(3);
end
function templechest_bite3(data)
local player = Player:new(data.player);
player:closeInventory();
tchest3sign:setSign('', 'Lastest Victim:', '', player.name);
player:setHealth(1);
end
function templechest_bite4(data)
local player = Player:new(data.player);
player:closeInventory();
tchest4sign:setSign('', 'Lastest Victim:', '', player.name);
player:setHealth(0);
templelightning1:lightningStrike();
worldsound:playSound('ENTITY_LIGHTNING_THUNDER', 10000, 1);
templespawnsound:playSound('ENTITY_LIGHTNING_THUNDER', 10000, 1);
end
function templechest_bite5(data)
local player = Player:new(data.player);
player:closeInventory();
tchest5sign:setSign('', 'Lastest Victim:', '', player.name);
player:setHealth(5);
EventEngine.player.addPotionEffect(player.name, 'POISON', 10, 10);
end
function templechest_bite6(data)
local player = Player:new(data.player);
player:closeInventory();
tchest6sign:setSign('', 'Lastest Victim:', '', player.name);
player:setHealth(18);
EventEngine.player.addPotionEffect(player.name, 'WITHER', 10, 10);
EventEngine.player.addPotionEffect(player.name, 'POISON', 10, 10);
EventEngine.player.addPotionEffect(player.name, 'CONFUSION', 10, 10);
end
function kill_chest(data)
local player = Player:new(data["player"]);
player:setHealth(0);
tchest7sign:setSign('', 'Lastest Victim:', '', player.name);
templelightning1:lightningStrike();
worldsound:playSound('ENTITY_LIGHTNING_THUNDER', 10000, 1);
templespawnsound:playSound('ENTITY_LIGHTNING_THUNDER', 10000, 1);
end
registerHook("INTERACT", "kill_chest", 146, "survival3", -30882.0, 37.0, 34896.0);
registerHook("INTERACT", "kill_chest", 146, "survival3", -30820.0, 13.0, 34859.0);
registerHook("INTERACT", "kill_chest", 146, "survival3", -30844.0, 26.0, 34832.0);
registerHook("INTERACT", "kill_chest", 54, "survival3", -30880.0, 10.0, 34879.0);
registerHook("INTERACT", "templechest_bite", 54, "survival3", -30880.0, 31.0, 34921.0);
registerHook("INTERACT", "templechest_bite2", 54, "survival3", -30881.0, 40.0, 34883.0);
registerHook("INTERACT", "templechest_bite3", 54, "survival3", -30872.0, 47.0, 34895.0);
registerHook("INTERACT", "templechest_bite4", 54, "survival3", -30830.0, 7.0, 34887.0);
registerHook("INTERACT", "templechest_bite4", 146, "survival3", -30826.0, 18.0, 34887.0);
registerHook("INTERACT", "templechest_bite5", 54, "survival3", -30900.0, 14.0, 34850.0);
registerHook("INTERACT", "templechest_bite5", 146, "survival3", -30791.0, 14.0, 34849.0);
registerHook("INTERACT", "templechest_bite6", 54, "survival3", -30839.0, 6.0, 34864.0);
---------------------------------------------
---------------Redstone Traps----------------
---------------------------------------------
function templemob_3(data)
local player = Player:new(data.player);
tmob1sign:setSign('', 'Lastest Victim:', '', player.name);
templelightning1:lightningStrike();
player:setHealth(6);
worldsound:playSound('ENTITY_LIGHTNING_THUNDER', 10000, 1);
templespawnsound:playSound('ENTITY_LIGHTNING_THUNDER', 10000, 1);
end
function templemob_4(data)
local player = Player:new(data.player);
tmob2sign:setSign('', 'Lastest Victim:', '', player.name);
player:setHealth(6);
end
function temple_fireball(data)
local player = Player:new(data.player);
tfireball1sign:setSign('', 'Lastest Victim:', '', player.name);
player:setHealth(12);
end
function temple_fireball2(data)
local player = Player:new(data.player);
tfireball2sign:setSign('', 'Lastest Victim:', '', player.name);
player:setHealth(6);
end
function temple_strike_trap(data)
local player = Player:new(data.player);
trapL1:lightningStrike();
trapL2:lightningStrike();
trapL3:lightningStrike();
trapL4:lightningStrike();
trapL5:lightningStrike();
trapL6:lightningStrike();
trapL7:lightningStrike();
trapL8:lightningStrike();
trapL9:lightningStrike();
trapL10:lightningStrike();
trapL11:lightningStrike();
trapL12:lightningStrike();
trapL13:lightningStrike();
worldsound:playSound('ENTITY_LIGHTNING_THUNDER', 10000, 1);
templespawnsound:playSound('ENTITY_LIGHTNING_THUNDER', 10000, 1);
player:setHealth(8);
tlightning1sign:setSign('', 'Lastest Victim:', '', player.name);
end
function temple_arrow1(data)
local player = Player:new(data.player);
taarowsign:setSign('', 'Lastest Victim:', '', player.name);
player:setHealth(10);
end
function temple_deb_trap(data)
local player = Player:new(data.player);
tdebsign:setSign('', 'Lastest Victim:', '', player.name);
end
registerHook("REGION_ENTER", "templemob_3", "survival3-temple_ai_6");
registerHook("REGION_ENTER", "templemob_4", "survival3-temple_ai_7");
registerHook("REGION_ENTER", "temple_fireball", "survival3-temple_fireballs");
registerHook("REGION_ENTER", "temple_fireball2", "survival3-temple_fireballs2");
registerHook("REGION_ENTER", "temple_strike_trap", "survival3-temple_lightning_trap");
registerHook("REGION_ENTER", "temple_arrow1", "survival3-temple_arrow");
registerHook("REGION_ENTER", "temple_deb_trap", "survival3-temple_deb");
-------------------------------------------------
---------------Effect Traps------------------
-------------------------------------------------
function wither_effect(data)
local player = Player:new(data["player"]);
EventEngine.player.addPotionEffect(player.name, 'WITHER', 30, 30);
twithersign:setSign('', 'Lastest Victim:', '', player.name);
end
function confus_effect(data)
local player = Player:new(data["player"]);
EventEngine.player.addPotionEffect(player.name, 'CONFUSION', 100, 10);
tconfussign:setSign('', 'Lastest Victim:', '', player.name);
end
function temple_out(data)
local player = Player:new(data.player);
player:teleport(temple_tp_out);
EventEngine.player.addPotionEffect(player.name, 'BLINDNESS', 10, 5);
tblind1sign:setSign('', 'Lastest Victim:', '', player.name);
end
function temple_out2(data)
local player = Player:new(data.player);
player:teleport(temple_tp_out2);
EventEngine.player.addPotionEffect(player.name, 'BLINDNESS', 10, 5);
tblind2sign:setSign('', 'Lastest Victim:', '', player.name);
player:setHealth(10);
end
function temple_spook(data)
local player = Player:new(data.player);
player:playSound('ENTITY_ENDERDRAGON_AMBIENT', 10000, 1);
EventEngine.player.addPotionEffect(player.name, 'CONFUSION', 15, 15);
EventEngine.player.addPotionEffect(player.name, 'BLINDNESS', 15, 15);
player:setHealth(20);
tdragonsign:setSign('', 'Lastest Victim:', '', player.name);
end
function temple_spook2(data)
local player = Player:new(data.player);
player:playSound('ENTITY_TNT_PRIMED', 10000, 1);
EventEngine.player.addPotionEffect(player.name, 'BLINDNESS', 15, 15);
player:setHealth(20);
ttntsign:setSign('', 'Lastest Victim:', '', player.name);
end
registerHook("REGION_ENTER", "wither_effect", "survival3-temple_effect");
registerHook("REGION_ENTER", "confus_effect", "survival3-temple_effect2");
registerHook("INTERACT", "wither_effect", 146, "survival3", -30842.0, 33.0, 34882.0);
registerHook("REGION_ENTER", "temple_out", "survival3-temple_out");
registerHook("REGION_ENTER", "temple_out2", "survival3-temple_punch");
registerHook("REGION_ENTER", "temple_out", "survival3-temple_out2");
registerHook("REGION_ENTER", "temple_spook", "survival3-temple_scare");
registerHook("REGION_ENTER", "temple_spook2", "survival3-temple_scare2");
-------------------------------------------------
---------------Block Edit Traps------------------
-------------------------------------------------
local world = "survival3";
local fall1current = 1;
local fall1maxData = 1;
local fall1blocks = {
Location:new(world, -30871.0 , 24.0, 34886.0),
Location:new(world, -30871.0 , 24.0, 34885.0),
Location:new(world, -30871.0 , 24.0, 34884.0),
Location:new(world, -30870.0 , 24.0, 34886.0),
Location:new(world, -30870.0 , 24.0, 34885.0),
Location:new(world, -30870.0 , 24.0, 34884.0),
Location:new(world, -30867.0 , 23.0, 34886.0),
Location:new(world, -30867.0 , 23.0, 34885.0),
Location:new(world, -30867.0 , 23.0, 34884.0),
Location:new(world, -30866.0 , 23.0, 34886.0),
Location:new(world, -30866.0 , 23.0, 34885.0),
Location:new(world, -30866.0 , 23.0, 34884.0),
Location:new(world, -30865.0 , 23.0, 34886.0),
Location:new(world, -30865.0 , 23.0, 34885.0),
Location:new(world, -30865.0 , 23.0, 34884.0),
Location:new(world, -30864.0 , 23.0, 34886.0),
Location:new(world, -30864.0 , 23.0, 34885.0),
Location:new(world, -30864.0 , 23.0, 34884.0),
};
function fall_1_pit(data)
if fall1current == fall1maxData then
fall1current = 1;
else
fall1current = fall1current + 1;
end
fall_1_setair();
end
function fall_1_setair()
for index, key in ipairs(fall1blocks) do
key:setBlock(0, fall1current);
end
end
function fall_1_setstone()
for index, key in ipairs(fall1blocks) do
key:setBlock(1, fall1current);
end
end
function fall_1_sound(data)
local player = Player:new(data.player);
templesound:playSound('BLOCK_PISTON_CONTRACT', 1, 1);
tlava1sign:setSign('', 'Lastest Victim:', '', player.name);
end
registerHook("REGION_ENTER", "fall_1_setair", "survival3-temple_fall1");
registerHook("REGION_ENTER", "fall_1_sound", "survival3-temple_fall1");
registerHook("REGION_ENTER", "fall_1_setstone", "survival3-temple_fall2");
registerHook("REGION_ENTER", "fall_1_setstone", "survival3-temple_fall6");
registerHook("REGION_ENTER", "fall_1_setstone", "survival3-temple_fall7");
local world = "survival3";
local fall2current = 1;
local fall2maxData = 1;
local fall2blocks = {
Location:new(world, -30835.0 , 25.0, 34837.0),
Location:new(world, -30836.0 , 25.0, 34837.0),
Location:new(world, -30836.0 , 26.0, 34837.0),
Location:new(world, -30836.0 , 25.0, 34836.0),
Location:new(world, -30835.0 , 24.0, 34835.0),
Location:new(world, -30836.0 , 24.0, 34835.0),
Location:new(world, -30837.0 , 24.0, 34835.0),
Location:new(world, -30835.0 , 24.0, 34836.0),
Location:new(world, -30836.0 , 24.0, 34836.0),
Location:new(world, -30837.0 , 24.0, 34836.0),
Location:new(world, -30835.0 , 24.0, 34837.0),
Location:new(world, -30836.0 , 24.0, 34837.0),
Location:new(world, -30837.0 , 24.0, 34837.0),
};
function fall_2_pit(data)
if fall2current == fall2maxData then
fall2current = 1;
else
fall2current = fall2current + 1;
end
fall_2_setair();
end
function fall_2_setair()
for index, key in ipairs(fall2blocks) do
key:setBlock(0, fall2current);
end
end
function fall_2_setstone()
for index, key in ipairs(fall2blocks) do
key:setBlock(1, fall2current);
end
end
function fall_2_sound(data)
local player = Player:new(data.player);
templesound:playSound('BLOCK_PISTON_CONTRACT', 1, 1);
tlava2sign:setSign('', 'Lastest Victim:', '', player.name);
end
registerHook("REGION_ENTER", "fall_2_setair", "survival3-temple_fall3");
registerHook("REGION_ENTER", "fall_2_setstone", "survival3-temple_fall4");
registerHook("REGION_ENTER", "fall_2_setstone", "survival3-temple_fall5");
registerHook("REGION_ENTER", "fall_2_setstone", "survival3-temple_fall8");
local world = "survival3";
local fall3current = 1;
local fall3maxData = 1;
local fall3blocks = {
Location:new(world, -30862.0 , 26.0, 34854.0),
Location:new(world, -30862.0 , 26.0, 34853.0),
Location:new(world, -30862.0 , 26.0, 34852.0),
Location:new(world, -30863.0 , 26.0, 34854.0),
Location:new(world, -30863.0 , 26.0, 34853.0),
Location:new(world, -30863.0 , 26.0, 34852.0),
Location:new(world, -30864.0 , 26.0, 34854.0),
Location:new(world, -30864.0 , 26.0, 34853.0),
Location:new(world, -30864.0 , 26.0, 34852.0),
};
function fall_3_pit(data)
if fall3current == fall3maxData then
fall3current = 1;
else
fall3current = fall3current + 1;
end
fall_3_setair();
end
function fall_3_setair()
for index, key in ipairs(fall3blocks) do
key:setBlock(0, fall3current);
end
end
function fall_3_setstone()
for index, key in ipairs(fall3blocks) do
key:setBlock(1, fall3current);
end
end
function fall_3_sound(data)
local player = Player:new(data.player);
templesound:playSound('BLOCK_PISTON_CONTRACT', 1, 1);
tendsign:setSign('', 'Lastest Victim:', '', player.name);
end
registerHook("REGION_ENTER", "fall_3_setair", "survival3-temple_fall10");
registerHook("REGION_ENTER", "fall_3_setstone", "survival3-temple_fall11");
registerHook("REGION_ENTER", "fall_3_sound", "survival3-temple_fall11");
registerHook("REGION_ENTER", "fall_3_setstone", "survival3-temple_fall12");
registerHook("REGION_ENTER", "fall_3_setstone", "survival3-temple_fall13");
-------------------------------------------------
------------------Emerald Check---------------
-------------------------------------------------
function temple_emerarld(data)
local player = Player:new(data.player);
if player:hasPermission("runsafe.temple.ewall") then
else
if not player:hasPermission("runsafe.temple.ewall") then
player:setHealth(0);
tfentersign:setSign('Latest', 'Explorer:', '', player.name);
player:sendMessage("&4[D] &bTemple Sentinel&f: You have not yet proven your worth..");
templelightningE:lightningStrike();
worldsound:playSound('ENTITY_LIGHTNING_THUNDER', 10000, 1);
templespawnsound:playSound('ENTITY_LIGHTNING_THUNDER', 10000, 1);
end
end
end
registerHook("REGION_ENTER", "temple_emerarld", "survival3-temple_emerald2");
local world = "survival3";
local ewallcurrent = 1;
local ewallmaxData = 1;
local ewallblocks = {
Location:new(world, -30806.0 , 21.0, 34846.0),
Location:new(world, -30806.0 , 21.0, 34845.0),
Location:new(world, -30806.0 , 22.0, 34847.0),
Location:new(world, -30806.0 , 22.0, 34846.0),
Location:new(world, -30806.0 , 22.0, 34845.0),
Location:new(world, -30806.0 , 23.0, 34847.0),
Location:new(world, -30806.0 , 23.0, 34846.0),
Location:new(world, -30806.0 , 23.0, 34845.0),
};
function emerald1(data)
if ewallcurrent == ewallmaxData then
ewallcurrent = 1;
else
ewallcurrent = ewallcurrent + 1;
end
emerald1_air();
end
function emerald1_air()
for index, key in ipairs(ewallblocks) do
key:setBlock(0, ewallcurrent);
templesound3:playSound('ENTITY_EVOCATION_ILLAGER_CAST_SPELL', 1, 0.1);
end
end
function emerald1_stone()
for index, key in ipairs(ewallblocks) do
key:setBlock(1, ewallcurrent);
end
end
function emerald_global(data)
local player = Player:new(data.player);
if not player:hasPermission("runsafe.temple.ewall") then
ts:speak( player.name .. " is worthy.");
templespawnsound:playSound('ENTITY_WITHER_SPAWN', 10000, 1);
player:addPermission("runsafe.temple.ewall");
tepasssign:setSign('Latest', 'Explorer:', '', player.name);
end
end
registerHook("BLOCK_GAINS_CURRENT", "emerald1_air", "survival3", -30800.0, 10.0, 34844.0);
registerHook("REGION_ENTER", "emerald1_stone", "survival3-temple_ewall");
registerHook("REGION_ENTER", "emerald_global", "survival3-temple_ewall");
function e_leave(data)
local player = Player:new(data.player);
player:teleport(etp);
templesound3:playSound('ENTITY_EVOCATION_ILLAGER_CAST_SPELL', 1, 0.1);
end
registerHook("REGION_ENTER", "e_leave", "survival3-temple_eleave");
-------------------------------------------------
------------------Portal Room Door---------------
-------------------------------------------------
function temple_p_door(data)
local player = Player:new(data.player);
if not player:hasPermission("runsafe.temple.portal.found") then
ts:speak( player.name .. " has uncovered the Portal To The Unknown.");
player:sendMessage("&4[D] &bTemple Sentinel&f: Dark magic readings are off the charts here..");
player:addPermission("runsafe.temple.portal.found");
player:playSound('UI_TOAST_CHALLENGE_COMPLETE', 1, 1);
tlight1:lightningStrike();
tlight2:lightningStrike();
tlight3:lightningStrike();
tlight4:lightningStrike();
tlight5:lightningStrike();
tlight6:lightningStrike();
tlight7:lightningStrike();
tlight8:lightningStrike();
worldsound:playSound('ENTITY_LIGHTNING_THUNDER', 10000, 1);
templespawnsound:playSound('ENTITY_LIGHTNING_THUNDER', 10000, 1);
end
end
registerHook("REGION_ENTER", "temple_p_door", "survival3-temple_portal_door");
-------------------------------------------------
-------------------Portal------------------------
-------------------------------------------------
function temple_portal_fail1(data)
ts:speak("Improper heads detected, removing foreign contamination in 10 seconds");
end
function temple_portal_fail2(data)
ts:speak("8 seconds");
end
function temple_portal_fail3(data)
ts:speak("9 seconds");
end
function temple_portal_fail4(data)
ts:speak("7 seconds");
end
function temple_portal_fail5(data)
ts:speak("6 seconds");
end
function temple_portal_fail6(data)
ts:speak("5 seconds");
end
function temple_portal_fail7(data)
ts:speak("4 seconds");
end
function temple_portal_fail8(data)
ts:speak("3 seconds");
end
function temple_portal_fail9(data)
ts:speak("2 seconds");
end
function temple_portal_fail10(data)
ts:speak("1 second");
end
function temple_portal_failF(data)
ts:speak("Contamination Cleared.");
end
local world = "survival3";
local pheadcurrent = 1;
local pheadmaxData = 1;
local pheadblocks = {
Location:new(world, -30853.0 , 18.0, 34836.0),
Location:new(world, -30855.0 , 18.0, 34837.0),
Location:new(world, -30855.0 , 18.0, 34835.0),
Location:new(world, -30857.0 , 18.0, 34838.0),
Location:new(world, -30857.0 , 18.0, 34836.0),
Location:new(world, -30857.0 , 18.0, 34834.0),
Location:new(world, -30859.0 , 18.0, 34839.0),
Location:new(world, -30859.0 , 18.0, 34837.0),
Location:new(world, -30859.0 , 18.0, 34835.0),
Location:new(world, -30859.0 , 18.0, 34833.0),
};
function portal_head(data)
if pheadcurrent == pheadmaxData then
pheadcurrent = 1;
else
pheadcurrent = pheadcurrent + 1;
end
portal_head_clear();
end
function portal_head_clear()
for index, key in ipairs(pheadblocks) do
key:setBlock(0, pheadcurrent);
worldsound:playSound('ENTITY_LIGHTNING_THUNDER', 10000, 1);
templespawnsound:playSound('ENTITY_LIGHTNING_THUNDER', 10000, 1);
end
end
registerHook("BLOCK_GAINS_CURRENT", "temple_portal_fail1", "survival3", -30847.0, 15.0, 34834.0);
registerHook("BLOCK_GAINS_CURRENT", "temple_portal_fail2", "survival3", -30847.0, 15.0, 34826.0);
registerHook("BLOCK_GAINS_CURRENT", "temple_portal_fail3", "survival3", -30847.0, 15.0, 34827.0);
registerHook("BLOCK_GAINS_CURRENT", "temple_portal_fail4", "survival3", -30847.0, 15.0, 34823.0);
registerHook("BLOCK_GAINS_CURRENT", "temple_portal_fail5", "survival3", -30847.0, 15.0, 34819.0);
registerHook("BLOCK_GAINS_CURRENT", "temple_portal_fail6", "survival3", -30847.0, 15.0, 34815.0);
registerHook("BLOCK_GAINS_CURRENT", "temple_portal_fail7", "survival3", -30847.0, 15.0, 34811.0);
registerHook("BLOCK_GAINS_CURRENT", "temple_portal_fail8", "survival3", -30847.0, 15.0, 34807.0);
registerHook("BLOCK_GAINS_CURRENT", "temple_portal_fail9", "survival3", -30847.0, 15.0, 34803.0);
registerHook("BLOCK_GAINS_CURRENT", "temple_portal_fail10", "survival3", -30847.0, 15.0, 34799.0);
registerHook("BLOCK_GAINS_CURRENT", "portal_head_clear", "survival3", -30847.0, 15.0, 34795.0);
registerHook("BLOCK_GAINS_CURRENT", "temple_portal_failF", "survival3", -30847.0, 15.0, 34789.0);