Date: 2015/03/10 16:56:51 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
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
MSLowerCryptBoss:
type: assignment
debug: false
actions:
on assignment:
- ^flag global mslowercryptboss:<npc>
- ^flag <global.flag[mslowercryptboss]> spawnpoint:l@-1284.1,49.9,-24.1,survive
- ^flag <global.flag[mslowercryptboss]> aggro:!
- ^flag <global.flag[mslowercryptboss]> highestdamage:0
- ^trigger name:proximity toggle:true radius: 3
- ^trigger name:damage toggle:true
- ^execute as_server "npc sel <<global.flag[mslowercryptboss]>.id>"
- ^execute as_server "npc name"
- ^execute as_server "npc nick --set '<<global.flag[mslowercryptboss]>.name> the Fire Elemental'"
- ^execute as_server "npc speed 1.6"
- ^execute as_server "npc respawn 1200"
- ^vulnerable state:true
- ^lookclose <global.flag[mslowercryptboss]> state:true realistic
- ^health <global.flag[mslowercryptboss]> 1000
- ^heal <global.flag[mslowercryptboss]>
- ^execute as_server "denizen save"
on spawn:
- ^health <global.flag[mslowercryptboss]> 1000
- ^heal <global.flag[mslowercryptboss]>
- ^vulnerable state:true
- ^foreach <server.list_online_players> {
- if <%value%.location.is_within[cu@mslowercrypt]> {
- run s@MSLowerCryptBossResetPlayer as:%value% }
}
MSLowerCryptBossRespawn:
type: task
debug: false
script:
- ^foreach <server.list_online_players> {
- if <%value%.location.is_within[cu@mslowercrypt]> {
- run s@MSLowerCryptBossResetPlayer as:%value% }
}
- ^execute as_server "npc create &4Giik --at -1284.1,49.9,-24.1,survive"
- ^execute as_server "npc assignment --set MSLowerCryptBoss"
MSLowerCryptBossNarrateWarning:
type: task
debug: false
script:
- ^if <s@MSLowerCryptBossNarrateWarning.cooled_down[<player>]> {
- narrate "<&5>* You hear a sinister laughter off in the distance..."
- cooldown duration:300 }
MSLowerCryptBossNarrateAttack:
type: task
debug: false
script:
- ^if <s@MSLowerCryptBossNarrateAttack.cooled_down[<player>]> {
- announce "<&4><global.flag[mslowercryptboss].as_npc.name.nickname> <&8>| <red>Ahhhhhh, it's been quite some time since I've had visitors. Now you must DIE!"
- cooldown duration:300 global }
MSLowerCryptBossReset:
type: task
debug: false
script:
- ^flag <global.flag[mslowercryptboss]> infernoearthquake:!
- ^flag <global.flag[mslowercryptboss]> infernofirering1:!
- ^flag <global.flag[mslowercryptboss]> infernofirering2:!
- ^foreach <server.list_players> {
- if <global.flag[mslowercryptboss].as_npc.has_flag[%value%]> {
- flag <global.flag[mslowercryptboss]> %value%:! }
}
- ^flag <global.flag[mslowercryptboss]> aggro:!
- ^flag <global.flag[mslowercryptboss]> highestdamage:0
- ^heal <global.flag[mslowercryptboss]>
- ^if <queue.exists[infernoearthquake1]> {
- queue id:infernoearthquake1 clear }
- ^if <queue.exists[infernoearthquake2]> {
- queue id:infernoearthquake2 clear }
- ^if <global.flag[mslowercryptboss].as_npc.is_spawned> {
- walk <global.flag[mslowercryptboss]> <global.flag[mslowercryptboss].as_npc.flag[spawnpoint]> }
- ^foreach <l@-1283,51,-28,survive.find.entities[blaze].within[30]> {
- if <%value%.location.is_within[cu@mslowercrypt]> || <%value%.location.is_within[cu@mschurchcrypt]> {
- remove %value% }
}
MSLowerCryptBossResetPlayer:
type: task
debug: false
script:
- ^teleport <player> l@-1276.5,51,-35.5,survive
- ^wait 0.3
- ^look <player> l@-1273.0,51.0,-36.0,survive
MSLowerCryptBossWorld:
type: world
debug: false
events:
on player damages entity:
- ^if <context.entity> == <global.flag[mslowercryptboss]> {
- define item <player.item_in_hand>
- if <proc[CustomItemCheck].context[%item%|<player>]> {
- determine <proc[CustomItemDamageBoss].context[%item%|<player>|<context.entity>|<context.cause>]> }
else {
- if <context.entity.flag[<player>].asint> !matches number {
- flag <context.entity> <player>:<context.damage.asint> }
else {
- flag <context.entity> <player>:<context.entity.flag[<player>].asint.add[context.damage.asint]>
- if <context.entity.flag[<player>]> > <context.entity.flag[highestdamage]> {
- flag <context.entity> aggro:<player>
- flag <context.entity> highestdamage:<context.entity.flag[<player>]> }
}
- run s@MSLowerCryptBossDefend d:<player>|<context.entity>
- foreach <context.entity.flag[attacklist].aslist> {
- adjust %value% "show_boss_bar:<global.flag[mslowercryptboss].as_npc.health.div[1000].mul[200].asint>|<&4><global.flag[mslowercryptboss].as_npc.name.nickname>" }
- inject s@NarrateDamage
- determine fulfilled
}
}
on player walks over mslowercryptwarning:
- ^if <<global.flag[mslowercryptboss]>.as_npc.is_spawned> {
- run s@MSLowerCryptBossNarrateWarning }
on player enters mslowercrypt:
- ^if <global.flag[mslowercryptboss].as_npc.is_spawned> {
- if <global.flag[mslowercryptboss].as_npc.has_flag[aggro]> {
- define highestaggro <global.flag[mslowercryptboss].flag[aggro]> }
- flag <global.flag[mslowercryptboss]> attacklist:->:<player>
- if !<global.flag[mslowercryptboss].as_npc.has_flag[<player>]> {
- flag <global.flag[mslowercryptboss]> <player>:0 }
- run s@MSLowerCryptBossNarrateAttack
- adjust <player> "show_boss_bar:<global.flag[mslowercryptboss].as_npc.health.div[1000].mul[200].asint>|<&4><global.flag[mslowercryptboss].as_npc.name.nickname>"
- if <def[highestaggro]||null> != null {
- attack <global.flag[mslowercryptboss]> target:<def[highestaggro]> }
else {
- attack <global.flag[mslowercryptboss]> target:<global.flag[mslowercryptboss].as_npc.flag[attacklist].aslist.random> }
}
on player exits mslowercrypt:
- ^flag <global.flag[mslowercryptboss]> attacklist:<-:<player>
- ^if <global.flag[mslowercryptboss].as_npc.is_spawned> {
- attack <global.flag[mslowercryptboss]> target:cancel
- adjust <player> "show_boss_bar:"
- if !<global.flag[mslowercryptboss].as_npc.has_flag[attacklist]> {
- run s@MSLowerCryptBossReset as:<global.flag[mslowercryptboss]> }
else {
- attack <global.flag[mslowercryptboss]> target:<global.flag[mslowercryptboss].as_npc.flag[attacklist].aslist.random> }
}
on player quits:
- ^if <global.flag[mslowercryptboss].as_npc.has_flag[<player>]> {
- flag <global.flag[mslowercryptboss]> attacklist:<-:<player>
- if !<global.flag[mslowercryptboss].as_npc.has_flag[attacklist]> {
- run s@MSLowerCryptBossReset as:<global.flag[mslowercryptboss]> }
on player joins:
- ^if <player.location.is_within[cu@mslowercrypt]> {
- run s@MSLowerCryptBossResetPlayer delay:0.5 }
on entity killed:
- ^if <context.entity> == <global.flag[mslowercryptboss]> {
- inject s@MSLowerCryptBossDeath }
on npc damaged by FIRE_TICK:
- ^if <context.entity> == <global.flag[mslowercryptboss]> {
- determine cancelled }
on npc damaged by FIRE:
- ^if <context.entity> == <global.flag[mslowercryptboss]> {
- determine cancelled }
on npc damaged by BLOCK_EXPLOSION:
- ^if <context.entity> == <global.flag[mslowercryptboss]> {
- determine cancelled }
MSLowerCryptBossAttack:
type: procedure
definitions: player|npc
debug: false
script:
- ^define normaldamage <util.random.int[8].to[12].asint>
- ^narrate "<&4><def[npc].as_npc.name.nickname> <red>hits YOU for <def[normaldamage]> damage!"
- ^determine <def[normaldamage]>
MSLowerCryptBossDefend:
type: task
debug: false
definitions: player|npc
script:
- ^define roll <util.random.int[1].to[100].asint>
- ^if <def[npc].as_npc.has_flag[aggro]> {
- define highestaggro <def[npc].flag[aggro]>
- if <def[highestaggro].location.is_within[cu@mslowercrypt]> {
- attack <def[npc]> target:<def[highestaggro]> }
}
- ^if <def[npc].health> < 750 && <def[npc].flag[infernoearthquake].is_expired> {
- flag <def[npc]> infernoearthquake
- announce "<&4><def[npc].as_npc.name.nickname> <&8>| <red>Fools! Now you will truly feel the pain of FIRE!!"
- run s@InfernoEarthquake d:<def[npc]>
- wait 1
- attack <def[npc]> target:<def[npc].as_npc.flag[attacklist].aslist.random>
- run s@InfernoEarthquake d:<def[npc]> id:infernoearthquake1 delay:20
- wait 1
- attack <def[npc]> target:<def[npc].as_npc.flag[attacklist].aslist.random> }
- ^if <def[npc].health> < 500 && <def[npc].flag[infernofirering1].is_expired> {
- ^flag <def[npc]> infernofirering1
- playeffect portal <def[npc].location> qty:500 data:1 offset:0.5
- playsound <def[npc].location> effect:portal_trigger volume:1.0 pitch:2
- attack <def[npc]> target:cancel
- ^execute as_server "npc sel <def[npc].id>"
- ^execute as_server "npc speed 0"
- announce "<&4><def[npc].as_npc.name.nickname> <&8>| <red>Time for you to taste my FLAMES!!"
- modifyblock <cu@-1286.0,50.0,-25.0,survive|-1280.0,50.0,-31.0,survive.get_outline> m@fire
- modifyblock l@-1290.0,50.0,-25.0,survive m@fire
- modifyblock l@-1290.0,50.0,-26.0,survive m@fire
- modifyblock l@-1290.0,50.0,-27.0,survive m@fire
- modifyblock l@-1290.0,50.0,-28.0,survive m@fire
- modifyblock l@-1290.0,50.0,-29.0,survive m@fire
- modifyblock l@-1290.0,50.0,-30.0,survive m@fire
- modifyblock l@-1290.0,50.0,-31.0,survive m@fire
- modifyblock l@-1276.0,50.0,-31.0,survive m@fire
- modifyblock l@-1276.0,50.0,-30.0,survive m@fire
- modifyblock l@-1276.0,50.0,-29.0,survive m@fire
- modifyblock l@-1276.0,50.0,-28.0,survive m@fire
- modifyblock l@-1276.0,50.0,-27.0,survive m@fire
- modifyblock l@-1276.0,50.0,-26.0,survive m@fire
- modifyblock l@-1276.0,50.0,-25.0,survive m@fire
- wait 0.1
- teleport <def[npc]> l@-1282.5,51.0,-27.5,survive
- playeffect portal l@-1282.5,51.0,-27.5,survive qty:200 data:0 offset:0.4
- ^spawn e@blaze l@-1273.5,50.86,-23.5,survive target:<def[npc].as_npc.flag[attacklist].aslist.random>
- ^spawn e@blaze l@-1273.5,50.86,-31.5,survive target:<def[npc].as_npc.flag[attacklist].aslist.random>
- ^spawn e@blaze l@-1291.4,50.86,-31.5,survive target:<def[npc].as_npc.flag[attacklist].aslist.random>
- ^spawn e@blaze l@-1291.4,50.86,-23.58,survive target:<def[npc].as_npc.flag[attacklist].aslist.random>
- ^spawn e@blaze l@-1273.5,50.86,-23.5,survive target:<def[npc].as_npc.flag[attacklist].aslist.random>
- ^spawn e@blaze l@-1273.5,50.86,-31.5,survive target:<def[npc].as_npc.flag[attacklist].aslist.random>
- ^spawn e@blaze l@-1291.4,50.86,-31.5,survive target:<def[npc].as_npc.flag[attacklist].aslist.random>
- ^spawn e@blaze l@-1291.4,50.86,-23.58,survive target:<def[npc].as_npc.flag[attacklist].aslist.random>
- ^wait 2
- ^run s@fireball as:<def[npc]>
- ^wait 2
- ^run s@fireball as:<def[npc]>
- ^wait 2
- ^run s@fireball as:<def[npc]>
- ^wait 2
- ^run s@fireball as:<def[npc]>
- ^wait 2
- ^execute as_server "npc sel <def[npc].id>"
- ^execute as_server "npc speed 1.6"
- ^attack %npc% target:<def[npc].as_npc.flag[attacklist].aslist.random> }
- ^if <def[npc].health> < 300 && <def[npc].flag[infernofirering2].is_expired> {
- ^flag <def[npc]> infernofirering2
- playeffect portal <def[npc].location> qty:500 data:1 offset:0.5
- playsound <def[npc].location> effect:portal_trigger volume:1.0 pitch:2
- attack <def[npc]> target:cancel
- ^execute as_server "npc sel <npc[def].id>"
- ^execute as_server "npc speed 0"
- announce "<&4><def[npc].name.nickname> <&8>| <red>Time for you to taste my FLAMES!!"
- modifyblock <cu@-1286.0,50.0,-25.0,survive|-1280.0,50.0,-31.0,survive.get_outline> m@fire
- modifyblock l@-1290.0,50.0,-25.0,survive m@fire
- modifyblock l@-1290.0,50.0,-26.0,survive m@fire
- modifyblock l@-1290.0,50.0,-27.0,survive m@fire
- modifyblock l@-1290.0,50.0,-28.0,survive m@fire
- modifyblock l@-1290.0,50.0,-29.0,survive m@fire
- modifyblock l@-1290.0,50.0,-30.0,survive m@fire
- modifyblock l@-1290.0,50.0,-31.0,survive m@fire
- modifyblock l@-1276.0,50.0,-31.0,survive m@fire
- modifyblock l@-1276.0,50.0,-30.0,survive m@fire
- modifyblock l@-1276.0,50.0,-29.0,survive m@fire
- modifyblock l@-1276.0,50.0,-28.0,survive m@fire
- modifyblock l@-1276.0,50.0,-27.0,survive m@fire
- modifyblock l@-1276.0,50.0,-26.0,survive m@fire
- modifyblock l@-1276.0,50.0,-25.0,survive m@fire
- wait 0.1
- teleport <def[npc]> l@-1282.5,51.0,-27.5,survive
- playeffect portal l@-1282.5,51.0,-27.5,survive qty:200 data:0 offset:0.4
- ^spawn e@blaze l@-1273.5,50.86,-23.5,survive target:<def[npc].as_npc.flag[attacklist].aslist.random>
- ^spawn e@blaze l@-1273.5,50.86,-31.5,survive target:<def[npc].as_npc.flag[attacklist].aslist.random>
- ^spawn e@blaze l@-1291.5,50.86,-31.5,survive target:<def[npc].as_npc.flag[attacklist].aslist.random>
- ^spawn e@blaze l@-1291.5,50.86,-23.58,survive target:<def[npc].as_npc.flag[attacklist].aslist.random>
- ^spawn e@blaze l@-1273.5,50.86,-23.5,survive target:<def[npc].as_npc.flag[attacklist].aslist.random>
- ^spawn e@blaze l@-1273.5,50.86,-31.5,survive target:<def[npc].as_npc.flag[attacklist].aslist.random>
- ^spawn e@blaze l@-1291.5,50.86,-31.5,survive target:<def[npc].as_npc.flag[attacklist].aslist.random>
- ^spawn e@blaze l@-1291.5,50.86,-23.58,survive target:<def[npc].as_npc.flag[attacklist].aslist.random>
- ^spawn e@blaze l@-1273.5,50.86,-23.5,survive target:<def[npc].as_npc.flag[attacklist].aslist.random>
- ^spawn e@blaze l@-1273.5,50.86,-31.5,survive target:<def[npc].as_npc.flag[attacklist].aslist.random>
- ^spawn e@blaze l@-1291.5,50.86,-31.5,survive target:<def[npc].as_npc.flag[attacklist].aslist.random>
- ^spawn e@blaze l@-1291.5,50.86,-23.58,survive target:<def[npc].as_npc.flag[attacklist].aslist.random>
- ^wait 2
- ^run s@fireball as:<def[npc]>
- ^wait 2
- ^run s@fireball as:<def[npc]>
- ^wait 2
- ^run s@fireball as:<def[npc]>
- ^wait 2
- ^run s@fireball as:<def[npc]>
- ^wait 2
- ^execute as_server "npc sel <def[npc].id>"
- ^execute as_server "npc speed 1.6"
- ^attack <def[npc]> target:<def[npc].as_npc.flag[attacklist].aslist.random> }
# - ^if %roll% <= 7 ^inject 's@Forcetoss1'
# else if %roll% > 7 && %roll% <= 15 ^inject 's@Slow4'
# else if %roll% > 15 && %roll% <= 23 ^inject 's@Blindness'
# else if %roll% > 23 && %roll% <= 31 ^inject 's@MobHeal1'
- ^playeffect location:<def[npc]> effect:lava qty:10 offset:0.2
MSLowerCryptExplodeDamage:
type: task
debug: false
script:
- ^define damage <util.random.int[10].to[18].asint>
- ^narrate "<red>YOU were injured for <def[damage]> damage!"
- ^determine <def[damage]>
MSLowerCryptBossDeath:
type: task
debug: false
script:
- ^announce "<&6>BOSS<&co> <&4><context.entity.name.nickname> <&6>has been slain!!"
- ^announce "<&6>Top Damage<&co> <<context.entity.flag[aggro]>.name.display> <&f>(<context.entity.flag[<player>]>)"
- ^foreach <context.entity.flag[attacklist].aslist> {
- adjust %value% "show_boss_bar:"
- run s@MSLowerCryptBossReward as:%value% }
- ^flag <global.flag[mslowercryptboss]> infernoearthquake:!
- ^flag <global.flag[mslowercryptboss]> infernofirering1:!
- ^flag <global.flag[mslowercryptboss]> infernofirering2:!
- ^foreach <server.list_players> {
- if <global.flag[mslowercryptboss].as_npc.has_flag[%value%]> {
- flag <global.flag[mslowercryptboss]> %value%:! }
}
- ^flag <global.flag[mslowercryptboss]> aggro:!
- ^flag <global.flag[mslowercryptboss]> highestdamage:!
- ^if <queue.exists[infernoearthquake1]> {
- queue id:infernoearthquake1 clear }
- ^if <queue.exists[infernoearthquake2]> {
- queue id:infernoearthquake2 clear }
- ^execute as_server "npc sel <global.flag[mslowercryptboss].id>"
- ^execute as_server "npc remove"
- ^flag global mslowercryptboss:dead
- ^run s@MSLowerCryptBossRespawn delay:60
MSLowerCryptBossReward:
type: task
debug: false
script:
- announce "give reward"
# - ^define roll <util.random.int[1].to[100].asint>
# - ^define money <util.random.int[500].to[1000].asint>
# - ^give money qty:%money%
# - ^narrate "<&6>You have received <&a>$%money%<&6>!"
# - ^run 's@GiveItem' d:i@emerald|2|5|<player>
# - ^run 's@GiveItem' d:i@diamond|2|5|<player>
# - ^if %roll% > 70 ^run 's@GiveItem' d:i@diamond_barding|1|1|<player>
# - ^if %roll% > 60 {
# - random {
# - ^run 's@GiveCustomItem' d:i@meteorite|1|1|<player>
# - ^run 's@GiveCustomItem' d:i@heartburn|1|1|<player>
# - ^run 's@GiveCustomItem' d:i@cryptstalkersword|1|1|<player> }
# }
# - ^if <el@<player.flag[activequests].contains[mslowercrypt]>> {
# - ^run s@GiveQuestItem d:i@MSLowerCryptBossHead|1|1|<player>
# }
# - ^if <context.entity.flag[aggro]> == <player> {
# - ^announce "<&d>BONUS <&8>| <player.name.display> <&6>has received <&e>$1,000<&6> for TOP DAMAGE!"
# - ^give money qty:1000
# - ^narrate "<&6>You have received <&a>$1,000<&6>!" }