Paste #7133: bleh5

Date: 2014/07/19 08:47:12 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


TheBloodMoon:
  type: world
  debug: true
  events:
    on time changes in world:
    - if (<<context.time> >= 20 && <context.time> <= 24>) || (<<context.time> >= 0 && <context.time> <= 5>>)  {
      - run TheBloodMoonTask
      }
    on 6:00 in world:
    - execute as_server "butcher"

TheBloodMoonTask:
    type: task 
    debug: true 
    script: 
    - define bloodmoon <util.random.int[1].to[20]> 
    - if %bloodmoon% == 1 { 
      - announce "Hurry and dig in in hell has broke loose" 
      - foreach <server.list_online_players> { 
        - define target %value% 
        - repeat <util.random.int[1].to[50]> { 
          - define r <util.random.int[1].to[5]> 
          - if %r% == 1 { 
            - define mob pig_Zombie 
            } 
            else if %r% == 2 { 
            - define mob Blaze 
            } 
            else if %r% == 3 { 
            - define mob Magma_Cube 
            } 
            else if %r% == 4 { 
            - define mob Lightning 
            } 
            else if %r% == 5 { 
            - define mob GHAST 
            } 
          - define mobspot <def[target].location.get_chunk.surface_blocks.random> 
          - spawn %mob% %mobspot% 
          } 
        - if <util.random.int[1].to[1000]> == 123 { 
          - define mobspot <def[target].location.get_chunk.surface_blocks.random> 
          - spawn WITHER %mobspot% 
          } 
        } 
      } 
      else { 
      - announce "You are safe for now" 
      }