Paste #11760: Edit of P#11758 - Edit of P#11757 - Denizen Debug Logs From Hitmoncraft - Play your way

Date: 2014/12/02 08:04:48 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


killquest:
    type: assignment
    actions:
        on assignment:
        - trigger name: click state:true
        - trigger name: chat state:true
    interact scripts:
    - 10 npc_killquest_interact

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

npc_killquest_interact:
    type: interact
    steps:
        1:
            click trigger:
                script:
                - if <player.has_flag[npc_engaged]> queue clear
                - if <player.flag[kill_zombie_quest_cooldown]> {
                  - narrate "You can repeat this quest in <player.flag[kill_zombie_quest_cooldown].expiration.formatted>"
                  - queue clear
                  }
                - flag player npc_engaged
                - engage
                - if <player.flag[kill_zombie_quest_count]> == 5 {
                  - narrate format:cchat "Great work! Here's your reward!"
                  - give 1@diamond
                  - flag player kill_zombie_quest_count:!
                  - flag player kill_zombie_quest_cooldown duration:24h
                  - disengage
                  - flag player npc_engaged:!
                  - queue clear
                  }
                - narrate format:cchat "Oh hello, can you help me?"
                - wait 5t
                - narrate format:cchat "I need somebody to kill 5 zombies."
                - wait 5t
                - narrate format:cchat "Will you help me?"
                - wait 5t
                - narrate "[<&c>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[kill_zombie_quest_cooldown]> {
                        - queue clear
                        }
                    - if <player.has_flag[kill_zombie_quest]> queue clear
                    - engage
                    - narrate "Okay great!" format:cchat
                    - wait 5t
                    - narrate "[Kill 5 Zombies!]"
                    - flag player kill_zombie_quest
                    - flag player kill_zombie_quest_count:0
                    - disengage
                2:
                    trigger: "/No/ I won't"
                    script:
                    - if <player.has_flag[kill_zombie_quest]> queue clear
                    - engage
                    - random {
                        - narrate format:cchat "Go away then."
                        - narrate format:cchat "I'm sorry about that."
                        - narrate format:cchat "Some help you are."
                        - disengage
                        }                    

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:!
            }