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
|
// Basic magic functionality
// Magic system uses:
// - MAGIC_EXP (magic experience points, gained for spellcasting)
// - MAGIC_FLAGS
// Magic quests use:
// - QUEST_MAGIC
// - QUEST_MAGIC2
// ------------------------------------------------------------
// Gain initial magic skill
// ------------------------------------------------------------
function script MagicGainBasic {
set MAGIC_FLAGS, MAGIC_FLAGS | MFLAG_DRANK_POTION;
close;
}
// ------------------------------------------------------------
// Initialise Menu for selecting a choice of things to ask about
// ------------------------------------------------------------
function script MagicTalkOptionsSetup {
set @QQ_ELANORE, 1;
set @QQ_MANASEED, 2;
set @QQ_MANAPOTION, 3;
set @QQ_WYARA, 4;
set @QQ_SAGATHA, 5;
set @QQ_AULDSBEL, 6;
set @QQ_IMP, 7;
set @QQ_OLDWIZ, 8;
}
// ------------------------------------------------------------
// Print and run menu for choice of things to ask about
// Ignores the entry in @ignore
// Returns the result in `@c, or `0'
// ------------------------------------------------------------
function script MagicTalkMenu {
setarray @choice$, "", "", "", "", "", "", "", "", "";
set @choices_nr, 0;
setarray @choice_idx, 0, 0, 0, 0, 0, 0, 0, 0, 0;
if (@ignore == @QQ_ELANORE)
goto L_Q_post_elanore;
set @choice$[@choices_nr], "...Elanore the Healer?";
set @choice_idx[@choices_nr], @QQ_ELANORE;
set @choices_nr, @choices_nr + 1;
L_Q_post_elanore:
if (@ignore == @QQ_MANASEED)
goto L_Q_post_manaseed;
if (!(MAGIC_FLAGS & (MFLAG_KNOWS_MANASEED | MFLAG_MANASEED_RUMOUR)))
goto L_Q_post_manaseed;
set @choice$[@choices_nr], "...the Mana Seed?";
set @choice_idx[@choices_nr], @QQ_MANASEED;
set @choices_nr, @choices_nr + 1;
L_Q_post_manaseed:
if (@ignore == @QQ_MANAPOTION)
goto L_Q_post_manapotion;
if (!(MAGIC_FLAGS & MFLAG_KNOWS_MANAPOTION))
goto L_Q_post_manapotion;
set @choice$[@choices_nr], "...Mana Potions?";
set @choice_idx[@choices_nr], @QQ_MANAPOTION;
set @choices_nr, @choices_nr + 1;
L_Q_post_manapotion:
if (@ignore == @QQ_WYARA)
goto L_Q_post_wyara;
if (!(MAGIC_FLAGS & MFLAG_KNOWS_WYARA))
goto L_Q_post_wyara;
set @choice$[@choices_nr], "...Wyara the Witch?";
set @choice_idx[@choices_nr], @QQ_WYARA;
set @choices_nr, @choices_nr + 1;
L_Q_post_wyara:
if (@ignore == @QQ_SAGATHA)
goto L_Q_post_sagatha;
if (!(MAGIC_FLAGS & MFLAG_KNOWS_SAGATHA))
goto L_Q_post_sagatha;
set @choice$[@choices_nr], "...Sagatha the Witch?";
set @choice_idx[@choices_nr], @QQ_SAGATHA;
set @choices_nr, @choices_nr + 1;
L_Q_post_sagatha:
if (@ignore == @QQ_AULDSBEL)
goto L_Q_post_auldsbel;
if (!(MAGIC_FLAGS & MFLAG_KNOWS_AULDSBEL))
goto L_Q_post_auldsbel;
set @choice$[@choices_nr], "...Auldsbel the Wizard?";
set @choice_idx[@choices_nr], @QQ_AULDSBEL;
set @choices_nr, @choices_nr + 1;
L_Q_post_auldsbel:
if (@ignore == @QQ_OLDWIZ)
goto L_Q_post_oldwiz;
if (!(MAGIC_FLAGS & MFLAG_KNOWS_OLD_WIZARD))
goto L_Q_post_oldwiz;
set @choice$[@choices_nr], "...the Old Wizard?";
set @choice_idx[@choices_nr], @QQ_OLDWIZ;
set @choices_nr, @choices_nr + 1;
L_Q_post_oldwiz:
if (@ignore == @QQ_IMP)
goto L_Q_post_imp;
if (!(MAGIC_FLAGS & MFLAG_KNOWS_IMP))
goto L_Q_post_imp;
set @choice$[@choices_nr], "...the Earth Spirit in the desert well?";
set @choice_idx[@choices_nr], @QQ_IMP;
set @choices_nr, @choices_nr + 1;
L_Q_post_imp:
set @choice$[@choices_nr], "...never mind.";
set @choice_idx[@choices_nr], 0;
set @choices_nr, @choices_nr + 1;
menu @choice$[0], -,
@choice$[1], -,
@choice$[2], -,
@choice$[3], -,
@choice$[4], -,
@choice$[5], -,
@choice$[6], -,
@choice$[7], -,
@choice$[8], -;
set @menu, @menu - 1;
if (@menu >= @choices_nr)
set @menu, 0;
set @c, @choice_idx[@menu];
}
|