summaryrefslogtreecommitdiff
path: root/npc/009-1_Hurnscald/old_woman.txt
blob: b021ae0b06b6292d22812a9c37849dfb491d301a (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
// Old woman

009-1.gat,29,43,0	script	Old Woman	154,{
	if (BaseLevel < 40) goto L_Lower;

	mes "[Old Woman]";
	mes "\"Hello deary.\"";
	next;

    if ((Inspector >= 1  && Inspector <= 7) || Inspector == 9) goto L_NohMask;
    goto L_Easter;

L_Continue:
    if ((Inspector >= 1  && Inspector <= 7) || Inspector == 9) goto L_NohMask;
    close;

L_Lower:
	mes "[Old Woman]";
	mes "\"Watch out for these flowers. They don't like to be messed with.\"";
	next;
	goto L_Continue;

L_NohMask:
	if (Inspector == 7) goto L_NohMask_Alibi;
	callfunc "ProcessEquip";
	if (@torsoC == cDarkBlue && @legsC == cDarkBlue) goto L_NohMask_Fake;
	if (Inspector >= 3 && Inspector <= 6) close;

	menu
		"Have you seen anything strange lately?", L_NohMask_FirstAsk,
		"Do you know anything about the recent robberies?", L_NohMask_FirstAsk,
		"Hello", -;
	close;

L_NohMask_FirstAsk:
	mes "[Old Woman]";
	mes "\"Yes, but I'm only talking to the inspector himself!\"";
	if (Inspector == 1) set Inspector, 2;
	close;

L_NohMask_Alibi:
	menu
		"Was your husband with you at home all night the last night that the troupe was in town?", -;

	mes "[Old Woman]";
	mes "\"Yes, we were both at home all night.\"";
	set Inspector, 8;
	close;

L_NohMask_Fake:
	if (Inspector == 9) goto L_NohMask_Fake_Satchel;
	if (Inspector >= 3 && Inspector <= 6) goto L_NohMask_Filler;

	mes "[Old Woman]";
	mes "\"I saw someone sneaking around town wearing a theater mask. It looked like one of the masks used by the troupe that was in town recently.\"";
	set Inspector, 3;
	close;

L_NohMask_Filler:
	mes "[Old Woman]";
	mes "\"I hope you castch that naughty person!\"";
	close;

L_NohMask_Fake_Satchel:
	mes "[Old Woman]";
	mes "\"I've remembered something else. The night the troupe left, I saw someone with a theater mask take a large satchel out of town. He was heading north.\"";
	set Inspector, 10;
	close;

L_Easter:
    if ((Easter_2010_QuestState >> E10_STATE_ROSE_SHIFT) & E10_STATE_ROSE_MASK == E10_STATE_ROSE_ROSE_COMPLETE) goto L_Easter_Complete;
    if ((Easter_2010_QuestState >> E10_STATE_ROSE_SHIFT) & E10_STATE_ROSE_MASK == E10_STATE_ROSE_RETURNED) goto L_Easter_Gaveup;
    if ((Easter_2010_QuestState & E10_STATE_EGG_MASK) == E10_STATE_EGG_COLLECTING) goto L_Easter_Check;
    if ((Easter_2010_QuestState & E10_STATE_EGG_MASK) == E10_STATE_EGG_COLLECTED) goto L_Easter_Reward;
    if ((Easter_2010_QuestState & E10_STATE_EGG_MASK) == E10_STATE_EGG_REWARDED) goto L_Easter_Hint;

    mes "[Old Woman]";
    mes "\"Would you be able to do something for me, dear?\"";
    next;
    menu "Sure", L_Easter_Accept_Explain,
             "What do you need?", L_Easter_Explain,
             "No.", -;
    close;

L_Easter_Explain:
    mes "[Old Woman]";
    mes "\"Well, my grandchildren are coming to stay for Easter, and I'm afraid I've forgotten to buy any eggs. Now, there're three of them, and the youngest will want... four eggs. And the middle child will want... seven eggs. And the eldest child will want... nine eggs. And the youngest child will want... four eggs. And the middle child will want...\"";
    next;

L_Easter_Menu:
    menu "\"Uh... yeah, I can do that.\"", L_Easter_Accept,
             "What did you need again?", L_Easter_Explain,
             "No.", -;
    close;

L_Easter_Accept_Explain:
    mes "[Old Woman]";
    mes "\"Oh! Thank you very much, " + strcharinfo(0) + ". Please bring me those Easter eggs as quickly as you can - my grandchildren will be here soon, and if they arrive and there's no chocolate for them they will be most upset!\"";
    set Easter_2010_QuestState, (Easter_2010_QuestState & ~E10_STATE_EGG_MASK) | E10_STATE_EGG_COLLECTING;
    close;

L_Easter_Accept:
    mes "[Old Woman]";
    mes "\"Thank you, dear. What luck you dropped by here!\"";
    set Easter_2010_QuestState, (Easter_2010_QuestState & ~E10_STATE_EGG_MASK) | E10_STATE_EGG_COLLECTING;
    close;

L_Easter_Check:
    mes "[Old Woman]";
    if (countitem(E10_COLLECT_EGGS_ID) + ((Easter_2010_QuestState >> E10_STATE_EGGS_COLLECTED_SHIFT) & E10_STATE_EGGS_COLLECTED_MASK) < 20) goto L_Easter_Check_Not_Enough;
    mes "\"Thank you, dear; that should be all I need.\"";
    delitem E10_COLLECT_EGGS_ID, 20 - ((Easter_2010_QuestState >> E10_STATE_EGGS_COLLECTED_SHIFT) & E10_STATE_EGGS_COLLECTED_MASK);
    set Easter_2010_QuestState, (Easter_2010_QuestState & ~((E10_STATE_EGGS_COLLECTED_MASK << E10_STATE_EGGS_COLLECTED_SHIFT) | E10_STATE_EGG_MASK)) | (20 << E10_STATE_EGGS_COLLECTED_SHIFT) | E10_STATE_EGG_COLLECTED;
    close;

L_Easter_Check_Not_Enough:
    if (countitem(E10_COLLECT_EGGS_ID) + ((Easter_2010_QuestState >> E10_STATE_EGGS_COLLECTED_SHIFT) & E10_STATE_EGGS_COLLECTED_MASK) == 0) goto L_Easter_Check_None;
    if (countitem(E10_COLLECT_EGGS_ID) == 0) goto L_Easter_No_More_To_Add;
    set Easter_2010_QuestState, (Easter_2010_QuestState & ~((E10_STATE_EGGS_COLLECTED_MASK << E10_STATE_EGGS_COLLECTED_SHIFT) | E10_STATE_EGG_MASK)) | ((countitem(E10_COLLECT_EGGS_ID) + ((Easter_2010_QuestState >> E10_STATE_EGGS_COLLECTED_SHIFT) & E10_STATE_EGGS_COLLECTED_MASK)) << E10_STATE_EGGS_COLLECTED_SHIFT) | E10_STATE_EGG_COLLECTING;
    delitem E10_COLLECT_EGGS_ID, countitem(E10_COLLECT_EGGS_ID); // In order to reach this point, the player must not have enough eggs to complete the quest anyway

    mes "\"Thank you... that makes " + ((Easter_2010_QuestState >> E10_STATE_EGGS_COLLECTED_SHIFT) & E10_STATE_EGGS_COLLECTED_MASK) + " eggs from you so far.\"";
    if (((Easter_2010_QuestState >> E10_STATE_EGGS_COLLECTED_SHIFT) & E10_STATE_EGGS_COLLECTED_MASK) > 15) mes "\"If you could get just a few more, it would be very much appreciated...\"";
    if (((Easter_2010_QuestState >> E10_STATE_EGGS_COLLECTED_SHIFT) & E10_STATE_EGGS_COLLECTED_MASK) <= 15) mes "\"My mind isn't what it used to be, but if you could get somewhere around " + (20 - ((Easter_2010_QuestState >> E10_STATE_EGGS_COLLECTED_SHIFT) & E10_STATE_EGGS_COLLECTED_MASK) + rand(3) - rand(3)) + " more for us, it would be very much appreciated...\""; // Add some jitter to make her seem more absent-minded. Rand called twice to create a curve
    close;

L_Easter_No_More_To_Add:
    if (((Easter_2010_QuestState >> E10_STATE_EGGS_COLLECTED_SHIFT) & E10_STATE_EGGS_COLLECTED_MASK) > 15) mes "\"Thank you for you help so far... if you could get just a few more, it would be very much appreciated...\"";
    if (((Easter_2010_QuestState >> E10_STATE_EGGS_COLLECTED_SHIFT) & E10_STATE_EGGS_COLLECTED_MASK) <= 15) mes "\"Thank you for your help so far. You don't have to, but if you could find " + (20 - ((Easter_2010_QuestState >> E10_STATE_EGGS_COLLECTED_SHIFT) & E10_STATE_EGGS_COLLECTED_MASK)) + " more eggs, it would be very helpful to this old lady, and much appreciated...\"";
    close;

L_Easter_Check_None:
    mes "\"My memory isn't what it used to be, dear, but I think I saw some people looking around under rocks and trees outside town... maybe there're some eggs out there you can find?\"";
    close;

L_Easter_Reward:
    mes "[Old Woman]";
    mes "\"Ah, your reward... I was going to give you a hat, as seems to be the tradition around here, but I have a feeling of... something that I have not felt in a long time.\"";
    mes "She hesitates.";
    next;

    getinventorylist;
    if (@inventorylist_count == 100)
        goto L_Easter_No_Room;

    mes "[Old Woman]";
    mes "\"In light of this... you had best take this... rose with you. It might not seem like much, but in the right place, it can do much, much more than you think...\"";
    mes "She seems restless, and not at all as frail as she was moments before.";
    next;

    mes "[Old Woman]";
    mes "\"Take this, and carry it with you wherever you go... even in the darkest of moments, you may yet see the light with this...\"";
    set Easter_2010_QuestState, (Easter_2010_QuestState & ~E10_STATE_EGG_MASK) | E10_STATE_EGG_REWARDED;
    getitem E10_TOKEN_ID, 1;
    close;

L_Easter_No_Room:
    mes "[Old Woman]";
    mes "She looks at you briefly with a sudden, fierce searching look.";
    mes "She mutters, \"Though it doesn't matter right now I suppose... you wouldn't have the room for it anyway...\"";
    next;

    mes "[Old Woman]";
    mes "\"Yet you have shown yourself to be kind and good... if you make some room, I will have something very special for you when you return.\"";
    close;

L_Easter_Hint:
    mes "[Old Woman]";
    setarray @hints$, "\"The rose I gave you? To be honest with you, some strange things have been happening...\"", "\"This world knows many perils, and in times of uncertainty we often need something--to hold, dear, to guide us...\"", "\"I can't quite describe it, but if I were you, I'd hold on to that rose, especially when the light seems to fade...\"", "\"A power beyond my understanding seems to be stirring, I'm afraid.\"";
    mes @hints$[rand(getarraysize(@hints$))];
    close;


L_Easter_Complete:
    if ((Easter_2010_QuestState >> E10_STATE_REWARDS_SHIFT) & E10_STATE_REWARDS_MASK == 0) goto L_Easter_Complete_New_Rewards;
    if ((Easter_2010_QuestState >> E10_STATE_REWARDS_SHIFT) & E10_STATE_REWARDS_MASK == E10_STATE_REWARDS_MASK) goto L_Easter_Done_All;
    
    // Done some.
    if ((~(Easter_2010_QuestState >> E10_DOCTOR_HELP_STATES_SHIFT) & E10_DOCTOR_HELP_STATES_MASK) == 0) goto L_Easter_Finish_Reward;
    // Helped thrice, and has already been rewarded. Hint that there is more to be done, but still thank the player for the help.
    mes "[Old Woman]";
    mes "\"I just can't get over how helpful you've been lately. You know, I hear there might be more to do still, if you're interested. Either way, you have my sincerest thanks.\"";
    close;

L_Easter_Complete_New_Rewards:
// Player hasn't been rewarded yet. Give them the items and set states accordingly.
    if ((~(Easter_2010_QuestState >> E10_DOCTOR_HELP_STATES_SHIFT) & E10_DOCTOR_HELP_STATES_MASK) == 0) goto L_Easter_Reward_All;
    // Player helped thrice. Give one of the two items, and set one of the flags accordingly.
    if (rand(2) == 0) goto L_Half_Reward_Rabbit_Hat;
    getinventorylist;
    if (@inventorylist_count == 100) goto L_Hats_No_Room;
    // Reward Eggshell hat here
    mes "[Old Woman]";
    mes "\"Oh, it's good to see you again, sweetie! After giving out gifts to all the children I noticed I still had quite a few of them left. I thought you might enjoy one yourself.\"";
    getitem "EggshellHat", 1;
    set Easter_2010_QuestState, Easter_2010_QuestState | (E10_STATE_REWARD_EGGSHELL << E10_STATE_REWARDS_SHIFT);
    close;

L_Half_Reward_Rabbit_Hat:
    // Reward Rabbit hat here
    getinventorylist;
    if (@inventorylist_count == 100) goto L_Hats_No_Room;
    mes "[Old Woman]";
    mes "\"Hehe, oh, I'm glad I ran into you again! Look at these! Aren't they just adorable? You should have seen my grandchildren, bless them. Of course I saved you a pair!\"";
    getitem "WhiteRabbitEars", 1;
    set Easter_2010_QuestState, Easter_2010_QuestState | (E10_STATE_REWARD_RABBIT_EARS << E10_STATE_REWARDS_SHIFT);
    close;

L_Easter_Finish_Reward:
    // The player has already been rewarded once, but has gone back and helped. Give the other reward here.
    if ((Easter_2010_QuestState >> E10_STATE_REWARDS_SHIFT) & E10_STATE_REWARDS_MASK == E10_STATE_REWARD_RABBIT_EARS) goto L_Easter_Finish_Reward_Eggshell;
    
    // Give the Rabbit ears, as the player already has the eggshell.
    getinventorylist;
    if (@inventorylist_count == 100) goto L_Hats_No_Room;
    mes "[Old Woman]";
    mes "The old woman looks upon you as though you had been missing. \"Oh, so wonderful to see your kind face again! Rumour has it that you've been hopping about being more helpful. At least that's what I had heard.\"";
    getitem "WhiteRabbitEars", 1;
    set Easter_2010_QuestState, Easter_2010_QuestState | (E10_STATE_REWARD_RABBIT_EARS << E10_STATE_REWARDS_SHIFT);
    
    goto L_Easter_All_done;

L_Easter_Finish_Reward_Eggshell:
    // Give the eggshll, as the player already has the ears.
    getinventorylist;
    if (@inventorylist_count == 100) goto L_Hats_No_Room;
    mes "[Old Woman]";
    mes "\"Oh, I knew you could do it! I'm sure it was difficult, but you showed real patience throughout. I was saving this for you, just in case you came back. I think it's... eggsquisite!\" She giggles and gives you a hat.";
    getitem "EggshellHat", 1;
    set Easter_2010_QuestState, Easter_2010_QuestState | (E10_STATE_REWARD_EGGSHELL << E10_STATE_REWARDS_SHIFT);
    goto L_Easter_All_Done;

L_Easter_Reward_All:
    // The player has not yet been rewarded, but has helped with everything. Give both hats and set flags accordingly.
    mes "[Old Woman]";
    mes "\"Oh my, you're safe and sound! I was so worried, but it seems you have done so well.\"";
    next;
    mes "[Old Woman]";
    mes "After a moment, she continues. \"I believe reflecting upon one's actions to be very revealing.\"";
    next;
    mes "[Old Woman]";
    mes "\"You, my dear, are a shining example, demonstrating, among other things, perseverance and compassion.\"";
    next;
    mes "[Old Woman]";
    mes "\"So for that, and for helping me with my grandchildren, I would like to give you these tokens of my appreciation.\"";
    next;
    getinventorylist;
    if (@inventorylist_count > 98) goto L_Hats_No_Room;
    mes "[Old Woman]";
    mes "\"Hold out your hands please, sweetie.\" You do so, and receive two very well-crafted hats.";
    getitem "EggshellHat", 1;
    getitem "WhiteRabbitEars", 1;
    set Easter_2010_QuestState, Easter_2010_QuestState | ((E10_STATE_REWARD_EGGSHELL | E10_STATE_REWARD_RABBIT_EARS) << E10_STATE_REWARDS_SHIFT);
    next;

L_Easter_Done_All:
    mes "[Old Woman]";
    mes "\"Hehe, I could tell you were a little confused by my first gift, yes? People really seem to enjoy these sorts of things, so I decided to reconsider my hat policy. And you've earned everything, every step of the way.\"";
    close;

L_Easter_Gaveup:
    mes "[Old Woman]";
    mes "\"Oh no,\" she gasps, extremely disheartened at your early return. \"I was expecting so much more from you once I heard what had happened.\"";
    next;
    mes "[Old Woman]";
    mes "She shakes her head, obviously upset. \"In fact, I had planned on giving you some extra treats for being so helpful and brave.\"";
    next;
    mes "[Old Woman]";
    mes "\"But I guess you did your best, honey. Maybe that's all that matters.\"";
    close;

L_Hats_No_Room:
    mes "[Old Woman]";
    mes "\"Oh, no, no, that won't do. I'll wait until you have some more room for carrying things. I wouldn't want you to lose a gift.\"";
    mes "\"Please see me again when you are ready, honey.\"";
    close;

// The all important rose die script. Hooked into the old woman script for now.
OnPCDieEvent:
    if (countitem(E10_TOKEN_ID) < 1) end;
    if ((Easter_2010_QuestState >> E10_STATE_ROSE_SHIFT) & E10_STATE_ROSE_MASK >= E10_STATE_ROSE_ROSE_USED) end;
    savepoint "028-1", 63, 68;
    delitem E10_TOKEN_ID, 1;
    set Easter_2010_QuestState, (Easter_2010_QuestState & ~(E10_STATE_ROSE_MASK << E10_STATE_ROSE_SHIFT)) | (E10_STATE_ROSE_ROSE_USED << E10_STATE_ROSE_SHIFT);
    getitem "DarkPetal", 1;
    end;

OnManualStartTimer:
    initnpctimer;
    end;

OnManualStopTimer:
    stopnpctimer;
    end;


OnTimer30000:
    setnpctimer 0;
    if ($Easter_2010_Npc_State1 & E10_TIMER_STATE_EGGS_MASK < ($Easter_2010_Npc_State1 >> E10_EGGS_TIMER_OVERTICK_SHIFT) & E10_EGGS_TIMER_OVERTICK_MASK) goto L_timer_increment;

OnResetReplenish:
    set $Easter_2010_Npc_State1, $Easter_2010_Npc_State1 & ~E10_TIMER_STATE_EGGS_MASK;
OnReplenish:
    set $Easter_2010_Egg_Loc_State1, $Easter_2010_Egg_Loc_State1 | (rand(2147483647) & rand(2147483647));
    set $Easter_2010_Egg_Loc_State2, $Easter_2010_Egg_Loc_State2 | (rand(2147483647) & rand(2147483647));
    set $Easter_2010_Egg_Loc_State3, $Easter_2010_Egg_Loc_State3 | (rand(2147483647) & rand(2147483647));
    set $Easter_2010_Egg_Loc_State4, $Easter_2010_Egg_Loc_State4 | (rand(2147483647) & rand(2147483647));
    set $Easter_2010_Egg_Loc_State5, $Easter_2010_Egg_Loc_State5 | (rand(2147483647) & rand(2147483647));
    end;

L_timer_increment:
    set $Easter_2010_Npc_State1, ($Easter_2010_Npc_State1 & ~E10_TIMER_STATE_EGGS_MASK) | (($Easter_2010_Npc_State1 & E10_TIMER_STATE_EGGS_MASK) + 1 );
}