Date: 2015/01/15 15:47:17 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
initiate_game:
type: task
script:
- if <server.flag[game_going]||false> {
- announce format:error_format "TRIED TO START GAME THAT WAS ALREADY IN PROGRESS!"
- queue clear
}
- if <server.flag[in_queue].as_list.size||0> <= 1 {
- title "title:<&c>Not enough players in queue." "subtitle:<&e>The game will try to start again in 3 minutes!" targets:<server.list_online_players> fade_in:10t stay:5s fade_out:10t
- run pre_game_countdown instantly delay:2m
- flag server time_left duration:3m
- queue clear
}
- foreach <server.flag[in_queue].as_list> {
- teleport %value% <server.flag[spawnlocation.%loop_index%]>
- modifyblock <server.flag[spawnlocation.%LOOP_INDEX%].as_location.add[1,1,0]>|<server.flag[spawnlocation.%LOOP_INDEX%].as_location.add[0,1,1]>|<server.flag[spawnlocation.%LOOP_INDEX%].as_location.add[-1,1,0]>|<server.flag[spawnlocation.%LOOP_INDEX%].as_location.add[0,1,-1]>|<server.flag[spawnlocation.%LOOP_INDEX%].as_location.add[0,2,0]> m@barrier
- if !<server.has_flag[spawnlocation.%loop_index%]> announce format:error_format "spawnlocation.%loop_index% NOT FOUND!"
- run prepare_player player:%value% instantly
}
- flag server game_going:true
- flag server in_game:!
- flag server in_game:|:<server.flag[in_queue].as_list||li@>
- flag server in_queue:!
- flag server ring_carrier:!
- flag server time_of_start:<server.current_time_millis>
- flag server deathmatch_countdown duration:30m
- if !<server.has_flag[ringdestroylocation.1]> announce format:error_format "ringdestroylocation.1 NOT FOUND!"
- if !<server.has_flag[ringdestroylocation.2]> announce format:error_format "ringdestroylocation.2 NOT FOUND!"
- note cu@<server.flag[ringdestroylocation.1]>|<server.flag[ringdestroylocation.2]> as:mountdoom
- drop i@ring <server.flag[ringlocation].as_location.above> save:ring speed:0
- flag server ring_entity:<entry[ring].dropped_entities.get[1]>
- flag server ring_last_location:<server.flag[ringlocation].as_location.above>
- run ringannouncement instantly def:dropped|<server.flag[ringlocation]>
- if !<server.has_flag[ringlocation]> announce format:error_format "ringlocation NOT FOUND!"
- run ring_maintainer instantly delay:10s
- run game_countdown instantly
- run initiate_deathmatch instantly delay:25m def:<server.flag[time_of_start]>
Ring:
type: item
material: i@record_8
display name: <&6>The Ring
enchantments:
- durability:10
lore:
- 'Destroy to win the game.'
- 'Equip to use its power.'
ring_maintainer:
type: task
script:
- if !<server.flag[game_going]||false> queue clear
- if <server.flag[ring_entity].as_entity.is_spawned||false> {
- firework power:0 primary:white flicker trail fade:black type:burst <server.flag[ring_entity].as_entity.location>
- firework power:1 primary:white flicker trail fade:black type:burst <server.flag[ring_entity].as_entity.location>
- firework power:2 primary:white flicker trail fade:black type:burst <server.flag[ring_entity].as_entity.location>
- flag server ring_last_location:<server.flag[ring_entity].as_entity.location>
- if !<server.flag[ring_on_ground_cooldown]||false> {
- announce "<&4>The Ring is still on the ground!"
- flag server ring_on_ground_cooldown duration:30s
}
} else {
- if !<server.flag[in_game].contains[<server.flag[ring_carrier]||nobody>]||false> {
- drop i@ring <server.flag[ring_last_location].as_location.find.surface_blocks.within[20].random.above> save:ring
- flag server ring_entity:<entry[ring].dropped_entities.get[1]>
- flag server ring_carrier:!
}
}
- run ring_maintainer instantly delay:5s
ring_maintaining_events:
type: world
events:
on i@ring despawns:
- determine cancelled
on player drops i@ring:
- if !<context.location.is_within[cu@mountdoom]||false> determine cancelled
- run endgame instantly def:ring_destroy
on player clicks i@ring in inventory:
- if li@CRAFTING|PLAYER !contains <context.inventory.inventory_type> || <context.slot_type> == CRAFTING determine cancelled
prepare_player:
type: task
script:
- announce format:error_format "player.class.data not found"
- heal
- feed
- adjust <player> gamemode:survival
- inventory clear destination:<player.inventory>
game_countdown:
type: task
script:
- flag server lock_players:true
- title "title:<&6>10!" targets:<server.flag[in_game].as_list> fade_in:10t stay:2s fade_out:0t
- wait 1s
- title "title:<&6>9!" targets:<server.flag[in_game].as_list> fade_in:0t stay:2s fade_out:0t
- wait 1s
- title "title:<&6>8!" targets:<server.flag[in_game].as_list> fade_in:0t stay:2s fade_out:0t
- wait 1s
- title "title:<&6>7!" targets:<server.flag[in_game].as_list> fade_in:0t stay:2s fade_out:0t
- wait 1s
- title "title:<&6>6!" targets:<server.flag[in_game].as_list> fade_in:0t stay:2s fade_out:0t
- wait 1s
- title "title:<&6>5!" targets:<server.flag[in_game].as_list> fade_in:0t stay:2s fade_out:0t
- wait 1s
- title "title:<&6>4!" targets:<server.flag[in_game].as_list> fade_in:0t stay:2s fade_out:0t
- wait 1s
- title "title:<&6>3!" targets:<server.flag[in_game].as_list> fade_in:0t stay:2s fade_out:0t
- wait 1s
- title "title:<&6>2!" targets:<server.flag[in_game].as_list> fade_in:0t stay:2s fade_out:0t
- wait 1s
- title "title:<&6>1!" targets:<server.flag[in_game].as_list> fade_in:0t stay:2s fade_out:0t
- wait 1s
- title "title:<&6>GO!" targets:<server.flag[in_game].as_list> fade_in:0t stay:2s fade_out:10t
- flag server lock_players:false
- foreach <server.flag[in_game].as_list> {
- modifyblock <server.flag[spawnlocation.%LOOP_INDEX%].as_location.add[1,1,0]>|<server.flag[spawnlocation.%LOOP_INDEX%].as_location.add[0,1,1]>|<server.flag[spawnlocation.%LOOP_INDEX%].as_location.add[-1,1,0]>|<server.flag[spawnlocation.%LOOP_INDEX%].as_location.add[0,1,-1]>|<server.flag[spawnlocation.%LOOP_INDEX%].as_location.add[0,2,0]> m@air
}