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
|
// Anwar needs a magic fertilizer for his field
// Quest uses Nibble 3 of QUEST_NorthTulimshar
// Author: Jenalya
// state 1: Anwar sent to Tinris for help to get a magic fertilizer
// state 2: Tinris asked for chocolate cake as present for his girlfriend
// state 3: Tinris asked for ingredients for the fertilizer
// state 4: Tinris gave you the fertilizer
// state 5: Anwar tried it out and it doesn't work well, sent you back to Tinris
// state 6: Tinris asked for more ingredients for a new try
// state 7: Tinris says it's really hard, gives you the fertilizer and tells you to ask Eomie to cast a spell on it
// state 8: Eomie sends you to get some stuff so she can interrupt her spell on the spot of grass
// state 9: Eomie casted a spell on the fertilizer
// state 10: Anwar used it and it worked. he asks you to help him preparing a thank-you-gift for each Tinris and Eomis
// state 11: Anwar asked to bring present to Tinris
// state 12: gave present to Tinris
// state 13: Anwar asked to bring present to Eomie
// state 14: gave present to Eomie
// state 15: reported back to Anwar and done
-|script|#magicfieldNTconfig|-1,
{
OnInit:
set $@magicfieldNT_MASK, NIBBLE_3_MASK;
set $@magicfieldNT_SHIFT, NIBBLE_3_SHIFT;
end;
}
022-1.gat,41,46,0|script|Anwar|156,
{
set @state, ((QUEST_NorthTulimshar & $@magicfieldNT_MASK) >> $@magicfieldNT_SHIFT);
set @cloth_amount, 3;
set @silk_amount, 30;
set @firstTry_exp, 400;
set @secondTry_exp, 700;
set @material_exp, 1000;
set @final_exp, 2000;
if (@state >= 15) goto L_Done;
if (@state >= 13) goto L_GiveEomie;
if (@state >= 11) goto L_GiveTinris;
if (@state == 10) goto L_GiftMaterial;
if (@state >= 5) goto L_SecondTry;
if (@state >= 1) goto L_FirstTry;
mes "[Anwar]";
mes "\"Hello. You look like one of those young people who come here to go on an adventure.";
mes "Would you be interested in doing some small errand for me?\"";
menu
"Sure!",-,
"I'm busy, sorry.",L_Close;
mes "[Anwar]";
mes "\"That's the spirit! Ok, I'm tired of spending most of my time working on this field. I heard the magicians at the magic school are researching ways to enhance the growth of plants with magic.\"";
next;
mes "\"I can't go there myself, since this area of the city is full of sneaky ragtags and they will rob my field if I leave here. Could you go to the magic school and ask for some magic enhancement for my field?\"";
next;
mes "\"To find the school just follow the street south and then go west.\"";
set @state, 1;
callsub S_Update_Mask;
goto L_Close;
L_FirstTry: // @state >= 1 but below 5
mes "[Anwar]";
mes "\"I hope the wizards at the magic school can help me with the field. I'd really like to have more free time. I want to make clothing, but I'm not experienced enough to make a living out of that.\"";
if (@state != 4)
goto L_Close;
menu
"Tinris gave me a magic fertilizer for your field, but he isn't sure if it works.",-;
mes "[Anwar]";
mes "\"Really? Well, let's try it out!\"";
mes "He takes the fertilizer and starts to bespatter the field.";
next;
mes "But it doesn't seem to be good for the plants, they start to shrivel and get brown.";
mes "[Anwar]";
mes "\"Oh no! What is this? It's damaging my plants! Go back to Tinris and tell him it doesn't work!\"";
getexp @firstTry_exp, 0;
set @state, 5;
callsub S_Update_Mask;
goto L_Close;
L_SecondTry: // @state >= 5 but below 10
mes "[Anwar]";
mes "\"I hope Tinris can come up with a better fertilizer. My plants are suffering from the first try.\"";
if (@state != 9)
goto L_Close;
menu
"Here is another one. Eomie cast a spell on it.",-;
mes "[Anwar]";
mes "\"Eomie? I heard she's amazingly skilled with nature magic. I'll try if this works better.\"";
mes "He takes the fertilizer and puts it on only a few plants, then waits a moment to see the result.";
next;
mes "The plants recover a bit and become green again.";
mes "[Anwar]";
mes "\"Ah, this one is better. I'll put it on the entire field.\"";
getexp @secondTry_exp, 0;
set @state, 10;
callsub S_Update_Mask;
next;
L_GiftMaterial: // @state == 10
mes "[Anwar]";
mes "\"I want to show my gratitude to Tinris and Eomie. Can you help me once again? I would like to make some clothes for them and need " + @cloth_amount + " pieces of Cotton Cloth and " + @silk_amount + " Silk Cocoons.\"";
menu
"I have it.",-,
"Where can I get that?",L_Hint,
"I'll see what I can do.",L_Close;
getinventorylist;
if (@inventorylist_count == 100)
goto L_Full_Inv;
if ((countitem("CottonCloth") < @cloth_amount) || (countitem("SilkCocoon") < @silk_amount))
goto L_NoItem;
delitem "CottonCloth", @cloth_amount;
delitem "SilkCocoon", @silk_amount;
getexp @material_exp, 0;
getitem "GreenVNeckSweater", 1;
set @state, 11;
callsub S_Update_Mask;
mes "[Anwar]";
mes "\"Great! I'll start right away with the present for Tinris. That shouldn't take long.\"";
mes "After a short while of cutting and sewing he holds a V-Neck Sweater in his hands. Then he dyes it green.";
next;
mes "[Anwar]";
mes "\"Wonderful! Could you please bring this to Tinris to show him my gratitude?\"";
goto L_Close;
L_Hint:
mes "[Anwar]";
mes "\"As far as I know Cotton Cloth is given out as reward for hunting monsters. You should talk to Aidan on the bazaar.\"";
next;
mes "\"And silk cocoons come from Silkworms. They live in the woodland area around Hurnscald. You can get there by taking the ferry.\"";
goto L_Close;
L_GiveTinris: // @state >= 11 but below 13
mes "[Anwar]";
mes "\"Did you already bring the Green V-Neck Sweater to Tinris?\"";
if (@state != 12)
menu
"Not yet.",L_Close;
menu
"Yes, he was very happy.",-;
getinventorylist;
if (@inventorylist_count == 100)
goto L_Full_Inv;
mes "[Anwar]";
mes "\"Wonderful! I also finished the present for Eomie. Can you bring it to her?\"";
getitem "SilkHeadband", 1;
set @state, 13;
callsub S_Update_Mask;
goto L_Close;
L_GiveEomie: // @state >= 13 but below 15
getinventorylist;
if (@inventorylist_count == 100)
goto L_Full_Inv;
mes "[Anwar]";
mes "\"Did you give the Silk Headband to Eomie?\"";
if (@state != 14)
menu
"Not yet.",L_Close;
menu
"Yes. She asked me to thank you.",-;
mes "Anwar smiles.";
mes "[Anwar]";
mes "\"I'm so happy. Thank you so much for your help. I made this for you while you went to see Eomie.\"";
getexp @final_exp, 0;
getitem "DarkGreenCottonTrousers", 1;
set @state, 15;
callsub S_Update_Mask;
goto L_Close;
L_Done: // @state == 15
mes "[Anwar]";
mes "\"Thank you so much for your help. The plants are growing much better now. I don't have to spend all my time working in the field any more.";
mes "Finally I can do what I'm really interested in and work on getting better at sewing clothes.\"";
goto L_Close;
L_NoItem:
mes "[Anwar]";
mes "\"You don't have it!\"";
goto L_Close;
L_FullInv:
mes "[Anwar]";
mes "\"You carry a lot of stuff. Come back when you have more room.\"";
goto L_Close;
L_Close:
set @state, 0;
set @cloth_amount, 0;
set @silk_amount, 0;
set @inventorylist_count, 0;
close;
S_Update_Mask:
set QUEST_NorthTulimshar, (QUEST_NorthTulimshar & ~($@magicfieldNT_MASK)) | (@state << $@magicfieldNT_SHIFT);
return;
}
|