summaryrefslogtreecommitdiff
path: root/world/map/npc/011-1/auldsbel.txt
blob: c6816eecddbc64c2695a0944c29c8b5198d62a81 (plain) (blame)
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
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
// Auldsbel the Wizard
// Transmutation Magic expert

011-1.gat,50,68,0|script|Auldsbel#_M|168,{

    set @mexp, MAGIC_EXPERIENCE & 65535;

    // Set up SkillUp function
    set @SUP_id, SKILL_MAGIC_TRANSMUTE;
    set @SUP_name$, "Transmutation Magic";

    set @Q_STATUS_INITIAL, 0;
    set @Q_STATUS_POSTINTRO, 1;
    set @Q_STATUS_INITIATION, 2; // quest for being able to cast `create mouboo figurine'
    set @Q_STATUS_STUDENT, 3; // accepted as student
    set @Q_STATUS_STUDENT0, 4; // accepted as student
    set @Q_STATUS_STUDENT1, 5;
    set @Q_STATUS_STUDENT2, 6;
    set @Q_STATUS_STUDENT3, 7;
    set @Q_STATUS_STUDENT4, 8;
    set @Q_STATUS_STUDENT5, 9;
    set @Q_STATUS_STUDENT6, 10;


    set @wants_sulphur, (QUEST_MAGIC & (NIBBLE_6_MASK | NIBBLE_7_MASK)) // war quest
        || (((QUEST_MAGIC2 & NIBBLE_1_MASK) >> NIBBLE_1_SHIFT) >= 4); // Elanore's heal-Kadiya quest
    set @wants_ironpowder, (((QUEST_MAGIC & (NIBBLE_6_MASK | NIBBLE_7_MASK)) >> NIBBLE_6_SHIFT) >= 7);

    set @Q_MASK, NIBBLE_0_MASK | NIBBLE_1_MASK;
    set @Q_SHIFT, NIBBLE_0_SHIFT;

    set @Q_status, (QUEST_MAGIC & @Q_MASK) >> @Q_SHIFT;

    set @Q_main_status, @Q_status & 31;
    set @Q_component_quest, @Q_status >> 5;

    set @has_magic, getskilllv(SKILL_MAGIC);

    set @address$, "chap";
    if (Sex == 0)
        set @address$, "girl";

    if (@Q_main_status >= @Q_STATUS_POSTINTRO)
        goto L_short_intro;

    mes "[Robed Man]";
    mes "You notice a middle-aged man in expensive-looking robes.";
    mes "\"Ah, splendid, you finally came!\"";
    mes "He motions you to come closer.";
    next;
    mes "[Robed Man]";
    mes "The man is visibly excited.";
    mes "\"Here, I found a silk cocoon.  Now if you can just give me the obsidian salt, we can see whether it works!\"";
    next;
    menu
        "Whether what works?", L_intro_explain,
        "What are you talking about?", L_intro_explain,
        "I don't have any obsidian salt.", L_intro_nopowder,
        "Do I know you?", L_intro_identity,
        "Goodbye.", -;
    close;

    set @name_complaint, 0;

L_intro_explain:
    mes "[Robed Man]";
    mes "He frowns.";
    mes "\"The transmutation experiment, of course!  You can't have forgotten already...?\"";
    next;
    goto L_intro_identity;

L_intro_nopowder:
    mes "[Robed Man]";
    mes "\"What!?  You traveled all this way without any obsidian...\"";
    next;
    goto L_intro_identity;

L_intro_identity:
    mes "[Robed Man]";
    mes "He eyes you more carefully.";
    if (Sex == 0)
        mes "\"How odd.  I could have sworn that you were a man the last time we met.  Not that I mind...\"";
    mes "\"Wait.  You're not Padric.\"";
    next;
    set @xmsg$, "Right... my name is " + strcharinfo(0) + ".";
    if (strcharinfo(0) == "Padric")
        set @xmsg$, "Actually, I am, but I don't know you...?";
    menu
        @xmsg$, L_intro_wrongperson,
        "You're not very good with faces, are you?", L_intro_nogood,
        "Who are you?", L_intro_who_are_you,
        "Goodbye.", -;
    close;

L_intro_wrongperson:
    mes "[Robed Man]";
    mes "He laughs.";
    mes "\"Ah, I knew it... you're not the first one today, either.  I should apologize, I am horrible with faces.  Well, if you don't mind, please hurry along, I should go back to my experiments.\"";
    next;

L_intro_primary_menu:
    menu
        "Who are you?", L_intro_who_are_you,
        "Goodbye.", -;
    close;

L_intro_nogood:
    mes "[Robed Man]";
    mes "He laughs.";
    mes "\"Yes, you could say that.  Well, I shall get back to my experiments, then; I think I shall manage something that requires no obsidian salt instead.\"";
    next;
    menu
        "Who are you?", L_intro_who_are_you,
        "What is obsidian salt, anyway?", L_intro_obsidian_salt,
        "Goodbye.", -;
    close;

L_intro_obsidian_salt:
    mes "[Robed Man]";
    mes "\"Oh, obsidian salt is a catalyst... or rather a theoretical catalyst.  We know that it has to have an application somewhere, and I do have the strong suspicion that it may be linked to natural transmogrification...\"";
    next;
    goto L_intro_primary_menu;

L_intro_who_are_you:
    mes "[Robed Man]";
    mes "\"Oh, oh my...  of course you wouldn't know me, being from the countryside and all.\"";
    mes "He laughs.";
    mes "\"Well, my young friend, I am none other than Auldsbel the Graying, of the Council of Transmuters!\"";
    next;

    set @Q_main_status, @Q_STATUS_POSTINTRO;
    callsub S_update_var;
    set MAGIC_FLAGS, MAGIC_FLAGS | MFLAG_KNOWS_AULDSBEL;

    mes "[Auldsbel the Wizard]";
    mes "\"That means that I'm a wizard, in case you were wondering.\"";
    next;
    goto L_main_menu;

L_short_intro:
    mes "[Auldsbel the Wizard]";
    mes "\"Welcome back, Padric!\"";
    next;
    goto L_main_menu;

L_main_menu:
    if (@has_magic)
        goto L_main_menu_magic;

    menu
        "How does this 'magic' work?", L_about_magic,
        "I want to become a wizard!", L_learn_magic,
        "Where are you from?", L_about_auldsbel,
        "Do you need help with your experiments?", L_quest,
        "What do you know about...", L_question,
        "Goodbye.", -;
    close;

L_main_menu_magic:
    if (@wants_sulphur && @wants_ironpowder)
        menu
            "How does magic work?", L_about_magic,
             "Can you teach me a spell?", L_learn_spell,
             "Where are you from?", L_about_auldsbel,
             "Do you need help with your experiments?", L_quest,
             "What do you know about...", L_question,
             "Can you make sulphur powder?", L_sulphur,
             "Can you make iron powder?", L_ironpowder,
             "Goodbye.", -;
    if (@wants_sulphur && !@wants_ironpowder)
        menu
            "How does magic work?", L_about_magic,
            "Can you teach me a spell?", L_learn_spell,
            "Where are you from?", L_about_auldsbel,
            "Do you need help with your experiments?", L_quest,
            "What do you know about...", L_question,
            "Can you make sulphur powder?", L_sulphur,
            "Goodbye.", -;
    if (!@wants_sulphur)
        menu
            "How does magic work?", L_about_magic,
            "Can you teach me a spell?", L_learn_spell,
            "Where are you from?", L_about_auldsbel,
            "Do you need help with your experiments?", L_quest,
            "What do you know about...", L_question,
            "Goodbye.", -;
    close;

L_ironpowder:
    mes "[Auldsbel the Wizard]";
    mes "\"No, I do not know the spell for this.  I expect that it shouldn't be too hard an invocation, but I'm too busy to work it out.\"";
    next;
    mes "[Auldsbel the Wizard]";
    mes "\"I know that they used to make iron ore around here, though, many years ago.  Perhaps the secret is still hidden somewhere?\"";
    next;
    goto L_main_menu;

L_sulphur:
    mes "[Auldsbel the Wizard]";
    set @cost, 400 - (@Q_component_quest * 30);
    mes "\"Sulphur powder?  Ah, so we have picked up a little offensive magic, haven't we?  Good thinking, good thinking.  And yes, of course I can transmute volcanic ashes into sulphur powder at a ratio of 1:5, for " + @cost + " GP.\"";
    next;
    if (@Q_main_status >= @Q_STATUS_STUDENT)
        menu
            "No, thank you.", -,
            "I will see what I can find.", -,
            "Can you teach me how to make it myself?", L_sulphur_teach_spell,
            "Here you are.", L_sulphur_buy;
    if (@Q_main_status < @Q_STATUS_STUDENT)
        menu
            "No, thank you.", -,
            "I will see what I can find.", -,
            "Here you are.", L_sulphur_buy;
    close;

L_sulphur_buy:
    if (Zeny < @cost)
        goto L_sulphur_nozeny;
    if (countitem("PileOfAsh") < 1)
        goto L_sulphur_noash;
    getinventorylist;
    if (@inventorylist_count == 100
        && countitem("SulphurPowder") > 1
        && countitem("PileOfAsh") == 0)
            goto L_sulphur_noroom;

    set Zeny, Zeny - @cost;
    delitem "PileOfAsh", 1;
    getitem "SulphurPowder", 5;
    mes "[Auldsbel the Wizard]";
    mes "\"I shall transmute it later.  Here, have five half-ounces from my own stock.\"";
    next;
    goto L_main_menu;

L_sulphur_nozeny:
    mes "[Auldsbel the Wizard]";
    mes "\"No GP, no service.\"";
    next;
    goto L_main_menu;

L_sulphur_noash:
    mes "[Auldsbel the Wizard]";
    mes "\"Without volcanic ash, I can't give you any sulphur powder.  Try hunting some fire goblins, or somesuch.\"";
    next;
    goto L_main_menu;

L_sulphur_noroom:
    mes "[Auldsbel the Wizard]";
    mes "\"Hmm, you really managed to squeeze something into every little place you had that we could have stored the powder in... you might want to return once you have resolved this matter.\"";
    next;
    goto L_main_menu;

L_sulphur_teach_spell:
    if (@Q_component_quest <= 4)
        goto L_sulphur_teach_spell_no;
    mes "[Auldsbel the Wizard]";
    mes "\"Very well, then.  You have been quite helpful with my experiments, after all.  As you may have noticed, the spell takes a pile of volcanic ashes.  Close your hands around it, then whisper the invocation.\"";
    next;
    mes "[Auldsbel the Wizard]";
    mes "\"That invocation is '" + getspellinvocation("make-sulphur") + "'.\"";
    next;
    mes "[Auldsbel the Wizard]";
    mes "\"You may find that you can transmute the powder more effectively after a while; that is perfectly natural.\"";
    next;
    goto L_main_menu;

L_sulphur_teach_spell_no:
    mes "[Auldsbel the Wizard]";
    mes "\"Hmm...  how about this:  you help me with a few of my experiments, and I tell you?\"";
    next;
    menu
        "Very well, I will help you.", L_quest,
        "No.", -;
    mes "[Auldsbel the Wizard]";
    mes "\"Then I fear that I shall not reveal the spell to you either.\"";
    next;
    goto L_main_menu;

L_about_magic:
    mes "[Auldsbel the Wizard]";
    mes "\"Magic is a universal force that comes from within; only few individuals have the power to channel and manipulate it.  Most magic users resort to spells-- prefabricated invocations-- to access and control their magical power.\"";
    next;
    mes "[Auldsbel the Wizard]";
    mes "\"Most spells are claimed by one of the five schools of magic.  To properly use them, a magic user need not only have sufficient prowess in magic overall, but also in the specifics of that particular school.\"";
    next;

L_about_magic_minimenu:
    menu
        "What are the five schools?", L_about_magic_schools,
        "How can I advance in magic?", L_about_magic_advance,
        "How do spells work?", L_about_magic_spells,
        "Where can I learn spells?", L_about_magic_learn,
        "Never mind.", -;
    goto L_main_menu;

L_about_magic_schools:
    mes "[Auldsbel the Wizard]";
    mes "\"With few exceptions, all spells belong to one of the five schools of magic:  Transmutation, War, Astral, Life, and Nature.\"";
    next;

L_about_schools_minimenu:
    menu
        "What's Transmutation magic?", L_about_transmutation,
        "What's War magic?", L_about_war,
        "What's Astral magic?", L_about_astral,
        "What's Life magic?", L_about_life,
        "What's Nature magic?", L_about_nature,
        "Are there other spells?", L_about_other_spells,
        "Thank you.", -;
    goto L_about_magic_minimenu;

L_about_transmutation:
    mes "[Auldsbel the Wizard]";
    mes "\"Transmutation magic deals with forming matter into a new shape.  Some advanced transmutation magic can also expose special properties of the material in question.\"";
    next;
    mes "[Auldsbel the Wizard]";
    mes "He smiles.";
    mes "\"Transmutation magic is the engine of human civilization.  By allowing us to shape buildings, tools, and other items according to the power of our imagination, it gives us mastery over nature.\"";
    next;
    goto L_about_schools_minimenu;

L_about_astral:
    mes "[Auldsbel the Wizard]";
    mes "\"Astral magic comprises a family of spells that connect the caster to the Astral World.  This connection can be used to pull the caster 'through'-- effectively teleporting them-- or to 'pull others through'-- summoning creatures.\"";
    next;
    mes "[Auldsbel the Wizard]";
    mes "\"There are also some more direct uses of powers of the Astral World; mainly spells that affect other spells.\"";
    next;
    goto L_about_schools_minimenu;

L_about_war:
    mes "[Auldsbel the Wizard]";
    mes "\"War magic deals with the inevitable necessity of struggle against other creatures, and sometimes even against other humans.  War magic exclusively focuses on dealing damage and destruction.\"";
    next;
    mes "[Auldsbel the Wizard]";
    mes "\"If you use War magic, you better have a Transmuter around for the aftermath, to clear up your collateral damage.\"";
    next;
    goto L_about_schools_minimenu;

L_about_life:
    mes "[Auldsbel the Wizard]";
    mes "\"Life magic deals with healing.  Not much of a surprise there.\"";
    next;
    goto L_about_schools_minimenu;

L_about_nature:
    mes "[Auldsbel the Wizard]";
    mes "\"Nature magic is a rather subtle (and, in my eyes, rather weak) kind of magic that deals with manipulating nature as it is.  Think of it as Transmutation magic without being able to actually shape things the way you want.\"";
    next;
    goto L_about_schools_minimenu;

L_about_other_spells:
    mes "[Auldsbel the Wizard]";
    mes "\"A few spells are not claimed by any particular school of magic.  In practice, this means that anyone can cast them if they just have sufficient magical power.  The most prominent example is the 'detect magic' spell, '" + getspellinvocation("detect-magic") + "'.\"";
    next;
    goto L_about_schools_minimenu;

L_about_magic_advance:
    mes "[Auldsbel the Wizard]";
    mes "\"Advancing in your magical powers must come from two sources:  from within and from a person who can guide you in whichever school of magic you wish to advance.\"";
    next;
    mes "[Auldsbel the Wizard]";
    mes "\"For advancing in your general magic power, you must practice magical spells.  Make sure to vary them; you will learn little if you cast the same spell over and over.  Also, spells that consume no components seem not to be very instructive in practice.\"";
    next;
    mes "[Auldsbel the Wizard]";
    mes "\"Once you have gathered enough spellcasting experience, you should be able to advance to the next level of magic.  If you received your magic from a sponsor, you may have to seek out the sponsor again to advance.\"";
    next;
    mes "[Auldsbel the Wizard]";
    mes "\"Similarly, to advance in a particular school of magic, you should seek out someone sufficiently competent in that school.  Each school has a different rite for advancing its students, so make sure to talk to the right person.\"";
    next;
    mes "[Auldsbel the Wizard]";
    mes "\"I myself am a Transmutation Wizard.  Of course I know some spells from the other schools, but my focus is on Transmutation.  Theoretically speaking, I can advance you in this school.\"";
    next;
    goto L_about_magic_minimenu;

L_about_magic_learn:
    mes "[Auldsbel the Wizard]";
    mes "\"Finding and learning new spells is of course important in a magic user's quest towards becoming a full-fledged wizard.\"";
    next;
    mes "[Auldsbel the Wizard]";
    mes "\"Some wizards will be willing to share their knowledge, usually for a price.  But they are not the only sources of magical spells:  many magical books contain spells, and you can occasionally find them written down in the most unusual of places.\"";
    next;
    mes "[Auldsbel the Wizard]";
    mes "\"Some are even hiding as part of folklore or gossip.  Of course, for those it can sometimes be hard to determine just what their prerequisites are...\"";
    next;
    mes "[Auldsbel the Wizard]";
    mes "\"If you decide to hunt for spells, make sure to keep a journal with you.  Some spell invocations may only cross your path once in your lifetime; you must not allow them to get away!\"";
    next;
    goto L_about_magic_minimenu;

L_about_magic_spells:
    mes "[Auldsbel the Wizard]";
    mes "\"Magical spells are shortcuts, true magic bound to a word.  No-one today remembers how they were created at the beginning of time, though many have tried to find it out, and failed...\"";
    next;
    mes "[Auldsbel the Wizard]";
    mes "\"These magical words are the spells' invocations.  Spoken by someone who can't use magic, or by someone who doesn't satisfy the prerequisites, the word stands just for itself.\"";
    next;
    mes "[Auldsbel the Wizard]";
    mes "\"But when spoken by a competent magic user, the word may unleash its effect-- consuming any components it may require, draining the caster's mana, changing the world around it.\"";
    next;
    mes "[Auldsbel the Wizard]";
    mes "\"Some spells require catalysts on top of components, others vary in power depending on whom they are cast on or under what conditions.  However, all spells are affected by the caster's astral power.\"";
    next;

L_about_spells_minimenu:
    menu
        "What is this 'astral power'?", L_about_astral_power,
        "What is a catalyst?", L_about_catalysts,
        "What is a component?", L_about_components,
        "What other prerequisites are there?", L_about_other_prerequisites,
        "Where can I learn spells?", L_about_magic_learn,
        "How often can I cast spells?", L_about_speed,
        "Never mind.", L_about_magic_minimenu;
    close;

L_about_astral_power:
    mes "[Auldsbel the Wizard]";
    mes "\"A person's astral power is determined by several factors:  overall experience, intelligence, and any and all equipment the person may be wearing at a given time.\"";
    next;
    mes "[Auldsbel the Wizard]";
    mes "\"Greater astral power means more powerful spells.  Since equipment can greatly decrease astral power, most magic users tend to be careful about what they wear-- it takes a while to recover astral power even after armour is unequipped.\"";
    next;
    mes "[Auldsbel the Wizard]";
    mes "\"The worst offenders are metal items, particularly shields and body armour.  Helmets and gloves get in the way, too.  Still, a few special or enchanted items may even increase magical power.\"";
    next;
    goto L_about_spells_minimenu;

L_about_catalysts:
    mes "[Auldsbel the Wizard]";
    mes "\"A catalyst is a material prerequisite to a spell that is not consumed as part of the spell.  For example, the Transmuter's Tablet is required to properly perform many of the more powerful transmutation spells, but it is never consumed.\"";
    next;
    goto L_about_spells_minimenu;

L_about_components:
    mes "[Auldsbel the Wizard]";
    mes "\"A material component is an item that is consumed as part of the spells magic.  For example, when transmuting wood into arrows, you must consume a raw log to shape the arrows out of it.\"";
    next;
    goto L_about_spells_minimenu;

L_about_other_prerequisites:
    mes "[Auldsbel the Wizard]";
    mes "\"Some spells have additional requirements-- they can only be cast underground, or when you are standing very close to the person you are casting them on, or only when you are wearing a particular enchanted item.  Spells are quirky, so read their descriptions carefully-- if you do find a description.\"";
    next;
    goto L_about_spells_minimenu;

L_about_speed:
    mes "[Auldsbel the Wizard]";
    mes "\"Most spells are effective immediately, unless they require some complex astral connectoin-- summoning or teleporting can take a while to take effect, for example.  Still, after casting a spell you usually need a moment to recover before casting the next.\"";
    next;
    goto L_about_spells_minimenu;

L_about_auldsbel:
    mes "[Auldsbel the Wizard]";
    mes "\"Well, there is no harm in giving you the general picture, I suppose.\"";
    mes "He sighs, as if he had been forced to repeat something one time too many.";
    mes "\"I am from the Council of Transmuters, the head organ of organized Transmutation magic in the known world.\"";
    next;
    mes "[Auldsbel the Wizard]";
    mes "\"The council oversees recruitment, education, accreditation, and, if necessary, disciplining of Transmuters.";
    mes "It ensures that Transmuter conduct is according to its statutes and acts as representative and point of contact towards other entities.\"";
    next;
    mes "[Auldsbel the Wizard]";
    mes "\"Of all the schools of magic, the School of Transmutation is the most organised by far, and held in high esteem by rulers all across the world.  Of course this is not only due to the outstanding and rigid structure of the school, but also because of the exceptional services that its members provide.\"";
    next;
    mes "[Auldsbel the Wizard]";
    mes "\"The Council, presently overseen by Lord Transmogrifier Pontorias the Plaid (May His Shape Reflect His Soul Forever), consists of fourty-nine members and is situated in the citadel of Dorngard, in the northern mountains near the Crimson Cascade.\"";
    next;
    mes "[Auldsbel the Wizard]";
    mes "\"The Council is sovereign over three hundred acres of land and nearby farming communities and has been ever since Yorick the Younger shaped Dorngard out of a mountain by sheer power of will, to build a home for the school his father had founded.\"";
    next;
    mes "[Auldsbel the Wizard]";
    mes "\"The Council has held peaceful relations with nearby realms for almost two centruries now and is widely regarded as a reliable partner in shaping civilization to allow it to evolve towards its next stage.\"";
    next;
    menu
        "All right, but what about you?.", L_about_auldsbel_2,
        "Never mind.", -;
    goto L_main_menu;

L_about_auldsbel_2:
    mes "[Auldsbel the Wizard]";
    mes "\"Oh, myself?  I am just vacationing in the area.  Very relaxed and peaceful place, the Hurnscald area.  And plenty of splendid specimens for experimentation.\"";
    next;
    goto L_main_menu;

L_learn_magic:
    mes "[Auldsbel the Wizard]";
    mes "Auldsbel laughs heartily.";
    mes "\"Hah, if only it were so easy!  No, my young friend, I fear that 'learning magic' here is not an option.  Either you are born with it, or without.\"";
    next;
    mes "[Auldsbel the Wizard]";
    mes "\"Sure, there are a few entities that may grant you magic-- Ether Spirits or Mana Seeds or Great Dragons-- but those are the stuff of legends, so I suggest that you don't waste your life trying to find one of them.\"";
    next;
    goto L_main_menu;

L_question:
    callfunc "MagicTalkOptionsSetup";
    set @ignore, @QQ_AULDSBEL;
    callfunc "MagicTalkMenu";

    if (@c == 0)
        goto L_main_menu;
    if (@c == @QQ_ELANORE)
        goto L_Q_elanore;
    if (@c == @QQ_MANASEED)
        goto L_Q_manaseed;
    if (@c == @QQ_MANAPOTION)
        goto L_make_mana_potion;
    if (@c == @QQ_WYARA)
        goto L_Q_wyara;
    if (@c == @QQ_SAGATHA)
        goto L_Q_sagatha;
    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 "[Auldsbel the Wizard]";
    mes "\"Let us talk about something else.\"";
    next;
    goto L_main_menu;

L_Q_astralsoul:
    if (!(getskilllv(SKILL_ASTRAL_SOUL)))
        goto L_Q_astralsoul_L;
    next;
    mes "[Auldsbel the Wizard]";
    mes "\"Oh that is a really useful focus. It will help you doing magic of all kinds.\"";
    next;
    mes "\"...uhm...\"";
    next;
    mes "\"Didn't I teach you the ability to focus on magic, did I?\"";
    goto L_main_menu;

L_Q_astralsoul_L:
    mes "[Auldsbel the Wizard]";
    mes "\"Oh that is a really useful focus. It will help you doing magic of all kinds.\"";
    next;
    mes "\"I can try to teach you this ability.\"";
    next;
    mes "\"But I will need some very expensive magical substances to focus your brain onto magic.\"";
    next;
    mes "\"It is about... erm, 11300 GP. Do you have so much money?\"";
    menu
        "Here you are", L_Q_astralsoul_L1,
        "I will get it.", -;
    goto L_main_menu;

L_Q_astralsoul_L1:
    if (Zeny < 11300)
        goto L_Q_astralsoul_nz;
    set Zeny, Zeny - 11300;
    mes "[Auldsbel the Wizard]";
    mes "\"Okay, listen:\"";
    next;
    mes "\"Some parts of your brain is still unused. These parts will now get the ability to get focused to magic.\"";
    next;
    mes "\"To do so, think of a magic spell!\"";
    next;
    mes "Auldsbel mumbles some invocations";
    next;
    set @SUP_lvl, 1;
    set @SUP_id, SKILL_ASTRAL_SOUL;
    set @SUP_name$, "Astral Soul";
    set @SUP_xp, 2500;
    callfunc "SkillUp";
    next;
    mes "[Auldsbel the Wizard]";
    mes "\"Now go and try to find someone who can actually activate that focus.\"";
    next;
    mes "\"You have the powers to focus on magic, but you need to get magic focused now.\"";
    goto L_main_menu;

L_Q_astralsoul_nz:
    mes "[Auldsbel the Wizard]";
    mes "\"When learning powerful stuff, you should try not to make so many jokes.\"";
    next;
    mes "\"Come back when you have the money.\"";
    goto L_main_menu;

L_Q_old_wizard:
    mes "[Auldsbel the Wizard]";
    mes "\"I'm still not sure what exactly to make of him.  At first appearance, he seems like a senile old man, but there can be no doubt that he has-- or at least had, at some point-- a very deep understanding of magic.\"";
    next;
    mes "[Auldsbel the Wizard]";
    mes "\"I have not had the opportunity to talk to him too much, though.\"";
    next;
    goto L_main_menu;

L_Q_imp:
    mes "[Auldsbel the Wizard]";
    mes "\"There are many different kinds of spirits in the world.  Some are good-natured, others evil; some are weak, others very powerful.  I don't know the particular one you have encountered, though I urge caution.\"";
    next;
    goto L_main_menu;

L_Q_elanore:
    mes "[Auldsbel the Wizard]";
    mes "\"Ah, Elanore.  A kind little woman.  Also a very proficient healer, from what I have been told, though we have interacted little.  If you are interested in Life magic, you might want to talk to her.\"";
    next;
    goto L_main_menu;

L_Q_wyara:
    mes "[Auldsbel the Wizard]";
    mes "\"The village witch?  Not exactly the brightest person, but she has managed to figure out how to brew potions.  I doubt that she can do any real magic, though.\"";
    next;
    goto L_main_menu;

L_Q_sagatha:
    mes "[Auldsbel the Wizard]";
    mes "Auldsbel frowns.";
    mes "\"That witch, hmm?  She's a well-known trouble-maker, and quite a clever one at that; she once prevented us from cutting down a forest near Dorngaard that the villages wanted to use for farming, using some ingenious magic.\"";
    next;
    mes "[Auldsbel the Wizard]";
    mes "\"That woman has spent too much time alone in the forests... I have the strong suspicion that she is more loyal towards her animals than towards us humans!  I recommend that you stay away from her, if you value your well-being.\"";
    next;
    goto L_main_menu;

L_Q_manaseed_rumour:
    mes "\"A mana seed?  Around here?  Nah, they've been pulling your leg.  Those things are extremely rare, after all.\"";
    next;
    goto L_main_menu;

L_Q_manaseed:
    mes "[Auldsbel the Wizard]";
    if (@has_magic)
        goto L_Q_manaseed_withmagic;
    if (!(MAGIC_FLAGS & MFLAG_KNOWS_MANASEED)) // rumour only?
        goto L_Q_manaseed_rumour;
    if (MAGIC_FLAGS & MFLAG_DRANK_POTION)
        goto L_Q_manaseed_prepared;
    if (MAGIC_FLAGS & MFLAG_TOUCHED_MANASEED)
        goto L_Q_manaseed_touched;
    mes "\"You have found an actual Mana Seed?  That's impossible!  Well, very unlikely...  Then again, some others have told me similar rumours.  I find it hard to believe that...\"";
    next;
    mes "[Auldsbel the Wizard]";
    mes "\"Well, if it's true, then try touching it.  That should do you no harm, but if you are very, very lucky, it just might grant you some minuscule amount of magical power.\"";
    next;
    goto L_main_menu;

L_Q_manaseed_touched:
    if (MAGIC_FLAGS & MFLAG_DRANK_POTION)
        goto L_Q_manaseed_prepared;
    mes "\"So you touched the Mana Seed, and its power flowed right through you?  You are lucky-- it is willing to share-- but you are also unlucky, in that you lack the discipline and control needed to contain this power.\"";
    next;
    if (MAGIC_FLAGS & MFLAG_KNOWS_MANAPOTION)
        goto L_Q_manaseed_touched_short;
    mes "[Auldsbel the Wizard]";
    mes "\"Legend has it that you can substitute for such control by imbibing a Mana Potion.  I am not sure whether that legend is true, but for you it might be worth trying it out.\"";
    next;
    set MAGIC_FLAGS, MAGIC_FLAGS | MFLAG_KNOWS_MANAPOTION;

L_Q_manaseed_touched_short:
    menu
        "Where can I get a Mana Potion?", L_where_mana_potion,
        "Can you make a Mana Potion?", L_make_mana_potion,
        "Thank you.", -;
    goto L_main_menu;

L_where_mana_potion:
    mes "[Auldsbel the Wizard]";
    mes "\"Well, quite a few alchemists should be able to brew one for you.  Or maybe the village witch, even, though I personally would recommend seeing an alchemist.\"";
    next;
    goto L_Q_manaseed_touched_short;

L_make_mana_potion:
    mes "[Auldsbel the Wizard]";
    mes "\"Well, I can transmute some components into a Mana Potion for you.  Let's see... I will need one pearl, 10,000 GP, about twenty Mauve leaves, and some Gamboge ones... ten should do, I think.  Oh, and a bottle of water, of course.\"";
    next;
    menu
        "Here you are.", -,
        "I will look for those items.", L_main_menu,
        "I'm not interested.", L_Q_manaseed_touched_short;
    if (Zeny < 10000)
        goto L_make_mana_potion_missing;
    if (countitem("GambogeHerb") < 10)
        goto L_make_mana_potion_missing;
    if (countitem("MauveHerb") < 20)
        goto L_make_mana_potion_missing;
    if (countitem("Pearl") < 1)
        goto L_make_mana_potion_missing;
    if (countitem("BottleOfWater") < 1)
        goto L_make_mana_potion_missing;
    getinventorylist;
    if (@inventorylist_count == 100
            && countitem("GambogeHerb") > 10
            && countitem("MauveHerb") > 20
            && countitem("Pearl") > 1
            && countitem("BottleOfWater") > 1
            && countitem("ManaPotion") < 1)
                goto L_mana_potion_toomuch;
    set Zeny, Zeny - 10000;
    delitem "GambogeHerb", 10;
    delitem "MauveHerb", 20;
    delitem "Pearl", 1;
    delitem "BottleOfWater", 1;
    getitem "ManaPotion", 1;

    mes "[Auldsbel the Wizard]";
    mes "Auldsbel pockets your GP and the pearl, then stuffs the leaves into the bottle.  Holding the bottle between his hands, he focuses briefly.  The water and leaves flash bright red, then the leaves dissolve.";
    next;
    mes "[Auldsbel the Wizard]";
    mes "The wizard pours the resultant mixture into a different bottle.  \"It will lose its power quickly if left in a glass bottle\", he explains.";
    mes "He hands you the final result, which feels surprisingly heavy.";
    next;
    menu
        "Thank you!", L_main_menu,
        "What about the pearl and GP?", -;
    mes "[Auldsbel the Wizard]";
    mes "Auldsbel raises his eyebrows in surprise.";
    mes "\"Those were payment.  You don't expect me to work for free, now do you?\"";
    next;
    goto L_main_menu;

L_mana_potion_toomuch:
    mes "[Auldsbel the Wizard]";
    mes "\"Burdened as you are, I doubt you could carry it.  Get rid of some of your old things first, will you?\"";
    next;
    goto L_main_menu;

L_make_mana_potion_missing:
    mes "[Auldsbel the Wizard]";
    mes "\"No, I need one pearl, 10,000 GP, 20 Mauve leaves, 10 Gamboge leaves, and one bottle of water.\"";
    next;
    goto L_main_menu;

L_Q_manaseed_prepared:
    mes "\"So you found a Mana Seed and prepared yourself by drinking a mana potion?  I recommend that you visit the seed again and see if that actually works...\"";
    next;
    goto L_main_menu;

L_Q_manaseed_withmagic:
    if (MAGIC_FLAGS & MFLAG_MANASEED_MAXEDOUT)
        goto L_Q_manaseed_maxedout;
    mes "\"I still find it hard to believe that you have found an actual Mana Seed here, in the middle of nowhere...  Well, I suggest that you keep visiting it.  As your control over magic grows, it may grant you additional power.\"";
    next;
    goto L_main_menu;

L_Q_manaseed_maxedout:
    mes "\"So the mana seed isn't giving you any more power?  You might want to try again later; normally those seeds grow in power, over time.\"";
    next;
    goto L_main_menu;

L_quest:
    if (@Q_component_quest == 0)
        goto L_component_quest_0;
    if (@Q_component_quest == 1)
        goto L_component_quest_1;
    if (@Q_component_quest == 2)
        goto L_component_quest_2;
    if (@Q_component_quest == 3)
        goto L_component_quest_3;
    if (@Q_component_quest == 4)
        goto L_component_quest_4;
    if (@Q_component_quest == 5)
        goto L_component_quest_5;
    mes "[Auldsbel the Wizard]";
    mes "\"You have been very helpful, but at this point I have everything I need.  Except perhaps for a Wumpus Egg, though I have no idea where you could find one... If you ever come across one, I will give you a special reward for it, though.\"";
    next;
    goto L_main_menu;

L_component_quest_0:
    mes "[Auldsbel the Wizard]";
    mes "Auldsbel is visibly delighted.";
    mes "\"Ah, indeed, indeed!  I can often use help with my experiments, and you just happen to be arriving at a particularly opportune time.  See, I found this...\"";
    mes "He pulls something from his pocket and shows it to you.";
    next;
    mes "[Auldsbel the Wizard]";
    mes "\"It's a silk cocoon.  This area has been virtually infested with silkworms, from what I have seen.  This is splendid!  I will try to... do something very special with this one.  But for that I will need twenty Mauve leaves.\"";
    next;
    mes "[Auldsbel the Wizard]";
    mes "\"There are plenty of Mauve plants around, so I'm sure that you won't have a hard time finding the leaves.\"";
    next;
    menu
        "I have them here.", -,
        "Sure, I will look for them.", L_main_menu;
    if (countitem ("MauveHerb") < 20)
        goto L_component_quest_missing;
    delitem "MauveHerb", 20;
    set Zeny, Zeny + 2500;
    mes "[Auldsbel the Wizard]";
    mes "\"Well done, my young friend!  Here are 2,500 GP to compensate you for your efforts.\"";
    mes "[You gain 250 experience points]";
    getexp 250, 0;
    set @Q_component_quest, 1;
    callsub S_update_var;
    next;
    goto L_main_menu;

L_component_quest_1:
    mes "[Auldsbel the Wizard]";
    mes "\"Good, good... I am trying to come up with a way to best use the Mauve leaves you brought me, but it seems that I will need further components.  I am not sure about the exact composition yet, but I will need a few potions.\"";
    next;
    mes "[Auldsbel the Wizard]";
    mes "\"Please be a good " + @address$ + " and get me an iron potion, a concentration potion, and three small and three medium healing potions.\"";
    next;
    menu
        "Here you are.", -,
        "I'm not your 'good " + @address$ + "'!", L_main_menu,
        "I'll see what I can do.", L_main_menu;
    if (countitem ("SmallHealingPotion") < 3)
        goto L_component_quest_missing;
    if (countitem ("MediumHealingPotion") < 3)
        goto L_component_quest_missing;
    if (countitem ("IronPotion") < 1)
        goto L_component_quest_missing;
    if (countitem ("ConcentrationPotion") < 1)
        goto L_component_quest_missing;
    delitem "SmallHealingPotion", 3;
    delitem "MediumHealingPotion", 3;
    delitem "IronPotion", 1;
    delitem "ConcentrationPotion", 1;
    set Zeny, Zeny + 2500;
    mes "[Auldsbel the Wizard]";
    mes "\"Ah, excellent, excellent!  These are precisely what I needed.  Here are another 2,500 GP to compensate you for your efforts.\"";
    mes "[You gain 500 experience points]";
    getexp 500, 0;
    set @Q_component_quest, 2;
    callsub S_update_var;
    next;
    goto L_main_menu;

L_component_quest_2:
    mes "[Auldsbel the Wizard]";
    mes "\"Ah!  Excellent!  Yes, yes, indeed I need help.  I have managed to transmute the components you brought me into a liquid that I believe to be a demetamorphosis stock, but it seems that the details still need some fine-tuning, and I am out of silk cocoons...\"";
    next;
    mes "[Auldsbel the Wizard]";
    mes "\"I would like to run the next batch of experiments on a larger scale, though.  Would you be so kind as to fetch me some one hundred silk cocoons, please?\"";
    next;
    menu
        "One hundred cocoons, here you are.", -,
        "That's a lot; I'll see what I can do.", L_main_menu;
    if (countitem ("SilkCocoon") < 100)
        goto L_component_quest_missing;
    delitem "SilkCocoon", 100;
    set Zeny, Zeny + 5000;
    mes "[Auldsbel the Wizard]";
    mes "\"Splendid, splendid!  Here are 5,000 GP for you.\"";
    mes "Auldsbel attempts to cram the cocoons into his pockets, with little success.  Finally he gives up and takes them into his hut.";
    mes "[You gain 2,000 experience points]";
    getexp 2000, 0;
    set @Q_component_quest, 3;
    callsub S_update_var;
    next;
    goto L_main_menu;

L_component_quest_3:
    mes "[Auldsbel the Wizard]";
    mes "\"Yes... I'm actually not certain that my demetamorphosis stock will not drain the life out of these little creatures.  Perhaps an alchemical revitalization tincture would be called for.  Fortunately this one is easy, I can make it myself.\"";
    next;
    mes "[Auldsbel the Wizard]";
    mes "\"I'm still not sure how to integrate it into the spell...  but leave that to me.  Can you get me twenty-five red scorpion stingers and twenty-five lumps of maggot slime?  Those should be just what I need.\"";
    next;
    menu
        "Here are your stingers and slimes.", -,
        "I will get back to you once I have them.", L_main_menu;
    if (countitem ("RedScorpionStinger") < 25)
        goto L_component_quest_missing;
    if (countitem ("MaggotSlime") < 25)
        goto L_component_quest_missing;
    delitem "RedScorpionStinger", 25;
    delitem "MaggotSlime", 25;
    set Zeny, Zeny + 5000;
    mes "[Auldsbel the Wizard]";
    mes "\"Good " + @address$ + "!  Another 5,000 GP for you.\"";
    mes "\"I believe that I have figured out one possible way to integrate the tincture into the spell... I will let you know how that goes.\"";
    mes "[You gain 10,000 experience points]";
    getexp 10000, 0;
    set @Q_component_quest, 4;
    callsub S_update_var;
    next;
    goto L_main_menu;

L_component_quest_4:
    mes "[Auldsbel the Wizard]";
    mes "\"Hmm, yes... See, the thing is that transmuting living beings is not normally something that transmutation magic can do.  It seems that the beings' life force must be overcome to transmute them, but that in turn kills them.\"";
    next;
    mes "[Auldsbel the Wizard]";
    mes "\"But I was wondering whether creatures that already can auto-transmute-- or metamorphose, as some people call it-- might not allow themselves to be subjected to magical transmutation more easily... Still, all of my demetamorphosis attempts so far have failed.\"";
    next;
    mes "[Auldsbel the Wizard]";
    mes "\"I am thinking of injecting the life force of another creature, perhaps using some astral channelling.  Snakes sound most promising, as they have a similar physical shape but a strong life force.\"";
    next;
    mes "[Auldsbel the Wizard]";
    mes "\"Could you get me twenty regular, cave, and mountain snake tongues, please?  So a total of sixty tongues.  This is where most of their life force is concentrated, incidentally.\"";
    next;
    menu
        "Here are your tongues.", -,
        "I will hunt some snakes for you.", L_main_menu;
    if (countitem ("SnakeTongue") < 20)
        goto L_component_quest_missing;
    if (countitem ("CaveSnakeTongue") < 20)
        goto L_component_quest_missing;
    if (countitem ("MountainSnakeTongue") < 20)
        goto L_component_quest_missing;
    delitem "SnakeTongue", 20;
    delitem "CaveSnakeTongue", 20;
    delitem "MountainSnakeTongue", 20;
    set Zeny, Zeny + 8000;
    mes "[Auldsbel the Wizard]";
    mes "\"8,000 GP should cover your efforts, I think.\"";
    mes "\"Now let's see if this works...\"";
    mes "[You gain 40,000 experience points]";
    getexp 40000, 0;
    set @Q_component_quest, 5;
    callsub S_update_var;
    next;
    mes "[Auldsbel the Wizard]";
    mes "Auldsbel focuses on the bundle of snake tongues, which begin to assume a bright red colour, then start to glow.  Yellow sparks drop to the ground, as Auldsbel rolls the tongues into a ball.";
    next;
    mes "[Auldsbel the Wizard]";
    mes "He tosses in a cocoon, then squeezes everything together.  A bright red flash blinds you momentarily.";
    next;
    mes "[Auldsbel the Wizard]";
    mes "As Auldsbel opens his hands, there is nothing there.";
    next;
    mes "[Auldsbel the Wizard]";
    mes "He frowns.  \"Their life force was still not strong enough.  Hmm.\"";
    next;
    goto L_main_menu;

L_component_quest_5:
    mes "[Auldsbel the Wizard]";
    mes "\"I do have another assignment for you, but this one will be tricky.  I will need fifty grass snake tongues.  I believe that this may be just enough life force to return the silkworm back to its original shape.\"";
    next;
    menu
        "Here they are.", -,
        "That's quite a challenge.", L_main_menu;
    if (countitem ("GrassSnakeTongue") < 50)
        goto L_component_quest_missing;
    delitem "GrassSnakeTongue", 50;
    set Zeny, Zeny + 10000;
    mes "[Auldsbel the Wizard]";
    mes "\"Excellent!  Here are 10,000 GP for you, and now let's see how this goes.\"";
    mes "[You gain 100,000 experience points]";
    getexp 100000, 0;
    set @Q_component_quest, 6;
    callsub S_update_var;
    next;
    mes "[Auldsbel the Wizard]";
    mes "Auldsbel rolls the snake tongues into a ball again, whilst chanting some words that you fail to discern.  As the ball begins to glow, he tosses in a silkworm cocoon.";
    mes "He then presses his hands together; you are blinded by a blue flash.";
    next;
    mes "[Auldsbel the Wizard]";
    mes "The wizard steps back in horror.";
    mes "\"Oh my... I should have known.  I have stepped into Astral spell territory here.  This is bad...\"";
    mes "He mumbles a brief spell invocation.";
    mes "\"I suggest that you run.\"";
    next;
    misceffect sfx_magic_transmute;
    monster "this", 50, 68, "Grass Snake", 1034, 4;
    close;

L_component_quest_missing:
    mes "[Auldsbel the Wizard]";
    mes "\"No, you are missing some items.  Come back later when you have everything!\"";
    next;
    goto L_main_menu;

L_learn_spell:
    if (@Q_main_status == @Q_STATUS_INITIATION)
        goto LL_initiation;
    if (@Q_main_status == @Q_STATUS_STUDENT)
        goto LL_student_start;
    if (@Q_main_status == @Q_STATUS_STUDENT0)
        goto LL_student_0;
    if (@Q_main_status == @Q_STATUS_STUDENT1)
        goto LL_student_1;
    if (@Q_main_status == @Q_STATUS_STUDENT2)
        goto LL_student_2;
    if (@Q_main_status == @Q_STATUS_STUDENT3)
        goto LL_student_3;
    if (@Q_main_status == @Q_STATUS_STUDENT4)
        goto LL_student_4;
    if (@Q_main_status == @Q_STATUS_STUDENT5)
        goto LL_student_5;
    if (@Q_main_status == @Q_STATUS_STUDENT6)
        goto LL_student_6;

    mes "[Auldsbel the Wizard]";
    mes "\"Wellll.... you do seem to have some magical abilities.  But do you possess the talent and diligence needed for a true wizard?\"";
    mes "He raises an eyebrow at you, then grins.";
    mes "\"Only one way to find out!  Let me teach you a first spell.\"";
    next;
    mes "[Auldsbel the Wizard]";
    mes "\"This spell is a simple transmutation invocation.  All it takes is a clean wooden log.  Hold it in your hand, focus your powers, and say the magic invocation.\"";
    next;
    mes "[Auldsbel the Wizard]";
    mes "\"You can turn the log into a wooden figurine by imagining the creature whose shape you want in your head and saying `" + getspellinvocation("transmute-wood-to-figurine") + ",' followed by the last syllable of the name of the creature you want to shape it into.\"";
    next;
    mes "[Auldsbel the Wizard]";
    mes "\"So `" + getspellinvocation("transmute-wood-to-figurine") +  " lurk' for a Skrytlurk figurine, for example.  If you know what a Skrytlurk is, I mean, otherwise you will have a hard time imagining it.  You may want to try some others instead, though.\"";
    next;
    mes "[Auldsbel the Wizard]";
    mes "\"Oh... and it has to be the old Tritan name.  Most creatures nowadays have very different names, but some old Tritan names have survived.  Just try some, until you find one that fits.\"";
    next;
    mes "[Auldsbel the Wizard]";
    mes "\"Oh, actually, make sure to write that down.  You should keep track of all spells and spell fragments, really.  I always keep a notebook handy, in fact.\"";
    next;
    set @Q_main_status, @Q_STATUS_INITIATION;
    callsub S_update_var;
    goto L_main_menu;

LL_repeat_spell:
    mes "[Auldsbel the Wizard]";
    mes "\"The invocation is `" + getspellinvocation("transmute-wood-to-figurine") + ",' followed by the last syllable of the name of the creature you want to shape the log into.  So `" + getspellinvocation("transmute-wood-to-figurine") + " lurk' for a Skrytlurk figurine.\"";
    next;
    mes "[Auldsbel the Wizard]";
    mes "\"But keep two things in mind:  First, you must KNOW what the creature looks like-- so a Skrytlurk probably won't work-- and second, you must use the old Tritan name of it.  `Fluffy' and `Scorpion' are modern names, so those won't work, you should try some others.\"";
    next;
    mes "[Auldsbel the Wizard]";
    mes "\"And make sure to keep notes of your spells!  In the future, I will only tell you once.\"";
    next;
    goto L_main_menu;

LL_initiation:
    mes "[Auldsbel the Wizard]";
    mes "\"So, have you managed to transmute something?\"";
    next;
    if (countitem("MoubooFigurine"))
        menu
            "Not yet.", -,
            "How about this mouboo figurine?", LL_initiation_check;
    if (!(countitem("MoubooFigurine")))
        menu
            "Not yet.", -,
            "What was the spell again?", LL_repeat_spell;
    goto L_main_menu;

LL_initiation_fail:
    mes "[Auldsbel the Wizard]";
    mes "\"No, no, no.  This is no good-- too many imperfections.\"";
    mes "He throws it away.";
    mes "\"Keep practicing-- and make sure to vary the spells you cast a little; that will make it easier to learn.\"";
    next;
    goto L_main_menu;

LL_initiation_check:
    if (!(countitem("MoubooFigurine")))
        goto L_main_menu;
    delitem "MoubooFigurine", 1;
    mes "[Auldsbel the Wizard]";
    mes "Auldsbel inspects your figurine.";
    next;
    if (@mexp < 40)
        goto LL_initiation_fail;
    mes "[Auldsbel the Wizard]";
    mes "Auldsbel nods.";
    mes "\"This looks good.\"";
    next;
    mes "[Auldsbel the Wizard]";
    mes "He pockets the figurine.";
    mes "\"Very well, then.  I shall accept you as my student.\"";
    next;
    mes "[Auldsbel the Wizard]";
    mes "Auldsbel presses his index and middle finger against your forehead.";
    mes "\"Accept my blessing!\"";
    next;
    mes "[Auldsbel the Wizard]";
    mes "You feel new powers flowing into your body!";
    set @Q_main_status, @Q_STATUS_STUDENT;
    callsub S_update_var;
    set @SUP_xp, 5000;
    set @SUP_lvl, 2;
    callfunc "SkillUp";
    next;
    goto L_main_menu;

LL_student_start:
    if (@mexp < 200) goto LL_notready;
        mes "[Auldsbel the Wizard]";
    mes "\"Next, I shall teach you a higher-level transmutation spell.\"";
    if (getskilllv(SKILL_MAGIC) < 2)
        mes "\"Beware, for you will not be able to use it yet; you will first have to gain a greater understanding of magic overall.\"";
    next;
    mes "[Auldsbel the Wizard]";
    mes "\"Bring me ten bug legs, and I will reveal its invocation to you.\"";
    next;
    menu
        "Here you are.", -,
        "I'll be back with them.", L_main_menu;
    if (countitem("BugLeg") < 10)
        goto L_component_quest_missing;
    delitem "BugLeg", 10;
    getexp 1000, 0;
    set @Q_main_status, @Q_STATUS_STUDENT0;
    callsub S_update_var;
    mes "[Auldsbel the Wizard]";
    mes "He picks up the bug legs.";
    mes "\"Good.  These will come in handy later...\"";
    mes "He grins.";
    mes "[1000 experience points]";
    next;
    mes "[Auldsbel the Wizard]";
    mes "\"Now, listen carefully:  to make a short tank top out of three pieces of cloth, you must use the invocation '" + getspellinvocation("make-short-tanktop") + "'.\"";
    next;
    mes "[Auldsbel the Wizard]";
    mes "\"But be careful; transmutations can go wrong, and that can injure you.  When you have some more overall spellcasting practice, come back to me.\"";
    next;
    goto L_main_menu;

LL_notready:
    mes "[Auldsbel the Wizard]";
    mes "\"You still need more practice with spellcasting; I won't give you another spell until you are ready.\"";
    next;
    goto L_main_menu;

LL_student_0:
    if (@mexp < 350)
        goto LL_notready;
    mes "[Auldsbel the Wizard]";
    mes "\"The next transmutation spell is a little harder than the last one I taught you, but you should be able to manage.\"";
    next;
    mes "[Auldsbel the Wizard]";
    mes "\"Bring me twenty mauve leaves, and I will reveal its invocation.\"";
    next;
    menu
        "Here you are.", -,
        "I'll be back with them.", L_main_menu;
    if (countitem("MauveHerb") < 20)
        goto L_component_quest_missing;
    delitem "MauveHerb", 20;
    getexp 1000, 0;
    set @Q_main_status, @Q_STATUS_STUDENT1;
    callsub S_update_var;
    mes "[Auldsbel the Wizard]";
    mes "He pockets your mauve leaves.";
    mes "\"Those should go very well with the salmon.\"";
    mes "[1000 experience points]";
    next;
    mes "[Auldsbel the Wizard]";
    mes "\"The next spell I have will make a normal tank top out of four pieces of cloth.  The invocation is '" + getspellinvocation("make-tanktop") + "', make sure to write this down.\"";
    next;
    goto L_main_menu;

LL_student_1:
    if (@mexp < 425)
        goto LL_notready;
    mes "[Auldsbel the Wizard]";
    mes "\"Up next is the transmutation spell for regular shirts.\"";
    next;
    mes "[Auldsbel the Wizard]";
    mes "\"For this, I would like ten scorpion stingers.\"";
    next;
    menu
        "Here you are.", -,
        "I'll be back with them.", L_main_menu;
    if (countitem("ScorpionStinger") < 10)
            goto L_component_quest_missing;
    delitem "ScorpionStinger", 10;
    getexp 1000, 0;
    set @Q_main_status, @Q_STATUS_STUDENT2;
    callsub S_update_var;
    mes "[Auldsbel the Wizard]";
    mes "He carefully takes the stingers.";
    mes "\"You are being quite helpful.  If my experiments go well, I will make sure to acknowledge you in a footnote somewhere.\"";
    mes "[1000 experience points]";
    next;
    mes "[Auldsbel the Wizard]";
    mes "\"To make a shirt, use the invocation '" + getspellinvocation("make-shirt") + "'.  This will require five pieces of cloth.\"";
    next;
    goto L_main_menu;

LL_student_2:
    if (@mexp < 500)
        goto LL_notready;
    mes "[Auldsbel the Wizard]";
    mes "\"You may find the next spell particularly useful.\"";
    next;
    mes "[Auldsbel the Wizard]";
    mes "\"Bring me twenty wooden logs, and I will teach you.\"";
    next;
    menu
        "Here you are.", -,
        "I'll be back with them.", L_main_menu;
    if (countitem("RawLog") < 20)
            goto L_component_quest_missing;
    delitem "RawLog", 20;
    getexp 1000, 0;
    set @Q_main_status, @Q_STATUS_STUDENT3;
    callsub S_update_var;
    mes "[Auldsbel the Wizard]";
    mes "Auldsbel places the logs next to his hut.";
    mes "\"I'm hoping to animate them into the shape of one of those odd log heads.\"";
    mes "[1000 experience points]";
    next;
    mes "[Auldsbel the Wizard]";
    mes "\"This spell makes arrows out of a single wooden log.  Its invocation is '" + getspellinvocation("make-arrows") + "'.\"";
    next;
    goto L_main_menu;

LL_student_3:
    if (getskilllv(SKILL_MAGIC) < 3)
        goto LL_magic_skill_insufficient;
    mes "[Auldsbel the Wizard]";
    mes "\"I believe that you may be ready for the next level of transmutation magic!  Let me teach you one last spell that you can handle before your promotion, and if you can cast this one, I will advance you.\"";
    next;

LL_student_3_repeat:
    mes "[Auldsbel the Wizard]";
    mes "\"This one has the invocation `" + getspellinvocation("make-concentration-potion") + "'.  Put two cobalt leaves and two pink flower petals into a bottle of water, hold it up, and speak that phrase.\"";
    next;
    mes "[Auldsbel the Wizard]";
    mes "\"It is a tricky spell, but if it works out, you will transform the bottle into a concentration potion.\"";
    next;
    mes "[Auldsbel the Wizard]";
    mes "\"Hmm.  That reminds me-- there was a similar spell, but I forgot what it was... anyway, try using this, and bring me the potion when you are done.\"";
    next;
    set @Q_main_status, @Q_STATUS_STUDENT4;
    callsub S_update_var;
    goto L_main_menu;

LL_student_4:
    mes "[Auldsbel the Wizard]";
    mes "\"Did you manage to transmute a concentration potion?\"";
    next;
    menu
        "What was the invocation again?", LL_student_3_repeat,
        "No, still working on it...", L_main_menu,
        "Yes.", -;
    if (countitem("ConcentrationPotion") < 1)
        goto LL_student_4_no_potion;
    if (!(MAGIC_FLAGS & MFLAG_MADE_CONC_POTION))
        goto LL_student_4_wrong_potion;
    mes "[Auldsbel the Wizard]";
    mes "Auldsbel examines your potion and nods.";
    mes "\"Good work!  You are ready for a promotion!\"";
    next;
    mes "[Auldsbel the Wizard]";
    mes "Auldsbel presses his index and middle finger against your forehead.";
    mes "\"Accept my blessing!\"";
    next;
    set @Q_main_status, @Q_STATUS_STUDENT5;
    callsub S_update_var;
    mes "[Auldsbel the Wizard]";
    mes "You feel new powers flowing into your body!";
    set @SUP_xp, 30000;
    set @SUP_lvl, 3;
    callfunc "SkillUp";
    next;
    goto L_main_menu;

LL_student_4_wrong_potion:
    mes "[Auldsbel the Wizard]";
    mes "Auldsbell examines your potion, then shakes his head.";
    mes "\"This doesn't look quite right, though I can't quite point at what the problem is.  You will have to continue trying.\"";
    next;
    goto L_main_menu;

LL_student_4_no_potion:
    mes "[Auldsbel the Wizard]";
    mes "\"You seem to be rather lacking the concentration potion you need to justify your claim, my dear fellow.\"";
    next;
    goto L_main_menu;

LL_student_5:
    mes "[Auldsbel the Wizard]";
    mes "\"Hmm.  Come back some other time, please; I still haven't figured out what to teach you next.\"";
    close;

LL_magic_skill_insufficient:
    mes "[Auldsbel the Wizard]";
    mes "\"No, not at this time.  You will have to advance in your overall magic skill before I can teach you more.\"";
    next;
    goto L_main_menu;


S_update_var:
    set @Q_status, @Q_main_status | (@Q_component_quest << 5);
    set QUEST_MAGIC,
        (QUEST_MAGIC & ~(@Q_MASK)
        | (@Q_status << @Q_SHIFT));
    return;
}