Paste #57463: Untitled Paste

Date: 2019/08/28 14:36:21 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


gardener:
    type: assignment
    actions:
        on assigment:
        - trigger name:click state:true
        - trigger name:chat state:true
    interact scripts:
        - gardener_interact
gardener_interact:
    type: interact
    steps:
        1:
            click trigger:
                script:
                - if <player.has_flag[gardener_cooldown]>:
                    - chat "Thank you for helping me out. I'll need you again in <player.flag[gardener_cooldown].expiration.formatted> and I'll give you more work." targets:<player>
                    - disengage
                    - stop
                - if <player.has_flag[gardener_job]>:
                    - chat "You're doing a great job, keep it up!"
                    - actionbar "<green> You have <player.flag[gardener_job].expiration.formatted> left on this job!"
                    - queue clear
                - chat "Hi! are you looking for work?"
                - wait 5t
                - chat "I'm really low on flowers, can you pick me some Allium?"
                - wait 5t
                - chat "Yes, you'd like to, or No, not this time?"
                - wait 5t
            chat trigger:
                1:
                    trigger: /Yes/
                    script:
                    - engage
                    - wait 10t
                    - chat "Excellent, for the next 24hours you'll earn money picking allium"
                    - wait 5t
                    - actionbar "<green> Picking Allium will earn you money for the next 24 hours."
                    - flag <player> gardener_job duration:24h
                    - disengage
                2:
                    trigger: /No/
                    script:
                    - engage
                    - random:
                      - chat "Next time then"
                      - chat "Aww, that sucks!"
                      - chat "Ok then, cya."
                    - disengage
gardener_job:
    type: world
    events:
        on player picks up allium:
        - if <player.has_flag[gardener_job]>:
            - give money quantity:1

expires:
    type: world
    events:
        on player flag gardener_job expires:
        - flag <player> gardener_cooldown duration:48h
        - actionbar "<red> Your gardening job has ended."