Paste #21483: LuckyBlocks

Date: 2015/10/24 20:41:37 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


# Author SeqSee 
# LuckyBlock v1.4
# Denizen Script to create LuckyBlock plugin

LuckyBlock Commands:
  type: world
  events:
    on luckyblock command:
    - define arg_size <context.args.size> 
    - if %arg_size% == 0 {
      - run LuckyBlockInfo
      - determine fulfilled
      }
      else { 
        - if <context.args.get[1]> == "help" {
          - narrate '<white>Command Usage:'
          - narrate '<gold>/luckyblock <yellow><&lt>Arguments<&gt>' 
          - narrate '<gold>/luckyblock<white> Basic instructions for using LuckyBlocks.'
          - narrate '<gold>/luckyblock <yellow>ver<white> Diplays current version of dLuckyBlock.'
          - narrate '<gold>/luckyblock <yellow>give <&lt>Player<&gt> <&lt>Qty<&gt><white> Gives LuckyBlock(s)'
          - determine fulfilled
          }
          else if <context.args.get[1]> == "ver" {
          - narrate '<gold>dLuckyBlock v1.4<yellow> by SeqSEE'
          - determine fulfilled
          }
          else if <context.args.get[1]> == "give" {
          - define Player <server.match_player[<context.args.get[2]>]>
          - if <def[Player]> == null {              
             - give i@sponge qty:1
             - determine fulfilled
            }
            else {
              - if <context.args.get[3].length> == 0 {
              - give i@sponge qty:1 player:<def[Player]>
                - determine fulfilled
                }
                else {
                  - if <context.args.get[3]> == null {
                  - give i@sponge qty:1 player:<def[Player]>
                  - determine fulfilled
                  }
                  - if <context.args.get[3]> matches number {
                    - give i@sponge qty:<context.args.get[3]> player:<def[Player]>
                    - determine fulfilled
                    }
                    else {
                    - narrate "<red><context.args.get[3]> is not a valid quantity!"
                    - determine fulfilled
                    }
                }

            } 
          }





          else if <context.args.get[1]> != ver && <context.args.get[1]> != help && <context.args.get[1]> != give {
          - narrate '<red>Unknown Argument(s)!'
          - determine fulfilled
          }
      }
LuckyBlockInfo:
  type: task
  script:
    - narrate "Place LuckyBlocks and break them for surprises!"
    - wait 1 
    - narrate "Wet LuckyBlocks are more potent, so to speak."

dLuckyBlock: 
  type: world 
  events: 
    on server start:
    - run 'BlockListener'
    - determine fulfilled

BlockListener: 
  type: world 
  events: 
    on player breaks block:
    - flag "BlockLocation:<context.location>"
    - if <context.material> == m@sponge {
      - run 'DryBroken'
      - determine "NOTHING"
      - run 'BlockListener'
      }
      else if <context.material> == m@sponge,1 {
      - run 'WetBroken'
      - determine "NOTHING"
      - run 'BlockListener'
      }
      else {
      - run 'BlockListener'
      }
DryBroken:
  type: task
  script:
  - random 8
  - run Popcorn
  - drop i@gold_ingot <player.flag[BlockLocation]> qty:32
  - spawn zombie|zombie|zombie <player.flag[BlockLocation]>
  - drop i@iron_sword|i@iron_chestplate|i@iron_leggings|i@iron_helmet| <player.flag[BlockLocation]> qty:1
  - run SkeleBats
  - explode power:5 <player.flag[BlockLocation]> fire breakblocks
  - drop i@iron_ingot <player.flag[BlockLocation]> qty:64
  - drop i@diamond <player.flag[BlockLocation]> qty:16
WetBroken:
  type: task
  script:
  - random 9
  - run ZombiesOnChickens
  - run BombBats 
  - drop i@diamond_block <player.flag[BlockLocation]> qty:1
  - drop i@gold_block <player.flag[BlockLocation]> qty:5
  - spawn creeper|creeper|creeper|creeper|creeper <player.flag[BlockLocation]> persistent
  - drop i@diamond_sword|i@diamond_chestplate|i@diamond_leggings|i@diamond_helmet| <player.flag[BlockLocation]>
  - run SpiderJokeys
  - run Skelombie
  - run BurriedAlive
GiveLightDamage:
  type: task
  script:
  # Gives player light damage.
  - hurt 2.5 <player> 
GiveMediumDamage:
  type: task
  script:
  # Gives player medium damage.
  - hurt 5 <player> 
GiveHeavyDamage:
  type: task
  script:
  # Gives player heavy damage.
  - hurt 10 <player> 
BombBats:
  type: task
  script:
  - mount e@primed_tnt|bat <player.flag[BlockLocation]>
  - mount e@primed_tnt|bat <player.flag[BlockLocation]>
  - mount e@primed_tnt|bat <player.flag[BlockLocation]>
  - mount e@primed_tnt|bat <player.flag[BlockLocation]>
  - mount e@primed_tnt|bat <player.flag[BlockLocation]>
  - mount e@primed_tnt|bat <player.flag[BlockLocation]>
SkeleBats:
  type: task
  script:
  - mount e@Skeleton|bat <player.flag[BlockLocation]>
  - mount e@Skeleton|bat <player.flag[BlockLocation]>
  - mount e@Skeleton|bat <player.flag[BlockLocation]>
  - mount e@Skeleton|bat <player.flag[BlockLocation]>
  - mount e@Skeleton|bat <player.flag[BlockLocation]>
  - mount e@Skeleton|bat <player.flag[BlockLocation]>
SpiderJokeys:
  type: task
  script:
  - mount e@Skeleton|Spider <player.flag[BlockLocation]>
  - mount e@Skeleton|Spider <player.flag[BlockLocation]>
  - mount e@Skeleton|Spider <player.flag[BlockLocation]>
  - mount e@Skeleton|Spider <player.flag[BlockLocation]>
  - mount e@Skeleton|Spider <player.flag[BlockLocation]>
  - mount e@Skeleton|Spider <player.flag[BlockLocation]>
ZombiesOnChickens:
  type: task
  script:
  - mount e@Zombie|chicken <player.flag[BlockLocation]>
  - mount e@Zombie|chicken <player.flag[BlockLocation]>
  - mount e@Zombie|chicken <player.flag[BlockLocation]>
  - mount e@Zombie|chicken <player.flag[BlockLocation]>
  - mount e@Zombie|chicken <player.flag[BlockLocation]>
  - mount e@Zombie|chicken <player.flag[BlockLocation]>
Skelombie:
  type: task
  script:
  - mount e@Skeleton|zombie <player.flag[BlockLocation]>
  - mount e@Skeleton|zombie <player.flag[BlockLocation]>  
  - mount e@Skeleton|zombie <player.flag[BlockLocation]>  
  - mount e@Skeleton|zombie <player.flag[BlockLocation]>
  - mount e@Skeleton|zombie <player.flag[BlockLocation]>
  - mount e@Skeleton|zombie <player.flag[BlockLocation]>  
Popcorn:
  type: task
  script:
  - shoot <player> origin:<player.location> destination:<player.location.add[0,20,0]> script:GiveMediumDamage
  - narrate "Popcorn!"
BurriedAlive:
  type: task
  script:
  - teleport <player> <player.location.sub[0,4,0]> 
  - run GiveHeavyDamage
  - narrate "Burried Alive!"