Date: 2016/05/04 00:01:24 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
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
# ===================================================
#
# Server Greeter Chat Format
#
# ===================================================
cChat:
type: format
format: "<aqua><npc.name><white><&co> <green><text>"
# ===================================================
#
# The Server Greeter Assignment
#
# ===================================================
ServerGreeter:
type: assignment
actions:
on assignment:
- trigger name:click state:true
- trigger name:chat state:true
- lookclose <npc> state:true range:5 realistic
default constants:
isNarrating: false
sentWaitingMessage: false
interact scripts:
- 10 ServerGreeter_interact
# ===================================================
#
# The main server greeter interaction script
#
# ===================================================
ServerGreeter_interact:
type: interact
steps:
1:
click trigger:
script:
# If the player has already had the tutorial, we can say different things to them
- if <player.flag[hadTutorial]> {
- narrate ""
- narrate format:cChat "Hello again <player.name>! Still UnAwakened, I see. Interesting it is, that you have not yet chosen the Aspect which best suits you."
- wait 2
- narrate ""
- narrate format:cChat "Would you like the short tutorial and tour again? (<dark_green>Yes<&r> or <dark_red>No<&r>) - or for information, (<dark_gray>Aspects<&r>, <blue>Facet<&r>, or <dark_aqua>Attribute<&r>)"
- narrate ""
} else {
# Otherwise,
- narrate ""
- narrate format:cChat "Hello <player.name>! I am Kieliah, your guide to embracing the destiny that fate has seen fit to bestow upon you. You are now an UnAwakened - one who's soul has been torn from your body, and thrust into this new world. "
- wait 2
- narrate ""
- narrate format:cChat "Would you like a short tutorial (and tour) about the server?"
- narrate ""
- narrate "<&r>-- You can say <dark_green>Yes<&r> for the tutorial, or <dark_red>No<&r> to just continue on to race selection. You can also say <dark_gray>Aspects<&r>, <blue>Facet<&r>, or <dark_aqua>Attribute<&r> for respective information"
- narrate ""
}
# Send off to step 2 for chat responses, only if the player has interacted for step 1
- zap 2
2:
chat trigger:
1:
trigger: /No/ thanks.
script:
- narrate ""
- if <player.flag[hadTutorial]> {
- random 4
- narrate format:cChat "Well, you know where I stay, <player.name>!"
- narrate format:cChat "Ok <player.name>. If you need a refresher, I will be here!"
- narrate format:cChat "Ah, you UnAwakened. So indecisive."
- narrate format:cChat ".... ok."
} else {
- random 4
- narrate format:cChat "Alright. I will be here if you change your mind."
- narrate format:cChat "Ok <player.name>. You can find me here if you change your mind."
- narrate format:cChat "Ah well, here I shall wait for other newly UnAwakened..."
- narrate format:cChat "DARN! I was hoping to get out and walk some! "
}
- narrate ""
# Reset script to allow interaction once more
- zap 1
2:
trigger: Why /yes/, I would like to know more about the server!
script:
# Start tutorial and tour - Create the 'phased' npc for the player, and remove the -real- npc
- ^create witch "Kieliah" <npc.location> save:ServerGreeter_guide
- ^adjust <server.list_online_players.exclude[<player>]> hide_entity:<entry[ServerGreeter_guide].created_npc>
- ^adjust <player> hide_entity:<npc>
# Check if the player is on a follow-up tour
- if <player.flag[hadTutorial]> {
- narrate format:cChat "Another tour, <player.name>? Excellent! I need the exercise, so follow me once more and I shall explain the server and its lore!"
} else {
- narrate format:cChat "Alright then, follow me and I will tell you a little about how the server works, as well as provide you with some lore and background on the worlds you now call home."
}
- narrate ""
# Run the walking task, which will call specific steps in the dialog for narration
- ^run ServerGreeter_path npc:<entry[ServerGreeter_guide].created_npc> def:<^npc>
- ^run ServerGreeter_talk npc:<entry[ServerGreeter_guide].created_npc>
# Set the script to step 3, to disallow this player from accessing it until after the tour
- zap 3
# ===================================================
#
# The Server Greeter walking path
#
# ===================================================
ServerGreeter_path:
type: task
definitions: sGreeter
script:
# Start the walking. We want to be talking while walking, but we do not want to move
# from point to point until some text has been done. There are 7 stops before the
# Server Greeter returns to it's starting location.(the 8th 'stop')
# -------------------------------------------------
#
# Wait for 2 seconds, allowing the narrate script
# to start the story before we start moving
#
# -------------------------------------------------
- wait 2
# -------------------------------------------------
#
# Moving to the SpacePort window
#
# -------------------------------------------------
# Walk to the midpoint of Start -> SpacePort waypoints, wait for player
- ~walk <def[sGreeter].anchor[wpStart-SpacePort]> auto_range
- ^inject ServerGreeter_narrate def:1
# Walk to SpacePort waypoint, set flag that we are at "step 1", wait for player
- ~walk <def[sGreeter].anchor[SpacePort]> auto_range
- ^flag <npc> step:1
- ^inject ServerGreeter_narrate def:1
# wait until narration is complete before moving on
- while <npc.flag[isNarrating]> {
- wait 1
}
# -------------------------------------------------
#
# Moving from SpacePort to Parolit window
#
# -------------------------------------------------
- ~walk <def[sGreeter].anchor[wpSpacePort-Parolit-1]> auto_range
- ^inject ServerGreeter_narrate def:1
- ~walk <def[sGreeter].anchor[wpSpacePort-Parolit-2]> auto_range
- ^inject ServerGreeter_narrate def:1
- ~walk <def[sGreeter].anchor[wpSpacePort-Parolit-3]> auto_range
- ^inject ServerGreeter_narrate def:1
- ~walk <def[sGreeter].anchor[Parolit]> auto_range
- ^inject ServerGreeter_narrate def:1
- ^flag <npc> step:2
# wait until narration is complete before moving on
- while <npc.flag[isNarrating]> {
- wait 1
}
# -------------------------------------------------
#
# Return to the Start point, remove the fake NPC
# greeter and re-show the placeholder Greeter
#
# -------------------------------------------------
# Return to Start
- flag <npc> step:3
- ~walk <def[sGreeter].anchor[Start]> auto_range
- wait 3
- remove <npc>
- adjust <player> show_entity:<def[sGreeter]>
# And allow the greeter to take this player on another tour
- zap 1 script:s@ServerGreeter_interact
# ===================================================
#
# The Server Greeter Talking points
#
# Narrate based on the step we are in. We do this for
# walking to a point, and then at the point, through
# the tour
#
# ===================================================
ServerGreeter_talk:
type: task
script:
# -------------------------------------------------
#
# Welcome the player based on whether they have
# done the intro or not, and begin tour. Walk to
# the SpacePort display window
#
# -------------------------------------------------
# set the narrating flag to true so we stop at the SpacePort window
- flag <npc> isNarrating:true
# Start narration for server background
- ~run ServerGreeter_narrate "def:2|This server is designed with entirely custom lore - that is the items, enemies, areas, system - virtually everything is customized."
- ~run ServerGreeter_narrate "def:5|In doing so, it also pays homage to old 8-bit and 16-bit games like <dark_blue>Final Fantasy<white>, <gold>Phantasy Star<white>, <dark_green>Zelda<white>, <dark_red>Golvellius<white>, <light_purple>Zillion<white>, <green>and others"
# -------------------------------------------------
#
# Tour is at SpacePort window. Explain relevance
# of the SpacePort, and that there are connections
# to many other areas for the player
#
# -------------------------------------------------
# Wait until the NPC is at the SpacePort window before continuing narration
- while <npc.flag[step].is[LESS].than[1]> {
- wait 1
}
# Talk about the SpacePort
- ~run ServerGreeter_narrate "def:10|Through this window, you can see the SpacePort below us. It is here that you will access the main adventure world, server shops, purchase housing vouchers and store ownership deeds."
# set the narrating flag to false so we leave the SpacePort window
- flag <npc> isNarrating:false
# Start talking as we leave the window
- ~run ServerGreeter_narrate "def:3|The SpacePort is also the central point of access for the player shops, player housing, and the start of your adventure."
# set the narrating flag back to true so we stop at the Parolit window
- flag <npc> isNarrating:true
# -------------------------------------------------
#
# Walking away from SpacePort window and onward to
# the Parolit display window.
#
# -------------------------------------------------
- ~run ServerGreeter_narrate "def:7|The start of your adventure begins once you have completed attunement with the Aspect of your choice. We will get to that in a moment, as there is much more to explain to you about this world."
# wait until the NPC is at the walk destination before moving onward
- while <npc.flag[step].is[LESS].than[2]> {
- wait 1
}
# set the narrating flag to true
- flag <npc> isNarrating:true
# Talk about the SpacePort
- look <npc> <npc.location.add[<location[2209,130,1555,30,-15,<npc.world.name>]>.direction.vector]>
- ~run ServerGreeter_narrate "def:8|Look here - you see that railway? At the other end of that railway is Parolit."
# set the narrating flag to false
- flag <npc> isNarrating:false
# ===================================================
#
# The Server Greeter narrate section
#
# Takes a time delay and text to narrate
#
# Validates player is close to greeter
#
# Allows for delay without narration, narration
# without delay, or neither (delay == 2 ticks)
#
# ===================================================
ServerGreeter_narrate:
type: task
definitions: delay|text
# Set up default constants
default constants:
# Time that the NPC will wait for, in seconds
npcWaitTime: 60
# Distance that the NPC will check for the player
npcMaxDistance: 4
script:
# Only display text if text was asked for
- if <def[text].exists> {
- narrate format:cChat %text%
- narrate ""
}
# If a delay was passed, wait for that long. Otherwise, wait for 2 ticks by default
- if <def[delay].exists> {
- wait %delay%
} else {
- wait 2t
}
# Pauses the script for narration, and also checks for player in area before moving onward
- ^while <npc.location.distance[<player.location>].is[OR_MORE].than[npcMaxDistance]> {
- flag <player> waitedTooLong:++
# If the player was away from the NPC for too long, reset.
- if <player.flag[waitedTooLong].is[OR_MORE].than[npcWaitTime]> {
# Clear flag, set tour Running to false
- flag <player> waitedTooLong:!
- flag <player> tourRunning:false
- narrate ""
- narrate format:cChat "Where have you gone, <player.name><&r>? I have waited long enough."
- narrate ""
- queue clear
}
# If we have sent a waiting message in the last 10 seconds, dont send one
- if !<player.flag[sentWaitingMessage]> {
# Otherwise set the sentWaitingMessage flag
- flag <player> sentWaitingMessage:true duration:10s
# and send a random waiting message
- random 6
- narrate format:cChat "Do try to keep up, <red><player.name><&r>!"
- narrate format:cChat "Why are you making me wait around, <red><player.name><&r>?"
- narrate format:cChat "I don't have all day <red><player.name><&r> - let's move it!"
- narrate format:cChat "Do I look like Damor the Soothsayer to you? <red><player.name><&r>, get a move on!"
- narrate format:cChat "I think Cloud spent less time in that tank than I am, right now, waiting for you <red><player.name><&r>!"
- narrate format:cChat "... ... ... ... ... ... ... ... <red><player.name><&r>!!!! "
- narrate ""
}
# Wait for the player to get in range again
- wait 1
}
# Remove the waitedTooLong flag (player got closer)
- flag <player> waitedTooLong:!