Paste #46416: Untitled Paste

Date: 2018/01/20 09:16:17 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


killquest_zombie_assignment:
    type: assignment
    actions:
        on assignment:
        - trigger name:click state:true
        - trigger name:proximity state:true radius:5
    interact scripts:
    - 10 npc_killquest_interact


npc_killquest_interact:
    type: interact
    steps:
        1:
            click trigger:
                script:
                - engage
                - if <player.flag[kill_zombie_quest_count]> == 5 {
                    - chat "Oh cool. Have a thing." targets:<player>
                    - flag <player> kill_zombie_quest:!
                    - flag <player> kill_zombie_quest_count:!
                    - give 1@diamond
                    - flag <player> kill_zombie_quest_cooldown duration:24h
                    - disengage
                    - queue clear
                    }
                - if <player.has_flag[kill_zombie_quest]> {
                    - chat "...Don't you have something to do?" targets:<player>
                    - disengage
                    - queue clear
                    }
                - if <player.has_flag[kill_zombie_quest_cooldown]> {
                    - chat "Come back in <player.flag[kill_zombie_quest_cooldown].expiration.formatted>." targets:<player>
                    - disengage
                    - queue clear
                    }
                - if !<player.has_flag[killquestchat]> {
                    - chat "Sup nerd."
                    - wait 10t
                    - chat "You want to kill stuff for me?" targets:<player>
                    - narrate "[click again or walk away]"
                    - flag <player> killquestchat:+:1
                    - disengage
                        - queue clear
                    }
                - if <player.has_flag[killquestchat]> == 1 {
                    - engage
                    - chat "Cool beans. Kill 5 of those pesky zombies." targets:<player>
                    - flag <player> kill_zombie_quest
                    - flag <player> kill_zombie_quest_count:0
                    - disengage
                    - queue clear
                    }
            proximity trigger:
                exit:
                    script:
                        - if <player.has_flag[killquestchat]> {
                            - engage
                            - chat "OK, bye then." targets:<player>
                            - flag <player> killquestchat:!
                            - disengage
                            - queue clear
                            }

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