Paste #27846: Untitled Paste

Date: 2016/01/05 10:45:25 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


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


kitpvpConfig:
    type: yaml data
    config:
        streaks:
            a: 50
            b: 100
            c: 200
            d: 500
            e: 1000

## <s@kitpvpConfig.yaml_key[config.streaks.e]>

MainEventsKitPvp:
    type: world
    events:
        on server start: 
        - run looping_scoreboard_script instantly 
        - inject Kitpvp_Load_Config

        on reload scripts:
        - inject Kitpvp_Load_Config

        on shutdown:
        - execute as_server "denizen save"

        on player join:
        - if <player.has_flag[kitpvp_kills].not> {
            - flag player kitpvp_kills:0
        }
        - flag player kitpvp_spree:0
        - flag player kitpvp_bounty:0

        on player death:
        - if <context.damager.is_player||false>  {
            - define player "<context.damager>"
            - run player_specific_streak_count player:<context.damager> instantly
            - inject kitpvp_spree_shutdown
        }
        else if <context.damager.shooter.is_player||false> {
            - define player "<context.damager.shooter>"
            - run player_specific_streak_count player:<context.damager.shooter> instantly
            - inject kitpvp_spree_shutdown
        }

        on player shoots bow:
        - if <context.force> < 1.0 {
            - determine CANCELLED
        }

        on player breaks BEACON:
        - if <player.is_op> {
            - queue clear 
        }
        - execute as_server "tempban <player.name> 1h Auto-beacon-detector fandt dig!"
        - determine cancelled

        on player damages BEACON:
        - repeat 5 {
            - narrate "<&c>ADVARSEL<&co> Smadring af BEACON medfører ban!"
        }
        - execute as_server "spawn <player.name>"

Kitpvp_Load_Config:
    type: task
    script:
    - if <server.has_file[../GGPVP/scoreboard.yml].not> {
        - yaml create id:ggpvp_scoreboard
        # Setup Basics
        - yaml id:ggpvp_scoreboard set Text.Scoreboard_Header:&3GGPVP
        - yaml id:ggpvp_scoreboard set Text.Online:&bOnline
        - yaml id:ggpvp_scoreboard set Text.Penge:&bPenge
        - yaml id:ggpvp_scoreboard set Text.Kills:&bKills
        - yaml id:ggpvp_scoreboard "savefile:../GGPVP/scoreboard.yml"
    }
    else {
        - yaml "load:../GGPVP/scoreboard.yml" id:ggpvp_scoreboard
    }

kitpvp_spree_shutdown:
    type: task
    script:
    - if <player.has_flag[kitpvp_bounty]> {
        - if <player.flag[kitpvp_bounty].as_int> > 0 {
            - playsound <server.list_online_players> ANVIL_LAND Volume:0.5 Pitch:2.0
            - drop <player.location> i@NetherStar qty:<player.flag[kitpvp_bounty].as_int>
            - define action "<&6><player.name> <&1> <&6><player.flag[kitpvp_spree].as_int> kills blev <&4>SHUDOWN <&1>af <&c><def[player].as_player.name> (Bounty<&co> <player.flag[kitpvp_bounty].as_int>)"
            - flag player kitpvp_bounty:0
            - flag player kitpvp_spree:0
            - repeat 10 {
                - adjust <server.list_online_players> action_bar:<def[action]>
                - wait 1s
            }
        }
    }

announce_killstreaks_bounty:
    type: task
    script:
    - flag player kitpvp_bounty:++
    - playsound <server.list_online_players> ORB_PICKUP Volume:0.2 Pitch:0.5
    - define action "<&6><player.name> <&1>er  <&6><&l><player.flag[kitpvp_spree].as_int> <&1>streaks! <&7>(BOUNTY<&co> <player.flag[kitpvp_bounty].as_int>)"
    - repeat 10 {
        - adjust <server.list_online_players> action_bar:<def[action]>
        - wait 1s
    }

player_specific_streak_count:
    type: task
    script:
    - flag player kitpvp_kills:++
    - flag player kitpvp_spree:++
    - if <player.has_flag[kitpvp_spree]> {
        - if <player.flag[kitpvp_spree].as_int> == <s@kitpvpConfig.yaml_key[config.streaks.a]> {
            - inject announce_killstreaks_bounty
        }
        else if <player.flag[kitpvp_spree].as_int> == <s@kitpvpConfig.yaml_key[config.streaks.b]> {
            - inject announce_killstreaks_bounty
        }
        else if <player.flag[kitpvp_spree].as_int> == <s@kitpvpConfig.yaml_key[config.streaks.c]> {
            - inject announce_killstreaks_bounty
        }
        else if <player.flag[kitpvp_spree].as_int> == <s@kitpvpConfig.yaml_key[config.streaks.d]> {
            - inject announce_killstreaks_bounty
        }
        else if <player.flag[kitpvp_spree].as_int> == <s@kitpvpConfig.yaml_key[config.streaks.e]> {
            - inject announce_killstreaks_bounty
        }
    }
    - if <player.has_flag[kitpvp_combo]> {
        - if <player.flag[kitpvp_combo]> == 1 {
            - narrate "<&a><&l>DOUBLE KILL"
            - playsound <player> sound:ENDERDRAGON_GROWL volume:10 pitch:2
            - playeffect <player> effect:HAPPY_VILLAGER qty:100 data:1 offset:1.5
            - cast speed duration:7s power:1
            - flag player kitpvp_combo:2 duration:140t
        }
        else if <player.flag[kitpvp_combo]> == 2 {
            - narrate "<&a><&l>TRIPLE KILL"
            - playsound <player> sound:ENDERDRAGON_GROWL volume:10 pitch:2
            - playeffect <player> effect:HAPPY_VILLAGER qty:100 data:1 offset:1.5
            - cast speed duration:8s power:1
            - flag player kitpvp_combo:3 duration:160t
        }
        else if <player.flag[kitpvp_combo]> == 3 {
            - narrate "<&a><&l>QUADRA KILL"
            - playsound <player> sound:ENDERDRAGON_GROWL volume:10 pitch:2
            - playeffect <player> effect:HAPPY_VILLAGER qty:100 data:1 offset:1.5
            - cast speed duration:9s power:1
            - flag player kitpvp_combo:4 duration:180t
        }
        else if <player.flag[kitpvp_combo]> == 4 {
            - narrate "<&a><&l>PENTA KILL"
            - playsound <player> sound:ENDERDRAGON_GROWL volume:10 pitch:2
            - playeffect <player> effect:HAPPY_VILLAGER qty:100 data:1 offset:1.5
            - cast speed duration:10s power:1
            - cast fire_resistance duration:10s power:1
            - flag player kitpvp_combo:5 duration:200t
        }
        else if <player.flag[kitpvp_combo]> == 5 {
            - narrate "<&a><&l>HEXA KILL"
            - playsound <player> sound:ENDERDRAGON_GROWL volume:10 pitch:2
            - playeffect <player> effect:HAPPY_VILLAGER qty:100 data:1 offset:1.5
            - cast speed duration:10s power:1
            - flag player kitpvp_combo:6 duration:200t
        }
        else if <player.flag[kitpvp_combo]> == 6 {
            - narrate "<&a><&l>SEPTA KILL"
            - playsound <player> sound:ENDERDRAGON_GROWL volume:10 pitch:2
            - playeffect <player> effect:HAPPY_VILLAGER qty:100 data:1 offset:1.5
            - cast speed duration:10s power:1
            - flag player kitpvp_combo:7 duration:200t
        }
        else if <player.flag[kitpvp_combo]> == 7 {
            - narrate "<&a><&l>OCTA KILL (8)"
            - playsound <player> sound:ENDERDRAGON_GROWL volume:10 pitch:2
            - playeffect <player> effect:HAPPY_VILLAGER qty:100 data:1 offset:1.5
            - cast speed duration:10s power:1
            - flag player kitpvp_combo:8 duration:200t
        }
        else if <player.flag[kitpvp_combo]> == 8 {
            - narrate "<&a><&l>NONA KILL (9)"
            - playsound <player> sound:ENDERDRAGON_GROWL volume:10 pitch:2
            - playeffect <player> effect:HAPPY_VILLAGER qty:100 data:1 offset:1.5
            - cast speed duration:10s power:1
            - flag player kitpvp_combo:9 duration:200t
        }
        else if <player.flag[kitpvp_combo]> == 9 {
            - narrate "<&a><&l>DECA KILL (10)"
            - playsound <player> sound:ENDERDRAGON_GROWL volume:10 pitch:2
            - playeffect <player> effect:HAPPY_VILLAGER qty:100 data:1 offset:1.5
            - cast speed duration:10s power:1
            - flag player kitpvp_combo:10 duration:200t
        }
        else if <player.flag[kitpvp_combo]> == 10 {
            - narrate "<&a><&l>HENDECA KILL (11)"
            - playsound <player> sound:ENDERDRAGON_GROWL volume:10 pitch:2
            - playeffect <player> effect:HAPPY_VILLAGER qty:100 data:1 offset:1.5
            - cast speed duration:10s power:1
            - flag player kitpvp_combo:11 duration:200t
        }
        else if <player.flag[kitpvp_combo]> == 11 {
            - narrate "<&a><&l>DODECA KILL (12)"
            - playsound <player> sound:ENDERDRAGON_GROWL volume:10 pitch:2
            - playeffect <player> effect:HAPPY_VILLAGER qty:100 data:1 offset:1.5
            - cast speed duration:10s power:1
            - flag player kitpvp_combo:12 duration:200t
        }
        else if <player.flag[kitpvp_combo]> == 12 {
            - narrate "<&a><&l>TRIDECA KILL (13)"
            - playsound <player> sound:ENDERDRAGON_GROWL volume:10 pitch:2
            - playeffect <player> effect:HAPPY_VILLAGER qty:100 data:1 offset:1.5
            - cast speed duration:10s power:1
            - flag player kitpvp_combo:13 duration:200t
        }
        else if <player.flag[kitpvp_combo]> == 13 {
            - narrate "<&a><&l>QUADECA KILL (14)"
            - playsound <player> sound:ENDERDRAGON_GROWL volume:10 pitch:2
            - playeffect <player> effect:HAPPY_VILLAGER qty:100 data:1 offset:1.5
            - cast speed duration:10s power:1
            - flag player kitpvp_combo:14 duration:200t
        }
        else if <player.flag[kitpvp_combo]> == 14 {
            - narrate "<&a><&l>PENTADECA KILL (15)"
            - playsound <player> sound:ENDERDRAGON_GROWL volume:10 pitch:2
            - playeffect <player> effect:HAPPY_VILLAGER qty:100 data:1 offset:1.5
            - cast speed duration:10s power:1
            - flag player kitpvp_combo:15 duration:200t
        }
        else if <player.flag[kitpvp_combo]> == 15 {
            - narrate "<&a><&l>HEXADECA KILL (16)"
            - playsound <player> sound:ENDERDRAGON_GROWL volume:10 pitch:2
            - playeffect <player> effect:HAPPY_VILLAGER qty:100 data:1 offset:1.5
            - cast speed duration:10s power:1
            - flag player kitpvp_combo:16 duration:200t
        }
        else if <player.flag[kitpvp_combo]> == 16 {
            - narrate "<&a><&l>HEPTADECA KILL (17)"
            - playsound <player> sound:ENDERDRAGON_GROWL volume:10 pitch:2
            - playeffect <player> effect:HAPPY_VILLAGER qty:100 data:1 offset:1.5
            - cast speed duration:10s power:1
            - flag player kitpvp_combo:17 duration:200t
        }
        else if <player.flag[kitpvp_combo]> == 17 {
            - narrate "<&a><&l>OCTADECA KILL (18)"
            - playsound <player> sound:ENDERDRAGON_GROWL volume:10 pitch:2
            - playeffect <player> effect:HAPPY_VILLAGER qty:100 data:1 offset:1.5
            - cast speed duration:10s power:1
            - flag player kitpvp_combo:18 duration:200t
        }
        else if <player.flag[kitpvp_combo]> == 18 {
            - narrate "<&a><&l>ENEADECA KILL (19)"
            - playsound <player> sound:ENDERDRAGON_GROWL volume:10 pitch:2
            - playeffect <player> effect:HAPPY_VILLAGER qty:100 data:1 offset:1.5
            - cast speed duration:10s power:1
            - flag player kitpvp_combo:19 duration:200t
        }
        else if <player.flag[kitpvp_combo]> == 19 {
            - narrate "<&a><&l>ICOSA KILL (20)"
            - playsound <server.list_online_players> sound:WITHER_DEATH volume:0.6 pitch:1
            - playeffect <player> effect:HAPPY_VILLAGER qty:100 data:1 offset:1.5
            - cast speed duration:10s power:1
            - flag player kitpvp_combo:20 duration:200t
            - announce "<&4><&l><player.name> har fået ICOSA KILL! (20)"
            - if <player.has_flag[kitpvp_icosa]> {
                - flag player kitpvp_icosa:++
            }
            else {
                - flag player kitpvp_icosa:1
            }
            - wait 3s
            - repeat 15 {
                - firework <player.location> star primary:yellow fade:white 
                - wait 5t
            }
            - flag player kitpvp_bounty:++
            - playsound <server.list_online_players> ORB_PICKUP Volume:0.2 Pitch:0.5
            - define action "<&6><player.name> <&1>er  <&6><&l><player.flag[kitpvp_spree].as_int> <&1>streaks! <&7>(BOUNTY<&co> <player.flag[kitpvp_bounty].as_int>)"
            - repeat 10 {
                - adjust <server.list_online_players> action_bar:<def[action]>
                - wait 1s
            }
        }
        else if <player.flag[kitpvp_combo].as_int> == 29 {
            - narrate "<&a><&l>TRIACONTA KILL (30)"
            - playsound <server.list_online_players> sound:WITHER_DEATH volume:0.6 pitch:1
            - playeffect <player> effect:HAPPY_VILLAGER qty:100 data:1 offset:1.5
            - cast speed duration:10s power:1
            - flag player kitpvp_combo:30 duration:200t
            - announce "<&6><&l><player.name> har fået TRIACONTA KILL! (30)"
            - wait 3s
            - repeat 15 {
                - firework <player.location> star primary:yellow fade:white 
                - wait 5t
            }
            - flag player kitpvp_bounty:++
            - playsound <server.list_online_players> ORB_PICKUP Volume:0.2 Pitch:0.5
            - define action "<&6><player.name> <&1>er  <&6><&l><player.flag[kitpvp_spree].as_int> <&1>streaks! <&7>(BOUNTY<&co> <player.flag[kitpvp_bounty].as_int>)"
            - repeat 10 {
                - adjust <server.list_online_players> action_bar:<def[action]>
                - wait 1s
            }
        }
        else if <player.flag[kitpvp_combo].as_int> == 39 {
            - narrate "<&a><&l>TETRACANTA KILL (40)"
            - playsound <server.list_online_players> sound:WITHER_DEATH volume:0.6 pitch:1
            - playeffect <player> effect:HAPPY_VILLAGER qty:100 data:1 offset:1.5
            - cast speed duration:10s power:1
            - flag player kitpvp_combo:40 duration:200t
            - announce "<&c><&l><player.name> har fået TETRACANTA KILL! (40)"
            - wait 3s
            - repeat 15 {
                - firework <player.location> star primary:yellow fade:white 
                - wait 5t
            }
            - flag player kitpvp_bounty:++
            - playsound <server.list_online_players> ORB_PICKUP Volume:0.2 Pitch:0.5
            - define action "<&6><player.name> <&1>er  <&6><&l><player.flag[kitpvp_spree].as_int> <&1>streaks! <&7>(BOUNTY<&co> <player.flag[kitpvp_bounty].as_int>)"
            - repeat 10 {
                - adjust <server.list_online_players> action_bar:<def[action]>
                - wait 1s
            }
        }
        else if <player.flag[kitpvp_combo].as_int> == 49 {
            - narrate "<&a><&l>PENTACONTA KILL (50)"
            - playsound <server.list_online_players> sound:WITHER_DEATH volume:0.6 pitch:1
            - playeffect <player> effect:HAPPY_VILLAGER qty:100 data:1 offset:1.5
            - cast speed duration:10s power:1
            - flag player kitpvp_combo:50 duration:200t
            - announce "<&c><&l><player.name> har fået PENTACONTA KILL! (50)"
            - wait 3s
            - repeat 15 {
                - firework <player.location> star primary:yellow fade:white 
                - wait 5t
            }
            - flag player kitpvp_bounty:++
            - playsound <server.list_online_players> ORB_PICKUP Volume:0.2 Pitch:0.5
            - define action "<&6><player.name> <&1>er  <&6><&l><player.flag[kitpvp_spree].as_int> <&1>streaks! <&7>(BOUNTY<&co> <player.flag[kitpvp_bounty].as_int>)"
            - repeat 10 {
                - adjust <server.list_online_players> action_bar:<def[action]>
                - wait 1s
            }
        }
        else {
            - flag player kitpvp_combo:++ duration:200t
            - narrate "<&6><&l><util.random.duuid> KILL (<player.flag[kitpvp_combo].as_int>)"
            - playsound <player> sound:ENDERDRAGON_GROWL volume:10 pitch:2
            - playeffect <player> effect:HAPPY_VILLAGER qty:100 data:1 offset:1.5
            - cast speed duration:10s power:1
            - firework <player.location> power:1 star primary:red trail
            - if kitpvp_combo:
        }
    }
    else {
        - flag player kitpvp_combo:1 duration:140t
    }


looping_scoreboard_script:
    type: task
    debug: false
    script:
    - while true {
        - foreach <server.list_online_players> {
            - wait 2t
            - run player_specific_scoreboard_script player:<def[value]> instantly 
        }
        - wait 2t
    }

player_specific_scoreboard_script:
    type: task 
    debug: false
    script: 
    ##Syntax: - sidebar (add/remove/{set}) (title:<title>) (lines:<#>|...) (values:<line>|...) (start:<#>/{num_of_lines}) (increment:<#>/{-1}) (players:<player>|...) (per_player)
    - define ID <player.name><server.current_time_millis>
    - scoreboard add id:<def[ID]> 
    - scoreboard add id:<def[ID]> "objective:<yaml[ggpvp_scoreboard].read[Text.Scoreboard_Header].parse_color>" "lines:<yaml[ggpvp_scoreboard].read[Text.Penge].parse_color>" "score:<player.money.as_int>"
    - scoreboard add id:<def[ID]> "objective:<yaml[ggpvp_scoreboard].read[Text.Scoreboard_Header].parse_color>" "lines:<yaml[ggpvp_scoreboard].read[Text.Online].parse_color>" "score:<server.list_online_players.size>"
    - scoreboard add id:<def[ID]> "objective:<yaml[ggpvp_scoreboard].read[Text.Scoreboard_Header].parse_color>" "lines:<yaml[ggpvp_scoreboard].read[Text.Kills].parse_color>" "score:<player.flag[kitpvp_kills].as_int>"
    ## - scoreboard add id:<def[ID]> "objective:<yaml[ggpvp_scoreboard].read[Text.Scoreboard_Header].parse_color>" "lines:<&e>TEST: <&7><server.current_time_millis>" "score:1"
    - scoreboard add id:<def[ID]> viewers:<player> 
    - wait <server.list_online_players.size.mul_int[2].add_int[<server.list_online_players.size>].add_int[2]>t
    - scoreboard remove id:<def[ID]>

RefreshScoreboard:
    type: command
    name: boardgo
    script:
    - if !<player.is_op> { 
        - narrate 'You must be an administrator to use this command!' 
        - queue clear 
    }
    - run looping_scoreboard_script instantly

KitPvpCommands:
    type: command
    name: kpstats
    script:
    - if <context.args.size> > 0 {
        - if <context.args.get[1]> == "help" {
            - narrate "<&7>/kpstats help"
            - narrate "<&7>/kpstats <&lt>player<&gt>"
            - if !<player.is_op> { 
                - narrate 'You must be an administrator to use this command!' 
                - queue clear 
            }
            - narrate "<&7>/kpstats reset <&lt>player<&gt>"
        }
        else if <context.args.get[1]> == "reset" {
            - if !<player.is_op> { 
                - narrate 'You must be an administrator to use this command!' 
                - queue clear 
            }
            - if %arg_size% == 1 {
                - narrate "<&c>Wrong arguments! Brug <&7>/kpstats help"
            }
            else {
                - narrate "<&7>Reseting <context.args.get[2]>..."
                - flag server ResetPlayerKitPvpFinder:<context.args.get[2]>
                - flag server ResetPlayerKitPvpCheck:False
                - foreach <server.list_online_players> {
                    - run ResetPlayerKitPvpRunner player:<def[value]> instantly 
                    - wait 1t
                }
                - if <server.flag[ResetPlayerKitPvpCheck]> == "True"
                    - narrate "<&7>Succesfully reset player<&co> <context.args.get[2]>"
                else {
                    - narrate "<&c>No player found to reset!"
                }
            }
        }
        else <context.args.size> == 1 {
            - define Target <server.match_offline_player[<context.args.get[1]>]||null>
            - if <def[Target]> == null {
                - narrate "Ingen spiller fundet!"
                - queue clear
            }
            - narrate "<&a><def[Target].name> har <&6><def[Target].flag[kitpvp_kills].as_int> <&a>kills."
            - queue clear
        }
        else {
            - narrate "<&c>For mange arguments! Brug <&7>/kpstats help"
        }
    }
    else {
        - narrate "<&a>Du har <&6><player.flag[kitpvp_kills].as_int> <&a>kills." 
    }

ResetPlayerKitPvpRunner:
    type: task 
    script: 
    - if <player.name> == <server.flag[ResetPlayerKitPvpFinder]> {
        ## Check plugin ! <pl@plugin.name> <el@element.as_plugin>
        ##
        - narrate "<&a>Dine stats er nu blevet reset!"
        - flag player kitpvp_kills:0
        - flag player kitpvp_deaths:0
        - flag server ResetPlayerKitPvpCheck:True
    }