summaryrefslogtreecommitdiff
path: root/npc/024-1/john.txt
blob: 3ae7806e4162c0e6c96c08657beffd916af235e8 (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
// TMW2 scripts.
// Author:
//    Jesusalva
// Description:
//    John H

024-1,154,45,0	script	Jhon Henryfield	NPC_PLAYER,{
	if (BaseLevel < 42) {
        asleep();
		end;
	}
	.@q=getq(FrostiaQuest_JhonH);

    // Quest failed
    if (.@q == 8) {
        mesn;
        mesq l("Go away creep, I HATE YOU!");
        close;
    }

    if (!.@q) {
		mesn;
		mesc l("ZZZzzzz...");
        mesc l("%s seems to be asleep... Maybe we can wake him up somehow?", .name$);
        next;
        do
        {
            select
                l("Poke him"),
                l("Attack him"),
                l("Give him an item");
            mes "";
            if (@menu == 1) {
                mesc l("No reply. We should try something else.");
                next;
            } else if (@menu == 2) {
                mesn;
                mesc l("*Opening eyes in a shock*");
                mesq l("AAAAaaahhhhh!!!");
                setq FrostiaQuest_JhonH, 8; // Quest failed
                close;
            } else {
                mes "##B" + l("Drag and drop an item from your inventory.") + "##b";

                .@give = requestitem();
                if (.@give < 1) continue;
                if (!countitem(.@give)) continue;
                if (checkbound(.@give)) continue;
                if (getiteminfo(.@give, ITEMINFO_TYPE) != IT_HEALING &&
                    getiteminfo(.@give, ITEMINFO_TYPE) != IT_USABLE) continue;
                mesc l("Really give a %s to Jhon?", getitemlink(.@give));
                mesc l("The item will be lost forever."), 1;
                next;
                if (askyesno() == ASK_NO) continue;
                mes "";
                delitem .@give, 1;
                if (.@give == Coffee) {
                    setq FrostiaQuest_JhonH, 1;
                    .@q = 1;
                    getexp 250, 25;
                    mesn;
                    mesq l("Coffee! I'm awake now!");
                    next;
                    break;
                } else {
                    mesc l("...No reaction...");
                    next;
                }
            }
        } while (true);
    }
    ///////////////////////////
    if (!.@q) close;
    do
    {
        mesn;
        mesq l("How can I help you, my friend?");
        next;
        select
            l("Who are you?"),
            rif(.@q >= 2 && countitem(Coffee), l("Do you want more coffee?")),
            l("Nothing, thanks anyway.");
        mes "";
        switch (@menu) {
        case 1:
            mesn;
            mesq l("Name is Jhon, and that's not a typo! I am an absolute coffee lover, and I travel to exotic places in search of the perfect brew.");
            next;
            mesn;
            mesq l("Unfortunately, elves doesn't like to share coffee, so I thought in leaving but fell asleep. Oops!");
            next;
            mesn;
            mesq l("If you have some coffee to me, I'll buy it of your hands.");
            compareandsetq FrostiaQuest_JhonH, 2;
            .@q = max(.@q, 2);
            next;
            break;
        case 2:
            mesc l("How much coffee you'll give Jhon?");
            input .@c, 0, countitem(Coffee);
            mes "";
            .@c = min(.@c, countitem(Coffee));
            if (.@c < 1) break;
            delitem Coffee, .@c;
            .@q2 = getq2(FrostiaQuest_JhonH) + rand2(.@c);
            .@q3 = getq3(FrostiaQuest_JhonH);
            setq2 FrostiaQuest_JhonH, .@q2;
            .@xp = 250 + rand2(getiteminfo(Coffee, ITEMINFO_SELLPRICE) / 3);
            .@gp = getiteminfo(Coffee, ITEMINFO_SELLPRICE) * 2 / 3; // 67% GP
            Zeny += .@c * .@gp;
            getexp .@c * .@xp, .@c * 25; // ~33% EXP + bonus
            mesn;
            mesq lg("Thanks, gal!", "Thanks, pal!");
            next;
            switch (.@q3) {
            case 0:
                if (.@q2 >= 1) {
                    inventoryplace Potatoz, 1;
                    getitem Potatoz, 1;
                    setq3 FrostiaQuest_JhonH, .@q3 + 1;
                }
                break;
            case 1:
                if (.@q2 >= 5) {
                    inventoryplace IcedBottle, 1;
                    getitem IcedBottle, 1;
                    setq3 FrostiaQuest_JhonH, .@q3 + 1;
                }
                break;
            case 2:
                if (.@q2 >= 10) {
                    inventoryplace ScrollBattlePlansA, 1;
                    getitem ScrollBattlePlansA, 1;
                    setq3 FrostiaQuest_JhonH, .@q3 + 1;
                }
                break;
            case 3:
                if (.@q2 >= 15) {
                    inventoryplace ScrollDefenseBlessA, 1;
                    getitem ScrollDefenseBlessA, 1;
                    setq3 FrostiaQuest_JhonH, .@q3 + 1;
                }
                break;
            case 4:
                if (.@q2 >= 20) {
                    inventoryplace ScrollSYeti, 1;
                    getitem ScrollSYeti, 1;
                    setq3 FrostiaQuest_JhonH, .@q3 + 1;
                }
                break;
            case 5:
                if (.@q2 >= 25) {
                    inventoryplace AlchemyBlueprintA, 1;
                    getitem AlchemyBlueprintA, 1;
                    setq3 FrostiaQuest_JhonH, .@q3 + 1;
                }
                break;
            case 6:
                if (.@q2 >= 30) {
                    inventoryplace AlchemyBlueprintB, 1;
                    getitem AlchemyBlueprintB, 1;
                    setq3 FrostiaQuest_JhonH, .@q3 + 1;
                }
                break;
            case 7:
                if (.@q2 >= 40) {
                    .@i = any(LukPotionA, DexPotionA, IntPotionA, VitPotionA, AgiPotionA);
                    inventoryplace .@i, 1;
                    getitem .@i, 1;
                    setq3 FrostiaQuest_JhonH, .@q3 + 1;
                }
                break;
            case 8:
                if (.@q2 >= 50) {
                    inventoryplace AlchemyBlueprintC, 1;
                    getitem AlchemyBlueprintC, 1;
                    setq3 FrostiaQuest_JhonH, .@q3 + 1;
                }
                break;
            case 9:
                if (.@q2 >= 60) {
                    .@i = any(LukPotionC, DexPotionC, IntPotionC, VitPotionC, AgiPotionC, SacredLifePotion, SacredManaPotion);
                    inventoryplace .@i, 1;
                    getitem .@i, 1;
                    setq3 FrostiaQuest_JhonH, .@q3 + 1;
                }
                break;
            case 10:
                if (.@q2 >= 75) {
                    inventoryplace AlchemyBlueprintD, 1;
                    getitem AlchemyBlueprintD, 1;
                    setq3 FrostiaQuest_JhonH, .@q3 + 1;
                }
                break;
            case 11:
                if (.@q2 >= 90) {
                    inventoryplace AncientBlueprint, 1;
                    getitem AncientBlueprint, 1;
                    setq3 FrostiaQuest_JhonH, .@q3 + 1;
                }
                break;
            case 12:
                if (.@q2 >= 100) {
                    .@i = any(LukPotionB, DexPotionB, IntPotionB, VitPotionB, AgiPotionB, SacredLifePotion, SacredManaPotion, DodgePotion, PrecisionPotion, MoveSpeedPotion, StatusResetPotion, DeathPotion, PurificationPotion, NymphPoison, ElixirOfLife);
                    inventoryplace .@i, 1;
                    getitem .@i, 1;
                    setq3 FrostiaQuest_JhonH, .@q3 + 1;
                }
                break;
            case 13:
                if (.@q2 >= 120) {
                    .@i = any(LukPotionC, DexPotionC, IntPotionC, VitPotionC, AgiPotionC, SacredLifePotion, SacredManaPotion, DodgePotion, PrecisionPotion, MoveSpeedPotion, StatusResetPotion, DeathPotion, PurificationPotion, NymphPoison, ElixirOfLife);
                    inventoryplace .@i, 1;
                    getitem .@i, 1;
                    setq3 FrostiaQuest_JhonH, .@q3 + 1;
                }
                break;
            case 14:
                if (.@q2 >= 140) {
                    .@i = any(LukPotionC, DexPotionC, IntPotionC, VitPotionC, AgiPotionC, SacredLifePotion, SacredManaPotion, DodgePotion, PrecisionPotion, MoveSpeedPotion, StatusResetPotion, DeathPotion, PurificationPotion, NymphPoison, ElixirOfLife, SacredImmortalityPotion, Manapple);
                    inventoryplace .@i, 1;
                    getitem .@i, 1;
                    setq3 FrostiaQuest_JhonH, .@q3 + 1;
                }
                break;
            case 15:
                if (.@q2 >= 150) {
                    .@i = any(LukPotionC, DexPotionC, IntPotionC, VitPotionC, AgiPotionC, SacredLifePotion, SacredManaPotion, DodgePotion, PrecisionPotion, MoveSpeedPotion, StatusResetPotion, DeathPotion, PurificationPotion, NymphPoison, ElixirOfLife, SacredImmortalityPotion, AncientBlueprint, FrostiaWarpCrystal);
                    inventoryplace .@i, 1;
                    getitem .@i, 1;
                    setq3 FrostiaQuest_JhonH, .@q3 + 1;
                }
                break;
            case 16:
                if (.@q2 >= 175) {
                    .@i = any(LukPotionC, DexPotionC, IntPotionC, VitPotionC, AgiPotionC, SacredLifePotion, SacredManaPotion, DodgePotion, PrecisionPotion, MoveSpeedPotion, StatusResetPotion, NymphPoison, ElixirOfLife, SacredImmortalityPotion, AncientBlueprint, FrostiaWarpCrystal, ScrollCriticalFortuneA);
                    inventoryplace .@i, 1;
                    getitem .@i, 1;
                    setq3 FrostiaQuest_JhonH, .@q3 + 1;
                }
                break;
            case 17:
                if (.@q2 >= 200) {
                    .@i = any(LukPotionC, DexPotionC, IntPotionC, VitPotionC, AgiPotionC, SacredLifePotion, SacredManaPotion, ElixirOfLife, SacredImmortalityPotion, AncientBlueprint, FrostiaWarpCrystal, ScrollCriticalFortuneA, ScrollMagnusHealA, ScrollSWolvern);
                    inventoryplace .@i, 1;
                    getitem .@i, 1;
                    setq3 FrostiaQuest_JhonH, .@q3 + 1;
                }
                break;
            case 18:
                if (.@q2 >= 250) {
                    .@i = any(LukPotionC, DexPotionC, IntPotionC, VitPotionC, AgiPotionC, SacredLifePotion, SacredManaPotion, ElixirOfLife, SacredImmortalityPotion, AncientBlueprint, FrostiaWarpCrystal, ScrollCriticalFortuneA, ScrollMagnusHealA, ScrollSWolvern);
                    inventoryplace .@i, 1;
                    getitem .@i, 1;
                    setq3 FrostiaQuest_JhonH, .@q3 + 1;
                }
                break;
            case 19:
                if (.@q2 >= 300) {
                    .@i = any(LukPotionC, DexPotionC, IntPotionC, VitPotionC, AgiPotionC, SacredLifePotion, SacredManaPotion, SacredImmortalityPotion, AncientBlueprint, FrostiaWarpCrystal, ScrollCriticalFortuneA, ScrollMagnusHealA, ScrollSWolvern, GoldenApple);
                    inventoryplace .@i, 1;
                    getitem .@i, 1;
                    setq3 FrostiaQuest_JhonH, .@q3 + 1;
                }
                break;
            case 20:
                if (.@q2 >= 400) {
                    .@i = any(SacredImmortalityPotion, AncientBlueprint, FrostiaWarpCrystal, ScrollCriticalFortuneA, ScrollMagnusHealA, ScrollSWolvern, PirateTreasureMap, TimeFlask);
                    inventoryplace .@i, 1;
                    getitem .@i, 1;
                    setq3 FrostiaQuest_JhonH, .@q3 + 1;
                }
                break;
            case 21:
                if (.@q2 >= 450) {
                    .@i = any(ScrollCriticalFortuneB, ScrollBattlePlansB, ScrollDefenseBlessB, ScrollMagnusHealB, ScrollSDragon, GoldenApple);
                    inventoryplace .@i, 1;
                    getitem .@i, 1;
                    setq3 FrostiaQuest_JhonH, .@q3 + 1;
                }
                break;
            case 22:
                if (.@q2 >= 500) {
                    .@i = any(ScrollCriticalFortuneB, ScrollBattlePlansB, ScrollDefenseBlessB, ScrollMagnusHealB, ScrollSDragon, DivineApple);
                    inventoryplace .@i, 1;
                    getitem .@i, 1;
                    setq3 FrostiaQuest_JhonH, .@q3 + 1;
                    mesc l("You have reached the current reward limit for Jhon."), 1;
                    mesc l("Futurely, Mylarin Dust and a Sunny Crystal will also be available."); // And a Mysterious Fruit + Platinum, just like Ryan
                }
                break;
            }
            // Item acquired?
            if (getq3(FrostiaQuest_JhonH) != .@q3) {
                mesn;
                mesq l("Here, you can have this, token of my appreciation.");
                next;
            }
            break;
        default:
            .@q = 12; break;
        }
    } while (.@q < 8);

    closeclientdialog;
    goodbye;
    close;

OnInit:
    .@npcId = getnpcid(.name$);
    setunitdata(.@npcId, UDT_HEADTOP, AFKCap);
    setunitdata(.@npcId, UDT_HEADMIDDLE, SilkRobe); // TODO
    setunitdata(.@npcId, UDT_WEAPON, DeepBlackBoots);
    setunitdata(.@npcId, UDT_HAIRSTYLE, 22);
    setunitdata(.@npcId, UDT_HAIRCOLOR, 5);
    npcsit;

    .sex = G_MALE;
    .distance = 4;
    end;
}