Paste #10157: meat

Date: 2014/09/29 15:11:31 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


StableMasterAssign:
    type: assignment
    interact scripts:
    - 10 DailyStablemasterQuest
    default constants:
        npctype: "FidgetingNPC"

    actions:
        on assignment:
            - trigger name:chat state:true
            - trigger name:click state:true
            - trigger name:proximity state:true radius:5
            - trigger name:damage state:false
            - lookclose true range:4 realistic  
        on spawn:
            - run s@stableinit instantly   
        on enter proximity:    
            - walk <player.location> radius:3

stableinit:
    type: task
    script:
        - ^trigger name:chat state:true
        - ^trigger name:click state:true
        - ^trigger name:proximity state:true radius:5
        - ^trigger name:damage state:false
        - ^lookclose true range:4 realistic  


DailystablemasterQuest:
    type: interact
    steps:
        start*:   
            proximity trigger:
                entry radius: 10
                entry:
                    script:
                    - narrate "You hear the neighing of horses nearby" 
                    - wait 2
                    - chat "<red>Hello there stranger."
                    - pause waypoints
                    - narrate "<green>Hint:<white>Right click to continue"
                exit:
                    script:
                    - resume waypoints
            click trigger:
                script:
                - pause waypoints
                - chat "<red>I havent seen you around these parts before"
                - wait 1
                - chat "<red>Where are my manners my name is <npc.name>."
                - wait 1
                - chat "<red>Are you looking for work?"
                - wait 1           
                - narrate "<white>You can say, <green>Yes<white> or <green>No<white>."                
                - trigger name:chat state:true radius:100
            chat trigger:
                1:
                    trigger: /Yes/, I could use the work.
                    script:
                    - chat "<red>Great! I am always looking for a little help around here."                    
                    - wait 1
                    - chat "<red>I need 5 iron bars to make shoes for all of these horses."
                    - wait 1
                    - chat "<red>Go fetch them for me and I will make it worth your time."
                    - narrate " <npc.name> returns to his work"
                    - ^flag server stablemaster:->:<player>   
                    - resume waypoints
                    - zap step:initial
                2:
                    trigger: /No/, I am far to busy.
                    script:
                    - chat "Fair enough come back if you find yourself looking for work"
                    - resume waypoints
        initial:
            click trigger:
                script:
                 - if <player.inventory.contains[IRON_INGOT].qty[5]> {
                    - take iron_ingot qty:5
                    - pause waypoints
                    - chat "<red> Oh great you have the iron  thank you so much."
                    - wait 1 
                    - chat "<red>Here you go payment as promised."
                    - ^narrate "<red>You receieved <gold>5 Gold bars<red> from <npc.name>!"
                    - give gold_ingot qty:5
                    - wait 1 
                    - chat "<red>Thank you again for your help!"
                    - wait 3 
                    - chat "<red> Come back tommorow if you are still looking for work."
                    - narrate "<npc.name> Returns to his work"
                    - resume waypoints
                    - flag player stableCooldown duration:24h
                    - zap step:cooldown                    
                    } else {
                    - pause waypoints
                    - chat "<red>Please come back when you have the 5 iron bars."
                    - wait 1
                    - narrate " <npc.name> looks at you and shakes his head and goes back to his work."   
                    - resume waypoints
                    }

        wait:  
            click trigger:
                script:     
                - chat "<red>Thanks again for your help."
                - wait 3 
                - chat "<red>Stop back by tommorow if you are still looking for work."
                - narrate "<green>Goes back to his work."
        return:
            click trigger:
                script:
                - pause waypoints
                - random {
                  - chat "<red>Welcome back <player.name>"
                  - chat "<red>Hey there <player.name> long time no see."
                  - chat "<red>Glad to see you are still alive."
                  }
                - wait 3
                - chat "<red>Are you looking for more work?"
                - narrate "<white>You can say, <green>Yes<white> or <green>No<white>."
                - trigger name:chat state:true radius:100                
            chat trigger:
                1:
                    trigger: /Yes/, I am.
                    script:                    
                    - random {
                      - chat "Great to hear!"
                      - chat "Wonderful!"
                      - chat "Fantastic!"
                      }
                    - wait 1
                    - chat "<red>I need you to fetch me 2 apples for the horses."                                     
                    - wait 1
                    - chat "Return to me when you have finished."
                    - narrate "<npc.name>returns to his work"
                    - resume waypoints
                    - zap step:reward
                2:
                    trigger: /No/, I am not.
                    script:
                    - chat "No problem come see me if you find yourself looking for work in the future."
                    - resume waypoints
        waiting:
            click trigger:
                script:
                - chat "<red>Please hurry with the apples <player.name> the horses are getting hungry."                
        reward:
            click trigger:
                script:                
                 - if <player.inventory.contains[apple].qty[2]> {
                    - take apple qty:2
                    - pause waypoints
                    - chat "<red> Oh great you have the apples  thank you so much."
                    - wait 1 
                    - ^narrate "<red>You receieved <gold>10 Gold bar<red> from <npc.name>!"
                    - give gold_ingot qty:10
                    - wait 1 
                    - chat "<red>Thank you again for your help!"  
                    - flag player stableCooldown duration:24h
                    - zap step:cooldown
                    } else {
                    - chat "<red>Please come back when you have the 2 apples"
                    - wait 1
                    - narrate " <npc.name> looks at you and shakes his head then returns back to his work"  
                    - resume waypoints
                    }                                    
        cooldown:
            click trigger:
                script:
                - pause waypoints
                - chat "<red>Thanks again for your help."
                - wait 3 
                - chat "<red>Stop back by tommorow if you are still looking for work."
                - narrate "Goes back to his work."
                - resume waypoints

stableWorld:
    type: world
    debug: false
    events:
        on time changes in w@world:
        - if <server.flag[stablemaster]> == "null" queue clear
        - foreach <server.flag[stablemaster].as_list> {
          - if !<%value%.as_player.flag[stableCooldown]> && <s@DailystablemasterQuest.step[%value%]> != "return" {
            - zap script:DailystablemasterQuest step:return player:%value%
            - if <%value%.as_player.is_online> {
              - narrate player:%value% "<red>The Stable Master in Glint has more work for you."
              - narrate player:%value% "<red>Return to him as soon as possible."
              }
            }
          }