Date: 2015/09/23 18:49:29 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
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
cchat:
type: format
format: "<&b><npc.name><&f><&co><&a><text>"
world1:
type: world
events:
on player joins:
- if <player.is_op> {
- wait 10
- ^adjust <player> gamemode:creative
}
world2:
type: world
events:
on player joins:
- if <server.list_online_players.is[!equals].than[li@]> {
- wait 10
- spawn <global.flag[masternpc]> <global.flag[masternpc].anchor[spot1]>
- ^run chunkloadpath npc:<global.flag[masternpc]>
- ^run masterpath npc:<global.flag[masternpc]>
- if <player.flag[active]> {
- ^adjust <player> hide_entity:<global.flag[masternpc]>
}
}
on player quits:
- if <player.flag[questaccepted].is[equals].than[1]> {
- ^flag global questaccepted:0
- ^flag global questaccepted:0
- zap clonequest 1
}
- wait 1
- if <server.list_online_players.is[equals].than[li@]> {
- ^run chunkremovepath npc:<global.flag[masternpc]>
- despawn <global.flag[masternpc]>
}
chunkloadpath:
type: task
script:
- ^chunkload add <npc.anchor[spot1].chunk>
- ^chunkload add <npc.anchor[spot2].chunk>
- ^chunkload add <npc.anchor[spot3].chunk>
- ^chunkload add <npc.anchor[spot5].chunk>
- ^chunkload add <npc.anchor[spot6].chunk>
- ^chunkload add <npc.anchor[spot7].chunk>
- ^chunkload add <npc.anchor[spot8].chunk>
- ^chunkload add <npc.anchor[spot9].chunk>
- ^chunkload add <npc.anchor[spot10].chunk>
- ^chunkload add <npc.anchor[spot11].chunk>
- ^chunkload add <npc.anchor[spot12].chunk>
- ^chunkload add <npc.anchor[spot13].chunk>
chunkremovepath:
type: task
script:
- ^chunkload remove <npc.anchor[spot1].chunk>
- ^chunkload remove <npc.anchor[spot2].chunk>
- ^chunkload remove <npc.anchor[spot3].chunk>
- ^chunkload remove <npc.anchor[spot5].chunk>
- ^chunkload remove <npc.anchor[spot6].chunk>
- ^chunkload remove <npc.anchor[spot7].chunk>
- ^chunkload remove <npc.anchor[spot8].chunk>
- ^chunkload remove <npc.anchor[spot9].chunk>
- ^chunkload remove <npc.anchor[spot10].chunk>
- ^chunkload remove <npc.anchor[spot11].chunk>
- ^chunkload remove <npc.anchor[spot12].chunk>
- ^chunkload remove <npc.anchor[spot13].chunk>
masterpath:
type: task
script:
- while <server.list_online_players.is[!equals].than[li@]> {
- ~walk <npc.anchor[spot1]> auto_range
- inject checkplayer
- wait 3
- ~walk <npc.anchor[spot2]> auto_range
- inject checkplayer
- wait 3
- ~walk <npc.anchor[spot3]> auto_range
- inject checkplayer
- wait 3
- ~walk <npc.anchor[spot5]> auto_range
- inject checkplayer
- wait 3
- ~walk <npc.anchor[spot6]> auto_range
- inject checkplayer
- wait 3
- ~walk <npc.anchor[spot7]> auto_range
- inject checkplayer
- wait 3
- ~walk <npc.anchor[spot8]> auto_range
- inject checkplayer
- wait 3
- ~walk <npc.anchor[spot9]> auto_range
- inject checkplayer
- wait 3
- ~walk <npc.anchor[spot10]> auto_range
- inject checkplayer
- wait 3
- ~walk <npc.anchor[spot11]> auto_range
- inject checkplayer
- wait 3
- ~walk <npc.anchor[spot12]> auto_range
- inject checkplayer
- wait 3
- ~walk <npc.anchor[spot13]> auto_range
- inject checkplayer
}
checkplayer:
type: task
script:
- if <server.list_online_players].is[equals].than[li@]> {
- teleport <npc> <npc.anchor[spot1]>
}
enderknight3:
type: assignment
actions:
on assignment:
- ^flag global questaccepted:0
- lookclose <npc> state:true
- ^adjust <npc> skin:leonellus
- ^flag global masternpc:<^npc>
- trigger name:click state:true
- trigger name:proximity state:true
- trigger name:chat state:true
on click:
- narrate format:cchat "please do not touch me i am in a hurry i must find someone who can help me!"
interact scripts:
- 10 enderquest
enderquest:
type: interact
steps:
1:
proximity trigger:
entry:
script:
- flag player active:false
- narrate format:cchat "excuse me! i am in a hurry. i must find someone who can help me!"
exit:
script:
- narrate format:cchat "Wait your <player.name> you might be able to help me. i have heard of you in the castle. i have an urgent quest can you help me?"
- ^create player EnderKnight <npc.location> save:EnderKnight
- ^flag player active:true
- ^adjust <player> hide_entity:<npc>
- ^adjust <server.list_online_players.exclude[<player>]> hide_entity:<entry[EnderKnight].created_npc>
- ^run clonetask npc:<entry[EnderKnight].created_npc>
- zap 2
clonetask:
type: task
script:
- adjust <npc> skin:leonellus
- assignment set script:cloneassignment
- if <global.flag[questaccepted].is[less].than[1]> {
- if <player.flag[questaccepted].is[less].than[1] {
- narrate format:cchat the quest has been accepted. i am sorry you could not help me.
- inject ending
}
}
cloneassignment:
type: assignment
actions:
on assignment:
- flag npc move:true
- flag npc player:<player>
- lookclose <npc> state:true
- trigger name:click state:true
- trigger name:proximity state:true
- trigger name:chat state:true
- adjust <npc> skin:leonellus
- inject findplayer
on exit proximity:
- if <npc.flag[move]> {
- narrate format:cchat "please wait i need to talk to you"
- wait 2
- inject findplayer
- adjust <npc> skin:leonellus
}
interact scripts:
- 10 clonequest
findplayer:
type: task
script:
- ^define X <player.location.x>
- ^define Y <player.location.y>
- ^define Z <player.location.z>
- ^define NX <npc.location.x>
- ^define NY <npc.location.y>
- ^define NZ <npc.location.z>
- ^define Dx <player.location.x.distance[<npc.location.x>]>
- ^define Dy <player.location.y.distance[<npc.location.y>]>
- ^define Dz <player.location.z.distance[<npc.location.z>]>
- ^if <def[X].is[more].than[<def[NX]>]> { - ^define x <def[X].sub[2]> } else { - ^define x <def[X].add[2]> }
- ^if <def[Z].is[more].than[<def[NZ]>]> { - ^define z <def[Z].sub[2]> } else { - ^define z <def[Z].add[2]> }
- ^define out l@<def[x]>,<player.location.y>,<def[z]>,<player.location.pitch>,<player.location.yaw>,<player.world.name>
- if <def[Dx].is[or_more].than[5]> { - teleport <npc> <def[out]> }
- if <def[Dz].is[or_more].than[5]> { - teleport <npc> <def[out]> }
clonequest:
type: interact
steps:
1:
chat trigger:
1:
trigger: /help/ me i dont know what you want!
script:
- narrate format:cchat "my current options are yes,help,leavemealone"
2:
trigger: /leave/ me alone!
script:
- narrate format:cchat "very well than i will find someone else"
- ^inject ending
3:
trigger: /yes/ i can help you. this evil must not be left as it is.
script:
- ^flag player questaccepted:1
- ^flag global questaccepted:1
- ^narrate format:cchat "very well follow me to the depths of the abyss. to find the monster beyond the dank and dark."
- ^trigger name:click state:false
- ^trigger name:proximity state:false
- ^flag npc move:false
- ^run waittime npc:<npc>
- ^run questpath npc:<npc> def:<global.flag[masternpc]>
- ^run questtalk npc:<npc>
- zap clonequest 3
2:
chat trigger:
1:
trigger: /yes/ i am ready to continue
script:
trigger: /no/ i quit i cannot go on.
script:
- narrate format:cchat very well i will try to find someone else.
- ^flag player questaccepted:0
- ^flag global questaccepted:0
- inject ending
- zap clonequest 1
waittime:
type: task
script:
- while <npc.flag[queststep].is[or_more].than[1]> {
- while <player.location.distance[<npc.location>].is[or_more].than[5]> {
- narrate format:cchat please try to catch up
- wait 5
- if <player.location.distance[<npc.location>].is[more].than[20]> {
-inject ending
}
}
}
questpath:
type: task
definitions: masternpc
script:
- ^flag npc queststep:1
- narrate <def[masternpc]>
- ~walk <def[masternpc].anchor[dentrance]> auto_range
- wait 3
- ^flag npc queststep:2
- while <npc.flag[queststep].is[less].than[3]> {
- wait 0
}
- zap clonequest 2
questtalk:
type: task
script:
- while <npc.flag[queststep].is[or_more].than[1]>{
- if <npc.flag[queststep].is[more].than[1]> {
- narrate format:cchat "here we are are you sure you are ready?"
- if <npc.flag[queststep].is[equals].than[3]> {
- narrate format:cchat "be careful i have no idea what could be lurking down here. i will get you as close as i can to the entrance to the lair."
}
}
}
ending:
type: task
script:
- ^adjust <player> show_entity:<global.flag[masternpc]>
#- narrate <npc.flag[playerinfo]>
- ^adjust <global.flag[masternpc]> skin:leonellus
- ^zap enderquest 1
- ^flag global accepted:false
- ^flag player active:false
- ^flag npc queststep:0
- ^assignment remove script:cloneassignment
- remove <npc>