Date: 2018/01/20 09:16:17 UTC-08:00
            
Type: Denizen Script
        
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
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:!
            }