summaryrefslogtreecommitdiff
path: root/world/map/npc/002-2/omar.txt
blob: 6e51a706bd14b68b2cb62d44460bff41ca9f4d98 (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
//
function|script|KadiyaSubquestConsts
{
    set @Q_kadiya_status, (QUEST_MAGIC2 & NIBBLE_3_MASK) >> NIBBLE_3_SHIFT;

    set @Q_STATUS_NONE, 0;
    set @Q_STATUS_KNOWS_MOPOX, 1;
    set @Q_STATUS_MADE_MOPOX, 2;
    set @Q_STATUS_DIDNT_DRINK, 3;
    set @Q_STATUS_WANTS_CHOCOCAKE, 4;
    set @Q_STATUS_WANTS_ORANGECUPCAKE, 5;
    set @Q_STATUS_COMPLETED, 6;
    set @Q_STATUS_COMPLETED_ELANORE, 7;
    set @Q_STATUS_COMPLETED_NOELANORE, 8;
    set @Q_STATUS_COMPLETED_POST_ELANORE, 9;

    if (((QUEST_MAGIC2 & NIBBLE_1_MASK) >> NIBBLE_1_SHIFT) < 4) set @Q_kadiya_status, @Q_STATUS_NONE;

    if (((QUEST_MAGIC2 & NIBBLE_1_MASK) >> NIBBLE_1_SHIFT) > 4) set @Q_kadiya_status, @Q_STATUS_COMPLETED_POST_ELANORE;

    return;
}

002-2,117,126,0|script|Omar|162
{
    callfunc "ElanoreFix";
    callfunc "KadiyaSubquestConsts";

    set @Q_status, @Q_kadiya_status;

    if (@Q_status >= @Q_STATUS_COMPLETED) goto L_cured;

    if (@Q_status == @Q_STATUS_DIDNT_DRINK) goto L_didnt_drink;

    if (@Q_status > @Q_STATUS_DIDNT_DRINK) goto L_make_food;

    mes "[Omar]";
    mes "\"Welcome to my humble abode.\"";
    next;
    menu
        "Well met!  May I ask who you are?", L_omar,
        "What's wrong with your daughter?", L_kadiya_sick,
        "Thank you!", L_Close;

L_omar:
    mes "[Omar]";
    mes "\"My name is Omar;  I am a trader of oils and spices.\"";
    goto L_Close;

L_kadiya_sick:
    mes "[Omar]";
    mes "\"Kadiya has caught Ponderpox, I fear.\"";
    mes "He sighs.";
    mes "\"She's has been feverish for many days now. I wish there were something I could do.\"";
    next;
    menu
        "Have you asked Elanore the healer?", L_sick_elanore,
        "How about the Hurnscald hospital?", L_sick_hospital,
        "Can I help?", L_sick_self,
        "I'm sorry to hear that.", L_Next;

L_Next:
    mes "[Omar]";
    mes "\"Well, she is a strong girl. I am sure that she will get over it eventually.\"";
    mes "He smiles, but you see doubt in his eyes.";
    goto L_Close;

L_sick_elanore:
    mes "[Omar]";
    mes "\"Elanore?\"";
    mes "He frowns.";
    mes "\"She knows nothing. I see no point in talking to her.\"";
    goto L_Close;

L_sick_hospital:
    mes "[Omar]";
    mes "\"Hurnscald is too far away. I don't think that it would be good for her to go on such a long trip.\"";
    goto L_Close;

L_sick_self:
    mes "[Omar]";
    mes "\"You are very kind, but I don't think there is anything you can do.\"";
    goto L_Close;

L_didnt_drink:
    mes "[Omar]";
    mes "\"So she has Mopox, not Ponderpox, you say?  Hmm. That is much harder to cure, I think.\"";
    mes "\"I am grateful for the effort you put into brewing a potion for her. But it does smell vile...\"";
    next;
    mes "[Omar]";
    mes "\"I promised my dear wife that I would never make Kadiya eat or drink anything she doesn't like. So I won't force her to drink this.\"";
    next;
    mes "[Omar]";
    set @Q_status, (@Q_STATUS_WANTS_CHOCOCAKE + rand(2));
    callsub S_update_var;
    if (@Q_status == @Q_STATUS_WANTS_ORANGECUPCAKE)
        mes "\"If only we could make it smell and taste like orange cupcakes... she really loves those cupcakes.\"";
    if (@Q_status == @Q_STATUS_WANTS_CHOCOCAKE)
        mes "\"If only this were a chocolate cake and not a potion... she really loves chocolate cakes.\"";
    goto L_Close;

L_make_food:
    mes "[Omar]";
    mes "\"I should stay here to watch over her. I wish I could think of a way to convince her to drink the potion...\"";
    if (@Q_status == @Q_STATUS_WANTS_ORANGECUPCAKE)
        mes "\"Alas, it is not an orange cupcake.\"";
    if (@Q_status == @Q_STATUS_WANTS_CHOCOCAKE)
        mes "\"If only it were to smell and taste like her favourite chocolate cake...\"";
    goto L_Close;

L_cured:
    if (@Q_status == @Q_STATUS_COMPLETED) goto L_cured_choice;
    mes "[Omar]";
    mes "\"She is sleeping now, but she seems to be much better. I am sure that she will be up and running around again soon.\"";
    goto L_Close;

L_cured_choice:
    mes "[Omar]";
    mes "\"I am very grateful for your help. I really was sure that it was Ponderpox, not Mopox, that she had.\"";
    next;
    menu
        "Oh, it was nothing.", L_cured_nothing,
        "I didn't do it alone; Elanore helped.", L_cured_elanore,
        "That will be 5000 GP.", L_Next1;

L_Next1:
    mes "[Omar]";
    mes "\"Ah, certainly.\"";
    mes "He hands you a small bag of money.";
    next;
    set @Q_status, @Q_STATUS_COMPLETED_NOELANORE;
    callsub S_update_var;
    set Zeny, Zeny + 5000;
    goto L_Close;

L_cured_nothing:
    mes "[Omar]";
    mes "\"No, this wasn't nothing. She is everything to me. Here, you deserve a reward.\"";
    mes "He hands you a bag of money containing 10,000 GP and two pearls.";
    mes "\"And feel free to drop by again whenever you would like!\"";
    set @Q_status, @Q_STATUS_COMPLETED_NOELANORE;
    callsub S_update_var;
    getitem "Pearl", 2;
    set Zeny, Zeny + 10000;
    goto L_Close;

L_cured_elanore:
    mes "[Omar]";
    mes "Omar frowns.";
    mes "\"That witch?  You worked with her without telling me?\"";
    mes "He looks over to his daughter, concern suddenly in his eyes.";
    mes "\"She is looking better, though...\"";
    next;
    mes "[Omar]";
    mes "Omar shakes his head.";
    mes "\"I will have to think about this. Please leave me alone.\"";
    next;
    set @Q_status, @Q_STATUS_COMPLETED_ELANORE;
    callsub S_update_var;
    goto L_Close;

L_Close:
    set @Q_STATUS_KNOWS_MOPOX, 0;
    set @Q_STATUS_MADE_MOPOX, 0;
    set @Q_STATUS_DIDNT_DRINK, 0;
    set @Q_STATUS_WANTS_CHOCOCAKE, 0;
    set @Q_STATUS_WANTS_ORANGECUPCAKE, 0;
    set @Q_STATUS_COMPLETED, 0;
    set @Q_STATUS_COMPLETED_ELANORE, 0;
    set @Q_STATUS_COMPLETED_NOELANORE, 0;
    set @Q_STATUS_COMPLETED_POST_ELANORE, 0;
    set @Q_status, 0;
    close;


S_update_var:
    set QUEST_MAGIC2, (QUEST_MAGIC2 & ~(NIBBLE_3_MASK) | (@Q_status << NIBBLE_3_SHIFT));
    return;
}

002-2,124,124,0|script|Kadiya|174
{
    set @child_number, 7;
    callfunc "XmasList";

    callfunc "ElanoreFix";
    set @Q_MASK, NIBBLE_3_MASK;
    set @Q_SHIFT, NIBBLE_3_SHIFT;
    callfunc "KadiyaSubquestConsts";
    set @Q_status, @Q_kadiya_status;
    if (@Q_status >= @Q_STATUS_COMPLETED) goto L_cured;

    mes "You see a young girl lying in bed. At first she doesn't seem to notice you approaching.";
    mes "Finally, she turns her head towards you. Judging from the sweat on her forehead and look in her eyes, she is suffering from some kind of fever.";
    next;
    mes "[Kadiya]";
    mes "\"Hello,\" she says in a tiny voice.";
    next;
    set @M_NAME, 1;
    set @M_CANDY, 2;
    set @M_POTION, 3;
    set @M_CHOCOCAKE, 4;
    set @M_CUPCAKE, 5;

    setarray @choice$, "Hello!  What's your name?", "Would you like some candy?", "", "", "", "", "", "";
    setarray @choice_idx, @M_NAME, @M_CANDY, 0, 0, 0, 0, 0, 0;
    set @choices_nr, 2;

    if (countitem("MopoxCurePotion") == 0) goto L_M_no_cure;

    set @choice_idx[@choices_nr], @M_POTION;
    set @choice$[@choices_nr], "This potion will cure your illness!";
    set @choices_nr, @choices_nr + 1;
    goto L_M_no_cure;

L_M_no_cure:
    if ((countitem("LacedChocolateCake") == 0) || (@Q_status != @Q_STATUS_WANTS_CHOCOCAKE))
        goto L_M_no_chococake;
    set @choice_idx[@choices_nr], @M_CHOCOCAKE;
    set @choice$[@choices_nr], "Would you like special chocolate cake?";
    set @choices_nr, @choices_nr + 1;
    goto L_M_no_chococake;

L_M_no_chococake:
    if ((countitem("LacedOrangeCupcake") == 0) || (@Q_status != @Q_STATUS_WANTS_ORANGECUPCAKE))
        goto L_M_no_cupcake;
    set @choice_idx[@choices_nr], @M_CUPCAKE;
    set @choice$[@choices_nr], "Would you like special orange cupcake?";
    set @choices_nr, @choices_nr + 1;
    goto L_M_no_cupcake;

L_M_no_cupcake:
    set @choice_idx[@choices_nr], 0;
    set @choice$[@choices_nr], "Goodbye.";
    set @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;

L_MenuItems:
    set @choice, @choice_idx[@menu - 1];

    if (@choice == @M_NAME) goto L_name;
    if (@choice == @M_CANDY) goto L_no_candy;
    if (@choice == @M_POTION) goto L_potion;
    if (@choice == @M_CHOCOCAKE) goto L_chococake;
    if (@choice == @M_CUPCAKE) goto L_cupcake;
    goto L_Close;

L_name:
    mes "[Kadiya]";
    mes "She smiles a faint smile.";
    mes "\"My name is Kadiya.\"";
    goto L_Close;

L_no_candy:
    mes "[Kadiya]";
    mes "She hesitates for a moment.";
    mes "\"No, thank you. I don't think I should.\"";
    goto L_Close;

L_potion:
    mes "[Kadiya]";
    if (@Q_status < @Q_STATUS_DIDNT_DRINK) set @Q_status, @Q_STATUS_DIDNT_DRINK;
    callsub S_update_var;

    mes "Kadiya grimaces and pushes the bottle away.";
    mes "\"That smells terrible!\"";
    next;
    mes "[Kadiya]";
    mes "She pulls the sheets over her head.";
    mes "\"I won't drink that!\"";
    goto L_Close;

L_chococake:
    delitem "LacedChocolateCake", 1;
    goto L_do_cure;

L_cupcake:
    delitem "LacedOrangeCupcake", 1;
    goto L_do_cure;

L_do_cure:
    if (@Q_status < @Q_STATUS_COMPLETED) set @Q_status, @Q_STATUS_COMPLETED;
    callsub S_update_var;

    mes "[Kadiya]";
    mes "Kadiya's eyes widen.";
    mes "\"Oh!  Daddy, is it okay if I eat this?\"";
    mes "Omar nods and smiles. \"You should eat a bit to regain your strength, sweetheart.\"";
    next;
    mes "[Kadiya]";
    mes "Kadiya devours your gift in just a handful of bites.";
    next;
    mes "[Kadiya]";
    mes "She smiles. \"Thank you!  I feel better already!\".";
    next;
    mes "[Kadiya]";
    mes "She looks much healthier, too. Omar walks over and touches her forehead.";
    mes "\"Now that is funny – your fever has gone down quite a bit!\"";
    mes "He smiles at you. \"Thank you for your help!\"";
    next;
    mes "[Kadiya]";
    mes "\"You should get some sleep now, sweetheart. I'm sure that you will be better soon.\"";
    goto L_Close;

L_cured:
    mes "[Kadiya]";
    mes "Kadiya seems to be sleeping calmly. She looks much less sweaty than earlier; unless you are very much mistaken, her fever has disappeared.";
    goto L_Close;

L_Close:
    set @Q_status, 0;
    set @Q_MASK, 0;
    set @Q_SHIFT, 0;
    set @M_NAME, 0;
    set @M_CANDY, 0;
    set @M_POTION, 0;
    set @M_CHOCOCAKE, 0;
    set @M_CUPCAKE, 0;
    set @choice, 0;
    set @choices_nr, 0;
    cleararray @choice_idx[0], 0, 7;
    cleararray @choice$[0], "", 7;
    close;

S_update_var:
    set QUEST_MAGIC2, (QUEST_MAGIC2 & ~(@Q_MASK) | (@Q_status << @Q_SHIFT));
    return;
}