summaryrefslogtreecommitdiff
path: root/npc/033-1/nico.txt
blob: e656f4bd1affccc2db817be4b50cedf6b1a6c9d1 (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
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
// TMW2 scripts.
// Authors:
//    Jesusalva
// Description:
//    Arcmage Cards Enhancer

033-1,157,89,0	script	Nico Goethe	NPC_PLAYER,{
    function colorname;
    function gameinfo;
    mesn;
    mesq l("My name is Nico Goethe, an %s card player.", "[@@https://arcmage.org|Arcmage@@]");
    next;
    mesn;
    mesq l("Would love to invite you to a card minigame... But alas, Kenton told me that minigames are a waste of time, and that I should not bother adventurers with it.");
    next;
    mesn;
    mesq l("However, I am still up for trading cards, if you wish.");
    mesc l("%s discreetly point out that cards only works well in Moubootaur Legends weapons, but this depends on your origin server.", .name$);
    next;
    goto L_Main;

L_Main:
    select
        l("Trade a card"),
        l("Evolve a card"),
        l("Remove a card"),
        l("Lets play!"),
        l("Bye.");
    mes "";
    switch (@menu) {
        // Trade Card
        case 1:
            mesn;
            mesq l("Give me a card and select another card of same class. I charge %d GP for simple exchanges.", 5000);
            next;
            if (Zeny < 5000)
                break;

            mes "##B" + l("Drag and drop an item from your inventory.") + "##b";
            .@card = requestitem();
            if (.@card <= 1) break;

            @menuret = 0;
            switch (.@card) {
            case HeroCard:
            case KnightCard:
            case ClericCard:
            case DruidCard:
            case MageCard:
            case NinjaCard:
            case NatureCard:
            case NecromancerCard:
                menuint
                    "Sorry, I don't want to trade it.", 0,
                    getitemname(HeroCard), HeroCard,
                    getitemname(KnightCard), KnightCard,
                    getitemname(ClericCard), ClericCard,
                    getitemname(DruidCard), DruidCard,
                    getitemname(MageCard), MageCard,
                    getitemname(NinjaCard), NinjaCard,
                    getitemname(NatureCard), NatureCard,
                    getitemname(NecromancerCard), NecromancerCard;
                mes "";
                break;
            case SpeedCard:
            case ReflectCard:
            case PowerCard:
            case WallCard:
                menuint
                    "Sorry, I don't want to trade it.", 0,
                    getitemname(SpeedCard), SpeedCard,
                    getitemname(ReflectCard), ReflectCard,
                    getitemname(PowerCard), PowerCard,
                    getitemname(WallCard), WallCard;
                mes "";
                break;
            case HeroCardS:
            case KnightCardS:
            case ClericCardS:
            case DruidCardS:
            case MageCardS:
            case NinjaCardS:
            case NatureCardS:
            case NecromancerCardS:
                menuint
                    "Sorry, I don't want to trade it.", 0,
                    getitemname(HeroCardS), HeroCardS,
                    getitemname(KnightCardS), KnightCardS,
                    getitemname(ClericCardS), ClericCardS,
                    getitemname(DruidCardS), DruidCardS,
                    getitemname(MageCardS), MageCardS,
                    getitemname(NinjaCardS), NinjaCardS,
                    getitemname(NatureCardS), NatureCardS,
                    getitemname(NecromancerCardS), NecromancerCardS;
                mes "";
                break;
            case SpeedCardS:
            case ReflectCardS:
            case PowerCardS:
            case WallCardS:
                menuint
                    "Sorry, I don't want to trade it.", 0,
                    getitemname(SpeedCardS), SpeedCardS,
                    getitemname(ReflectCardS), ReflectCardS,
                    getitemname(PowerCardS), PowerCardS,
                    getitemname(WallCardS), WallCardS;
                mes "";
                break;
            case HeroCardX:
            case KnightCardX:
            case ClericCardX:
            case DruidCardX:
            case MageCardX:
            case NinjaCardX:
            case NatureCardX:
            case NecromancerCardX:
                menuint
                    "Sorry, I don't want to trade it.", 0,
                    getitemname(HeroCardX), HeroCardX,
                    getitemname(KnightCardX), KnightCardX,
                    getitemname(ClericCardX), ClericCardX,
                    getitemname(DruidCardX), DruidCardX,
                    getitemname(MageCardX), MageCardX,
                    getitemname(NinjaCardX), NinjaCardX,
                    getitemname(NatureCardX), NatureCardX,
                    getitemname(NecromancerCardX), NecromancerCardX;
                mes "";
                break;
            case SpeedCardX:
            case ReflectCardX:
            case PowerCardX:
            case WallCardX:
                menuint
                    "Sorry, I don't want to trade it.", 0,
                    getitemname(SpeedCardX), SpeedCardX,
                    getitemname(ReflectCardX), ReflectCardX,
                    getitemname(PowerCardX), PowerCardX,
                    getitemname(WallCardX), WallCardX;
                mes "";
                break;
            default:
                mesn;
                mesq l("Sorry, I only deal with Arcmage cards.");
                break;
            }
            if (@menuret < 1)
                break;
            Zeny -= 5000;
            delitem .@card, 1;
            getitem @menuret, 1;
            break;
        // Evolve Card
        case 2:
            mesn;
            mesq l("Give me %s copies of the same card and %s GP, and I'll improve its tier.", b(l("three")), fnum(25000));
            mesc l("Normal Cards can be upgraded to S-Tier, and S Cards can be upgraded to X-Tier. X-Tier cards cannot be upgraded.");
            next;
            if (Zeny < 25000)
                break;

            mes "##B" + l("Drag and drop an item from your inventory.") + "##b";
            .@card = requestitem();
            if (.@card <= 1) break;
            if (countitem(.@card) < 3) {
                mesn;
                mesq l("You don't have enough cards of this type to upgrade.");
                next;
                break;
            }
            switch (.@card) {
            case HeroCard:
                delitem .@card, 3; Zeny -= 25000;
                getitem HeroCardS, 1;
                break;
            case KnightCard:
                delitem .@card, 3; Zeny -= 25000;
                getitem KnightCardS, 1;
                break;
            case ClericCard:
                delitem .@card, 3; Zeny -= 25000;
                getitem ClericCardS, 1;
                break;
            case DruidCard:
                delitem .@card, 3; Zeny -= 25000;
                getitem DruidCardS, 1;
                break;
            case MageCard:
                delitem .@card, 3; Zeny -= 25000;
                getitem MageCardS, 1;
                break;
            case NinjaCard:
                delitem .@card, 3; Zeny -= 25000;
                getitem NinjaCardS, 1;
                break;
            case NatureCard:
                delitem .@card, 3; Zeny -= 25000;
                getitem NatureCardS, 1;
                break;
            case NecromancerCard:
                delitem .@card, 3; Zeny -= 25000;
                getitem NecromancerCardS, 1;
                break;
            case SpeedCard:
                delitem .@card, 3; Zeny -= 25000;
                getitem SpeedCardS, 1;
                break;
            case ReflectCard:
                delitem .@card, 3; Zeny -= 25000;
                getitem ReflectCardS, 1;
                break;
            case PowerCard:
                delitem .@card, 3; Zeny -= 25000;
                getitem PowerCardS, 1;
                break;
            case WallCard:
                delitem .@card, 3; Zeny -= 25000;
                getitem WallCardS, 1;
                break;


            case HeroCardS:
                delitem .@card, 3; Zeny -= 25000;
                getitem HeroCardX, 1;
                break;
            case KnightCardS:
                delitem .@card, 3; Zeny -= 25000;
                getitem KnightCardX, 1;
                break;
            case ClericCardS:
                delitem .@card, 3; Zeny -= 25000;
                getitem ClericCardX, 1;
                break;
            case DruidCardS:
                delitem .@card, 3; Zeny -= 25000;
                getitem DruidCardX, 1;
                break;
            case MageCardS:
                delitem .@card, 3; Zeny -= 25000;
                getitem MageCardX, 1;
                break;
            case NinjaCardS:
                delitem .@card, 3; Zeny -= 25000;
                getitem NinjaCardX, 1;
                break;
            case NatureCardS:
                delitem .@card, 3; Zeny -= 25000;
                getitem NatureCardX, 1;
                break;
            case NecromancerCardS:
                delitem .@card, 3; Zeny -= 25000;
                getitem NecromancerCardX, 1;
                break;
            case SpeedCardS:
                delitem .@card, 3; Zeny -= 25000;
                getitem SpeedCardX, 1;
                break;
            case ReflectCardS:
                delitem .@card, 3; Zeny -= 25000;
                getitem ReflectCardX, 1;
                break;
            case PowerCardS:
                delitem .@card, 3; Zeny -= 25000;
                getitem PowerCardX, 1;
                break;
            case WallCardS:
                delitem .@card, 3; Zeny -= 25000;
                getitem WallCardX, 1;
                break;

            default:
                mesn;
                mesq l("Sorry, I only deal with Arcmage cards.");
                break;
            }
            break;
        // Remove a card
        case 3:
            mesc l("You can drag and drop an item to the NPC window or select an item through your inventory.");

            delinventorylist();
            getinventorylist();
            .@item_index = requestitemindex();
            .@item_id = @inventorylist_id[.@item_index];

            mesn;
            mesq l("Your mind is set? You will probably lose all the dyes and/or cards during on the item during this process. You're bleaching a %s by the way, and THERE ARE NO REFUNDS even if the item go ablaze.", getitemlink(.@item_id));

            if (askyesno() == ASK_YES) {
                mesn;
                mesq l("Sure, I'll be done in a jiff.");
                next;
                successremovecardsindex(.@item_index); // *should* return the card
                mesn;
                mesq l("Here it is, clean like a whistle!");
            } else {
                mesn;
                mesq l("Is it truly a hard choice to make?");
            }
            next;
            break;
        // Play minigame
        case 4:
            mesn;
            mesq l("...Are you trying to troll me?");
            next;
            mesn;
            mesq l("Well, I can't offer you an %s match, but do you want to play something else? I would charge %d GP for a match.", "[@@https://arcmage.org|Arcmage@@]", .price);
            next;
            if (askyesno() == ASK_NO) {
                mesn;
                mesq l("Suit yourself.");
                next;
                break;
            }
            gameinfo();
            mesn;
            mesq l("Ready to begin?");
            if (askyesno() == ASK_YES) goto L_Start;
            break;
        // Leave
        default:
            closeclientdialog;
            goodbye;
            close;
            break;
    }
    goto L_Main;

function colorname {
    switch (getarg(0)) {
    case 1:
        return "Green"; break;
    case 2:
        return "Blue"; break;
    case 3:
        return "Red"; break;
    case 4:
        return "Yellow"; break;
    case 5:
        return "Exit"; break;
    default:
        return l("ERROR: %d", getarg(0));
    }
}

function gameinfo {
    showavatar NPC_FLOPPED_NOBLEMAN;
    mes "";
    mesc l("Rules:");
    mesc l("A color sequence will be displayed on the avatar frame.");
    mesc l("You must then repeat the sequence at the board which will show.");
    next;
    mesc l("Prizes:");
    mesc l("You'll get %d GP every time you finish the sequence.", .prize);
    mesc l("If you finish %d sequences, you'll get a(n) %s!", 10, getitemlink(ArcmageBoxset));
    next;
    return;
}

L_Start:
    showavatar AVATAR_SEQBOARD;
    mesc l("Pay attention to the sequence!");
    next;
    Zeny -= .price;
    deletearray(@sequence);
    @streak=0;

L_Sequence:
    // Configure
    setnpcdialogtitle l("Memorize the sequence!");
    array_push(@sequence, 1+rand2(4));
    sleep2(1000);

    // Display
    freeloop(true);
    for (.@i=0;.@i < getarraysize(@sequence);.@i++) {
        showavatar 1200+@sequence[.@i];
        sleep2(1200-(@streak*20));
    }
    freeloop(false);

    // Request
    setnpcdialogtitle l("What was the sequence?");
    showavatar AVATAR_SEQBOARD;
    sleep2(500);

    for (.@i=0;.@i < getarraysize(@sequence);.@i++) {
        setskin "seqboard";
        select
            l("Green"),
            l("Blue"),
            l("Red"),
            l("Yellow"),
            l("Exit");
        .@ans=@menu;
        setskin "";
        mes "";
        mes l("%s", colorname(.@ans));
        //next;
        setnpcdialogtitle strnpcinfo(1);

        // Exit
        if (.@ans == 5)
            goto L_Close;

        // Wrong reply
        if (.@ans != @sequence[.@i])
            goto L_Wrong;
        // Correct!
    }
    mes "";
    showavatar AVATAR_SEQBOARD_WELL;

    // Seems like everything is/was correct
    mesn;
    mesq l("Congratulations! Everything was correct!");
    Zeny+=.prize;
    @streak+=1;

    // Winning Streak
    if (@streak % 10 == 0)
        getitem ArcmageBoxset, 1;
    mesc l("Your current win streak is @@!", @streak);
    next;
    // Game over
    if (@streak == 50)
        goto L_Close;
    // Otherwise, go ahead
    mesn;
    mesc l("Continue?"), 1;
    next;
    if (askyesno() == ASK_YES)
        goto L_Sequence;
    goto L_Close;

L_Wrong:
    showavatar AVATAR_SEQBOARD_FAIL;
    mesn;
    mesq l("Oh no... That is wrong! %%3");
    next;
    mesn;
    mesq l("Better luck next time!");
    next;
    showavatar;
    goto L_Main;

L_Close:
    showavatar;
    mesn;
    mesq l("Thanks for the match, it was fun!");
    next;
    goto L_Main;


OnInit:
    .@npcId = getnpcid(.name$);
    setunitdata(.@npcId, UDT_HEADTOP, TopHat);
    setunitdata(.@npcId, UDT_HEADMIDDLE, GoldenLightPlatemail);
    setunitdata(.@npcId, UDT_HEADBOTTOM, LeatherTrousers);
    setunitdata(.@npcId, UDT_WEAPON, ManaGloves);
    setunitdata(.@npcId, UDT_HAIRSTYLE, 24);
    setunitdata(.@npcId, UDT_HAIRCOLOR, 4);
    npcsit;

    .sex = G_MALE;
    .distance = 4;
    .price = 100;
    .prize = 25;
	end;

}