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
|
018-2,37,22,0 script Caul NPC107,{
@inspector = ((QUEST_Hurnscald & NIBBLE_3_MASK) >> NIBBLE_3_SHIFT);
@SETZER_INITIAL = 0;
@SETZER_KNOWS_OIL = 1;
@SETZER_KNOWS_STINGER = 2;
@SETZER_FLAG_MADE_OIL = 4;
@MONSTER_OIL_XP = 100000;
@MOPOX_CURE_XP = 30000;
@Q_MASK = NIBBLE_3_MASK;
@Q_SHIFT = NIBBLE_3_SHIFT;
@Q_status = (QUEST_Forestbow_state & @Q_MASK) >> @Q_SHIFT;
set @Q_knows_mopox_cure, ((QUEST_MAGIC2 & NIBBLE_1_MASK) >> NIBBLE_1_SHIFT) >= 4; // Elanore's quest for curing Kadiya
// Can the player get XP for brewing the cure?
set @Q_can_score_mopox_cure, (((QUEST_MAGIC2 & NIBBLE_1_MASK) >> NIBBLE_1_SHIFT) == 4) // Elanore's quest for curing Kadiya
&& (((QUEST_MAGIC2 & NIBBLE_3_MASK) >> NIBBLE_3_SHIFT) < 2); // Haven't brewed it yet
mes "[Caul]";
mes "\"I can help you to brew healing potions out of mauve, cobalt, gamboge and alizarin herbs.";
mes "How many potions do you want to brew?\"";
next;
@C_monster_oil = 20;
@C_mopox_cure = 21;
@C_nohmask = 22;
@C_dementiapotion = 23;
@C_bye = 24;
setarray @choice$, "One.", "Five.", "Ten.", "Fifty.", "", "", "", "", "";
setarray @choice_idx, 1, 5, 10, 50, 0, 0, 0, 0, 0;
@choices_nr = 4;
if (!(@Q_status))
goto L_M_no_monster_oil;
@choice_idx[@choices_nr] = @C_monster_oil;
@choice$[@choices_nr] = "I would like to brew Monster Oil.";
@choices_nr = @choices_nr + 1;
goto L_M_no_monster_oil;
L_M_no_monster_oil:
if (!@Q_knows_mopox_cure)
goto L_M_no_mopox_cure;
@choice_idx[@choices_nr] = @C_mopox_cure;
@choice$[@choices_nr] = "I would like to brew a Mopox Cure Potion.";
@choices_nr = @choices_nr + 1;
goto L_M_no_mopox_cure;
L_M_no_mopox_cure:
if (@inspector != 10)
goto L_M_no_inspector;
@choice_idx[@choices_nr] = @C_nohmask;
@choice$[@choices_nr] = "Actually...";
@choices_nr = @choices_nr + 1;
goto L_M_no_inspector;
L_M_no_inspector:
if (!(MAGIC_FLAGS & MFLAG_KNOWS_UNFOCUS_RECIPE))
goto L_M_no_dempo;
@choice_idx[@choices_nr] = @C_dementiapotion;
@choice$[@choices_nr] = "I would like to brew a Dementia Potion.";
@choices_nr = @choices_nr + 1;
goto L_M_no_dempo;
L_M_no_dempo:
@choice_idx[@choices_nr] = @C_bye;
@choice$[@choices_nr] = "Never mind.";
@choices_nr = @choices_nr + 1;
menu
@choice$[0], L_MenuItems,
@choice$[1], L_MenuItems,
@choice$[2], L_MenuItems,
@choice$[3], L_MenuItems,
@choice$[4], L_MenuItems,
@choice$[5], L_MenuItems,
@choice$[6], L_MenuItems,
@choice$[7], L_MenuItems;
L_MenuItems:
@choice = @choice_idx[@menu - 1];
if (@choice == @C_monster_oil)
goto L_mo_start;
if (@choice == @C_mopox_cure)
goto L_mox_start;
if (@choice == @C_nohmask)
goto L_NohMask;
if (@choice == @C_dementiapotion)
goto L_DemPotion;
if (@choice == @C_bye)
goto L_close;
// otherwise the choice is the number of potions-to-brew
@num = @choice;
if (@num == 0)
goto L_close;
goto L_brew;
L_brew:
mes "[Caul]";
mes "\"Now put " + @num + " herbs of each kind into the cauldron, stir, and concentrate all your mental energy on it.\"";
next;
if (countitem("MauveHerb") < @num)
goto L_NotEnough;
if (countitem("CobaltHerb") < @num)
goto L_NotEnough;
if (countitem("GambogeHerb") < @num)
goto L_NotEnough;
if (countitem("AlizarinHerb") < @num)
goto L_NotEnough;
@a = @num;
@result1 = 0;
@result2 = 0;
@result3 = 0;
@result4 = 0;
goto L_CraftLoop;
L_CraftLoop:
@throw = rand(Int);
@result = 1;
if (@throw >= 5) set @result, 2;
if (@throw >= 15) set @result, 3;
if (@throw >= 35) set @result, 4;
if (@result == 1) set @result1, @result1 + 1;
if (@result == 2) set @result2, @result2 + 1;
if (@result == 3) set @result3, @result3 + 1;
if (@result == 4) set @result4, @result4 + 1;
@a = @a - 1;
if (@a > 0) goto L_CraftLoop;
delitem "MauveHerb", @num;
delitem "CobaltHerb", @num;
delitem "GambogeHerb", @num;
delitem "AlizarinHerb", @num;
getitem "TinyHealingPotion", @result1;
getitem "SmallHealingPotion", @result2;
getitem "MediumHealingPotion", @result3;
getitem "LargeHealingPotion", @result4;
mes "[Caul]";
mes "\"Well done! You made:";
if (@result1 > 0)
mes @result1 + " tiny potions";
if (@result2 > 0)
mes @result2 + " small potions";
if (@result3 > 0)
mes @result3 + " medium potions";
if (@result4 > 0)
mes @result4 + " large potions";
mes "Come again.\"";
close;
L_NotEnough:
mes "[Caul]";
mes "\"Oh, it seems like you don't have enough herbs. You can find herbs in deep forests.\"";
close;
L_mo_start:
mes "[Caul]";
mes "\"Monster oil? Hmm, I have heard of it, but I don't remember the precise recipe to make it...\"";
next;
if (@Q_status == @SETZER_KNOWS_OIL)
menu
"OK, I'll ask around, perhaps someone else knows.", L_close;
if (@Q_status > @SETZER_KNOWS_OIL)
menu
"Rauk told me the recipe.", L_mo_knows_recipe;
close;
L_mo_knows_recipe:
mes "[Caul]";
mes "\"Ah, but of course! Yes, we should be able to brew that here. Except that... hmm. Pearl and three black scorpion stingers? This sounds very dangerous;";
mes "I fear that I will have to ask you to do this yourself.\"";
next;
goto L_mo_main_menu;
L_mo_main_menu:
@main_menu = 1;
menu
"What do you mean by 'dangerous'?", L_mo_why_dangerous,
"What do I need, again?", L_mo_ingredients,
"How does this work?", L_mo_explain,
"Let's start!", L_mo_start_brew,
"Where can I get a golden scorpion stinger?", L_mo_where_gold,
"I've changed my mind.", L_close;
L_mo_why_dangerous:
mes "[Caul]";
mes "\"Well, with those two reagents in there at that ratio, you risk an explosion – quite possibly a fatal one. So be prepared to duck if the brew gets too bubbly – it's better to lose the ingredients than your head!\"";
next;
goto L_mo_main_menu;
L_mo_ingredients:
mes "[Caul]";
mes "\"You will need one pearl, two snake skins, three black scorpion stingers, two piles of ash, and a golden scorpion stinger. The golden stinger goes in last, after the dangerous part, so you won't lose it if your brew blows up.\"";
next;
mes "[Caul]";
mes "\"You should also bring gamboge, mauve, alizarin and cobalt leaves. You will have to stabilize the brew, and they will help with that.\"";
next;
goto L_mo_main_menu;
L_mo_explain:
mes "[Caul]";
mes "\"After you have put in the monster parts – except for the golden stinger – the brew will take on some random color; this can be a light, dark, or medium color. You have to stabilize this color by adding leaves to it.\"";
next;
mes "[Caul]";
mes "\"Of course, with such a violent brew the mixture will change color by itself, too, probably faster than your leaves can affect it. It will randomly add or remove colors, and might even get lighter.\"";
next;
mes "[Caul]";
mes "\"From what I have seen, it seems to go through phases – for each alternate leaf it adds a colour, then removes a color, then adds again and so on. Of course, if the color is there already it can't add any more.\"";
next;
mes "[Caul]";
mes "\"I haven't figured out yet precisely when it gets lighter, though.\"";
next;
mes "[Caul]";
mes "\"By adding Mauve, you can make it darker. Alizarin adds red, Gamboge yellow, Cobalt blue. To make it a proper black, you have to get it to be dark gray, then add one Mauve leaf.\"";
next;
mes "[Caul]";
mes "\"Unfortunately the brew changes randomly before your leaves dissolve, so sometimes you can't help but add the wrong color...\"";
next;
mes "[Caul]";
mes "\"Since the brew changes its color first, you might want to add the Mauve when your color is a dark purple or dark green or dark orange and hope for the best.\"";
next;
mes "[Caul]";
mes "\"But don't add too much! If you add a color that is already there, or try to make it darker at the wrong spot, it may backfire.\"";
next;
if (@main_menu)
goto L_mo_main_menu;
goto L_mo_loop;
L_mo_where_gold:
mes "[Caul]";
mes "\"Good question. There aren't any golden scorpions nearby. Perhaps you can find a trader or an adventurer who have travelled further south and ask them to help?\"";
next;
goto L_mo_main_menu;
L_mo_start_brew:
@main_menu = 0;
if (countitem ("Pearl") < 1)
goto L_mo_missing;
if (countitem ("SnakeSkin") < 2)
goto L_mo_missing;
if (countitem ("BlackScorpionStinger") < 3)
goto L_mo_missing;
if (countitem ("PileOfAsh") < 2)
goto L_mo_missing;
if (countitem ("GoldenScorpionStinger") < 1)
goto L_mo_missing_gold;
delitem "Pearl", 1;
delitem "SnakeSkin", 2;
delitem "BlackScorpionStinger", 3;
delitem "PileOfAsh", 2;
@bubble_mode = 0;
setarray @bubble_modes$,
"The brew is calm.",
"The brew is bubbling.",
"The brew is bubbling violently.";
@color = 1 << (rand(3));
setarray @colors$,
"white",
"red",
"yellow",
"orange",
"blue",
"purple",
"green",
"gray";
@intensity = 1;
setarray @intensities$,
"light",
"medium",
"dark";
set @auto_mode, 0; // Start by adding a colour or going lighter
goto L_mo_loop;
L_mo_missing:
mes "[Caul]";
mes "\"You don't seem to have all of the ingredients. You need one pearl, two snake skins, three black stingers, two piles of ash, and one golden stinger.\"";
close;
L_mo_missing_gold:
mes "[Caul]";
mes "\"You seem to have everything except for the golden stinger. I understand that this one is hard to get, but I'm sure that you can find one somewhere.\"";
close;
L_mo_loop:
mes "[Brewing monster oil]";
mes @bubble_modes$[@bubble_mode];
mes "It is currently a " + @intensities$[@intensity] + " " + @colors$[@color] + ".";
next;
menu
"Add alizarin leaf", L_mo_alizarin,
"Add gamboge leaf", L_mo_gamboge,
"Add cobalt leaf", L_mo_cobalt,
"Add mauve leaf", L_mo_mauve,
"Ask Caul for advice", L_mo_explain,
"Duck!", L_Explodes;
L_Explodes:
mes "[Brewing monster oil]";
mes "You throw yourself onto the ground. Seconds later, the cauldron shakes, and your entire mixture explodes upwards.";
mes "Caul crawls out from underneath a char.";
next;
mes "[Caul]";
mes "\"I'm glad to see that you chose to brew another day... perhaps it might be best if you give up on this dangerous concoction, though!\"";
close;
L_mo_out_of_leaves:
mes "[Brewing monster oil]";
mes "You don't have any of these leaves left!";
next;
goto L_mo_loop;
L_mo_alizarin:
@use_leaf$ = "AlizarinHerb";
@use_color = 1;
goto L_mo_leaf_color;
L_mo_gamboge:
@use_leaf$ = "GambogeHerb";
@use_color = 2;
goto L_mo_leaf_color;
L_mo_cobalt:
@use_leaf$ = "CobaltHerb";
@use_color = 4;
goto L_mo_leaf_color;
L_mo_leaf_color:
if (countitem (@use_leaf$) < 1)
goto L_mo_out_of_leaves;
callsub S_mo_random_move;
if (@color & @use_color)
goto L_mo_pc_bad;
@color = @color | @use_color;
delitem @use_leaf$, 1;
mes "The brew changes its hue as your leaf dissolves.";
next;
goto L_mo_loop;
L_mo_mauve:
if (countitem("MauveHerb") < 1)
goto L_mo_out_of_leaves;
delitem "MauveHerb", 1;
callsub S_mo_random_move;
if (@intensity == 2 && @color == 7)
goto L_mo_done;
if (@intensity == 2)
goto L_mo_pc_bad;
@intensity = @intensity + 1;
mes "The brew darkens as your mauve leaf dissolves.";
next;
goto L_mo_loop;
S_mo_random_move:
mes "[Brewing monster oil]";
mes "You throw in a leaf and stir.";
if (@auto_mode == 1)
goto L_mo_random_1;
goto L_mo_random_0;
L_mo_random_0: // mode 0: add colour or lighten up
@auto_mode = 1;
if (rand(3) == 0)
goto L_mo_random_0_lighten;
@choice = 1 << (rand(3));
if (@color & @choice)
goto L_mo_auto_bad;
@color = @color | @choice;
mes "Before your leaf has a chance to dissolve, the brew changes to a " + @colors$[@color] + " hue.";
return;
L_mo_random_0_lighten:
if (@intensity == 0)
goto L_mo_auto_bad;
@intensity = @intensity - 1;
mes "Before your leaf has a chance to dissolve, the brew takes on a lighter shade of " + @colors$[@color] + ".";
return;
L_mo_random_1: // mode 1: remove colour
@auto_mode = 0;
@choice = 1 << (rand(3));
if (!(@color & @choice))
goto L_mo_auto_bad;
@color = @color & (~@choice);
mes "Before your leaf has a chance to dissolve, the brew changes to a " + @colors$[@color] + " hue.";
return;
L_mo_pc_bad:
if (rand(Int + 100) > 60)
goto L_mo_pc_bad_ok;
if (@bubble_mode)
mes "As your leaf dissolves, the intensity of the bubbling increases.";
if (!@bubble_mode)
mes "As your leaf dissolves, the brew begins to bubble.";
next;
@bubble_mode = @bubble_mode + 1;
if (@bubble_mode > 2)
goto L_mo_explode;
goto L_mo_loop;
L_mo_pc_bad_ok:
mes "Your leaf dissolves but seems to have no effect.";
next;
goto L_mo_loop;
L_mo_auto_bad:
if (rand(3) == 0)
goto L_Return;
if (rand(Int + 100) > 70)
goto L_Return;
mes "The brew begins to bubble more violently.";
@bubble_mode = @bubble_mode + 1;
if (@bubble_mode > 2)
next;
if (@bubble_mode > 2)
goto L_mo_explode;
return;
L_mo_explode:
mes "[Exploding monster oil]";
mes "Your brew explodes!";
if (rand(readparam(bAgi)) > 40)
goto L_mo_explode_dodge;
mes "The burst of boiling monster brew hits you.";
next;
heal (15 * rand(Vit)) - 1500, 0;
close;
L_mo_explode_dodge:
mes "You throw yourself to the ground at the very last moment, barely avoiding the burst of boiling monster brew.";
next;
mes "[Caul]";
mes "Caul nods at you from underneath a chair.";
mes "\"I told you, it's dangerous!!\"";
close;
L_mo_done:
mes "As you throw in another mauve leaf, the brew takes on a deep black color and calms down.";
next;
mes "[Brewing monster oil]";
mes "As instructed, you toss in your golden scorpion stinger.";
if (countitem ("GoldenScorpionStinger") < 1)
goto L_mo_no_gold_end;
mes "The brew bubbles once more, then calms completely.";
delitem "GoldenScorpionStinger", 1;
getitem "MonsterOilPotion", 1;
if (!(@Q_status & @SETZER_FLAG_MADE_OIL))
getexp @MONSTER_OIL_XP, 0;
if (!(@Q_status & @SETZER_FLAG_MADE_OIL))
mes "[" + @MONSTER_OIL_XP + " experience points]";
@Q_status = @Q_status | @SETZER_FLAG_MADE_OIL;
callsub S_Update_Var;
next;
mes "[Caul]";
mes "Caul gets up from underneath the cover he was taking and looks at your brew. He is visibly impressed.";
mes "\"Well done! This should be just enough for one potion of monster oil. Let me get you a bottle.\"";
mes "He hands you the monster oil.";
close;
L_mo_no_gold_end:
mes "But where is your golden stinger? Didn't you have one earlier?";
mes "Frustrated, you give up.";
close;
L_mox_start:
mes "[Caul]";
mes "\"The mopox cure potion? Certainly, if you have all of the ingredients... oh, and make sure to bring water, roots, sulphur powder and Mauve leaves.\"";
mes "\"This is a very easy one, so I think I should let you do this yourself. It is very good exercise.\"";
next;
goto L_mox_overview_menu;
L_mox_overview_menu:
menu
"I'm ready!", L_mox_setup,
"What are the ingredients?", L_mox_ingredients,
"How does this work?", L_mox_howto,
"I'd rather not try.", L_close;
L_mox_ingredients:
mes "[Caul]";
mes "\"You will need one concentration potion, one iron potion, a lifestone, and one gamboge leaf.\"";
next;
goto L_mox_overview_menu;
L_mox_howto:
mes "[Caul]";
mes "\"When you start brewing, the liquid very rarely has the proper consistency and color. You need to make it gooey and medium dark.\"";
next;
mes "[Caul]";
mes "\"You can affect the consistency by adding ground roots and water, and you can change the color by adding mauve leaves (to darken it) and sulphur powder (to make it brighter).\"";
next;
mes "[Caul]";
mes "\"The ingredients have some side effects, though, so you will have to experiment a little.\"";
next;
mes "[Caul]";
mes "\"Oh, and be careful: water will evaporate over time, too.\"";
next;
goto L_mox_overview_menu;
L_mox_no_lifestone:
mes "[Caul]";
mes "\"You will need a lifestone.\"";
goto L_mox_overview_menu;
L_mox_no_gamboge:
mes "[Caul]";
mes "\"You will need a gamboge leaf.\"";
goto L_mox_overview_menu;
L_mox_no_concentration:
mes "[Caul]";
mes "\"You will need a concentration potion.\"";
goto L_mox_overview_menu;
L_mox_no_iron:
mes "[Caul]";
mes "\"You will need an iron potion.\"";
goto L_mox_overview_menu;
L_mox_setup:
if (countitem("IronPotion") < 1)
goto L_mox_no_iron;
if (countitem("ConcentrationPotion") < 1)
goto L_mox_no_concentration;
if (countitem("GambogeHerb") < 1)
goto L_mox_no_gamboge;
if (countitem("Lifestone") < 1)
goto L_mox_no_lifestone;
delitem "IronPotion", 1;
delitem "ConcentrationPotion", 1;
delitem "GambogeHerb", 1;
delitem "Lifestone", 1;
mes "[Brewing Mopox Cure]";
mes "You pour your two potions into the cauldron, then add a gamboge herb and a lifestone. Caul heats up the cauldron and you wait until it begins to boil.";
setarray @colours$, "white", "almost white", "light", "medium-dark", "dark", "very dark", "almost black", "black";
setarray @stickinesses$, "watery", "very runny", "runny", "gooey", "sticky", "very sticky", "almost solid";
@stickiness = rand(7);
@colour = 2 + rand(5);
// Target: (@stickiness, @colour) = (3, 3)
if (@stickiness == 3 && @colour == 3)
set @colour, 4; // don't allow insta-win; it's easy enough.
@rounds = 0;
goto L_mox_loop;
L_mox_loop:
mes "[Brewing Mopox Cure]";
mes "The brew is " + @colours$[@colour] + " and " + @stickinesses$[@stickiness] + ".";
if (@colour == 3 && @stickiness == 3)
goto L_mox_win;
next;
@colour = @colour + 10;
@stickiness = @stickiness + 10;
menu
"Add root", L_mopox_B_root,
"Add water", L_mopox_B_water,
"Add sulphur powder", L_mopox_B_sulphur,
"Add mauve", L_mopox_B_mauve,
"...what should I do again?", L_mopox_reexplain,
"Wait", L_mox_next;
L_mox_next:
@stickiness = @stickiness + @rounds;
@rounds = 1 - @rounds;
if (@stickiness < 10)
@stickiness = 10;
if (@colour < 10)
goto L_mopox_fail_bc;
if (@colour > 17)
goto L_mopox_fail_bc;
if (@stickiness > 16)
goto L_mof_hard;
if (@colour > 17)
goto L_mopox_fail_bc;
@colour = @colour - 10;
@stickiness = @stickiness - 10;
goto L_mox_loop;
L_mopox_reexplain:
mes "[Caul]";
mes "\"Make this brew gooey and medium dark.\"";
mes "\"(Gooey is right between runny and sticky.)\"";
mes "\"You can add different items that will affect both color and stickiness.\"";
next;
mes "[Caul]";
mes "\"Water and ground roots mostly affect stickiness.\"";
mes "\"Mauve and sulphur powder mostly affect color, with Mauve darkening the brew.\"";
next;
goto L_mox_next;
L_mopox_B_none:
mes "[Brewing Mopox Cure]";
mes "You don't have any left!";
next;
goto L_mox_next;
L_mopox_B_root:
if (countitem ("Root") < 1)
goto L_mopox_B_none;
delitem "Root", 1;
mes "[Brewing Mopox Cure]";
mes "You grind a root and pour it into the brew.";
next;
@colour = @colour + 1;
@stickiness = @stickiness + 3;
goto L_mox_next;
L_mopox_B_water:
if (countitem ("BottleOfWater") < 1)
goto L_mopox_B_none;
delitem "BottleOfWater", 1;
getitem "EmptyBottle", 1;
mes "[Brewing Mopox Cure]";
mes "You pour a bottle of water into the brew.";
next;
@colour = @colour;
@stickiness = @stickiness - 2;
goto L_mox_next;
L_mopox_B_sulphur:
if (countitem ("SulphurPowder") < 1)
goto L_mopox_B_none;
delitem "SulphurPowder", 1;
mes "[Brewing Mopox Cure]";
mes "You mix some sulphur powder into the brew.";
next;
@colour = @colour - 3;
@stickiness = @stickiness + 1;
goto L_mox_next;
L_mopox_B_mauve:
if (countitem ("MauveHerb") < 1)
goto L_mopox_B_none;
delitem "MauveHerb", 1;
mes "[Brewing Mopox Cure]";
mes "You grind a mauve herb and toss it in.";
next;
@colour = @colour + 2;
@stickiness = @stickiness + 1;
goto L_mox_next;
L_mopox_fail_bc:
mes "[Brewing Mopox Cure]";
mes "The brew suddenly begins to bubble again, turning green.";
mes "\"Oh dear,\" Caul remarks, \"you let the color stray too much.\"";
next;
mes "[Caul]";
mes "\"Better luck next time!\"";
close;
L_mof_hard:
mes "[Brewing Mopox Cure]";
mes "You find it almost impossible to stir the brew.";
mes "Suddenly, the thick mass bends outwards, a huge bubble bursting open right in your face!";
next;
if (rand(Vit) < 40)
sc_start SC_POISON, 1, 20;
mes "[Brewing Mopox Cure]";
mes "Yeech. That smelled bad.";
mes "\"Don't worry, I'll clean up the cauldron,\", interrupts Caul. \"You should wipe that off your face and make sure that you didn't get poisoned.\"";
next;
mes "[Caul]";
mes "\"Better luck next time!\"";
close;
L_mox_win:
mes "Caul looks pleased. \"Well done! This looks very good to me.\"";
next;
mes "[Caul]";
mes "Caul picks a bottle from a shelf and fills it with your brew.";
mes "\"One potion of Mopox cure, here you are. Good luck!\"";
getitem "MopoxCurePotion", 1;
if (!@Q_can_score_mopox_cure)
goto L_mox_win_quick;
getexp @MOPOX_CURE_XP, 0;
mes "[" + @MOPOX_CURE_XP + " experience points]";
set QUEST_MAGIC2, (QUEST_MAGIC2 & ~NIBBLE_3_MASK) | (2 << NIBBLE_3_SHIFT); // Make sure we can only get XP for brewing this once
goto L_mox_win_quick;
L_mox_win_quick:
close;
L_DemPotion:
mes "[Caul]";
mes "\"Ok, you do know this potion is one of the most dangerous potions brewed? My cauldron is empty, you can try it yourself.\"";
next;
mes "Caul goes three steps away and watches your actions carefully.";
menu
"Please explain to me what you know about that potion.", L_explain_dempo,
"Ok, I will start brewing.", L_brew_dempo_init,
"Nevermind", L_close;
L_explain_dempo:
mes "[Caul]";
mes "\"Hrrm. I have heard of that potion. I hope I can remember all the stuff needed.\"";
next;
mes "\"Basically this potion is a balancing between death and life; between knowledge and forgetting.\"";
next;
mes "\"So, to get it balanced, we need ingredients for both sides.\"";
next;
mes "\"For the death and forgetting side we can use bones. Although, bones do not work well. We would get the best results with a diseased heart of zombies. Of course, we can use undead ears and skulls as well.\"";
next;
mes "\"For the life and knowledge side we can use fresh mauve herbs. Lifestones would be even better. Roots will do as well, although these must be really fresh to show effect.\"";
next;
mes "\"Brewing such a powerful potion is dangerous. That is why you will need to do it yourself. I will try to assist you as best as I can.\"";
next;
mes "\"I don't know exactly, but there is a slight chance of exploding all time.\"";
next;
mes "\"The color of the mixture will give you a very good impression of what you need to do.\"";
mes "\"And to get that potion working, we need to stabilize it with a pearl at the end.\"";
next;
mes "\"The color will be in a range of really dark black to bright shining white. In between it is grey in different nuances.\"";
mes "\"When it is calm grey, the finalisation with a pearl will work best, so I have heard.\"";
next;
goto L_DemPotion;
L_brew_dempo_init:
if ((countitem("BottleOfWater") == 0)
|| (countitem("Bone") == 0)
|| (countitem("Lifestone") == 0)
|| (countitem("Pearl") == 0))
goto L_dempo_noinit;
delitem "BottleOfWater", 1;
delitem "Bone", 1;
delitem "Lifestone", 1;
@finish_dempo = 0;
// color can be either black or white at the beginning.
// with a slight randomness in there.
@dempo_color = rand(10);
if (rand(2)==0)
@dempo_color = @dempo_color + 90 ;
mes "To start that potion you put in the cauldron a bone, a bottle of water and a lifestone.";
next;
goto L_brew_dempo;
L_dempo_noinit:
mes "[Caul]";
mes "\"Hrrm. Usually you start that potion with a bone, a bottle of water and a lifestone.\"";
mes "\"I'd propose you do it exactly that way. You see, maybe it would even work with a skull and a healing potion, but since we don't know, and I don't want to repair my cauldron again, please don't try other solutions.\"";
next;
mes "\"Please use only this way to start the recipe: a bone, a bottle of water and a lifestone. In that order!\"";
mes "\"Ah, and of course you will need at least one pearl with you. This pearl is needed to finalize the potion.\"";
close;
L_brew_dempo:
callsub L_check_explosion;
callsub L_calc_dempo_color;
mes "After a little while of cooking you see its color turning into " + @dempo_color_S$+ ".";
next;
setarray @choice_idx, 0,0,0,0,0,0,0,0,0,0,0;
setarray @choice$, "","","","","","","","","","","";
@C_root = 12;
@C_mauve = 13;
@C_lifestone = 14;
@C_diseasedheart = 15;
@C_bone = 16;
@C_skull = 17;
@C_undeadear = 18;
@C_pearl = 19;
@C_nevermind = 20;
// counter of avalable answers
@choices_nr = 0;
if (countitem("Root") == 0)
goto L_Noroots;
@choice_idx[@choices_nr] = @C_root;
@choice$[@choices_nr] = "Add a root";
@choices_nr = @choices_nr + 1;
goto L_Noroots;
L_Noroots:
if (countitem("MauveHerb") == 0)
goto L_Nomauve;
@choice_idx[@choices_nr] = @C_mauve;
@choice$[@choices_nr] = "Add a mauve herb";
@choices_nr = @choices_nr + 1;
goto L_Nomauve;
L_Nomauve:
if (countitem("Lifestone") == 0)
goto L_Nolifestone;
@choice_idx[@choices_nr] = @C_lifestone;
@choice$[@choices_nr] = "Add a lifestone";
@choices_nr = @choices_nr + 1;
goto L_Nolifestone;
L_Nolifestone:
if (countitem("DiseasedHeart") == 0)
goto L_Noheart;
@choice_idx[@choices_nr] = @C_diseasedheart;
@choice$[@choices_nr] = "Add a diseased heart";
@choices_nr = @choices_nr + 1;
goto L_Noheart;
L_Noheart:
if (countitem("Bone") == 0)
goto L_Nobone;
@choice_idx[@choices_nr] = @C_bone;
@choice$[@choices_nr] = "Add a bone";
@choices_nr = @choices_nr + 1;
goto L_Nobone;
L_Nobone:
if (countitem("Skull") == 0)
goto L_Noskull;
@choice_idx[@choices_nr] = @C_skull;
@choice$[@choices_nr] = "Add a skull";
@choices_nr = @choices_nr + 1;
goto L_Noskull;
L_Noskull:
if (countitem("UndeadEar") == 0)
goto L_Noear;
@choice_idx[@choices_nr] = @C_undeadear;
@choice$[@choices_nr] = "Add an undead ear";
@choices_nr = @choices_nr + 1;
goto L_Noear;
L_Noear:
if (countitem("Pearl") == 0)
goto L_Nopearl;
@choice_idx[@choices_nr] = @C_pearl;
@choice$[@choices_nr] = "Finalize with a pearl.";
@choices_nr = @choices_nr + 1;
goto L_Nopearl;
L_Nopearl:
@choice_idx[@choices_nr] = @C_nevermind;
@choice$[@choices_nr] = "Nevermind and leave";
menu
@choice$[0],L_MenuItems1,
@choice$[1],L_MenuItems1,
@choice$[2],L_MenuItems1,
@choice$[3],L_MenuItems1,
@choice$[4],L_MenuItems1,
@choice$[5],L_MenuItems1,
@choice$[6],L_MenuItems1,
@choice$[7],L_MenuItems1,
@choice$[8],L_MenuItems1,
@choice$[9],L_MenuItems1,
@choice$[10],L_MenuItems1;
L_MenuItems1:
@menu = @menu - 1;
if (@choice_idx[@menu] == 0)
goto L_brew_dempo;
if ((countitem("Root") != 0)
&& (@choice_idx[@menu] == @C_root))
goto L_useroot;
if ((countitem("MauveHerb") != 0)
&& (@choice_idx[@menu] == @C_mauve))
goto L_usemauve;
if ((countitem("Lifestone") != 0)
&& (@choice_idx[@menu] == @C_lifestone))
goto L_uselifestone;
if ((countitem("DiseasedHeart") != 0)
&& (@choice_idx[@menu] == @C_diseasedheart))
goto L_usediseasedheart;
if ((countitem("Bone") != 0)
&& (@choice_idx[@menu] == @C_bone))
goto L_usebone;
if ((countitem("Skull") != 0)
&& (@choice_idx[@menu] == @C_skull))
goto L_useskull;
if ((countitem("UndeadEar") != 0)
&& (@choice_idx[@menu] == @C_undeadear))
goto L_useear;
if ((countitem("Pearl") != 0)
&& (@choice_idx[@menu] == @C_pearl))
goto L_usepearl;
if ((@choice_idx[@menu] == @C_nevermind))
goto L_Ask_quit;
// fallthrough only when player remove the items while in menu, trying to cheat
// the potion will be lost then
mes "\"Do not try to betray me. Come back when you have a better morale.\"";
close;
L_useroot:
delitem "Root", 1;
@dempo_color = @dempo_color + 9 + rand(9);
goto L_brew_dempo;
L_usemauve:
delitem "MauveHerb", 1;
@dempo_color = @dempo_color + 1 + rand(2);
goto L_brew_dempo;
L_uselifestone:
delitem "Lifestone", 1;
@dempo_color = @dempo_color + 3 + rand(4);
goto L_brew_dempo;
L_usediseasedheart:
delitem "DiseasedHeart", 1;
@dempo_color = @dempo_color - 35 - rand(25);
goto L_brew_dempo;
L_usebone:
delitem "Bone", 1;
@dempo_color = @dempo_color - 3 - rand(3);
goto L_brew_dempo;
L_useskull:
delitem "Skull", 1;
@dempo_color = @dempo_color - 9 - rand(9);
goto L_brew_dempo;
L_useear:
delitem "UndeadEar", 1;
@dempo_color = @dempo_color - 15 - rand(13);
goto L_brew_dempo;
L_usepearl:
delitem "Pearl", 1;
//ending it is a little dangerous as well,
// stay calm, when it smashes your fine tuned well done potion.
@finish_dempo = 1;
callsub L_check_explosion;
// ok now you really did it. Here is your potion:
getitem "GrimaceOfDementia",1;
mes "[Caul]";
mes "\"The potion is now ready. It seems as if it worked fine.\"";
next;
mes "\"Ok here is a flask of that potion. I'll care for the rest.\"";
mes "\"I mean it is a very dangerous fluid.\"";
next;
mes "\"See you later, alligator!\"";
close;
L_Ask_quit:
mes "[Caul]";
mes "\"The potion is not ready. You can't just leave now!\"";
menu
"Please throw away that stupid potion, I'm in a hurry!", L_close,
"Oh you are right, let me finish it.", L_brew_dempo;
L_check_explosion:
// set to range [-50 50];
@prob = @dempo_color - 50;
@prob = ((@prob * @prob) / 80) + 4;
if (@finish_dempo == 0)
goto L_check_exp_nof;
// square again, so you must be in the middle to get it work there;
// and multiply with 3 so there is definitly no chance to get it directly after starting
@prob = (@prob * @prob) * 2;
goto L_check_exp_nof;
L_check_exp_nof:
// in about 95% of the cases anything is fine, so return.
if (rand(1000) > @prob) goto L_Return;
// in some cases it is not:
// kabooom!
close2;
heal -(Hp/2), 0;
misceffect 5;
misceffect 16;
die();
end;
L_calc_dempo_color:
// @dempo_color_S$ is set in here:
//really dark black 0-11
if (@dempo_color < 12)
@dempo_color_S$ = "really dark black";
//dark black 12-23
if ((@dempo_color > 11) && (@dempo_color < 24))
@dempo_color_S$ = "dark black";
//black 24-34
if ((@dempo_color > 23) && (@dempo_color < 35))
@dempo_color_S$ = "black";
//dark grey with little dark spots 35-41
if ((@dempo_color > 34) && (@dempo_color < 42))
@dempo_color_S$ = "dark grey with little dark spots";
//dark grey 42-47
if ((@dempo_color > 41) && (@dempo_color < 48))
@dempo_color_S$ = "dark grey";
//calm grey 48-52
if ((@dempo_color > 47) && (@dempo_color < 53))
@dempo_color_S$ = "calm grey";
//light grey 53-58
if ((@dempo_color > 52) && (@dempo_color < 59))
@dempo_color_S$ = "light grey";
//light grey with little light spots 59-65
if ((@dempo_color > 58) && (@dempo_color < 66))
@dempo_color_S$ = "light grey with little light spots";
//white 66-76
if ((@dempo_color > 65) && (@dempo_color < 77))
@dempo_color_S$ = "white";
//shining white 77-88
if ((@dempo_color > 76) && (@dempo_color < 89))
@dempo_color_S$ = "shining white";
//bright shining white 77-100
if (@dempo_color > 88)
@dempo_color_S$ = "bright shining white";
return;
L_NohMask:
mes "[Caul]";
mes "\"I'm sorry, but I didn't. I'm staying in town. Try asking one of the miners.\"";
goto L_close;
L_close:
@inspector = 0;
close;
L_Return:
return;
S_Update_Var:
set QUEST_Forestbow_state,
(QUEST_Forestbow_state & ~(@Q_MASK)
| (@Q_status << @Q_SHIFT));
return;
}
|