Paste #31138: Untitled Paste

Date: 2016/03/03 15:43:33 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


myassignment:
    type: assignment
    actions:
        on assignment:
        - trigger name:click state:true
        - trigger name:chat state:true 
    interact scripts:
    - 10 zombiequestinteract


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

zombiequestinteract:
    type: interact
    steps:
        1:
            click trigger:
                script:
                - if <player.has_flag[npc_engaged]> queue clear
                - if <player.flag[zombiequest_cooldown]> {
                - narrate "You can repeat this quest in <player.flag[zombiequest_cooldown].expiration.formatted>
                - queue clear
                }
                - if <player.flag[zombiequest]> queue clear
                - flag player npc_engaged
                - if <player.flag[zombiequestcount]> == 5 {
                    - narrate format:cchat "Great work! Here's your reward!"
                    - give i@diamond
                    - flag player zombiequestcount:!
                    - flag player zombiequest_cooldown duration:24h
                    - disengage
                    - flag player npc_engaged:!
                    - queue clear
                    }
                - engage
                - narrate format:cchat "Hello there, would you care for a special prize?"
                - wait 3s
                - narrate format:cchat "If so you can kill 5 zombies for me."
                - wait 5s
                - narrate format:cchat "Will you accept this request?"
                - wait 5s
                - narrate "[<&o>Type <&b><&o>Yes<&f><&o> or <&b><&o>No<&7>]"
                - disengage
                - flag player npc_engaged:!
            chat trigger:
                1:
                    trigger: /Yes/ I accept the quest
                    script:
                    - if <player.flag[zombiequest_cooldown]> {
                        - queue clear
                        }
                    - if <player.has_flag[zombiequest]> queue clear
                    - engage
                    - narrate "Okay great!" format:cchat
                    - wait 3s
                    - narrate "[Kill 5 zombies!]"
                    - flag player zombiequestinteract
                    - flag player zombiequestcount:0
                    - disengage
                2:
                    trigger: /No/ I don't
                    script:
                    - if <player.has_flag[zombiequest]> queue clear
                    - random {
                    - narrate format:cchat "Okay screw off!"
                    - narrate format:cchat "okay then."
                    - narrate format:cchat "Screw you then!"
                    }

zombiequestworld:
    type: world
    events:
        on player kills zombie:
        - if !player.has_flag[zombiequest]> queue clear
        - flag player zombiequestcount:++
        - if <player.flag[zombiequestcount]> == 5 {
        - narrate "[Return to the NPC]"
        - flag player zombiequest:!
        }