Paste #47207: kill quest

Date: 2018/04/14 17:03:05 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


KillAssignment:
    type: assignment
    actions:
        on assignment:
        - trigger name:click state:true
        - trigger name:chat state:true
    interact scripts:
    - 10 killinteract

cchat:
    type: format
    format: "<&b><npc.name> <&f>to you<&co> <&2><text>"

killinteract:
    type: interact
    steps:
        1:
            Proximity trigger:
                script:
                - if <player.has_flag[kill_complete]> 
                    - zap 2
                if <player.has_flag[kill_cooldown]>
                    - zap 3
                - narrate format:cchat "Hey you! Yeah you! Come over here and right click on me!"
            click trigger:
                script:
                - engage
                - narrate format:cchat "Im having a bit of a... zombie problem"
                - wait 5t
                - narrate format:cchat "Think you can help me out?"
                - wait 5t
                - narrate "[<&o>Type <&b><&o>Yes<&f><&o> or <&b><&0>No<&7>]"
                - disengage
            chat trigger:
                1: 
                    trigger: /Yes/ I think I can help you out.
                    script:
                    - narrate format:cchat "Ah thanks! Your the best!
                    - wait 5t
                    - narrate "<&b>[Kill 5 zombies]"
                    ## Adjust text here to change mob and type
                    - narrate format:cchat "Come see me when your done!"
                    - flag player quest_taken
                    - flag player kill_count:0
                    - flag player kill_cooldown duration:24h
                2:
                    trigger: /No/ I'd rather not do this right now.
                    script:
                    - random {
                        - narrate format:cchat "Aw come on! My grandmother could do this!"
                        - narrate format:cchat "Your missing out on a fantastic reward..."
                        - narrate format:cchat "Fine then. I'll keep the reward for myself."
                        }
        2:
            script:
            - narrate format:cchat "You did it! Here is your reward."
            - give Diamond QTY:1
            - wait 3s
            - narrate format:cchat "Come back tomorrow. I might need your help again!"
        3:
            script:
            - narrate format:cchat "I dont need you again for another <player.flag[kill_cooldown].expiration.formatted>"

kill_count_world:
    type: world
    events:
        on player kills zombie:
        - if !<player.has_flag[quest_taken]> queue clear
        - flag player kill_count:++
        - if <player.flag[kill_count]> == 5
            - narrate "<&b>[Return to the NPC]"
            - flag player kill_complete