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
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
|
// ----------------------------------------
// Wyara the Hurnscald witch
// ----------------------------------------
009-2,121,26,0|script|Wyara#_M|103
{
set @Q_MASK, NIBBLE_2_MASK;
set @Q_SHIFT, NIBBLE_2_SHIFT;
set @Q_status, (QUEST_MAGIC2 & @Q_MASK) >> @Q_SHIFT;
// Set up SkillUp function
set @SUP_id, SKILL_MAGIC_NATURE;
set @SUP_name$, "Nature Magic";
set @STATUS_INITIAL, 0;
set @STATUS_PURIFY_EXPLAINED, 1;
set @STATUS_PURIFY_ONCE, 2;
set @STATUS_PURIFY_TWICE, 3;
set @STATUS_PURIFY_OVER, 4;
set @STATUS_MAX, @STATUS_PURIFY_OVER;
// This operation works around an earlier possible corruption of this state
if (@Q_status > @STATUS_MAX)
set @Q_status, @STATUS_INITIAL;
if ((@Q_status == @STATUS_PURIFY_OVER) && (getskilllv(SKILL_MAGIC_NATURE) < 2))
set @Q_status, @STATUS_INITIAL;
callsub S_update_var;
set @has_magic, getskilllv(SKILL_MAGIC);
if (@Q_status == @STATUS_PURIFY_ONCE) goto L_M_purify_once;
if (@Q_status == @STATUS_PURIFY_TWICE) goto L_M_purify_done;
mes "[Wyara the witch]";
mes "\"Greetings, fair traveller! What can I do for you?\"";
next;
set MAGIC_FLAGS, MAGIC_FLAGS | MFLAG_KNOWS_WYARA;
goto L_Main;
L_Main:
if (!@has_magic && (MAGIC_FLAGS & MFLAG_TOUCHED_MANASEED))
menu
"What do you know about...", L_Question,
"Can you help me use the mana seed?", L_Q_manaseed_unabsorbed,
"Can you help me learn magic?", L_Magic,
"I would like to buy potions.", L_Shop,
"Can you reset my stats?", L_StatReset,
"Bye!", L_Close;
if (!(!@has_magic && (MAGIC_FLAGS & MFLAG_TOUCHED_MANASEED)))
menu
"What do you know about...", L_Question,
"Can you help me learn magic?", L_Magic,
"I would like to buy potions.", L_Shop,
"Can you reset my stats?", L_StatReset,
"Bye!", L_Close;
goto L_Shop;
L_Shop:
mes "[Wyara the Witch]";
mes "\"Please have a look at the shelf behind me.\"";
close;
L_StatReset:
set @npcname$, "Wyara";
callfunc "StatReset";
goto L_Close;
L_Question:
callfunc "MagicTalkOptionsSetup";
set @ignore, @QQ_WYARA;
callfunc "MagicTalkMenu";
if (@c == 0) goto L_Main;
if (@c == @QQ_ELANORE) goto L_Q_elanore;
if (@c == @QQ_MANASEED) goto L_Q_manaseed;
if (@c == @QQ_MANAPOTION) goto L_Q_manapotion;
if (@c == @QQ_SAGATHA) goto L_Q_sagatha;
if (@c == @QQ_AULDSBEL) goto L_Q_auldsbel;
if (@c == @QQ_IMP) goto L_Q_imp;
if (@c == @QQ_OLDWIZ) goto L_Q_old_wizard;
if (@c == @QQ_ASTRALSOUL) goto L_Q_astralsoul;
mes "[Wyara the Witch]";
mes "\"I fear that I can't help you with that.\"";
next;
goto L_Main;
L_Q_astralsoul:
mes "[Wyara the Witch]";
mes "\"The astral soul skill? Yes, I have heard about that. It can be taught by old and wise mages usually.\"";
next;
mes "\"You need lots of practise until you can handle the ability, and even more practise until you have the powers to teach it to someone else.\"";
next;
goto L_Main;
L_Q_old_wizard:
mes "[Wyara the Witch]";
mes "\"I don't know his name, but I do know that he has been living in the mountains since I first came here. He is a master of many schools of magic, I believe.\"";
next;
mes "[Wyara the Witch]";
mes "She smiles.";
mes "\"He is also a nice and friendly person to talk to, and quite knowledgeable about the teas of this area.\"";
next;
goto L_Main;
L_Q_elanore:
mes "[Wyara the Witch]";
mes "\"Elanore is the Tulimshar healer. She is a very kind person and an outstanding healer.\"";
next;
goto L_Main;
L_Q_manaseed:
if (!@has_magic && (MAGIC_FLAGS & MFLAG_TOUCHED_MANASEED))
goto L_Q_manaseed_unabsorbed;
mes "[Wyara the Witch]";
mes "\"A mana seed? I'm afraid that I can't help you with that.\"";
next;
goto L_Main;
L_Q_manaseed_unabsorbed:
mes "[Wyara the Witch]";
mes "\"So you touched the mana seed but weren't able to absorb its powers? That means that you're lacking a natural magical ability. Still, there are ways around that.\"";
next;
mes "[Wyara the Witch]";
mes "\"If you drink a mana potion, you should be able to retain this magical power and slowly build up a magical skill.\"";
set MAGIC_FLAGS, MAGIC_FLAGS | MFLAG_KNOWS_MANAPOTION;
next;
goto L_Main;
L_Q_manapotion:
mes "[Wyara the Witch]";
mes "\"I have a simple recipe for making mana potions, but I don't have one ready right now. Can you bring me 40 mauve leaves and a bottle of water? I can make one from those quite easily.\"";
next;
menu
"Sure!", L_make_manapotion,
"No.", L_Main;
L_manapotion_toomany:
mes "[Wyara the Witch]";
mes "\"Hmm... looking at you, I don't think that you would be able to carry it.\"";
next;
goto L_Main;
L_make_manapotion:
if(countitem("MauveHerb") < 40)
goto L_make_manapotion_lack;
if(countitem("BottleOfWater") < 1)
goto L_make_manapotion_lack;
getinventorylist;
if ((@inventorylist_count == 100)
&& (countitem("MauveHerb") > 40)
&& (countitem("BottleOfWater") > 100)
&& (countitem("ManaPotion") < 1))
goto L_manapotion_toomany;
delitem "MauveHerb", 40;
delitem "BottleOfWater", 1;
getitem "ManaPotion", 1;
mes "[Wyara the Witch]";
mes "Wyara takes your mauve leaves, grinds them, and pours some of the resultant paste into her cauldron. She then takes your bottle and sticks it into her brew, head-first.";
next;
mes "[Wyara the Witch]";
mes "The water in the bottle takes on a strange golden hue, but doesn't flow out.";
mes "After a while, she retrieves the bottle and pours some of the liquid into a smaller clay bottle. She proceeds to mix in the rest of the paste, then plugs the bottle and shakes it.";
next;
mes "[Wyara the Witch]";
mes "\"I shall keep the rest of your water and the bottle as a payment, if you don't mind. But here is the potion; let it rest for a minute before you use it for maximum effect.\"";
next;
goto L_Main;
L_make_manapotion_lack:
mes "[Wyara the Witch]";
mes "\"No, we need forty mauve leaves and a bottle of water.\"";
next;
goto L_Main;
L_Q_imp:
mes "[Wyara the Witch]";
mes "\"Sagatha told me that she imprisoned an evil earth spirit in a dried-up well. She wants it to stay there until it has mended its ways, or forever, if it doesn't.\"";
next;
goto L_Main;
L_Q_sagatha:
mes "[Wyara the Witch]";
mes "Wyara smiles.";
mes "\"You have met Sagatha? She's a wonderful person, isn't she? Well, she does hold back a little towards humans, but deep down she feels for them, too.\"";
next;
mes "[Wyara the Witch]";
mes "\"She does hold all plants and animals very dear, though. Well, the peaceful ones more than the aggressive ones, I suppose, and scorpions not very much at all.\"";
next;
goto L_Main;
L_Q_auldsbel:
mes "[Wyara the Witch]";
mes "\"Auldsbel... the guild wizard? I don't know him very well; as far as I know, he is only visiting.\"";
next;
goto L_Main;
L_M_no:
mes "[Wyara the Witch]";
mes "\"I am sorry, but you don't seem to be able to control any magic. That means that I really can't help you with that.\"";
next;
goto L_Main;
L_Magic:
if (!@has_magic)
goto L_M_no;
mes "[Wyara the Witch]";
mes "\"Perhaps I can help you a little, but I am not a master of any school of magic.\"";
next;
goto L_M_main;
L_M_main:
menu
"Can you explain magic to me?", L_M_explain,
"Can you teach me a spell?", L_M_spell,
"Can you train me?", L_M_train,
"Never mind.", L_Main;
L_M_explain:
mes "[Wyara the Witch]";
mes "\"Magic is just a name for the force that lives in all plants and animals and emanates from there into all things, living or dead.\"";
next;
mes "[Wyara the Witch]";
mes "\"Some things it finds easier to pass through – natural things, living things – but dead things, such as rock or metal, can slow it down.\"";
next;
mes "[Wyara the Witch]";
mes "\"There are different kinds of magic, too; nature, astral, and so on, but if this interests you, you should talk to a scholar.\"";
next;
goto L_M_main;
L_M_spell:
if (getskilllv(SKILL_MAGIC_NATURE) > 1)
goto L_M_spell3;
if (getskilllv(SKILL_MAGIC) > 1)
goto L_M_spell2;
mes "[Wyara the Witch]";
mes "\"No... I don't think that you are ready yet. But please ask me again when you have some more control over your magical powers.\"";
next;
goto L_M_main;
L_M_spell3:
mes "[Wyara the Witch]";
mes "\"Now that you know the basics of nature magic, here is one of my favourites: '" + ("rain") + "' will summon rain, whereever you are standing. It will consume a bottle of water, though.\"";
if (getskilllv(SKILL_MAGIC) < 2)
mes "\"You are not powerful enough to use it yet, though; you will first have to absorb more magic from the mana seed.\"";
next;
goto L_M_spell2;
L_M_spell2:
mes "[Wyara the Witch]";
mes "\"Here is another useful one: '" + ("detect-players") + "'. It will tell you the names of everyone nearby, but beware that there are ways to protect against it.\"";
if (getskilllv(SKILL_MAGIC) < 2)
mes "\"Hmm. You aren't powerful enough for this one either yet, I think.\"";
next;
if (!(getpartnerid2()))
goto L_M_main;
mes "[Wyara the Witch]";
mes "\"Married partners can find each other even more easily. Use the '" + ("sense-spouse") + "' spell instead.\"";
next;
goto L_M_main;
L_M_train:
if (getskilllv(SKILL_MAGIC_NATURE) > 1)
goto L_M_train_no;
mes "[Wyara the Witch]";
if (@Q_status >= @STATUS_PURIFY_EXPLAINED)
goto L_M_train_wb;
mes "\"Train you? No... you should talk to Sagatha.\"";
mes "She hesitates.";
next;
callfunc "SagathaStatus";
if (@evil) goto L_M_train_evil;
mes "[Wyara the Witch]";
mes "\"It would be difficult to ask her to accept you unless you understand some of the basics already.\"";
next;
goto L_M_train_dispatch;
L_M_train_evil:
mes "Wyara looks at you sadly.";
mes "\"I have heard that you have done something unforgiveable. No witch in this land will teach you now.\"";
next;
goto L_M_main;
L_M_train_wb:
callfunc "SagathaStatus";
if (@evil)
goto L_M_train_evil;
mes "\"Ah, yes, your training...\"";
next;
goto L_M_train_dispatch;
L_M_train_dispatch:
if (@Q_status == @STATUS_PURIFY_TWICE)
goto L_M_purify_done;
if (@Q_status == @STATUS_PURIFY_ONCE)
goto L_M_purify_once;
if (@Q_status == @STATUS_PURIFY_EXPLAINED)
goto L_M_purify_explained;
mes "[Wyara the Witch]";
mes "\"Well, let me help you get started, then! But first, to make sure that you are serious, I have a small task for you.\"";
next;
mes "[Wyara the Witch]";
mes "\"There is a pond west of Hurnscald, a very small one, almost square in shape, with a rock on its southern ledge leading to its center. This pond is close to dying.\"";
next;
mes "[Wyara the Witch]";
mes "\"I want to save it; for that, someone will have to pour a purification potion into it.\"";
next;
set @Q_status, @STATUS_PURIFY_EXPLAINED;
callsub S_update_var;
goto L_M_purify_explained;
L_M_purify_explained:
if (countitem("PurificationPotion"))
goto L_M_purify_doit;
mes "[Wyara the Witch]";
mes "\"To make the purification potion, I will need twenty maggot slimes and twenty leaves of mauve.\"";
next;
menu
"I shall get them later.", L_M_main,
"Booring.", L_M_main,
"Here they are.", L_Next;
L_Next:
getinventorylist;
if ((@inventorylist_count == 100) && (countitem("MauveHerb") > 20) && (countitem("MaggotSlime") > 20))
goto L_M_purify_nospace;
if (countitem("MauveHerb") < 20)
goto L_M_purify_lacking;
if (countitem("MaggotSlime") < 20)
goto L_M_purify_lacking;
delitem "MauveHerb", 20;
delitem "MaggotSlime", 20;
getitem "PurificationPotion", 1;
mes "[Wyara the Witch]";
mes "Wyara grinds the leaves and mixes them with the slime, boils them, then speaks a brief incantation over them and hands you the result.";
next;
goto L_M_purify_doit;
L_M_purify_doit:
mes "[Wyara the Witch]";
mes "\"Take your purification potion to the pond, right next to its center, and pour the potion in.\"";
close;
L_M_purify_nospace:
mes "[Wyara the Witch]";
mes "\"You don't have enough space to carry the potion. Please come back later.\"";
next;
goto L_M_main;
L_M_purify_lacking:
mes "[Wyara the Witch]";
mes "\"You'll need twenty mauve leaves and twenty maggot slimes for the potion.\"";
next;
goto L_M_main;
L_M_purify_once:
mes "[Wyara the Witch]";
mes "Wyara nods.";
mes "\"You have purified the pond a little, but not enough, I think. We'll need another potion.\"";
next;
if (countitem("PurificationPotion"))
goto L_M_purify_doit2;
mes "[Wyara the Witch]";
mes "\"I'll need twenty more maggot slimes and leaves of mauve.\"";
next;
menu
"I'll do that later.", L_Main,
"No way.", L_Main,
"Here you are.", L_Next1;
L_Next1:
getinventorylist;
if ((@inventorylist_count == 100) && (countitem("MauveHerb") > 20) && (countitem("MaggotSlime") > 20))
goto L_M_purify_nospace;
if (countitem("MauveHerb") < 20)
goto L_M_purify_lacking;
if (countitem("MaggotSlime") < 20)
goto L_M_purify_lacking;
delitem "MauveHerb", 20;
delitem "MaggotSlime", 20;
getitem "PurificationPotion", 1;
mes "[Wyara the Witch]";
mes "Wyara brews another purification potion.";
next;
goto L_M_purify_doit2;
L_M_purify_doit2:
mes "[Wyara the Witch]";
mes "\"Please apply this one quickly, again.\"";
close;
L_M_purify_done:
mes "[Wyara the Witch]";
mes "Wyara smiles at you.";
mes "\"A friend told me... you have saved the pond for now. Perhaps it will need some more attention later, but I'll ask others for this.\"";
next;
mes "[Wyara the Witch]";
mes "\"Please sit down and touch the ground.\"";
next;
menu
"Very well.", L_Next2,
"No way!", L_M_purify_abort;
L_Next2:
mes "[Wyara the Witch]";
mes "You sit down and touch the ground, and so does Wyara.";
next;
mes "[Wyara the Witch]";
mes "You sense the earth, through the floor boards, and begin to feel one with it, as if you were a plant or rock.";
next;
mes "[Wyara the Witch]";
mes "The gentle breeze coming in through the window begins to take on a very different quality, as if it were the gentle caress of a mother soothing her child.";
next;
mes "[Wyara the Witch]";
mes "You can sense the water within the ground, and from it you sense your sisters and brothers, plants, animals, people...";
next;
mes "[Wyara the Witch]";
mes "Slowly, the sensation recedes, but you feel changed.";
set @SUP_xp, 5000;
set @SUP_lvl, 2;
callfunc "SkillUp";
set @Q_status, @STATUS_PURIFY_OVER;
callsub S_update_var;
close;
L_M_purify_abort:
mes "[Wyara the Witch]";
mes "\"I can't help you if you don't subject yourself to the ritual.\"";
close;
L_M_train_no:
mes "[Wyara the Witch]";
mes "\"I can't teach you anything at this time. Perhaps Sagatha can help you, but I'm not sure if she will accept you as a student.\"";
next;
goto L_M_train_sagatha;
L_M_train_sagatha:
menu
"OK.", L_M_main,
"How can I convince her to accept me?", L_Next3;
L_Next3:
callfunc "SagathaStatus";
mes "[Wyara the Witch]";
if (@evil)
goto L_M_train_s_fail;
if (getskilllv(SKILL_MAGIC) < 2)
goto L_M_train_s_lvl1;
if (@good > 1)
mes "\"Come to think of it, I have heard good things about you. Perhaps she will be willing to accept you as a student now?\"";
if (@good == 1)
mes "\"I have heard some good things about you, but I'm not sure if it will be enough to sway her – she is hesitant to accept students.\"";
if (@good == 0)
mes "\"Sagatha cares greatly about all living creatures, but particularly about the creatures of the forest. If you are kind to them, she will be more likely to be kind to you.\"";
next;
if (@druid == 3)
goto L_M_main;
mes "[Wyara the Witch]";
mes "She smiles.";
mes "\"Actually, I think I know of a good thing you could do. There is a very special tree in the desert south-east of Tulimshar, a tree that has been there for a very long time.\"";
next;
mes "[Wyara the Witch]";
mes "\"The tree is slowly dying – and has been for a long time – but it is there because of a wonderful thing that happened long ago. Tend to it, and I am sure that she will learn about this.\"";
next;
set MAGIC_FLAGS, MAGIC_FLAGS | MFLAG_KNOWS_DRUIDTREE;
menu
"What is that tree?", L_M_train_t_backgd,
"How should I tend to it?", L_Next4,
"Nah.", L_M_main;
L_Next4:
mes "[Wyara the Witch]";
mes "\"The tree has been there alone and unattended for a long time; what he needs most is water and affection. Give him both.\"";
next;
mes "[Wyara the Witch]";
mes "She hesitates for a moment.";
mes "\"But stay away from the well in the area. There is no water in there anymore, and it's also dangerous.\"";
next;
goto L_M_main;
L_M_train_t_backgd:
mes "[Wyara the Witch]";
mes "\"Many generations ago, there was a lush, green oasis in the desert south-east of Tulimshar. Plants of all kinds grew there, and many animals, including mouboos, made this place their home.\"";
next;
mes "[Wyara the Witch]";
mes "\"Then there came war, and some people pleaded to the demon Grenxen. He founded Tulimshar, and to provide it with water he changed the underground waterflow. The oasis began to dry out quickly.\"";
next;
mes "[Wyara the Witch]";
mes "\"But the oasis, like many such places back in the old days, had a druid watching over it. The druid refused to accept what Grenxen had done, but he was powerless to revert or change it.\"";
next;
mes "[Wyara the Witch]";
mes "\"All he could do was to delay the inevitable, to give the animals and nomads some time to adapt.\"";
next;
mes "[Wyara the Witch]";
mes "\"But to do so, he had to reach the water streams deep underground. Thus, he turned himself into a tree, a deep-rooted fyrad, so that his roots could reach underground.\"";
next;
mes "[Wyara the Witch]";
mes "\"He had to exert himself tremendously; he had to grow deep, quickly; I believe that no druid or witch has summoned such magic before or since. But he succeeded, and for a while he saved the oasis.\"";
next;
mes "[Wyara the Witch]";
mes "\"Many generations he remained the only one ever to have successfully defied Grenxen, but this came at a price: he had to remain a tree, and he never turned back.\"";
next;
mes "[Wyara the Witch]";
mes "\"I believe that he has not forgotten his old magic, because even though a tree remembers many things for a very long time, trees are not keen to change things, not even themselves.\"";
next;
mes "[Wyara the Witch]";
mes "\"Now he stands alone in the desert, dried-up and forgotten, with no-one remembering him.\"";
next;
mes "[Wyara the Witch]";
mes "\"Please give him water, for he is always in need of it, and thank him for his sacrifice. It is all we can do for him now.\"";
next;
goto L_M_t_menu;
L_M_t_menu:
menu
"How should I give him water?", L_M_t_water,
"How should I thank him?", L_M_t_remind,
"I will.", L_M_main,
"No.", L_M_main;
L_M_t_water:
mes "[Wyara the Witch]";
mes "\"A bottle of water would probably not be enough. No, you would have to water the ground all around... that's too many bottles. You will have to get water from elsewhere.\"";
next;
goto L_M_t_menu;
L_M_t_remind:
mes "[Wyara the Witch]";
mes "\"Give him a sign of affection. Something that works with a tree, but also something that humans might do to each other, to remind him of his days as a human.\"";
next;
mes "[Wyara the Witch]";
mes "\"Yes... that would be important. Show your affection in the same way that you might towards a human.\"";
next;
goto L_M_t_menu;
L_M_train_s_fail:
mes "She shakes her head.";
mes "\"No... from what I have heard, you have done something unforgivable. I very much doubt that you can be her student now, and I won't teach you any further either.\"";
next;
goto L_M_main;
L_M_train_s_lvl1:
mes "\"Well, you're still a bit of a beginner, so I don't think she will accept you yet. Maybe you can absorb some more power from the mana seed? If you can grow your magical powers a little, I might be able to help you.\"";
next;
goto L_M_main;
L_Close:
close;
S_update_var:
set QUEST_MAGIC2, (QUEST_MAGIC2 & ~(@Q_MASK) | (@Q_status << @Q_SHIFT));
return;
}
|