Paste #5875: goreatest2

Date: 2014/06/27 15:23:44 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


RancherQuest:
    type: assignment
    Actions:
        on assignment:
        - trigger name:chat toggle:true
        - trigger name:click toggle:true
        - lookclose state:true
    interact scripts:
    - 1 TestGorea1

TestGorea1:
    type: interact 
    steps:
        1:
            click trigger:
                script:
                - chat "Hey <player.name>, I could use some help" 
                - wait 2 
                - chat "I really need a new horse" 
                - wait 2 
                - chat "Can you help me out?" 
                - chatexecute as_server "tellraw <player.name> {text:'Yes',clickEvent:{action:run_command,value:'/say Yes'}} {text:'No',clickEvent:{action:run_command,value:'/say No'}}" 
            chat trigger:
                1:
                    trigger: /Yes/, I can help you out! 
                    script: 
                    - chat "Okay, I need you to bring me a horse on a lead." 
                    - wait 2 
                    - chat "Come back to me when you find one!" 
                    #- zap step:2 
                2:
                    trigger: /No/, I am too busy 
                    script: 
                    - chat "Oh, come back when you have more time..." 
        2:
            click trigger:
                script:
                - if <player.location.find.entities[HORSE].within[5].size> >= 1 { 
                  - foreach <player.location.find.entities[HORSE].within[5]> { 
                    - if <%value%.get_leash_holder> == <player> { 
                      - run s@HorseReturn2 delay:1 def:%value% 
                      } 
                    } 
                  } else { 
                  - chat "Hurry up <player.name>!" 
                  - wait 1 
                  - chat "I really need a new horse!" 
                  } 
        3:
            click trigger:
                script:
                - chat "Thanks again for helping me out!" 
                - zap step:1 

HorseReturn2:
    type: task 
    script:
    - chat "Great, a new horse!" 
    - wait 2 
    - chat "Let me put a post in the ground real quick!" 
    - wait 1 
    - animate <npc> animation:ARM_SWING 
    - modifyblock l@368,132,134,Craterlake m@fence 
    - leash %1% holder:l@368,132,134,Craterlake 
    - wait 1 
    - chat "Thanks <player.name>, this'll be a great help!" 
    - wait 3 
    - chat "Take this for helping me out!" 
    - wait 1 
    - give i@hay_block qty:10 
    - give money qty:500 
    - zap s@RancherMain step:3 
    - run s@RancherCleanup2 delay:10 

RancherCleanup2:
    type: task
    script:
    - remove <npc.location.find.entities[HORSE].within[5]> 
    - modifyblock l@368,132,134,Craterlake m@air 

RancherCleanup2World2:
    type: world
    events:
        on sever start:
        - if <l@368,132,134,Craterlake.material> == m@fence { 
          - modifyblock l@368,132,134,Craterlake m@air 
          }