summaryrefslogtreecommitdiff
path: root/npc/003-0/recepcionist.txt
blob: 7bd39ef0f6ae9af77dcd6c7701d845becc59bad8 (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
// TMW2 Scripts.
// Author:
//  Jesusalva
// Description:
//  Magic School recepcionist (TODO: Give S. Badge)

003-0,47,44,4	script	Recepcionist#003-0	NPC_FEMALE,{
    if (getskilllv(TMW2_SKILLPERMIT) == 2 && MAGIC_LVL >= 3 && ST_TIER >= 1) goto L_T3_S0;

    mesn;
    mesq l("Hello, and welcome to the Magic School of Tulimshar.");
    next;
    mesn;
    mesq l("Unfortunately, we're shutting down. This building is too old.");
    next;
    mesn;
    mesq l("I hope our new campus get built soon. It'll be much better than here.");
    if (!MGQUEST)
        goto L_Prologue;
    if (!MAGIC_LVL)
        close;
    next;
    switch (getskilllv(TMW2_SKILLPERMIT)) {
        case 0:
            if (MAGIC_LVL >= 1)
                goto L_Tier1;
            break;
        case 1:
            if (MAGIC_LVL >= 2)
                goto L_Tier2;
            break;
        case 2:
            if (MAGIC_LVL >= 3)
                goto L_Tier3;
            break;
    }
    closeclientdialog;
    goodbye;
    close;

//////////////
/* Prologue */
//////////////
L_Prologue:
    next;
    mesn l("Magic Academy Tutorial");
    mesc l("The Magic Academy System is responsible for learning most skills ingame. For that, you need two things: Magic Skill Points and a reagent.");
    next;
    mesn l("Magic Academy Tutorial");
    mesc l("The reagent is always the same for the same class. If you do not have enough reagents but have an @@, it'll be used to continue.", getitemlink(ScholarshipBadge));
    next;
    mesn l("Magic Academy Tutorial");
    mesc l("Magic Skill Points can be obtained in three ways: By touching a Mana Stone, by signing up in a Special Class (if you have enough magic power) and by having high amounts of Job Level.");
    next;
    mesn l("Magic Academy Tutorial");
    mesc l("Upgrading a skill level can be done the same away and will always cost a single Magic Skill Point. Job Level points are obtained only after Lv @@, and is a single point each @@ levels.", 15+12, 12);
    next;
    inventoryplace ScholarshipBadge, 1;
    mesn;
    mesq l("That being said, I'll give you an @@, which allows you to learn a skill even if you can't pay for it.", getitemlink(ScholarshipBadge));
    next;
    mesn;
    mesq l("Please note unless you have Magic Powers, obtained from the Mana Seed, all you will be able to learn are small tricks, so please make a wise choice.");
    MGQUEST=true;
    getitem ScholarshipBadge, 1;
    close;

////////////////
/* First Tier */
////////////////
L_Tier1:
    mesn;
    mesq l("Also, I see you're a newly registered mage. Am I right?");
    next;
    if (askyesno() == ASK_NO) {
        mesn;
        mesq l("Alright. I wish you good luck in your studies.");
        close;
    }
    mesn;
    mesq l("Good. Did you knew you could register to the Special Class, in order to get an extra skill point?");
    next;
    mesn;
    mesq l("We only require a small fee of 1 @@, or 40 @@, or 500 @@ if you are poor adventurer.", getitemlink(DivineApple), getitemlink(SnakeEgg), getitemlink(MaggotSlime));
    next;
    switch(select(
        rif(countitem(DivineApple) >= 1, l("I got the apple.")),
        rif(countitem(SnakeEgg) >= 40, l("I got the eggs.")),
        rif(countitem(MaggotSlime) >= 500, l("I got the maggots slimes.")),
        l("I will apply later."))) {

        case 1:
            delitem DivineApple, 1;
            getexp $MANA_BLVL*100, $MANA_JLVL*10;
            break;
        case 2:
            delitem SnakeEgg, 40;
            getexp $MANA_BLVL*100, $MANA_JLVL*10;
            break;
        case 3:
            delitem MaggotSlime, 500;
            break;
        default:
            close;
            break;
    }
    skill TMW2_SKILLPERMIT, 1, 0;
    mes "";
    mesn;
    mesq l("Many thanks, your help has been invaluable. You now have an extra point, use it wisely.");
    close;

/////////////////
/* Second Tier */
/////////////////
L_Tier2:
    mesn;
    mesq l("Maybe you're interested in the Special Class again? An extra magic skill point for a lot of items, what do ya say?");
    next;
    if (askyesno() == ASK_NO) {
        mesn;
        mesq l("Alright. I wish you good luck in your studies.");
        close;
    }
    mesn;
    mesq l("Great news! Then please bring me 1 @@, or 200 @@ and 20 @@.", getitemlink(DivineApple), getitemlink(SilkCocoon), getitemlink(ChocolateMouboo));
    next;
    switch(select(
        rif(countitem(DivineApple) >= 1, l("I got the apple.")),
        rif(countitem(SilkCocoon) >= 200 && countitem(ChocolateMouboo) >= 20, l("I got the silk and chocolate.")),
        l("I will apply later."))) {

        case 1:
            delitem DivineApple, 1;
            break;
        case 2:
            delitem SilkCocoon, 200;
            delitem ChocolateMouboo, 20;
            break;
        default:
            close;
            break;
    }
    skill TMW2_SKILLPERMIT, 2, 0;
    getexp 10000, 0;
    mes "";
    mesn;
    mes l("Many thanks, and once again, your help has been invaluable.");
    mes l("You now have an extra point, use it wisely.");
    close;

/////////////////
/* Third Tier */
/////////////////
L_Tier3:
    ST_TIER=1;
    mesn;
    mesq l("Maybe you're interested in the Special Class again? An extra magic skill point, but this time in a dangerous journey, what do ya say?");
    next;
    if (nard_reputation() < 8) {
        mesn;
        mesc l("I advise you to do more quests on Tulimshar and Candor, otherwise, you will fail right at the end."), 1;
        next;
    }
    if (askyesno() == ASK_NO) {
        mesn;
        mesq l("Alright. I wish you good luck in your studies.");
        close;
    }
    mesn;
    mesq l("I will prepare you a potion. But beware, that potion will only last 20 minutes. You should assign some intelligence points to succeed.");
    next;
    mesn;
    mes l("If it expires, you'll need to do another. To bake it I need 1 @@, 10 @@ and an @@.", getitemlink(EverburnPowder), getitemlink(MaggotSlime), getitemlink(EmptyBottle));
    mesc l("Have Maggot Slimes, Bug Legs, Mauve Herbs and Money, lots of them."), 1;
    next;
    select
        rif(countitem(MaggotSlime) >= 10 && countitem(EverburnPowder) && countitem(EmptyBottle), l("I have everything.")),
        l("I'm not ready.");
    mes "";
    if (@menu == 2) {
        mesn;
        mesq l("Yes, as you see, the costs are high. Prepare yourself.");
        close;
    }

    delitem EmptyBottle, 1;
    delitem EverburnPowder, 1;
    delitem MaggotSlime, 10;
    ST_TIER=2;
    QUEST_ELEVARTEMPO=gettimetick(2) + (60 * 20);
    getexp 400, 0;
    mesn;
    mesc l("She mix the powder with the slime inside the bottle, and makes some weird mixture.");
    next;
    mesn;
    mesc l("She pours something on it, you're not sure what. And then utters some magic words.");
    next;
    // Reset timer, this is the place where it should really happen.
    QUEST_ELEVARTEMPO=gettimetick(2) + (60 * 20);
    mesn;
    mesq l("The potion is baked, and the time is now running! Read as fast as you can, don't miss details!");
    next;
    mesn;
    mesq l("First thing is to get a @@. One from black market won't do, go to Halinarzo!", getitemlink(SunnyCrystal));
    next;
    mesn;
    mesq l("Speak with ##BBarzil##b. Tell him it is for the Magic Academy. HURRY UP!");
    close;

// Logic handler
L_T3_S0:
    if (getskilllv(TMW2_SKILLPERMIT) == 2 && MAGIC_LVL >= 3 && ST_TIER == 1) goto L_Tier3;
    if (gettimetick(2) > QUEST_ELEVARTEMPO) goto L_T3_Fail;

    if (getskilllv(TMW2_SKILLPERMIT) == 2 && MAGIC_LVL >= 3 && ST_TIER == 2) goto L_T3_S2;
    if (getskilllv(TMW2_SKILLPERMIT) == 2 && MAGIC_LVL >= 3 && ST_TIER == 3) goto L_T3_S3;
    if (getskilllv(TMW2_SKILLPERMIT) == 2 && MAGIC_LVL >= 3 && ST_TIER == 4) goto L_T3_S4;
    if (getskilllv(TMW2_SKILLPERMIT) == 2 && MAGIC_LVL >= 3 && ST_TIER == 5) goto L_T3_S5;
    if (getskilllv(TMW2_SKILLPERMIT) == 2 && MAGIC_LVL >= 3 && ST_TIER == 6) goto L_T3_S6;
    if (getskilllv(TMW2_SKILLPERMIT) == 2 && MAGIC_LVL >= 3 && ST_TIER <= 9) goto L_T3_S7;
    if (getskilllv(TMW2_SKILLPERMIT) == 2 && MAGIC_LVL >= 3 && ST_TIER == 10) goto L_T3_Final;
    mesc l("Error, error, L_T3_S0 General Error, REPORT ME");
    close;

L_T3_S2:
    mesn;
    mesq l("Hurry up! Bring a @@ from Barzil in Halinarzo!! You only have @@ left!", getitemlink(SunnyCrystal), FuzzyTime(QUEST_ELEVARTEMPO,2,2));
    close;

L_T3_S3:
    if (countitem(SunnyCrystal) == 0) {
        mesn;
        mesq l("Where's the Sunny Crystal? Hurry up, you only have @@ left!", FuzzyTime(QUEST_ELEVARTEMPO,2,2));
    }
    delitem SunnyCrystal, 1;
    ST_TIER=4;
    getexp 250, 0;
    mesn;
    mesq l("Good, you did it!");
    next;
    mesn;
    mesc l("*chants more words, while the crystal hovers the potion*");
    next;

L_T3_S4:
    mesn;
    mesq l("I will need many Mauve Herbs! Do you have them with you? If you don't have enough, we'll lose everything! You need at most @@!", BaseLevel+40);
    select
        rif(countitem(MauveHerb), l("Yes, I have herbs. I assume the risks.")),
        l("No I don't have herbs. I'll be back.");

    if (@menu == 2)
        close;

    if (gettimetick(2) > QUEST_ELEVARTEMPO) goto L_T3_Fail;
    .@req=rand2(BaseLevel-20, BaseLevel+40);
    // Minimum is 40, max is unknown, defaults to 100

    mesn;
    mesq l("I need @@ Herbs!", .@req);
    //next; // If you comment this next, you'll allow players to logout and prevent penalty.
    mes "";

    if (countitem(MauveHerb) < .@req) goto L_T3_Fail;
    delitem MauveHerb, .@r;
    ST_TIER=5;
    getexp .@r*3, 0;
    //getitem MagicPotion, 1;

    mesc l("You quickly give her the herbs, and she skillfully mix them on a potion.");
    next;
    // You'll get a random amount of time, based on spent herbs
    // Usually, 10~73 sec, being 73 sec = 1m13s
    QUEST_ELEVARTEMPO=QUEST_ELEVARTEMPO+rand2(10,.@r-27);

L_T3_S5:
    mesn;
    mesq l("Good! Last step! West of Hurnscald, there is a magic fountain.");
    next;
    mesn;
    mesq l("Talk to the Fountain. Pour the potion on it. I advise you to put all your points on int if possible.");
    next;
    mesn;
    mesq l("Hurry up, you'll run out of time in @@!", FuzzyTime(QUEST_ELEVARTEMPO,2,2));
    close;

L_T3_S6:
    ST_TIER=7;
    mesn;
    mesq l("You did it! You're now on the last stage of this BORING and LONG quest!");
    next;

L_T3_S7:
    mesn;
    mesq l("Jesusaves wrote a grimorie, with ancient secrets of our world.");
    next;
    mesn;
    mesq l("Captain Nard have it. Fetch it with him! Quick, you only have @@ left!", FuzzyTime(QUEST_ELEVARTEMPO,2,2));
    close;

L_T3_Final:
    skill TMW2_SKILLPERMIT, 3, 0;
    getexp 40000, 0; // Yes, 40k experience points. Waw.
    mesc l(".:: Congratulations! ::."), 2;
    mesc l("You have completed the Jesusaves Grimorium Quest!"), 2;
    next;
    mesn;
    mesq l("Keep the Grimorie with you. It's a rare book which holds data from all others. The book shall guide your advances!");
    next;
    mesn;
    mesq lg("Yes, courageous and worthy adventurer. You did well!");
    next;
    mesn;
    mesc l("*sigh*");
    mesq l("Now I can turn in my report to Professor Volrtaw... I should not have stayed behind the classes.");
    close;

/// Fail handlers
L_T3_Fail:
    if (ST_TIER == 3) {
        if (countitem(SunnyCrystal) > 0) {
            delitem SunnyCrystal, 1;
        } else {
            mesn;
            mesc l("WARNING. YOU ARE CHEATING THE SUNNY CRYSTAL QUEST."), 1;
            next;
            mesn;
            mesc l("YOU WILL BE PENALIZED WITH 60% OF HEALTH."), 1;
            mesc l("IF YOU DIE, YOU'LL SUFFER THE EXP PENALTY."), 1;
            percentheal -60, -100;
            close;
        }
    }

    if (ST_TIER == 10) {
        if (countitem(JesusalvaGrimorium) > 0) {
            delitem JesusalvaGrimorium, 1;
        } else {
            mesn;
            mesc l("WARNING. YOU ARE CHEATING THE GRIMORIE QUEST."), 1;
            next;
            mesn;
            mesc l("YOU WILL BE PENALIZED WITH 70% OF HEALTH."), 1;
            mesc l("IF YOU DIE, YOU'LL SUFFER THE EXP PENALTY."), 1;
            percentheal -70, -100;
            close;
        }
    }

    mesc l(".:: Mission Failed ::."), 1;
    mesc l("You ran out of time."), 1;
    mes "";
    mes l("You should have gotten here @@.", FuzzyTime(QUEST_ELEVARTEMPO,0,2));
    ST_TIER=1;
    close;

/// Core code
OnTimer1000:
    domovestep;

OnInit:
    .@npcId = getnpcid(.name$);
    setunitdata(.@npcId, UDT_HEADTOP, FancyHat);
    setunitdata(.@npcId, UDT_HEADMIDDLE, SorcererRobe);
    //setunitdata(.@npcId, UDT_HEADBOTTOM, NPCEyes);
    //setunitdata(.@npcId, UDT_WEAPON, JeansShorts);
    setunitdata(.@npcId, UDT_HAIRSTYLE, any(8,11,20));
    setunitdata(.@npcId, UDT_HAIRCOLOR, 5);

    // Small movement
    initpath "move", 47, 44,
             "dir", UP, 0,
             "wait", 7, 0,
             "move", 48, 46,
             "dir", DOWN, 0,
             "wait", 7, 0,
             "move", 49, 44,
             "dir", UP, 0,
             "wait", 7, 0,
             "move", 47, 44;
    initialmove;
    initnpctimer;

    .sex=G_FEMALE;
    .distance=5;
    end;
}