Paste #72709: Hourly Boss Spawns - Chano

Date: 2020/07/21 18:07:17 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


#======================================================#
# Script by Chano
# Zen Bosses
# Boss Spawn Intervals
# July 19, 2020
#======================================================#

########################################################
############## Boss Spawn Interval & Wipe ##############
########################################################

boss_interval:
    type: world
    debug: false
    events:
        after system time hourly:
        - if <server.flag[boss_count]> < 1:
          - narrate "<&c><&l>A Boss is summoning in the WarZone!" targets:<server.online_players>
          - playsound <server.online_players> sound:ENTITY_DRAGON_FIREBALL_EXPLODE volume:1 pitch:1
          - random:
            - mythicspawn RavagerKnight boss1 level:<util.random.int[1].to[16]>
            - mythicspawn PeaceKnight boss1 level:<util.random.int[1].to[16]>
            - mythicspawn AncientWitch boss1 level:<util.random.int[1].to[16]>
            - mythicspawn Chano boss1 level:<util.random.int[1].to[16]>
          - flag server boss_count:++
          - run boss_wipe
          - stop
        - else:
          - narrate "<&c><&l>There is a Boss in the Warzone!" targets:<server.online_players>
          - stop

boss_wipe:
    type: task
    script:
    - if <server.flag[boss_count]> > 1:
      - wait 150m
      - execute as_server "mm m killall"
      - flag server boss_count:--
      - stop
    - else:
      - stop

boss_death:
    type: world
    debug: false
    events:
        after mythicmob mob dies:
        - narrate "<&c><&l>The Boss was Defeated!" targets:<server.online_players>
        - flag server boss_count:--
        - stop

########################################################
##################### Boss Items #######################
########################################################

spawn_artifact:
    type: item
    material: player_head
    display name: <&0><&l><&k>ll <&c><bold>Ancient Artifact <&0><&l><&k>ll
    lore:
    - <&a>Right Click <&c>to Spawn a Boss in the WarZone
    mechanisms:
        skull_skin: 332316cf-8bbc-4e80-8014-a2321a75eb1f|eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMjc4NGI3MTVjMGQyYjE1MGI1NTZmMTZhMjQ2NDBkYWZmMjk3YTRlYzFiZmQ4Nzc1MTk5MDY2MmFjMzZlYjIifX19

spawn_artifacts_click:
    type: world
    debug: false
    events:
        after player right clicks with:spawn_artifact:
        - if <server.flag[boss_count]> >= 1:
            - narrate "<&c><&l>There are already the Maximum anount of Bosses in the WarZone! Try again later!"
            - stop
        - take iteminhand amount:1
        - playsound <player> sound:ENTITY_EXPERIENCE_ORB_PICKUP volume:1 pitch:1
        - narrate "<&b><&l><player.name> <&7>Has Used an <&c><&l>Ancient Artifact!" targets:<server.online_players>
        - narrate "<&c><&l>A Boss is summoning in the WarZone!" targets:<server.online_players>
        - random:
            - mythicspawn RavagerKnight boss1 level:<util.random.int[1].to[20]>
            - mythicspawn PeaceKnight boss1 level:<util.random.int[1].to[20]>
            - mythicspawn AncientWitch boss1 level:<util.random.int[1].to[20]>
            - mythicspawn Chano boss1 level:<util.random.int[1].to[20]>
        - playsound <server.online_players> sound:ENTITY_DRAGON_FIREBALL_EXPLODE volume:1 pitch:1
        - flag server boss_count:++
        - stop

########################################################
###################### Commands ########################
########################################################

boss_spawn_cmd:
    type: command
    name: spawnboss
    description: Spawns a Boss Randomly
    usage: /spawnboss
    aliases:
    - zenboss
    - bossspawn
    permission: zenith.admin
    permission message: <&c>Sorry, <&b><player.name>, <&c>You must be staff to use this!
    script:
    - playsound <player> sound:ENTITY_EXPERIENCE_ORB_PICKUP volume:1 pitch:1
    - narrate "<&b><&l><player.name> <&7>Has Used an <&c><&l>Ancient Artifact!" targets:<server.online_players>
    - narrate "<&c><&l>A Boss is summoning in the WarZone!" targets:<server.online_players>
    - random:
      - mythicspawn RavagerKnight boss1 level:<util.random.int[1].to[16]>
      - mythicspawn PeaceKnight boss1 level:<util.random.int[1].to[16]>
      - mythicspawn AncientWitch boss1 level:<util.random.int[1].to[16]>
      - mythicspawn Chano boss1 level:<util.random.int[1].to[16]>
    - playsound <server.online_players> sound:ENTITY_DRAGON_FIREBALL_EXPLODE volume:1 pitch:1
    - flag server boss_count:++
    - stop

give_spawn_artifact:
    type: command
    name: spawnartifact
    usage: /spawnartifact [player] [amount]
    description: gives the player a spawnartifact.
    permission: zenith.admin
    script:
    - if <context.args.size> < 2:
        - narrate "<red>/spawnartifact [player] [amount]"
        - stop
    - define target <server.match_player[<context.args.get[1]>]||null>
    - if <[target]> == null:
        - narrate "<red>Unknown player '<yellow><context.args.get[1]><red>'."
        - stop
    - define amount <context.args.get[2]>
    - if !<[amount].is_decimal>:
        - narrate "<red>Invalid amount input (not a number)."
        - stop
    - if <[amount]> <= 0:
        - narrate "<red>Amount must be more than zero."
        - stop
    - give spawn_artifact player:<[target]> quantity:<[amount]>
    - stop

boss_wipe_cmd:
    type: command
    name: wipebosses
    usage: /wipebosses
    description: kills all bosses
    permission: zenith.admin
    script:
    - narrate "<&c><&l>Bosses Wiped and Counter Reset!"
    - execute as_server "mm m killall"
    - flag server boss_count:--
    - stop