Date: 2015/10/05 03:23:06 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
DHGM:
type: assignment
interact scripts:
- 1 DHGMInteract
actions:
on assignment:
- trigger name:click state:true
- trigger name:chat state true
- trigger name:proximity state:true radius:3
- narrate "The Dragonhold Guild Master is active."
on exit proximity:
#- narrate format:GMChat "Goodbye, <&a><player.name><&r>."
- if <s@DHGMInteract.step[<player>]||1> != 1 {
- zap step:1 script:DHGMInteract
}
DHGMInteract:
type: interact
steps:
1:
click trigger:
script:
- narrate format:GMChat "Hi there <&9><player.name><&r>."
- if <player.has_flag[Guild]> {
- if <player.flag[Guild]> == dragonhold {
- narrate format:GMChat "It's good to see you again! I hope you're doing assignments!"
}
else {
- narrate format:GMChat "Sorry, but you are a member of a different guild."
}
}
else {
- narrate format:GMChat "Are you interested in joining our guild?"
- narrate format:GMChat "If you accept, when you die you will revive in our city! <&nl>You will also be able to do assignments for great <&e>rewards<&r>."
- narrate "Acceptable responses are <&a>Yes <&r>or <&a>No<&r>."
- zap step:JoiningGuild
}
# TODO leave guild
JoiningGuild:
chat trigger:
1:
trigger: /Yes/, I would love to join!
script:
- narrate format:GMChat "Fantastic, I will send the assignment manager a memo with your details!
- narrate format:GMChat "You're now able to assignments for us and will revive in our wonderful city!"
- narrate format:GMChat "I hope to see you around!
- flag <player> Guild:Dragonhold
- zap step:1
2:
trigger: /No/ thanks. I have other interests.
script:
- narrate format:GMChat "That's okay, maybe another day..."
- zap step:1
3:
trigger: /regex:.+/
script:
- narrate format:GMChat "I'm sorry I have no idea what you mean..."
- zap step:1
DHQG:
type: assignment
interact scripts:
- 1 DHQGInteract
actions:
on assignment:
- narrate "The Dragonhold QuestGiver is active."
- trigger name:click state:true
- trigger name:chat state:true
- trigger name:proximity state:true radius:3
on exit proximity:
- if <s@DHQGInteract.step[<player>]||1> != 1 {
- zap step:1 script:DHQGInteract
}
DHQGInteract:
type: interact
steps:
1:
click trigger:
script:
- narrate format:QGChat "Hello <&9><player.name><&r>!"
- if <player.has_flag[Guild]> {
- if <player.flag[Guild]> == dragonhold {
- if <player.has_flag[Quest]> {
- inject CheckQuest
}
else {
- narrate format:QGChat "Are you interested in doing an assignment for the guild?"
- narrate format:QGChat "You will be rewarded greatly upon completion!"
- narrate "Acceptable responses are <&a>Yes <&r>or <&a>No<&r>."
- zap step:AcceptAssignment
}
}
else {
- narrate format:QGChat "Uh.. Is there something I can do for you?"
}
}
else {
- narrate format:QGChat "Talk to the guild master upstairs to join our guild!"
}
AcceptAssignment:
chat trigger:
1:
trigger: /Yes/ I am!
script:
- narrate format:QGChat "Fantastic, just let me check what we have for you!"
- narrate format:QGChat "Okay, the Quests we have available for you are:"
- define avquest li@Zombies
- execute as_server "tellraw <player.name> ['',{'text':' - '},{'text':'Slay some Zombies!','color':blue,'hoverEvent':{'action':'show_text','value':{'text':'Kill 10 zombies.<&nl>Reward: $1000'}}}]"
- if !<player.has_flag[weaponsquestcooldown]> {
- define avquest <def[avquest].include[<&a>Weapons<&r>]>
- execute as_server "tellraw <player.name> ['',{'text':' - '},{'text':'Craft some weaponry','color':blue,'hoverEvent':{'action':'show_text','value':{'text':'Craft the guild 5 iron swords.<&nl>Reward: $1000 and 1 Chocolate Bar'}}}]"
}
- if !<player.has_flag[supplyquestcooldown]> {
- define avquest <def[avquest].include[<&a>Supply<&r>]>
- execute as_server "tellraw <player.name> ['',{'text':' - '},{'text':'Supply some resources','color':blue,'hoverEvent':{'action':'show_text','value':{'text':'Supply 32 oak logs and 128 cobblestone.<&nl>Reward: $1500'}}}]"
}
- define avquest <def[avquest].include[cancel]>
- narrate "Hover over each quest with your cursor for quest info!"
- narrate "Acceptable responses are <&a><def[avquest].formatted.replace[, and].with[<&r> or<&a>].replace[,].with[<&r>,<&a>]><&r>."
- zap step:ChooseAssignment
2:
trigger: /No/, not at the moment.
script:
- narrate format:QGChat "That's okay, you can always come back later."
- zap step:1
ChooseAssignment:
chat trigger:
1:
trigger: I want to kill some /Zombies/!
script:
- narrate format:QGChat "Awesome, I knew you were a bad ass zombie killer!"
- narrate format:QGChat "We've had some problems with zombies<&nl> attacking the citizens and we need you<&nl> to kill <&9>10 <&b>Zombies<&r> to help cull their population."
- narrate format:QGChat "You can kill them anywhere in the world,<&nl> just come back to me for the reward!"
- flag <player> Quest:zombies
- zap step:1
2:
trigger: I want to craft /weapons/ for the guild!
script:
- if <player.has_flag[weaponsquestcooldown]> {
- narrate "<&c>You must wait <player.flag[weaponsquestcooldown].expiration.formatted> before doing this quest again!"
- queue clear
}
- narrate format:QGChat "Sounds good. Our blacksmith has injured his back!"
- narrate format:QGChat "If you could bring me <&9>5 <&b>iron swords<&r><&nl> I will reward you greatly!"
# - narrate format:QGChat "Oh, and remember, you <&l><&n>must<&r> craft them!"
- flag <player> Quest:weapons
- zap step:1
3:
trigger: I can /supply/ some resources!
script:
- if <player.has_flag[supplyquestcooldown]> {
- narrate "<&c>You must wait <player.flag[supplyquestcooldown].expiration.formatted> before doing this quest again!"
- queue clear
}
- narrate format:QGChat "Excellent, we need some more materials to build<&nl> some houses and to expand Dragonhold!"
- narrate format:QGChat "Could you bring me 32 oak logs and 128 cobblestone?"
- flag <player> Quest:supply
- zap step:1
4:
trigger: I want to /cancel/.
script:
- random {
- narrate format:QGChat "Stop messing me around!"
- narrate format:QGChat "Thanks for wasting my time..."
- narrate format:QGChat "I have work to do, don't waste my time!"
}
- zap step:1
5:
trigger: /regex:.+/
script:
- narrate format:QGChat "I am sorry, I have no idea what you mean.."
- zap step:1
CheckQuest:
type: task
script:
- if <player.flag[Quest]> == zombies {
- if <player.flag[QuestKillCount]||0> < 10 {
- narrate format:QGChat "You have killed <&9><player.flag[QuestKillCount]||0><&r>/<&9>10<&r> zombies!"
- narrate format:QGChat "Please come back when you're done."
}
else {
- narrate format:QGChat "You did good, our citizens feel much safer."
- wait 10t
- narrate format:QGChat "Here is your reward!"
- give money qty:1000
- narrate "You have been rewarded with <&b>$1000<&r>!"
- flag player quest:!
- flag player questkillcount:!
}
}
else if <player.flag[Quest]> == weapons {
#- if <player.flag[QuestCraftCount]||0> < 5 {
#- narrate format:QGChat "You've crafted <&9><player.flag[QuestCraftCount]||0><&r>/<&9>5<&r> weapons!"
- define quantity <player.inventory.qty[iron_sword]>
- if <def[quantity]> < 5 {
- narrate format:QGChat "You have <&9><def[quantity]><&r>/<&9>5<&r> iron swords.."
- narrate format:QGChat "Please come back when you're finished."
}
else {
- narrate format:QGChat "Great, thanks for making those swords!"
- take iron_sword qty:5
- narrate format:QGChat "Here is your reward!"
- give money qty:1000
- give chocolate
- narrate "You have been rewarded with <&b>$1000<&r> and a <&b>Chocolate Bar<&r>!"
- flag player quest:!
- flag player weaponsquestcooldown duration:1d
}
}
else if <player.flag[Quest]> == supply {
- if <player.inventory.contains[cobblestone].qty[128]> && <player.inventory.contains[log].qty[32]> {
- narrate format:QGChat "Thanks for getting those materials."
- take i@cobblestone qty:128
- take i@log qty:32
- wait 10t
- narrate format:QGChat "Here is your reward!"
- give money qty:1500
- narrate "You have been rewarded with <&b>$1500<&r>!"
- flag player quest:!
- flag player supplyquestcooldown duration:1d
}
else {
- narrate format:QGChat "You don't have those materials yet...<&nl> You have <&9><player.inventory.qty[cobblestone]><&r>/<&9>128<&r> cobblestone<&nl> and <&9><player.inventory.qty[log]><&r>/<&9>32<&r> logs!"
- narrate format:QGChat "Please come back when you have them all."
}
}
QuestChecks:
type: world
events:
on player kills zombie:
- if <player.has_flag[Quest]> && <player.flag[Quest]> == zombies {
- define killcount <player.flag[QuestKillCount]||0>
- if <def[killcount]> < 10 {
- define killcount <def[killcount].add_int[1]>
- flag <player> QuestKillCount:<def[killcount]>
- if <def[killcount]> < 10 {
- narrate format:QWChat "You have killed <&9><def[killcount]><&r>/<&9>10<&r> zombies!"
}
else {
- narrate format:QWChat "You have killed all 10 zombies. Return for the reward."
}
}
}