summaryrefslogtreecommitdiff
path: root/npc/003-2/lua.txt
blob: d29e34b1f563fb4f8d35a536f18014cd2b97f0df (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
// TMW2 Scripts.
// Author:
//  Jesusalva
// Description:
//  Lua is an Alliance Officer. She takes care of miscelanneous administrative tasks, including Strange Coin generation.
//  She can also change the world's hero, give Sponsor their necklace, and is part of main storyline.

003-2,38,34,0	script	Lua#003-2	NPC_FEMALE,{
    .@n = getq(General_Narrator);

    mesn;
    mesq l("Hello, I act on the Alliance's behalf.");

L_Menu:
    mes "";
    menu
        l("Ok, see you later."),L_Close,
        rif(.@n == 1, l("I was found near Candor Island, on a raft, and can't remember anything. Do you know who I am?")), L_Info,
        rif(.@n == 2, l("What you asked me for, again?")), L_Task,
        rif(.@n == 3, l("Where I needed to go, again?")), L_Complete,
        rif(.@n >= 4, l("Do you think I'm ready to go to Halinarzo?")), L_Check,
        rif(is_gm(), l("I need a GM set, please!")), L_GMItems,
        rif(is_gm() && #GMEVENT_T <= gettimetick(2), l("I plan in doing an event! Give me the coins!")), L_GMEvent,
        rif(is_gm() && #GMEVENT_T > gettimetick(2), l("Trade my coins in Gift Boxes, pretty please!")), L_GMEventShop,
        rif(is_staff(), l("Tell people the name of a new hero.")), L_NewHero,
        rif((getgmlevel() == 1 || is_admin()) && #T_SPONSOR <= gettimetick(2), l("I want a Sponsor Necklace.")), L_Sponsor,
        l("Do you have any tips for beginners?"), L_Tips,
        //l("I am a contributor, and I want contributor stuff."), L_Contributor,
        l("I would like to change my ML rewards account"), L_TestServer,
        l("What alliance?"),-;
    mes "";
    mesn;
    mesq l("The Alliance which was formed after the war!");
    close;

L_TestServer:
    mesn "TMW 2 Staff";
    mesc l("Before we start, to be eligible for rewards, please insert your CHARACTER NAME on Live Server."), 1;
    mesc l("Your current official server account: ")+strip(OFFICIAL_NICKNAME$);
    next;
    mesc l("Change it?");
    if (askyesno() == ASK_NO)
        close;
    mesc l("You can leave it blank if you wish no reward."), 1;
    mesc l("This can be changed later, don't worry."), 1;
    mesc l("(Click next button to advance dialogs)"), 3;
    next;
    input OFFICIAL_NICKNAME$;
    next;
    mesc l("Your current official server account: ")+strip(OFFICIAL_NICKNAME$);
    close;

L_GMItems:
    getitembound GMRobe, 1, 1;
    getitembound GMCap, 1, 1;
    logmes(strcharinfo(0)+" just took a GM set.");
    logmes(strcharinfo(0)+" just took a GM set.", LOGMES_ATCOMMAND);
    mes "";
    mesn;
    mesq lg("Here they are, miss.", "Here they are, mister.");
    mes "";
    goto L_Menu;

L_GMEvent:
OnGMCoinClaim:
    if (!is_gm() || #GMEVENT_T > gettimetick(2)) {
        dispbottom l("ERROR: You already took the coins today. Please wait @@ more.", FuzzyTime(#GMEVENT_T)), 1;
        end;
    }
    #GMEVENT_T=gettimetick(2)+(60*60*24);
    getitem StrangeCoin, 30;
    //logmes(strcharinfo(0)+" just took thirty event coins.");
    //logmes(strcharinfo(0)+" just took thirty event coins.", LOGMES_ATCOMMAND);
    mes "";
    mesn;
    mesq lg("Here they are, miss.", "Here they are, mister.");
    mes "";
    goto L_Menu;

OnGMEventShop:
L_GMEventShop:
    // Inflaction: Non-admins pay more out of main events (for whatever reasons)
    .@inf=1;
    if (!is_admin() && $EVENT$ == "")
        .@inf+=1;

    // Main Code
    .@s=countitem(StrangeCoin);
    mes "";
    mesn;
    mesq l("You currently have @@ @@.", countitem(StrangeCoin), getitemlink(StrangeCoin));
    mes "";
    mesc l("@@ - @@ coins", getitemlink(BronzeGift), 10*.@inf);
    mesc l("@@ - @@ coins", getitemlink(SilverGift), 20*.@inf);
    mesc l("@@ - @@ coins", getitemlink(GoldenGift), 40*.@inf);
    mesc l("@@ - @@ coins", getitemlink(PrismGift), 80*.@inf);
    mesc l("@@ - @@ coins", getitemlink(SupremeGift), 160*.@inf);
    mes "";
    mesc l("Fruits - @@ coins", 30*.@inf);
    mes "";
    menuint
        "Return to main menu", -1,
        rif(.@s > 10*.@inf, "Bronze Gift"),  10,
        rif(.@s > 20*.@inf, "Silver Gift"),  20,
        rif(.@s > 40*.@inf, "Golden Gift"),  40,
        rif(.@s > 80*.@inf, "Prism Gift"),   80,
        rif(.@s > 160*.@inf, "Supreme Gift"), 160,
        rif(.@s > 30*.@inf, "Statusup Fruits"), 30;

    if (@menuret == -1)
        goto L_Menu;

    delitem StrangeCoin, @menuret*.@inf;
    switch (@menuret) {
        case 10:
            getitem BronzeGift, 1; break;
        case 20:
            getitem SilverGift, 1; break;
        case 40:
            getitem GoldenGift, 1; break;
        case 80:
            getitem PrismGift, 1; break;
        case 160:
            getitem SupremeGift, 1; break;
        case 30:
            menuint
                "Strength Fruit",StrengthFruit,
                "Agility Fruit",AgilityFruit,
                "Vitality Fruit",VitalityFruit,
                "Intelligence Fruit",IntelligenceFruit,
                "Dexterity Fruit",DexterityFruit,
                "Luck Fruit",LuckFruit,
                "Mysterious Fruit",MysteriousFruit;
            mes "";
            getitem @menuret, 1; break;
        default:
            mesc(l("A script error happened, please report: @@", @menuret), 1); break;
    }
    goto L_GMEventShop;

L_NewHero:
    mes "";
    mes l("Current hero: @@", $MOST_HEROIC$);
    input .@MH$;
    logmes "Changing hero from "+$MOST_HEROIC$+" to "+.@MH$;
    logmes(strcharinfo(0)+" changed the world's hero ("+$MOST_HEROIC$+"->"+.@MH$+")", LOGMES_ATCOMMAND);
    $MOST_HEROIC$ = .@MH$;
    goto L_Menu;

L_Sponsor:
    #T_SPONSOR=gettimetick(2)+(60*60*24*30);
    rentitem "SponsorNecklace", (60*60*24*30);
    logmes(strcharinfo(0)+" just took a Sponsor Necklace.");
    logmes(strcharinfo(0)+" just took a Sponsor Necklace.", LOGMES_ATCOMMAND);
    mes "";
    mesn;
    mesq lg("Here it is, miss.", "Here it is, mister.");
    mes col("This item will be returned in 30 days counting from now, and you will need to take another.", 9);
    mes col("It cannot be dropped, traded, sold, but you can store it and use with same account.", 9);
    mes "";
    goto L_Menu;

OnLuaInfo:
    @lua_isok=1;
    end;

L_Info:
    if (!@lua_isok) {
        mes "";
        mesn;
        mesq l("Of course, give me just a minute to look up for your data, @@.", strcharinfo(0));
        next;
        mesn;
        mesq l("Please wait here on the meanwhile. Try asking Estard about parties, or talk to Eistein.");
        //mesq l("You can explore the city on the meanwhile, I need to inspect the data.");
        if (!@lua_init) {
            @lua_init=1;
            addtimer(rand(55000,65000),"Lua#003-2::OnLuaInfo");
        }
        close;
    }
    mes "...";
    next;
    mes "... ...";
    next;
    mes "... ... ...";
    next;
    mesn;
    mesq l("No criminal record, no bank account, not even a tax payment declaration.");
    next;
    mesq l("I found your birth record, but it is not complete. Here says you were born on @@.", b("Halinarzo"));
    next;
    mesq l("The problem is that Halinarzo was destroyed in the never-ending war and was just recently rebuilt.");
    next;
    mesq l("Almost all documents were lost, destroyed or damaged. I cannot even find your parents name.");
    next;
    mesq l("All I can say is that you were born there, and moved by the age of 4, but to where? I don't know.");
    next;
    mesn;
    mesq l("Sorry. At best, you can try your luck in Halinarzo, but the odds of someone recognizing you are pretty slim.");
    next;
    mesn;
    mesq l("However...");
    mesq l("You will be killed on the road if you try to go like this. The Canyon route is dangerous, and the Swamps route claimed many souls.");
    mesq l("Not to say about bandits and robbers you'll find.");
    next;
    getexp BaseLevel*30, JobLevel*5; // Reference Levels: (10, 3)
    setq General_Narrator, 2;
    mesn;
    mesq l("Lucky for you, the Alliance have means to assist you. You'll be a grown up, full fledged adventurer in no time at all, and will be able to visit a friend of mine, who will then send you there.");
    next;
    goto L_Task;

L_Task:
    mesc b(l(".:: Main Quest 2-1 ::.")), 3;
    msObjective(BaseLevel >= 20, l("* @@/@@ Base Level", BaseLevel, 20));

    msObjective(JobLevel >= 6, l("* @@/@@ Job Level", JobLevel, 6));

    msObjective(Zeny >= 1000, l("* @@/@@ GP", Zeny, 1000));

    msObjective(CRAFTQUEST || MPQUEST, l("* Register as a Crafter or Hunter"));

    msObjective(countitem(TulimsharGuardCard), l("* @@/@@ @@", countitem(TulimsharGuardCard), 1, getitemlink(TulimsharGuardCard)));

    msObjective(countitem(FishingRod), l("* @@/@@ @@", countitem(FishingRod), 1, getitemlink(FishingRod)));

    msObjective(countitem(LifestonePendant), l("* @@/@@ @@", countitem(LifestonePendant), 1, getitemlink(LifestonePendant)));

    next;
    if (BaseLevel >= 20 &&
        JobLevel >= 6 &&
        Zeny >= 1000 &&
        (CRAFTQUEST || MPQUEST) &&
        countitem(TulimsharGuardCard) &&
        countitem(FishingRod) &&
        countitem(LifestonePendant))
        goto L_Finish;

    mesn;
    if (!countitem(TulimsharGuardCard)) {
        mes l("The Guard Card will prove your intentions. Talk to the Lieutenant in front of the Guard House.");
        mesc l("Completing this quest will allow access to the Guard House, where you can pick Daily Bounties for monsters.");
        mes "";
    }
    if (!countitem(FishingRod)) {
        mes l("The fishing rod allows a quick income by selling fishes. However, reaching the fisherman might require some exploration... The whole world is full of secrets.");
        mes "";
    }
    if (!countitem(LifestonePendant)) {
        mes l("The lifestone pendant allows you a quicker HP recovery. Life is more important than defense.");
        mes l("I have no idea about who would make a pendant, but lifestone can be done just outside the town walls.");
        mes "";
    }
    if (!getq(TulimsharQuest_Sailors) < 2) {
        mes l("There are some sailors near the forge. Think outside the box - or rather, inside it, unless you have a fortune to buy the items.");
        mes "";
    }
    if (!(CRAFTQUEST || MPQUEST)) {
        mes lg("To register as a craftswoman, you need to talk to Intense Beard in Terranite Forge. The forge is in the Bazar.", "To register as a craftsman, you need to talk to Intense Beard in Terranite Forge. The forge is in the Bazar.");
        mes l("To register as a hunter, talk to Aidan, also in the marketplace - the Bazar.");
        mesc l("You can, and @@, register on both programs, but only one is required for this quest.", b("SHOULD"));
        mes "";
    }
    if (BaseLevel < 20) {
        mes l("If you are in need to get lots of experience quickly, you should try to engage the bigger and stronger monsters in the town. However, if they hit you, it's Soul Menhir for you.");
        mes "";
    }
    close;

L_Finish:
    inventoryplace MercBoxAA, 1, TreasureKey, 1;
    getexp BaseLevel*60, JobLevel*10; // Reference Levels: (20, 6)
    setq General_Narrator, 3, 0;
    getitem MercBoxAA, 1;
    getitem TreasureKey, 1;
    mesn;
    mesq l("Great job! You can keep these items, they will be crucial to your journey.");
    next;
    mesn;
    mesq l("I'll also give you a @@. Open it to get a random Mercenary Card.", getitemlink(MercBoxAA));
    next;
    mesn;
    mesq l("You can only have one mercenary active at a time, they die and will leave after 10 minutes - logged in or not.");
    next;
    mesn;
    mesq l("Still, they can be useful when you're trying to solo a boss and need help. The number of stars on the card is the strength and rarity. Use them wisely.");
    next;
    mesn;
    mesq l("Ah, you might have seen a treasure chest on the mines. There are several of these chests to loot, and loot again! Here is a @@. Try it!", getitemlink(TreasureKey));
    next;
L_Complete:
    mesn;
    mesq l("You see the docks on the other side of the town? There should be a ship docked there.");
    next;
    if (!$HURNS_LIBDATE) {
        mesn;
        mesq l("The ship can bring you to the town of Hurnscald, but we have a problem: It is currently being occupied by a Monster Army.");
        next;
        mesn;
        mesq l("That would be your next destination, but first, the monster army must be driven out!");
        next;
        mesn;
        mesq l("The Game Masters are assembling a party to storm Hurnscald and liberate it. You should try joining it!");
        next;
        mesc l(">> Hurnscald must be Liberated first, to continue this story <<"), 1;
        close;
    }
    mesn;
    mesq l("You already got the money. Go there and pay ##B Hurnscald ##b a visit. The ##B mayor ##b should be able to help you.");
    next;
    mesn;
    mesq l("Ship travels are quite expensive, so perhaps you may think it is worth to complete the other quests here?");
    next;
    .@r=reputation("Tulim");
    mesn;
    if (.@r <= 35)
        mesq l("Try helping the city guard. Talk to NPCs around the city. Outside the city walls too. And there are some people on the mines.");
    else if (.@r <= 60)
        mesq l("You are doing some progress. There are about 4 quests on the mines, 1 outside walls, and 10 on the town. Some require level, so talk to people again sometimes.");
    else if (.@r <= 85)
        mesq l("You'll soon run out of stuff to do around here, so yeah, you should extend your horizons or you may get bored soon enough.");
    else
        mesq l("Tulimshar doesn't have a lot more of quests to offer you, so you should definitely explore new places.");
    if (BaseLevel < 30)
        mesq l("I'm sure there are a lot of sidequests here until you reach level 30, but that's optional.");
    close;

L_Tips:
    mesn;
    mes l("Hmm... First of, I would really add some agility. Agility helps you to don't be hit, and not being hit is awesome.");
    mes l("Hm, I would also do some quests if I needed money... On other hand, maybe I could go fishing? Do I know any fisher?");
    mes l("Ah, getting experience is hard, too... I would stay within the city. Hit and Run tactics works the best.");
    next;
    mesn;
    mes l("Hit'n'run is not so hard... One hit, one step back... One hit, another step back... One miss, two steps back...");
    mes l("That works with most of monsters. Well, but we all know from @@ that it is better to stay put and let mobs kill us, right?", "Apane");
    mes l("Heh, there is death penalty outside the town. You better watch out. The mobs are on a foul mood today, very easy to get killed.");
    close;

L_Check:
    mesn;
    mesq l("Hmm... That's a though question!");
    next;
    mesn;
    if (BaseLevel < 20)
        mesq l("Currently, you stand no chance against the Snakes on the Desert Canyon.");
    else if (BaseLevel < 25)
        mesq l("Currently, you should not attempt the Desert Canyon because low level.");
    else if (BaseLevel < 30)
        mesq l("Currently, you stand no chance against the Snakes on the Desert Canyon, but you probably can cross it.");
    else if (BaseLevel < 40)
        mesq l("I'm pretty confident you can attempt the Desert Canyon, but expect to die a few times.");
    else if (BaseLevel < 50)
        mesq l("You have a high level. Go to Halinarzo already! You could even, I don't know, search for magic?!");
    else
        mesq l("Your level is so high, I'm surprised you haven't went there already. But then, most quests around there are for your level...");
    next;
    mesn;
    mesq l("Bows are good, but if you're going to the Desert Canyon, I would instead invest on a light shield. Heavy ones make you walk slower.");
    next;
    .@r=reputation("Tulim");
    mesn;
    if (.@r <= 35)
        mesq l("Try helping the city guard. Talk to NPCs around the city. Outside the city walls too. And there are some people on the mines.");
    else if (.@r <= 60)
        mesq l("You are doing some progress. There are about 4 quests on the mines, 1 outside walls, and 10 on the town. Some require level, so talk to people again sometimes.");
    else if (.@r <= 85)
        mesq l("You'll soon run out of stuff to do around here, so yeah, you should extend your horizons or you may get bored soon enough.");
    else
        mesq l("Tulimshar doesn't have a lot more of quests to offer you, so you should definitely explore new places.");
    close;

L_Contributor:
    mes "";
    .@m = htget($@CONTRIBUTORS, strtolower(strcharinfo(0)), 0);
    if (!.@m) {
        mesn;
        mesq l("Ah... Sorry, your name is not on the contributor list.");
        next;
        mesn;
        mesq l("You can colaborate with our project though! Just ask on #tmw2-dev, be it on Discord or IRC!");
        close;
    }
    mesn;
    mesq l("Ah, welcome @@. You have @@ Contributor Points.", strcharinfo(0), .@m);
    mesq l("Let's see if you can pick a reward!");
    select
        rif(!(#CRW & 128) && .@m >= 10000, l("30x Bug Leg")),
        rif(!(#CRW & 32) && .@m >= 5000 && Zeny > 10000, l("(10,000 GP) Legendary Mount")),
        rif(!(#CRW & 16) && .@m >= 2000, l("Delicious Cookie")),
        rif(!(#CRW & 64) && .@m >= 1000, l("20x Bug Leg")),
        rif(!(#CRW & 8) && .@m >= 500, l("Developer Cap")),
        rif(!(#CRW & 4) && .@m >= 250, l("Contributor Sweater")),
        rif(!(#CRW & 2) && .@m >= 100, l("Community Shirt")),
        rif(!(#CRW & 1) && .@m, l("5x Strange Coins")),
        l("Which rewards are available?"),
        l("Ok, thanks.");

    mes "";
    switch (@menu) {
        case 1:
            getitem BugLeg, 30; #CRW=#CRW|128 ; break;
        case 2:
            Zeny=Zeny-10000; getitembound LegendaryMouboo, 1, 1; #CRW=#CRW|32 ; break;
        case 3:
            getitem DeliciousCookie, 1; #CRW=#CRW|16 ; break;
        case 4:
            getitem BugLeg, 20; #CRW=#CRW|64 ; break;
        case 5:
            getitem DEVCap, 1; #CRW=#CRW|8 ; break;
        case 6:
            getitem ContributorSweater, 1; #CRW=#CRW|4 ; break;
        case 7:
            getitem CommunityShirt, 1; #CRW=#CRW|2 ; break;
        case 8:
            getitem StrangeCoin, 5; #CRW=#CRW|1 ; break;
        case 9:
            mes l("10000 - 30x @@", getitemlink(BugLeg));
            mes l("5000 (+10,000 GP) - @@", getitemlink(LegendaryTortuga));
            mes l("2000 - @@", getitemlink(DeliciousCookie));
            mes l("1000 - 20x @@", getitemlink(BugLeg));
            mes l("500 - @@", getitemlink(DEVCap));
            mes l("250 - @@", getitemlink(ContributorSweater));
            mes l("100 - @@", getitemlink(CommunityShirt));
            next;
            goto L_Contributor;
            break;
    }
    close;

L_Close:
    close;

OnInit:
    .@npcId = getnpcid(.name$);
    setunitdata(.@npcId, UDT_HEADTOP, NPCEyes);
    setunitdata(.@npcId, UDT_HEADMIDDLE, GMRobe);
    setunitdata(.@npcId, UDT_HEADBOTTOM, LousyMoccasins);
    setunitdata(.@npcId, UDT_WEAPON, BugSlayer);
    setunitdata(.@npcId, UDT_HAIRSTYLE, 12);
    setunitdata(.@npcId, UDT_HAIRCOLOR, 5);
    bindatcmd "strangecoin", "Lua#003-2::OnGMCoinClaim", 60, 100, 1;
    bindatcmd "strangeshop", "Lua#003-2::OnGMEventShop", 60, 100, 1;

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