Paste #44428: Untitled Paste

Date: 2017/09/14 14:35:08 UTC-07: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
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


Plot_Config_Events:
    type: world
    events:
        on gm command:
        - inject Plot_Config_Gamemode_Command_Check

        on gamemode command:
        - inject Plot_Config_Gamemode_Command_Check

        on survival command:
        - inject Plot_Config_Gamemode_Command_Check

        on creative command:
        - inject Plot_Config_Gamemode_Command_Check

        on gm1 command:
        - inject Plot_Config_Gamemode_Command_Check

        on gm0 command:
        - inject Plot_Config_Gamemode_Command_Check

        on gms command:
        - inject Plot_Config_Gamemode_Command_Check

        on gmc command:
        - inject Plot_Config_Gamemode_Command_Check

        # on player changes gamemode:
        # - inject Plot_Config_Gamemode_Command_Check

        on plotsquared player enters plotsquaredplot:
        - announce "<&7>Test Enter <player.name> <context.plot>" to_ops
        - define plot <context.plot>
        - if <server.has_flag[Plots.<def[plot]>.Config.lock_gamemode]> {
            - inject Plot_Config_Ignore_OwnerTrust_Task
            - define gm <server.flag[Plots.<def[plot]>.Config.lock_gamemode]>
            - if <player.gamemode> != <def[gm]> {
                - flag player Last_Gamemode:<player.gamemode>
                - narrate format:util_ff "<&7>Dette plot-gamemode er låst til<&co> <&6><def[gm]>"
                - adjust <player> gamemode:Spectator
            }
        }

        on plotsquared player leaves plotsquaredplot:
        - announce "<&7>Test Exit <player.name> <context.plot>" to_ops
        - if <player.has_flag[Last_Gamemode]> {
            - define gm <player.flag[Last_Gamemode]>
            - narrate format:util_ff "<&7>Du er blevet sat tilbage til <player.flag[Last_Gamemode]>"
            - adjust <player> gamemode:<player.flag[Last_Gamemode]>
            - flag player Last_Gamemode:!
        }

        on player clicks Plot_Config_Item_Time in Plot_Config_MainMenu:
         - determine cancelled passively
        - define plot <player.flag[Plot_Config_Target].as_plotsquared_plot>
        - if <server.flag[Plots.<def[plot]>.Config.Time]||null> == "Dag" {
            - flag server Plots.<def[plot]>.Config.Time:Aften
        }
        else if <server.flag[Plots.<def[plot]>.Config.Time]||null> == Aften {
            - execute as_player "plot flag set time 12000"
            - flag server Plots.<def[plot]>.Config.Time:Nat
        }
        else if <server.flag[Plots.<def[plot]>.Config.Time]||null> == Nat {
            - execute as_player "plot flag set time 18000"
            - flag server Plots.<def[plot]>.Config.Time:Morgen
        }
        else if <server.flag[Plots.<def[plot]>.Config.Time]||null> == Morgen {
            - execute as_player "plot flag set time 0"
            - flag server Plots.<def[plot]>.Config.Time:!
        }
        else {
            - execute as_player "plot flag set time 6000"
            - flag server Plots.<def[plot]>.Config.Time:Dag
        }
        - flag server Plot_Config_Target:<def[plot]>
        - inventory open d:in@Plot_Config_MainMenu


        on player clicks Plot_Config_Item_Weather in Plot_Config_MainMenu:
        - determine cancelled passively
        - define plot <player.flag[Plot_Config_Target].as_plotsquared_plot>
        - if <server.flag[Plots.<def[plot]>.Config.Weather]||null> == Rain {
            - flag server Plots.<def[plot]>.Config.Weather:!
            - execute as_player "plot flag set weather sunny"
        }
        else {
            - flag server Plots.<def[plot]>.Config.Weather:Rain
            - execute as_player "plot flag set weather rain"
        }
        - flag server Plot_Config_Target:<def[plot]>
        - inventory open d:in@Plot_Config_MainMenu

        on player clicks Plot_Config_Item_LockGamemode in Plot_Config_MainMenu:
        - determine cancelled passively
        - define plot <player.flag[Plot_Config_Target].as_plotsquared_plot>
        - if <server.flag[Plots.<def[plot]>.Config.lock_gamemode]||null> == Survival {
            - flag server Plots.<def[plot]>.Config.lock_gamemode:Adventure
        }
        else if <server.flag[Plots.<def[plot]>.Config.lock_gamemode]||null> == Adventure {
            - flag server Plots.<def[plot]>.Config.lock_gamemode:Spectator
        }
        else if <server.flag[Plots.<def[plot]>.Config.lock_gamemode]||null> == Spectator {
            - flag server Plots.<def[plot]>.Config.lock_gamemode:!
        }
        else {
            - flag server Plots.<def[plot]>.Config.lock_gamemode:Survival
        }
        - flag server Plot_Config_Target:<def[plot]>
        - inventory open d:in@Plot_Config_MainMenu

        on player clicks Plot_Config_Item_SetPlotHome in Plot_Config_MainMenu:
        - determine cancelled passively
        - inventory close d:<context.inventory>
        - execute as_player "plot sethome"

        on player clicks Plot_Config_Item_Back:
        - determine cancelled passively
        - flag server Plot_Config_Target:<def[plot]>
        - inventory open d:in@Plot_Config_MainMenu

        on player drags in Plot_Config_MainMenu:
        - determine cancelled passively

Plot_Config_Ignore_OwnerTrust_Task:
    type: task
    script:
    # - define plot 
    - if <def[plot]> == null {
        - queue clear
    }
    - if <def[plot].owners.include[<def[plot].trusted>].contains[<player>]||true> {
        - queue clear
    }

Plot_Config_Gamemode_Command_Check:
    type: task
    script:
    - define plot <player.location.plotsquared_plot||null>
    - inject Plot_Config_Ignore_OwnerTrust_Task
    - if <server.has_flag[Plots.<def[plot]>.Config.lock_gamemode]> {
        - determine cancelled passively
        - narrate format:util_ff "<&c>Dette plot har gamemode låst til <&e><server.flag[Plots.<def[plot]>.Config.lock_gamemode]>"
        - narrate format:util_ff "<&7>Hvis du gerne vil ud,  brug <&b>/spawn"
        - queue clear
    }

Plot_Config_Command:
    type: command
    name: plotconfig
    usage: /plotconfig
    description: Command to open config for plot
    aliases:
    - pconfig
    - pmeconfig
    - plotcon
    - pcon
    script:
    - inject Plot_Config_OpenMenu

Plot_Config_OpenMenu:
    type: task
    script:
    - define plot <player.location.plotsquared_plot||null>
    - if <def[plot]> == null {
        - narrate format:util_ff "<&c>Du er ikke  noget plot!"
        - queue clear
    }
    - if <def[plot].owners.include[<def[plot].trusted>].deduplicate.contains[<player>].not||true> {
        - narrate format:util_ff "<&c>Du er ikke ejer eller trusted  dette plot!"
        - queue clear
    }
    - flag player Plot_Config_Target:<def[plot]>
    - flag server Plot_Config_Target:<def[plot]>
    - inventory open d:in@Plot_Config_MainMenu

##############################################################################################################
############ Main Menu
##############################################################################################################           

Plot_Config_MainMenu:
  type: inventory 
  inventory: CHEST
  title: <&3>Plot Config
  size: 27
  definitions: 
    GM: Plot_Config_Item_LockGamemode
    # Cmds: Plot_Config_Item_CommandSettings
    Time: Plot_Config_Item_Time
    Weather: Plot_Config_Item_Weather
    Home: Plot_Config_Item_SetPlotHome
    # NoteBlock: Plot_Config_Item_Music
    BeaconDrop: Plot_Config_Item_DropBeacon
  slots:
    - "[] [GM] [Time] [Weather] [] [] [] [] []"
    - "[] [Home] [] [] [] [] [] [] []"
    - "[] [BeaconDrop] [] [] [] [] [] [] []"

# Block /gm

## Lock Commandoer
# Kan ikke bruge kommandoer undtagen whitelisted
# /gm (Gamemode Kommandoer)
# /god
# /fly
# /tpyes/tpa/back/home/thru/top(Teleport Kommandoer) (Compass) 
# /item/kit (Spawn item/kits)
# /eec/craft/enderchest (Kister/Craft Kommandoer)
# /ast
# /mines
# /speed (default sat til 1 hvis slået fra)
# /

## Block Perm


Plot_Config_Item_Toggle_Proc:
    type: procedure
    definitions: type|opposite
    script:
    - define plot <server.flag[Plot_Config_Target].as_plotsquared_plot>
    - if <server.has_flag[Plots.<def[plot]>.Config.<def[type]>]> {
        - if <def[opposite].exists> {
            - determine "<&c>Slået Fra"
        }
        - determine "<&a><server.flag[Plots.<def[plot]>.Config.<def[type]>]>"
    }
    - if <def[opposite].exists> {
        - determine "<&a>Slået Til"
    }
    - determine "<&c>Slået Fra"

Plot_Config_Item_Amount_Proc:
    type: procedure
    definitions: type|default
    script:
    - define plot <server.flag[Plot_Config_Target].as_plotsquared_plot>
    - if <server.has_flag[Plots.<def[plot]>.Config.<def[type]>]> {
        - determine "<&a><server.flag[Plots.<def[plot]>.Config.<def[type]>]>"
    }
    - determine "<&a><def[default]>"

Plot_Config_Item_LockGamemode:
    type: item
    material: LOG
    display name: <&b><&l>Force Gamemode
    lore:
    - "<&3>Status<&co> <proc[Plot_Config_Item_Toggle_Proc].context[lock_gamemode]>"
    - "<&3>Låser dit gamemode  dit plot"
    - "<&3> spillere ikke kan ændre deres gamemode."
    - "<&3>Hvis en spiller ikke er i den korrekte gamemode,"
    - "<&3>bliver de istedet sat til spectator."
    - "<&e>En spiller skal ændre sit gamemode"
    - "<&e>før de træder ind  plottet!""

Plot_Config_Item_Time:
    type: item
    material: WATCH
    display name: <&b><&l>Time
    lore:
    - "<&3>Status<&co> <proc[Plot_Config_Item_Toggle_Proc].context[lock_gamemode]>"
    - "<&3>Ændre tiden  dit plot for dig og dine spillere."
    - "<&3>Nogen ting ser bedre ud om natten."

Plot_Config_Item_CommandSettings:
    type: item
    material: COMMAND
    display name: <&b><&l>Command Settings
    lore:
    - "<&3>Åbner indstillinger hvor du kan"
    - "<&3>ændre adgang til hvilke kommandoer"
    - "<&3>spillere har adgang til  dit plot."
    - "<&e>Ikke alle kommandoer kan ændres!"

Plot_Config_Item_Weather:
    type: item
    material: GHAST_TEAR
    display name: <&b><&l>Weather
    lore:
    - "<&3>Status<&co> <proc[Plot_Config_Item_Toggle_Proc].context[weather]>"
    - "<&3>Ændrer vejret  dit plot."
    - "<&e>Regn og Sne kan give client lag!"

Plot_Config_Item_SetPlotHome:
    type: item
    material: BED
    display name: <&b><&l>Set Plot Home
    lore:
    - "<&3>Sætter dit plot home til der hvor du står."
    - "<&3>Dette fungere ligesom at sætte spawn."
    - "<&3>Spillere der teleportere til dit plot, vil"
    - "<&3>blive teleportet til det home du har sat."

Plot_Config_Item_KitSettings:
    type: item
    material: DIAMOND_SWORD
    display name: <&b><&l>Kit Settings
    lore:
    - "<&3>Åbner indstillinger til plot kits."
    - "<&3>Opret eller ændre kits  dit plot."

Plot_Config_Item_RespawnHome:
    type: item
    material: BED
    display name: <&b><&l>Home Respawn
    lore:
    - "<&3>Status<&co> <proc[Plot_Config_Item_Toggle_Proc].context[respawn]>"
    - "<&3>Hvis en spiller dør  dit plot,"
    - "<&3> respawner de  plot home."
    - "<&e>Deaktivere automatisk hvis det abuses."
    # VIP ?

Plot_Config_Item_ComboKills:
    type: item
    material: DIAMOND_AXE
    display name: <&b><&l>Combo Kills
    lore:
    - "<&3>Status<&co> <proc[Plot_Config_Item_Toggle_Proc].context[combo]>"
    - "<&3>Combo system  dit plot."
    - "<&3>Bruges til "
    - "<&3>Op til 100 combo med broadcast og effekter."
    # VIP ?

Plot_Config_Item_DropBeacon:
    type: item
    material: BEACON
    display name: <&b><&l>Drop Beacon Indstillinger
    lore:
    - "<&3>Åbner indstillinger til din drop beacon."
    - "<&3>Derinde kan du også opsætte din drop beacon."

Plot_Config_Item_Back:
    type: item
    material: BEACON
    display name: <&b><&l>Back
    lore:
    - "<&3>Går tilbage til hovedmenuen."

##############################################################################################################
############ Drop Beacon
##############################################################################################################

Plot_Config_Events:
    type: world
    events:
        on player clicks Plot_Config_DropBeacon_Item_Setup in Plot_Config_DropBeacon_Menu:
        - determine cancelled passively
        - inventory close d:<context.inventory>
        - execute as_player "setbeacon"

        on player clicks Plot_Config_DropBeacon_Item_Need in Plot_Config_DropBeacon_Menu:
        - determine cancelled passively
        - define plot <player.flag[Plot_Config_Target].as_plotsquared_plot>
        - define flag <server.flag[Plots.<def[plot]>.Config.DropBeacon.Players_Need]||null>
        - if <def[flag]> == 5 {
            - flag server Plots.<def[plot]>.Config.DropBeacon.Players_Need:10
        }
        else if <def[flag]> == 10 {
            - flag server Plots.<def[plot]>.Config.DropBeacon.Players_Need:15
        }
        else if <def[flag]> == 15 {
            - flag server Plots.<def[plot]>.Config.DropBeacon.Players_Need:20
        }
        else if <def[flag]> == 20 {
            - flag server Plots.<def[plot]>.Config.DropBeacon.Players_Need:25
        }
        else if <def[flag]> == 25 {
            - flag server Plots.<def[plot]>.Config.DropBeacon.Players_Need:50
        }
        else if <def[flag]> == 50 {
            - flag server Plots.<def[plot]>.Config.DropBeacon.Players_Need:1
        }
        else if <def[flag]> == 1 {
            - flag server Plots.<def[plot]>.Config.DropBeacon.Players_Need:!
        }
        else {
            - flag server Plots.<def[plot]>.Config.DropBeacon.Players_Need:5
        }
        - flag server Plot_Config_Target:<def[plot]>
        - inventory open d:in@Plot_Config_DropBeacon_Menu

        on player clicks Plot_Config_DropBeacon_Item_Amount in Plot_Config_DropBeacon_Menu:
        - determine cancelled passively
        - define plot <player.flag[Plot_Config_Target].as_plotsquared_plot>
        - define flag <server.flag[Plots.<def[plot]>.Config.DropBeacon.Amount]||null>
        - if <def[flag]> == 150 {
            - flag server Plots.<def[plot]>.Config.DropBeacon.Amount:200
        }
        else if <def[flag]> == 200 {
            - flag server Plots.<def[plot]>.Config.DropBeacon.Amount:10
        }
        else if <def[flag]> == 10 {
            - flag server Plots.<def[plot]>.Config.DropBeacon.Amount:25
        }
        else if <def[flag]> == 25 {
            - flag server Plots.<def[plot]>.Config.DropBeacon.Amount:50
        }
        else if <def[flag]> == 50 {
            - flag server Plots.<def[plot]>.Config.DropBeacon.Amount:80
        }
        else if <def[flag]> == 80 {
            - flag server Plots.<def[plot]>.Config.DropBeacon.Amount:!
        }
        else {
            - flag server Plots.<def[plot]>.Config.DropBeacon.Amount:150
        }
        - flag server Plot_Config_Target:<def[plot]>
        - inventory open d:in@Plot_Config_DropBeacon_Menu

        on player clicks Plot_Config_DropBeacon_Item_Cooldown in Plot_Config_DropBeacon_Menu:
        - determine cancelled passively
        - define plot <player.flag[Plot_Config_Target].as_plotsquared_plot>
        - define flag <server.flag[Plots.<def[plot]>.Config.DropBeacon.Amount]||null>
        - if <def[flag]> == 30m {
            - flag server Plots.<def[plot]>.Config.DropBeacon.Amount:60m
        }
        else if <def[flag]> == 60m {
            - flag server Plots.<def[plot]>.Config.DropBeacon.Amount:1m
        }
        else if <def[flag]> == 1m {
            - flag server Plots.<def[plot]>.Config.DropBeacon.Amount:3m
        }
        else if <def[flag]> == 3m {
            - flag server Plots.<def[plot]>.Config.DropBeacon.Amount:5m
        }
        else if <def[flag]> == 5m {
            - flag server Plots.<def[plot]>.Config.DropBeacon.Amount:10m
        }
        else if <def[flag]> == 10m {
            - flag server Plots.<def[plot]>.Config.DropBeacon.Amount:!
        }
        else {
            - flag server Plots.<def[plot]>.Config.DropBeacon.Amount:30m
        }
        - flag server Plot_Config_Target:<def[plot]>
        - inventory open d:in@Plot_Config_DropBeacon_Menu

        on player drags in Plot_Config_DropBeacon_Menu:
        - determine cancelled passively

Plot_Config_DropBeacon_Menu:
  type: inventory 
  inventory: CHEST
  title: <&3>Drop Beacon Instillinger
  size: 27
  definitions: 
    Back: Plot_Config_Item_Back
    Setup: Plot_Config_DropBeacon_Item_Setup
    Need: Plot_Config_DropBeacon_Item_Need
    Cooldown: Plot_Config_DropBeacon_Item_Cooldown
    Amount: Plot_Config_DropBeacon_Item_Amount
  slots:
    - "[Back] [] [Setup] [] [Need] [] [Cooldown] [] [Amount]"

Plot_Config_DropBeacon_Item_Setup:
    type: item
    material: BEACON
    display name: <&b><&l>Install Drop Beacon
    lore:
    - "<&3>Opsætter drop beacon til en beacon block."
    - "<&3>Dette fungere ligesom /setbeacon"

Plot_Config_DropBeacon_Item_Need:
    type: item
    material: NETHER_STAR
    display name: <&b><&l>Players Needed
    lore:
    - "<&3>Status<&co> <proc[Plot_Config_Item_Amount_Proc].context[DropBeacon.Players_Need|<s@DropBeacon_Data.yaml_key[config.players]>]>"
    - "<&3>Sætter hvor mange spillere der skal være  dit plot."

Plot_Config_DropBeacon_Item_Amount:
    type: item
    material: NETHER_STAR
    display name: <&b><&l>Drop Amount
    lore:
    - "<&3>Status<&co> <proc[Plot_Config_Item_Amount_Proc].context[DropBeacon.Amount|<s@DropBeacon_Data.yaml_key[config.amount.drop_total]>]>"
    - "<&3>Sætter hvor meget der skal droppes hver gang."

Plot_Config_DropBeacon_Item_Cooldown:
    type: item
    material: WATCH
    display name: <&b><&l>Cooldown
    lore:
    - "<&3>Status<&co> <proc[Plot_Config_Item_Amount_Proc].context[DropBeacon.Cooldown|<s@DropBeacon_Data.yaml_key[config.cooldown]>]>"
    - "<&3>Sætter cooldown  mellem hvert drop."