Paste #17346: Edit of P#17345 - Edit of P#17344 - Untitled Paste

Date: 2015/07/03 18:43:13 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


Bender:
  type: assignment
  Interact Scripts:
  - 1 NPC_Bender

NPC_Bender:
  type: interact
  actions:
    on assignment:
    - trigger name:damage state:true  
  steps:
    1:
      chat trigger:
        1:
          trigger: What about /FIRE/
          script:
          - flag <npc> bender_type:fire
        2: 
          trigger: What about /WATER/ 
          script:
          - flag <npc> bender_type:water
          - define bender_type <npc.flag[bender_type]>

          - if %bender_type% == fire {  
            - define blocks li@m@netherrack|m@fire|m@lava 
            - define particles li@FLAME|LAVA 
            } else if %bender_type% == water {   
            - define blocks li@m@water|m@ice  
            - define particles li@DRIP_WATER|BUBBLE 
            } else if %bender_type% == earth {   
            } else if %bender_type% == air {   
            } 
          - define lift_blocks <npc.location.find.blocks[%blocks%].within[7]> 
          - flag <npc> remaining_blocks:|:%lift_blocks%   
          - run s@BenderBlocks def:<npc>|%particles%|%bender_type%

BenderBlocks:
  type: task
  script:
  - define npc <%1%.as_npc>
  - define particles %2%
  - define bender_type %3%
  - if <%npc%.flag[remaining_blocks].as_list.size.as_int> > 0 {   
    - define location <%npc%.flag[remaining_blocks].as_list.random>   
    - define block <%location%.material.id>   
    - spawn e@falling_block,%block%[velocity=<%npc%.location.block.add[0,5,0]>] %location% save:%location%_block   
    - look <npc> <entry[%location%_block].spawned_entities.location> duration:100  
    - push <entry[%location%_block].spawned_entities> destination:<%npc%.location.block.add[0,5,0]> speed:0.1   
    - if %bender_type% == fire {
      - repeat 5 {
        - animate <npc> SNEAK
        - execute as_server "particle reddust <entry[%location%_block].spawned_entities.location.simple.replace[,].with[ ]> R B G 1"
        - playeffect <entry[%location%_block].spawned_entities> <%particles%.get[1]>
        - playeffect <entry[%location%_block].spawned_entities> <%particles%.get[2]>

        - animate <npc> ARM_SWING
        }  
      }
    - flag %npc% remaining_blocks:<-:%location%   
    - wait d@1.5s   
    - run s@BenderBlocks def:%npc%|%particles%|%bender_type%
    }