Date: 2018/03/29 16:59:49 UTC-07: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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
zombiekillquestten:
type: assignment
actions:
on assignment:
- trigger name: click state:true
- trigger name: chat state:true
interact scripts:
- 10 zombiekillquestteninteract
cchat:
type: format
format: "<green><npc.name> <white><text>"
zombiekillquestteninteract:
type: interact
steps:
1:
click trigger:
scripts:
- engage
- if <player.has_flag[killZombieTenQuestCount.count]> == 10 { #check if the quest has been completed.
- narrate format:cchat "Great work! Take this for your trouble..."
- narrate "[You recieved a diamond!]"
- give i@diamond
- disengage
- flag player killZombieTenQuestCount:! # if quest completed, remove quest count.
- queue clear
}
# if the player is currently doing the quest.
- else if <player.has_flag[killZombieTenQuestCount]> {
- narrate format:cchat "Did you kill 10 zombies yet?"
- disengage
- queue clear
}
# if the player has not started and has not completed the quest.
# check if the player has talked to the npc or not.
- if <player.has_flag[killZombieTenTalked]> {
- narrate format:cchat "Can you kill 10 zombies for me?"
- wait 5t
- narrate "[Will you accept? Type <aqua>yes <white> or <aqua>no]"
- disengage
- queue clear
}
# if the player has not talked to the npc.
- narrate format:cchat "Hello there <aqua><player.name><white>. Would you care for a special prize?"
- wait 5t
- narrate format:cchat "If so, can you kill 10 zombies for me?"
- wait 5t
- narrate "[Will you accept? Type <aqua>yes <white> or <aqua> no]"
- flag player killZombieTenTalked
- disengage
chat trigger:
1:
trigger: /yes/ I accept!
script:
# if player is already doing the quest, do nothing.
- if <player.has_flag[killZombieTenQuestCount]> {
- queue clear
}
# if player is not currently doing the quest...
- engage
- narrate format:cchat "Great!"
- wait 5t
- narrate "[You have accepted the quest!]"
- wait 5t
- narrate "[Kill 10 zombies and then return.]"
- flag player killZombieTenQuestCount:0 # assign the quest and count.
- disengage
- flag player killZombieTenTalked:!
2:
trigger: /no/ I don't.
script:
- engage
- narrate format:cchat "Fine then..."
- disengage
- flag player killZombieTenTalked:!
killzombietenworld:
type: world
events:
on player kills zombie:
- if !<player.has_flag[killZombieTenQuestCount]> queue clear # checks if player has the quest.
# if the player has the quest...
# Gain a kill count
- flag player killZombieTenQuestCount.count++
# check if the kill count is less than 10.
- if <player.flag[killZombieTenQuestCount.count]> < 10> {
- narrate "[Zombies killed <player.flag[killZombieTenQuestCount.count]>/10]"
}
# check if the kill count is equal to 10.
- if <player.flag[killZombieTenQuestCount.count]> == 10> {
- narrate "[Zombies killed <player.flag[killZombieTenQuestCount.count]>/10]"
- wait 5t
- narrate "[Quest completed! Return to the NPC]"
}
# check if the kill count is greater than 10.
- if <player.flag[killZombieTenQuestCount]> > 10> {
- flag player killZombieTenQuestCount.count = 10
}