summaryrefslogtreecommitdiff
path: root/world/map/npc/009-2/airlia.txt
blob: 74dbd247e4e8c14c1ef6041ba5ce77bf7f5258b3 (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
// Airlia, daughter of the cemetary caretaker

// Future extensions:
//   * Add banter and random replies for the unlimited subquests
//   * Airlia quest = 2 unlocks options with Fighters of the Undead NPCs (in Cemetery), such as the 'Kill Sir Truk' quest
//   * Airlia quest = 2 unlocks other options, perhaps with future Warrior Guild prospects (this is long term)


009-2,123,71,0|script|Airlia|108
{
    // Subquest 1a: Caretaker's daughter (initial, once)
    set @LETTER_REWARD_GOLD_INITIAL, 1000;
    set @LETTER_REWARD_EXP_INITIAL, 2000;

    set @Q_STATUS_RECIEVED_FIRST_LETTER, 2;
    set @Q_STATUS_DELIVERED_FIRST_LETTER, 3;

    // Subquest 1b: Continued delivery of letters (unlimited)
    set @LETTER_REWARD_GOLD, 42;
    set @LETTER_REWARD_EXP, 500;

    set @Q_STATUS_HAS_NO_NEW_LETTER, 4;
    set @Q_STATUS_HAS_NEW_LETTER, 5;

    // Subquest 2a: Fetch those undead drops (initial, once)
    // TODO: Set sane values below
    set @FETCH_AMOUNT_INITIAL, 50;
    set @FETCH_LABEL_INITIAL$, "Bone";
    set @FETCH_REWARD_GOLD_INITIAL, 5000;
    set @FETCH_REWARD_EXP_INITIAL, 50000;

    set @Q_STATUS_HELP_AIRLIA, 1;
    set @Q_STATUS_INITIAL_FETCH_REWARDED, 2;

    // Subquest 2b: Fetch those undead drops (unlimited)
    // TODO: Set sane values below
    set @FETCH_AMOUNT, 10;
    set @FETCH_LABEL$, "DiseasedHeart";
    set @FETCH_REWARD_GOLD, 6000;
    set @FETCH_REWARD_EXP, 40000;


    if (QUEST_Airlia == @Q_STATUS_INITIAL_FETCH_REWARDED) goto L_Rewarded;
    if (QUEST_Airlia == @Q_STATUS_HELP_AIRLIA) goto L_Fetch;
    if (QUEST_Graveyard_Caretaker > @Q_STATUS_RECIEVED_FIRST_LETTER) goto L_intro;
    goto L_Caretaker;

L_Caretaker:
    mesn;
    mesq l("Greetings. Do you need a housing permit, or to license your shop?");
    next;
    if (QUEST_Graveyard_Caretaker < @Q_STATUS_RECIEVED_FIRST_LETTER)
        menu
            "Sorry, no.", L_Next,
            "Shop?", L_mount;
    if (QUEST_Graveyard_Caretaker == @Q_STATUS_RECIEVED_FIRST_LETTER)
        menu
            "Sorry, no.", L_Next,
            "I have a letter from your father.", L_first_reward,
            "Shop?", L_mount;
    goto L_Next;

L_Next:
    mesn;
    mes "\"Nobody ever does...\"";
    close;

L_mount:
    mesn;
    mesq l("Yes, some adventurers set up their own shops. However, unless they have citizenship, they're not allowed in Hurnscald without paying a symbolic monthly fee of 100,000,000 GP.");
    next;
    mesn;
    mesq l("This is a measure to protect Hurnscald domestic trade, I hope you understand. However, you can still set a shop in Tulimshar Bazaar, where [@@https://wiki.themanaworld.org/index.php/Classic:ManaMarket|ManaMarket@@] is.");
    next;
    mesn;
    mesq l("Anyone can set up their own shop in the Bazaar, but they'll be rate-limited, so there's a limit of trades it can do. You can also ask for official approval to be immune to this, I advise reading [@@https://forums.themanaworld.org/viewtopic.php?t=20882|these suggestions@@] which make more likely to acquire approval.");
    next;
    mesn;
    mesq l("But you pretty much must ask an admin and follow the game rules, and the team will decide. Ah, I fear if they don't lift this restriction I'll be without a job, but at least I'm not the Constable in charge of policing the town.");
    close;

L_first_reward:
    mesn;
    mesq l("Oh! Thank you very, very much! Please take this for your trouble.");
    if (@LETTER_REWARD_GOLD_INITIAL > 0)
        mes "[" + @LETTER_REWARD_GOLD_INITIAL + " GP]";
    if (@LETTER_REWARD_EXP_INITIAL > 0)
        mes "[" + @LETTER_REWARD_EXP_INITIAL + " experience points]";
    set Zeny, Zeny + @LETTER_REWARD_GOLD_INITIAL;
    getexp @LETTER_REWARD_EXP_INITIAL, 0;
    set QUEST_Graveyard_Caretaker, @Q_STATUS_DELIVERED_FIRST_LETTER;
    close;

L_later_rewards:
    mesn;
    mesq l("Oh! Thank you very, very much! Please take this for your trouble.");
    if (@LETTER_REWARD_GOLD > 0)
        mes "[" + @LETTER_REWARD_GOLD + " GP]";
    if (@LETTER_REWARD_EXP > 0)
        mes "[" + @LETTER_REWARD_EXP + " experience points]";
    set Zeny, Zeny + @LETTER_REWARD_GOLD;
    getexp @LETTER_REWARD_EXP, 0;
    set QUEST_Graveyard_Caretaker, @Q_STATUS_HAS_NO_NEW_LETTER;
    close;

L_intro:
    mesn;
    mesq l("My poor father, doomed to that awful cemetery.");
    next;

    // CASE REMOVED:
    // This step is pointless and just forces the player to make a selection that doesn't effect anything.
    // ALSO it misses the case where QUEST_Graveyard_Caretaker == 3, in this case it proceeds to the message without wasting player clicks
    // Removing this check will make execution the same for QUEST_Graveyard_Caretaker == 3 and QUEST_Graveyard_Caretaker == 4
    // If for some reason this is desireable, uncomment it and make sure to catch the extra case mentioned
    //
    //if (QUEST_Graveyard_Caretaker == @Q_STATUS_HAS_NO_NEW_LETTER)
    //    menu
    //        "...", -;

    if (QUEST_Graveyard_Caretaker == @Q_STATUS_HAS_NEW_LETTER)
        menu
            "...", L_Next3,
            "Oh, I have a letter from him.", L_later_rewards;
    goto L_Next3;

L_Next3:
    mesn;
    mes "\"You know, there are many who believe that each time the undead rise after being killed, they lose mana.";
    mes "Eventually, there will not be enough mana for them to rise again and they can be at rest. Do you believe this is true?\"";
    next;
    menu
        "I believe so, yes.", L_intro_mana_loss,
        "Maybe...", L_intro_mana_loss,
        "No, that is not proven.", L_Next1;

L_Next1:
    mesn;
    mes "\"Oh...\"";
    close;

L_intro_mana_loss:
    mesn;
    mes "\"When I am not working, I recruit help for the esteemed Fighters of the Undead, or FoU.";
    mes "They are an official group effort of the Warriors' Guild and Magicians, you know, a very prestigious group.\"";
    next;
    menu
        "...", L_intro_fou,
        "I have heard of them.", L_intro_fou,
        "Keep up the good work. I have to go now, bye.", L_Close;

L_intro_fou:
    mesn;
    mes "\"If we drain those evil creatures of their mana, I can get my father back. He is getting very old. Will you help us?\"";
    next;
    menu
        "Of course I will.", L_intro_fight,
        "Sure, I guess.", L_intro_fight,
        "Thanks, but no thanks. I have other business to attend to.", L_Close;

L_intro_fight:
    mesn;
    mes "\"Great, just kill any of the undead creatures you can and bring me proof of your work, and I will put in a word for you with the guild.\"";
    next;
    menu
        "I'm on it.", L_Next2,
        "What sort of proof?", L_intro_proof;

L_Next2:
    set QUEST_Airlia, @Q_STATUS_HELP_AIRLIA;
    goto L_Close;

L_intro_proof:
    mesn;
    mes "\"Let's say " + @FETCH_AMOUNT_INITIAL + " " + getitemlink(@FETCH_LABEL_INITIAL$) + "s. You don't know how much this means to me, thank you.\"";
    set QUEST_Airlia, @Q_STATUS_HELP_AIRLIA;
    close;

L_Fetch:
    mesn;
    mes "\"Thank you for helping my father.\"";
    next;
    mes "\"Have you collected the " + @FETCH_AMOUNT_INITIAL + " " + getitemlink(@FETCH_LABEL_INITIAL$) + "?\"";

    // Make sure to check if the player has a letter to deliver.
    // If the check is not made then there is a bug, where the player
    // has a letter but has not completed the initial fetch
    // and is prevented from turing in the letter until the fetch is completed.

    if (QUEST_Graveyard_Caretaker < @Q_STATUS_HAS_NEW_LETTER)
        menu
            "Yes.", L_Fetch_initial_reward,
            "No.", L_Close;
    if (QUEST_Graveyard_Caretaker == @Q_STATUS_HAS_NEW_LETTER)
        menu
            "I have another letter from your father.", L_later_rewards,
            "Yes.", L_Fetch_initial_reward,
            "No.", L_Close;
    goto L_Close;

L_Fetch_initial_reward:
    if (countitem(@FETCH_LABEL_INITIAL$) < @FETCH_AMOUNT_INITIAL) goto L_Fetch_not_enough;
    mesn;
    mes "\"Excellent work. You are definitely a great warrior. I will tell the guild of your deeds.\"";
    if (@FETCH_REWARD_GOLD_INITIAL > 0)
        mes "[" + @FETCH_REWARD_GOLD_INITIAL + " GP]";
    if (@FETCH_REWARD_EXP_INITIAL > 0)
        mes "[" + @FETCH_REWARD_EXP_INITIAL + " experience points]";
    delitem @FETCH_LABEL_INITIAL$, @FETCH_AMOUNT_INITIAL;
    set Zeny, Zeny + @FETCH_REWARD_GOLD_INITIAL;
    getexp @FETCH_REWARD_EXP_INITIAL, 0;
    set QUEST_Airlia, @Q_STATUS_INITIAL_FETCH_REWARDED;
    next;
    mesn;
    // TODO: Write the dialogue when I'm not tired...
    mes "\"Oh, before you leave. We all must do what we can to stop this tragedy.";
    mes "If you are willing to keep draining the undead of mana, I will give you what gold I can afford as a token of my gratitude.\"";
    close;

L_Fetch_later_rewards:
    if (countitem(@FETCH_LABEL$) < @FETCH_AMOUNT)
        goto L_Fetch_not_enough;
    mesn;
    mes "\"Excellent work. You are definitely a great warrior.\"";
    if (@FETCH_REWARD_GOLD > 0)
        mes "[" + @FETCH_REWARD_GOLD + " GP]";
    if (@FETCH_REWARD_EXP > 0)
        mes "[" + @FETCH_REWARD_EXP + " experience points]";
    delitem @FETCH_LABEL$, @FETCH_AMOUNT;
    set Zeny, Zeny + @FETCH_REWARD_GOLD;
    getexp @FETCH_REWARD_EXP, 0;
    close;

L_Fetch_not_enough:
    mesn;
    mes "\"I'm sorry, I didn't realize you couldn't count. Perhaps when I have some free time, I can help you learn if you'd like.\"";
    close;

L_Rewarded:
    mesn;
    mes "\"Thank you for your help.\"";
    next;
    mes "\"Have you collected the " + @FETCH_AMOUNT + " " + getitemlink(@FETCH_LABEL$) + "s?\"";
    if (QUEST_Graveyard_Caretaker < @Q_STATUS_HAS_NEW_LETTER)
        menu
            "Yes.", L_Fetch_later_rewards,
            "No.", L_Close;
    if (QUEST_Graveyard_Caretaker == @Q_STATUS_HAS_NEW_LETTER)
        menu
            "I have another letter from your father.", L_later_rewards,
            "Yes.", L_Fetch_later_rewards,
            "No.", L_Close;
    goto L_Close;

L_Close:
    close;
}