Date: 2016/05/14 16:03:18 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
##########################################@TERRAINCONTROL USERS@########################################
# Do not Modify anything unless indicated otherwise!
# The contents of this file provide the following functions:
# - AncientDungeonsArrow script ( This is a part of the dispenser script. removing this will break the dispenser script )
# - Dispenser Script ( Controls Traps & Special mob spawns of NLBlackEagle's Realms )
# - Sapling Fix ( Fixes a problem with trees growing constainly )
# - ChestScript ( Populates the chest generated by TerrainControl & Repopulate them after 300 minutes
# This function is player-bound so no global repopulate timings! )
# Check the lootcrates.yml file for all loot items!
#
# Note: After changing values type /denizen reload -a ingame! Otherwise there wont be any diffrence. No need to restart!
#
# This is a YAML formatted file, make sure you check for YAML errors after updating this script!
#####################################
# Created by NLBlackEagle #
# Website: www.craftrealms.org #
# TeamSpeak: ts3.craftrealms.org #
#####################################
DungeonGhost:
# This script creates a item which functions as boss spawn check.
type: item
debug: false
material: i@Bone
display name: <&3>Restless Bone
lore:
- This bone gives of a strange confusing aura
no_id: false
bound: false
DungeonBoss:
# This script creates a item which functions as boss spawn check.
type: item
debug: false
material: i@Bone
display name: <&3>Evil Bone
lore:
- You feel slightly unconfortable when holding this bone.
no_id: false
bound: false
DungeonGuardian:
# This script creates a item which functions as boss spawn check.
type: item
debug: false
material: i@Bone
display name: <&3>Heavy Bone
lore:
- This bone feels heavier then it should be, almosth as if something resides within
no_id: false
bound: false
AncientDungeonsArrow:
# This is a part of the dispenser script. removing this will break the dispenser script
type: item
debug: false
material: i@arrow
display name: <&3>Magical Ancient Arrow
lore:
- This arrow only works with the Ancient Dispensers
no_id: false
bound: false
DungeonsMobSlowEffect:
type: task
debug: false
script:
- ^narrate "You legs have been broken by your oppoment!"
- random {
- playeffect effect:SLOW target:<player> quantity:2
- playeffect effect:SLOW target:<player> quantity:3
- playeffect effect:SLOW target:<player> quantity:4
}
DungeonsMobPoisonEffect:
type: task
debug: false
script:
- ^narrate "You have been poisoned by your oppoment!"
- random {
- potion POISON duration:3 <player>
- potion POISON duration:2 <player>
- potion POISON duration:4 <player>
}
DungeonsMobWitherEffect:
type: task
debug: false
script:
- ^narrate "You are poisoned by your oppoment!"
- random {
- potion WITHER duration:3 <player>
- potion WITHER duration:2 <player>
- potion WITHER duration:1 <player>
}
DungeonsMobFlameEffect:
type: task
debug: false
script:
- ^narrate "You have been cursed by your oppoment!"
- random {
- burn <player> duration:4
- burn <player> duration:3
- burn <player> duration:2
}
DispenserScript:
# This script manages all dispensers placed by TerrainControl. To open the boss dispensers you'll need to have operator permissions!
type: world
debug: true
events:
on entity killed:
- if <context.entity> contains <server.flag[DungeonSpawns]> {
- explode power:10 l@<context.entity.location.simple>
- if <util.random.int[1].to[10]> == 1 {
- random {
- drop i@GOLDEN_APPLE <context.entity.location.simple> qty:1
- drop i@DIAMOND <context.entity.location.simple> qty:1
- drop i@EXP_BOTTLE <context.entity.location.simple> qty:1
- drop i@GOLD_BARDING <context.entity.location.simple> qty:1
- drop i@GOLD_BLOCK <context.entity.location.simple> qty:1
- drop i@GOLD_SWORD <context.entity.location.simple> qty:1
- drop i@GOLD_HELMET <context.entity.location.simple> qty:1
- drop i@GOLD_LEGGINGS <context.entity.location.simple> qty:1
- drop i@GOLDEN_CARROT <context.entity.location.simple> qty:1
}
}
}
on entity damages player:
- announce "<context.damager>"
- if <context.damager> contains <server.flag[DungeonSpawns]> {
- announce "hello"
- if <util.random.int[1].to[1]> == 1 {
- random {
- run s@DungeonsMobWitherEffect as :<context.entity>
- run s@DungeonsMobFlameEffect as:<context.entity>
- run s@DungeonsMobPoisonEffect as:<context.entity>
- run s@DungeonsMobSlowEffect as:<context.entity>
}
}
- random {
- determine |<context.damage.add[1]>
- determine |<context.damage.add[2]>
- determine |<context.damage.add[3]>
- determine |<context.damage.add[4]>
- determine |<context.damage.add[5]>
}
}
on player opens inventory:
- if <context.inventory.contains[li@DungeonBoss|DungeonGuardian|DungeonGhost]> {
- if !<player.is_op||false> {
- narrate "This dispenser has been locked with a ancient powerfull spell"
- DETERMINE CANCELLED
}
}
on block dispenses item:
- if !<server.flag[dispenser].as_list.contains[<context.location.simple>]||false> {
- if <context.location.inventory.list_contents> contains <i@DungeonBoss> {
- if !<server.has_flag[dungeonboss]||false> {
- playsound <context.location> sound:ENTITY_ENDERDRAGON_GROWL pitch:-100
- ^spawn skeleton <context.location.add[0,1,0]> save:DungeonBoss
- ^flag server "DungeonSpawns:|:<entry[DungeonBoss].spawned_entities>"
- ^health <entry[DungeonBoss].spawned_entities> 30
- ^heal <entry[DungeonBoss].spawned_entities>
- ^adjust <entry[DungeonBoss].spawned_entities.get[1]> "custom_name:<gold><bold>DungeonBoss"
- flag server dungeonboss duration:5m
- DETERMINE CANCELLED
}
}
- if <context.location.inventory.list_contents> contains <i@DungeonGuardian> {
- if !<server.has_flag[DungeonGuardian]||false> {
- playsound <context.location> sound:ENTITY_LIGHTNING_THUNDER pitch:-100
- ^spawn skeleton <context.location.add[0,1,0]> save:DungeonGuardian
- ^flag server "DungeonSpawns:|:<entry[DungeonGuardian].spawned_entities>"
- ^health <entry[DungeonGuardian].spawned_entities> 30
- ^heal <entry[DungeonGuardian].spawned_entities>
- ^adjust <entry[DungeonGuardian].spawned_entities.get[1]> "custom_name:<red><bold>DungeonGuardian"
- flag server DungeonGuardian duration:1m
- DETERMINE CANCELLED
}
}
- if <context.location.inventory.list_contents> contains <i@DungeonGhost> {
- if !<server.has_flag[DungeonGhost]||false> {
- playsound <context.location> sound:ENTITY_LIGHTNING_IMPACT pitch:-100
- ^spawn skeleton <context.location.add[0,1,0]> save:DungeonGhost
- ^flag server "DungeonSpawns:|:<entry[DungeonGhost].spawned_entities>"
- ^health <entry[DungeonGhost].spawned_entities> 30
- ^heal <entry[DungeonGhost].spawned_entities>
- ^adjust <entry[DungeonGhost].spawned_entities.get[1]> "custom_name:<bold>DungeonGhost"
- flag server DungeonGhost duration:1m
- DETERMINE CANCELLED
}
}
- if <context.location.inventory.list_contents> contains <i@AncientDungeonsArrow> {
- if <server.has_flag[Entity]> == true {
- if <server.has_flag[LaggOFix]> == false {
- random {
- DETERMINE i@lingering_potion[potion_effects=li@POISON,false,false]
- DETERMINE i@lingering_potion[potion_effects=li@INSTANT_DAMAGE,true,false]
- DETERMINE i@lingering_potion[potion_effects=li@SLOWNESS,false,true]
- DETERMINE i@AncientDungeonsArrow
}
- DETERMINE CANCELLED
- flag server LaggOFix duration:20
}
}
else if <server.has_flag[Entity]> == false {
- random {
- spawn zombie <context.location>
- spawn pig_zombie <context.location>
- spawn creeper <context.location>
- spawn spider <context.location>
- DETERMINE CANCELLED
}
- random {
- flag server Entity duration:5m
- spawn zombie <context.location>
- spawn pig_zombie <context.location>
- spawn spider <context.location>
- DETERMINE CANCELLED
}
- DETERMINE CANCELLED
}
}
}
- if <context.location.inventory.contains[li@DungeonBoss|DungeonGuardian|DungeonGhost|AncientDungeonsArrow]> {
- DETERMINE CANCELLED
}
Sapling100Script:
#This script makes sure that the saplings which remain on the ground after growing a tree gets deleted, removing this script can make the server have a increase generation time.
type: world
debug: false
events:
on structure grows:
- determine passively cancelled
- modifyblock <context.location> m@AIR
Chest100Script:
type: world
default constants:
#The RepopulateCooldown value is in minutes and determines the amount of time before a re-population
#should be executed. This causes no server load since the re-population is player-bound.
#Change the value "300m" to any number you'd like. 300m equals 5 hours.
RepopulateCooldown: 300m
#PopulateAttemts, lower this number to decrease the amount of items in a chest.
PopulateAttempts: 10
#PopulateMinimalItems, Minimal items in a chest upon populating. 0 Makes items more rare but not impossibile to populate.
PopulateMinimalItems: 1
#PopulateRarity, this parameter sets the rarity of the rare loot table. Adjust the rarity from 1 to 100. 1 = common. 100 is extremely rare.
PopulateRarity: 5
#RarePopulateAttempts, Minimal items in a chest upon populating from the rare item loot table. 0 Makes items more rare but not impossibile to populate.
RarePopulateAttempts: 1
debug: false
events:
on server start:
- yaml load:lootcrates.yml id:lootcrates
on player opens chest:
- if !<player.has_flag[<context.inventory.location.simple>]> {
- flag player <context.inventory.location.simple>:true duration:<s@chest100script.constant[RepopulateCooldown]>
- if <server.flag[chest].as_list.contains[<context.inventory.location.simple>]> {
- queue clear
}
- repeat <s@chest100script.constant[PopulateMinimalItems]> {
- inventory add d:<context.inventory> o:<yaml[lootcrates].read[loot].random.as_item> slot:<util.random.int[1].to[27]>
}
- repeat <s@chest100script.constant[PopulateAttempts]> {
- if <util.random.int[1].to[5]> == 5 {
- inventory add d:<context.inventory> o:<yaml[lootcrates].read[loot].random.as_item> slot:<util.random.int[1].to[27]>
}
}
- repeat <s@chest100script.constant[RarePopulateAttempts]> {
- if <util.random.int[1].to[<s@chest100script.constant[PopulateRarity]>]> == 1 {
- inventory add d:<context.inventory> o:<yaml[lootcrates].read[rareloot].random.as_item> slot:<util.random.int[1].to[27]>
}
}
}
on player places block:
# This is part of the ChestScript Script and detects if the chest was placed by TerrainControl
- if li@chest|trapped_chest contains <context.material.name> {
- flag server chest:->:<context.location.simple>
}
# This is part of the DispenserScript Script and detects if the Dispenser was placed by TerrainControl
- if dispenser contains <context.material.name> {
- flag server dispenser:->:<context.location.simple>
}