summaryrefslogtreecommitdiff
path: root/world/map/npc/xmas/2011/deliverPresentsHelper.txt
blob: bb26e76871893e40197a767931dba2ce5b81b551 (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
// author: Jenalya
// Aaron collects the finished toys
// good way: give toy + open box + wrapping
// bad way: give closed box prepared at the bad guy + wrapping

030-2.gat,127,41,0|script|Aaron|328,{

    if (!(gettime(7) == $@xmas2011_year && gettime(6) == 12 && gettime(5) >= $@xmas2011_start_day))
        goto L_NoEvent;
    if ((gettime(7) == $@xmas2011_year && gettime(6) == 12 && gettime(5) >= $@xmas2011_reward_start_day))
        goto L_RewardTime;

    set @plushmouboo, (xmas11 & $@xmas11_PlushMoubooMask) >> $@xmas11_PlushMoubooShift;
    set @stickreinboo, (xmas11 & $@xmas11_StickReinbooMask) >> $@xmas11_StickReinbooShift;
    set @ball, (xmas11 & $@xmas11_BallMask) >> $@xmas11_BallShift;
    set @doll, (xmas11 & $@xmas11_DollMask) >> $@xmas11_DollShift;

    if (xmas11 & $@xmas11_talkedToChief) goto L_Helping;

    mes "[Busy Helper]";
    mes "\"This is a disaster!\"";
    goto L_Close;

L_Helping:
    mes "[Aaron]";
    mes "\"Hello there! Do you have any finished toys ready for being packed and wrapped?";
    mes "We also need an empty box and wrapping paper.\"";

    cleararray @choice_idx, 0, 9;
    cleararray @choice$, "", 9;

    set @C_plushmouboo, 1;
    set @C_plushmouboobox, 2;
    set @C_stickreinboo, 3;
    set @C_stickreinboobox, 4;
    set @C_ball, 5;
    set @C_ballbox, 6;
    set @C_doll, 7;
    set @C_dollbox, 8;
    set @C_nevermind, 9;

    // counter of available answers
    set @choices_nr, 0;

    if (@plushmouboo != 3)
        goto L_NoPlushMouboo;
    set @choice_idx[@choices_nr], @C_plushmouboo;
    set @choice$[@choices_nr], "This Plush Mouboo needs to be packed.";
    set @choices_nr, @choices_nr + 1;

L_NoPlushMouboo:
    if (@plushmouboo != 4)
        goto L_NoPlushMoubooBox;
    set @choice_idx[@choices_nr], @C_plushmouboobox;
    set @choice$[@choices_nr], "I already packed this Plush Mouboo...";
    set @choices_nr, @choices_nr + 1;

L_NoPlushMoubooBox:
    if (@stickreinboo != 3)
        goto L_NoStickReinboo;
    set @choice_idx[@choices_nr], @C_stickreinboo;
    set @choice$[@choices_nr], "This Stick Reinboo needs to be packed.";
    set @choices_nr, @choices_nr + 1;

L_NoStickReinboo:
    if (@stickreinboo != 4)
        goto L_NoStickReinbooBox;
    set @choice_idx[@choices_nr], @C_stickreinboobox;
    set @choice$[@choices_nr], "I already packed this Stick Reinboo...";
    set @choices_nr, @choices_nr + 1;

L_NoStickReinbooBox:
    if (@ball != 3)
        goto L_NoBall;
    set @choice_idx[@choices_nr], @C_ball;
    set @choice$[@choices_nr], "This Leather Ball needs to be packed.";
    set @choices_nr, @choices_nr + 1;

L_NoBall:
    if (@stickreinboo != 4)
        goto L_NoBallBox;
    set @choice_idx[@choices_nr], @C_ballbox;
    set @choice$[@choices_nr], "I already packed this Leather Ball...";
    set @choices_nr, @choices_nr + 1;

L_NoBallBox:
    if (@doll != 3)
        goto L_NoDoll;
    set @choice_idx[@choices_nr], @C_doll;
    set @choice$[@choices_nr], "This Doll needs to be packed.";
    set @choices_nr, @choices_nr + 1;

L_NoDoll:
    if (@doll != 4)
        goto L_NoDollBox;
    set @choice_idx[@choices_nr], @C_dollbox;
    set @choice$[@choices_nr], "I already packed this Doll...";
    set @choices_nr, @choices_nr + 1;

L_NoDollBox:
    set @choice_idx[@choices_nr], @C_nevermind;
    set @choice$[@choices_nr], "I'll be back later.";

    menu
        @choice$[0],-,
        @choice$[1],-,
        @choice$[2],-,
        @choice$[3],-,
        @choice$[4],-,
        @choice$[5],-,
        @choice$[6],-,
        @choice$[7],-,
        @choice$[8],-;

    set @menu, @menu - 1;
    if (@choice_idx[@menu] == 0)
        goto L_Close;

    if ((@choice_idx[@menu] == @C_plushmouboo)|| (@choice_idx[@menu] == @C_plushmouboobox))
        set @toy$, "PlushMouboo";
    if (@choice_idx[@menu] == @C_plushmouboo)
        goto L_Pack;
    if (@choice_idx[@menu] == @C_plushmouboobox)
        goto L_Wrap;

    if ((@choice_idx[@menu] == @C_stickreinboo) || (@choice_idx[@menu] == @C_stickreinboobox))
        set @toy$, "StickReinboo";
    if (@choice_idx[@menu] == @C_stickreinboo)
        goto L_Pack;
    if (@choice_idx[@menu] == @C_stickreinboobox)
        goto L_Wrap;

    if ((@choice_idx[@menu] == @C_ball) || (@choice_idx[@menu] == @C_ballbox))
        set @toy$, "LeatherBall";
    if (@choice_idx[@menu] == @C_ball)
        goto L_Pack;
    if (@choice_idx[@menu] == @C_ballbox)
        goto L_Wrap;

    if ((@choice_idx[@menu] == @C_doll) || (@choice_idx[@menu] == @C_dollbox))
        set @toy$, "Doll";
    if (@choice_idx[@menu] == @C_doll)
        goto L_Pack;
    if (@choice_idx[@menu] == @C_dollbox)
        goto L_Wrap;

    if ((@choice_idx[@menu] == @C_nevermind))
        goto L_Close;
     goto L_Close;

L_Pack:
    mes "[Aaron]";
    mes "\"Very well, do you also have a box and wrapping paper?\"";

    callsub S_WrappingColor;

    if ((countitem("OpenPresentBox") < 1) || (countitem(@wrappingColor$) < 1) || (countitem(@toy$) < 1))
        goto L_NoItems;
    delitem "OpenPresentBox", 1;
    delitem @wrappingColor$, 1;
    delitem @toy$, 1;
    mes "[Aaron]";
    mes "\"Excellent! Give it to me!\"";
    mes "He takes the box, puts the toy into it and wraps it skillfully with the paper you gave him.";
    mes "Then he writes something on a paper next to him.";
    goto L_Deliver;

L_Wrap:
    mes "[Aaron]";
    mes "\"Ah, even better! Do you also have some wrapping paper?\"";

    callsub S_WrappingColor;

    if ((countitem("ClosedChristmasBox") < 1) || (countitem(@wrappingColor$) < 1))
        goto L_NoItems;
    delitem "ClosedChristmasBox", 1;
    delitem @wrappingColor$, 1;
    mes "[Aaron]";
    mes "\"Alright. Give it to me.\"";
    mes "He takes the box and wraps it elaborately with the paper you gave him.";
    mes "Then he writes something on a paper next to him.";
    goto L_Deliver;

L_Deliver:
    if (@toy$ == "PlushMouboo")
        set @plushmouboo, @plushmouboo + 2;
    if (@toy$ == "PlushMouboo")
        set xmas11, (xmas11 & ~($@xmas11_PlushMoubooMask) | (@plushmouboo << $@xmas11_PlushMoubooShift));

    if (@toy$ == "StickReinboo") 
        set @stickreinboo, @stickreinboo + 2;
    if (@toy$ == "StickReinboo")
        set xmas11, (xmas11 & ~($@xmas11_StickReinbooMask) | (@stickreinboo << $@xmas11_StickReinbooShift));

    if (@toy$ == "LeatherBall")
        set @ball, @ball + 2;
    if (@toy$ == "LeatherBall")
        set xmas11, (xmas11 & ~($@xmas11_BallMask) | (@ball << $@xmas11_BallShift));

    if (@toy$ == "Doll")
        set @doll, @doll + 2;
    if (@toy$ == "Doll")
        set xmas11, (xmas11 & ~($@xmas11_DollMask) | (@doll << $@xmas11_DollShift));

    goto L_Close;

L_NoEvent:
    mes "[Aaron]";
    mes "\"How did you come in? At this time of the year the door should be locked!\"";
    warp "030-1.gat", 99, 55;
    goto L_Close;

L_RewardTime:
    mes "[Aaron]";
    mes "\"This was a lot of hard work this year.\"";
    goto L_Close;

L_NoItems:
    mes "[Aaron]";
    mes "\"Don't be silly. Where are the items?\"";
    goto L_Close;

L_Close:
    set @plushmouboo, 0;
    set @stickreinboo, 0;
    set @ball, 0;
    set @doll, 0;
    set @C_plushmouboo, 0;
    set @C_plushmouboobox, 0;
    set @C_stickreinboo, 0;
    set @C_stickreinboobox, 0;
    set @C_ball, 0;
    set @C_ballbox, 0;
    set @C_doll, 0;
    set @C_dollbox, 0;
    set @C_nevermind, 0;
    set @choices_nr, 0;
    cleararray @choice_idx, 0, 9;
    cleararray @choice$, "", 9;
    set @menu, 0;
    set @toy$, "";
    set @wrappingColor$, "";
    close;

S_WrappingColor:
    menu
        "Yeah, I have this red dotted.",-,
        "Sure, see this yellow dotted.",-,
        "Yes, what about this blue dotted?",-,
        "Here, I have this purple striped.",-,
        "Isn't this red golden striped one wonderful?",-,
        "Here is this green red striped.",-,
        "No, I'll get it.",L_Close;
    if (@menu == 1)
        set @wrappingColor$, "RedDottedWrap";
    if (@menu == 2)
        set @wrappingColor$, "YellowDottedWrap";
    if (@menu == 3)
        set @wrappingColor$, "BlueDottedWrap";
    if (@menu == 4)
        set @wrappingColor$, "PurpleStripedWrap";
    if (@menu == 5)
        set @wrappingColor$, "RedGoldenStripedWrap";
    if (@menu == 6)
        set @wrappingColor$, "GreenRedStripedWrap";
    return;
}