Paste #6156: Untitled Paste

Date: 2014/07/02 19:28:15 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


'Bomable Arrow':
  type: item 
  material: arrow 
  display name: Bombable Arrow 
  recipe: 
  - i@air|i@77|i@air 
  - i@air|i@46|i@air 
  - i@air|i@262|i@air
  bound: true 
  lore: 
  - Explosive 

'Emerald Arrow':
  type: item 
  material: arrow 
  display name: Emerald Arrow
  recipe: 
  - i@air|i@77|i@air 
  - i@air|i@388|i@air 
  - i@air|i@262|i@air 
  bound: true 
  lore: 
  - Strong 

Firework Arrow:
  type: item 
  material: arrow
  display name: Firework Arrow
  recipe: 
  - i@air|i@77|i@air
  - i@air|i@401|i@air
  - i@air|i@262|i@air
  lore:
  - <&a>Fire this arrow
  - <&b>for magic funtime
  - <&c>surprise!

'Arrow Power':
  type: world 
  events: 
    on entity shoots bow:
    - define consumed_arrow <player.inventory.slot[<player.inventory.find.material[arrow]>]>  
    - if %consumed_arrow% == i@Bomable Arrow { 
      - flag server <context.projectile>:bomablearrow duration:30s 
      } 
      else if %consumed_arrow% == i@Emerald Arrow { 
      - flag server <context.projectile>:Emerald Arrow duration:30s
      } 
      else if %consumed_arrow% == i@Firework Arrow { 
      - flag server <context.projectile>:Firework Arrow duration:30s 
      } 
    on projectile hits block:
    - define consumed_arrow <server.flag[<context.projectile>]||none> 
    - if %consumed_arrow% == Bomable Arrow { 
      - explode power:4 <context.location>
      - foreach <player.location.cursor_on.find.living_entities.within[5].exclude[<server.list_online_players>]> 
      - hurt <el@val[20].sub[<%value%.location.distance[<context.location>]>]> %value%
      } 
      else if %consumed_arrow% == 'Emerald Arrow' {
      - foreach <player.location.cursor_on.find.living_entities.within[1].exclude[<server.list_online_players>]> 
      - hurt <el@val[20].sub[<%value%.location.distance[<context.location>]>]> %value%
      } 
      else if %consumed_arrow% == 'Firework Arrow' {
      - foreach <player.location.cursor_on.find.living_entities.within[10].exclude[<server.list_online_players>]> 
      - run firework_arrow_handler_internal def:<context.entity.location> as:<context.damager> 
      - hurt <el@val[20].sub[<%value%.location.distance[<context.location>]>]> %value%
      }
firework_arrow_handler_internal:
    type: task 
    debug: false 
    speed: 2t 
    script: 
    - if <player.flag[firework_arrow]> { 
      - flag player firework_arrow:! 
      - define t1 <li@ball|creeper.random>,<util.random.int[1].to[255]>,<util.random.int[1].to[255]>,<util.random.int[1].to[255]> 
      - explode %1% power:2 breakblocks fire 
      - spawn %1% firework[firework_item=i@firework[firework=true,false,%t1%,<util.random.int[1].to[255]>,<util.random.int[1].to[255]>,<util.random.int[1].to[255]>|0];velocity=0,0,0,<def[1].world.name>] 
      - spawn %1% firework[firework_item=i@firework[firework=true,false,%t1%,<util.random.int[1].to[255]>,<util.random.int[1].to[255]>,<util.random.int[1].to[255]>|0];velocity=0,0,0,<def[1].world.name>] save:myfirework 
      - wait 5t 
      - adjust <entry[myfirework].spawned_entities> detonate 
      }