Paste #18786: Untitled Paste

Date: 2015/07/28 18:08:53 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


rpg_arrow:
    type: item
    debug: false
    material: arrow
    display name: RPG AMMO
    lore:
    - <&a>Explodes on hit
    - <&b>Youll love it!
    - <&c>Requires RPG LAUNCHER
    recipe:
    - i@tnt|i@arrow|i@tnt
    - i@air|i@air|i@air
    - i@air|i@air|i@air

rpg_bow:
    type: item
    debug: false
    material: bow
    display name: RPG
    lore:
    - <&c>Shoots explosive rounds!
    - <&b>Requiresrpg ammo!
    recipe:
    - i@air|i@bow|i@air
    - i@air|i@tnt|i@air
    - i@diamond|i@iron|i@gold

sharp_arrow:
    type: item
    debug: false
    material: bow
    display name: SHARP ARROW
    lore:
    - <&c>Sharper then any other arrow hehe
    - <&B>Requires RPG LAUNCHER
    recipe:
    - i@air|i@air|i@air
    - i@arrow|i@tnt|i@tnt
    - i@air|i@air|i@air

rpg_arrow_dertmine_type:
    type: task
    debug: false
    script:
    - if <entry[myitem].result.scriptname||null> == rpg_arrow {
      - flag player arrowtype:rpg
      }
      else if <entry[myitem].result.scriptname||null == sharp_arrow {
      - flag player arrowtype:sharp
      }
      else {
      - narrate "<&c>You've loaded the wrong arrow type. Must load explosive round!"
      - determine cancelled
      }
    - flag player arrows:|:<context.projectile.eid> duration:10s
    - flag player arrows:|:<context.projectile.eid> duration:10s

rpg_arrow_world:
    type: world
    debug: false
    events:
        on player shoots bow:
        - flag player arrowtype:!
        - define item <player.inventory.slot[<player.inventory.find.material[arrow]>]>
        - adjust %item% quantity:1 save:myitem
        - if <context.bow.scriptname||null> == rpg_bow {
          - inject rpg_arrow_determine_type
          }
        - if <entry[myitem].result.scriptname||null> == rpg_arrow {
        - flag arrowtype:rpg
        - shoot arrow[arrow]arrow o:<player> speed:<context.force.mul[1.5]> spread:20
        - take <entry[myitem].result> qty:1
        - playsound sound:shoot_arrow <player.location>
        - determine cancelled
        }
        else if <entry[myitem].result.scriptname||null> == sharp_arrow { 
        - flag player arrowtype:sharp 
        - flag player arrows:|:<context.projectile.eid> duration:10s 
        } 
        on projectile hits block:
        - if !<context.shooter||null> == null queue clear
        - if <context.shooter.is_player> {
          - if !<context.shooter.as_player.flag[arrows].contains[<context.projectile.eid>]> queue clear
          - run rpg_handler_internal def:<context.projectile.location>|<context.projectile> as:<context.shooter>
          }
        on arrow damages entity:
        - if <context.damager.is._player> {
          - if !<context.damager.as_player.flag[arrows].contains[<context.projectile.eid>]> queue clear
          - if <context.damager.as_player.flag[arrowtype]> == sharp determine <context.damage.mul[2]> 
          - run rpg_arrow_handler_internal def:<context.entity.location>|null as:<context.damager>
          }

rpg_arrow_handler_internal:
    type: task
    debug: false
    speed: 2t
    script:
    - ^if <player.flag[arrowtype]> == rpg {
      - 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 %4% power:4
      - spawn %1% rpg[rpg_item=i@rpg[rpg=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% rpg[rpg_item=i@rpg[rpg=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:myrpg
      - if %2% != null remove %2% 
      - wait 5t
      - adjust <entry[myfirework].spawned_entities> detonate
      }

mininuke_bpg_shroomcloud:
    type: task
    speed: 1t
    definitions: center
    script:
    - ^playeffect %center% effect:huge_explosion visibility:100
    # draw the tall cloud
    - ^repeat 6 {
      - define center <def[center].add[0,2,0]>
      - ^playeffect effect:flame %center% offset:1 qty:50 visibility:100
      - ^playeffect effect:explode %center% offset:1 qty:15 visibility:100
      - ^playeffect effect:large_explode %center% visibility:100
      - playsound %center% enderdragon_growl pitch:0
      - wait 1t
      }
    # straight lines  x+    z+    y+    x-     y-     z-
    - ^define vecs li@1,0,0|0,0,1|0,1,0|-1,0,0|0,0,-1|0,-1,0
    # Angles   y=0        x- z-       x+ z+     x+ z-      x- z+
    - ^define vecs %vecs%|-0.7,0,-0.7|0.7,0,0.7|0.7,0,-0.7|-0.7,0,0.7
    # Raised lines: y+    x+        z+        x-         z-
    - ^define vecs %vecs%|0.7,0.7,0|0,0.7,0.7|-0.7,0.7,0|0,0.7,-0.7
    # draw the top shroom
    - ^repeat 8 {
      - ^define offset %value%
      - ^foreach %vecs% {
        - ^playeffect effect:explode <def[center].add[%value%].add[<util.random.int[-%offset%].to[%offset%]>,0,<util.random.int[-%offset%].to[%offset%]>]> offset:<def[offset].div[5]> qty:<def[offset].mul[10].as_int> visibility:100
        - ^playeffect effect:large_explode <def[center].add[%value%].add[<util.random.int[-%offset%].to[%offset%]>,0,<util.random.int[-%offset%].to[%offset%]>]> offset:<def[offset].div[5]> qty:%offset% visibility:100
        }
      - ^wait 3t
      }