summaryrefslogtreecommitdiff
path: root/npc/001-2-19/lloyd.txt
blob: 7106909a53a56aa9ad385cabc10dcfb1159f4adf (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
// Evol scripts.
// Author:
//    Reid
// Description:
//    Lloyd the banker NPC.
// Variables:
//    0  ArtisQuests_Lloyd
//    1  ArtisQuests_Fexil
//    2  ArtisQuests_Enora
// Quest states:
//    00  -- Never talked
//    01  -- Registred on the Guild
//    10  -- not started
//    11  -- Lloyd warned about the quest
//    20  -- Default.
//    21  -- BlackSmith quest delivered.
//    22  -- Chelios Quest given.
//    23  -- Chelios Quest done.

001-2-19,31,25,0	script	Lloyd the banker	NPC_LLOYD,{

    function enora_quest {
        speech 5,
            l("Black iron... That is a very specific request that you have for me!"),
            l("Let me check in my inventory book..."),
            l("..."),
            l("Yes, I have some! \"5x Black Iron Ingots\""),
            l("Is this for you or somebody else? Because you need to be registered to obtain these materials.");

        switch (select (l("This is for my own use."),
                        l("Chelios asked me to get it.")))
        {
            case 1:
                speech 1,
                    l("This is your first time asking for something, you won't pay this time, take it as a sign of good faith!"),
                    l("If you need something in the future, do not hesitate to pass by here, our stock is full of box collecting dust.");
                emotion 6;
                break;
            case 2:
                speech 1,
                    l("Chelios... He is part of the blacksmith house, is he not?"),
                    l("Since Don settled in Artis he and his band refused to register to the Merchant Guild."),
                    l("I will close my eyes for once, but only because it's your first time asking for something!"),
                    l("Sometimes a good merchant needs to reach out first. It's on the house, give Chelios my regards!");
                emotion 7;
                break;
        }
        setq ArtisQuests_Enora, 3;

        return;
    }

    function explain_guild {
        speech
            l("The guild is in charge of the commerce regularization throughout Artis and its surrounding."),
            l("With the help of the town hall and the Legion of Aemil we organize some auction and we help local merchants to launch their buisness."),
            l("We also feature some services like a storage and a bank for members."),
            l("Registration is open for everybody, but newcomers need to pay a fee for all of the paperwork.");

        return;
    }

    function first_visit {
        speech 4,
            l("Welcome!"),
            l("My name is Lloyd, I am a representative of the Merchant Guild of Artis.");

        select (l("My name is @@...", strcharinfo(0)));

        speech 5,
            l("\"@@\", I like this name!", strcharinfo(0)),
            l("Oh, wait a second...");
        narrator 4,
            l("Lloyd is searching something in his book.");
        speech 4,
            l("I see."),
            l("You are new around here, right?");

        if (select (l("How do you know?"), l("Yes I am.")) == 1)
        {
            speech 5,
                l("Oh, it is simple. I have on this book the name of every citizen of Artis and its surrounding."),
                l("And I have no sign of a so called \"@@\" on it!", strcharinfo(0));
        }
        else
        {
            speech 5,
                l("I knew it!");
        }

        speech 4,
            l("Let me explain to you what the Merchant Guild is for.");

        explain_guild;
        next;

        .@price = 500;
        speech 4,
            l("The fee is of @@E. So, do you want to register?", .@price);

        switch (select (l("Yes."),
                        l("I don't have the time now.")))
        {
            case 1:
                if (Zeny < .@price)
                {
                    speech 4,
                        l("You do not seem to have enough money, come back later!");
                }
                else
                {
                    Zeny = Zeny - .@price;
                    setq ArtisQuests_Lloyd, 1;
                    speech 4,
                        l("Perfect!"),
                        l("I wrote your name on the book, you are now free to use the storage and bank services.");
                }
                break;
            case 2:
                break;
        }

        return;
    }

    function paper_to_deliver {
        speech 5,
            l("Now that you bring up that topic, that reminds me of something..."),
            l("Earlier today there was this young seller named Fexil that passed by here."),
            l("He asked to lend some money and a place to open his store, I think that he asked for a place on the merchant squares on the south-west of the city..."),
            l("Anyway, he forgot his permit when he left the building."),
            l("Could you bring it to him?");

        do
        {
            .@q = select (l("Ok, I will bring it to him."),
                          l("I need more information first."),
                          l("I don't have the time."));
            switch (.@q)
            {
                case 1:
                    speech 5,
                        l("Thank you for this!");
                    setq ArtisQuests_Fexil, 1;
                    break;
                case 2:
                    speech 5,
                        l("You should look for a seller named Fexil around the merchant square."),
                        l("Ask other merchants, they might know where he is.");
                    break;
                case 3:
                    speech 5,
                        l("No problem, come back later if you changed your mind!");
                    break;
            }
        } while (.@q == 2);
    }

    function bank_account {
        speech 5,
            l("Fine, what do you want to do with your money?");

        do
        {
            .@q = select (l("Deposit."),
                         l("Withdraw."),
                         l("Check my balance."),
                         l("I'm done."));
            switch (.@q)
            {
                case 1:
                    speech 1,
                        l("Enter the amount that you want to deposit.");
                    mes "";

                    input .@amount;
                    if (.@amount < 1)
                    {
                        speech 5,
                            l("Please enter a valid amount.");
                        continue;
                    }
                    if (.@amount > Zeny)
                    {
                        speech 5,
                            l("You do not have enough Esperin on yourself.");
                        continue;
                    }
                    set Zeny, Zeny - .@amount;
                    set #MerchantBank, #MerchantBank + .@amount;

                    speech 5,
                        l("You made a cash deposit of @@E.", .@amount);

                    break;
                case 2:
                    speech 1,
                        l("Enter the amount that you want to withdraw.");
                    mes "";

                    input .@amount;
                    if (.@amount < 1)
                    {
                        speech 5,
                            l("Please enter a valid amount.");
                        continue;
                    }
                    if (.@amount > #MerchantBank)
                    {
                        speech 5,
                            l("You do not have enough Esperin on your bank account.");
                        continue;
                    }
                    set #MerchantBank, #MerchantBank - .@amount;
                    set Zeny, Zeny + .@amount;

                    speech 5,
                        l("You withdrawn a total of @@E.", .@amount);

                    break;
                case 3:
                    speech 5,
                        l("You currently have @@ on your bank account.", #MerchantBank);
                    break;
                case 4:
                    mes "";
                    break;
            }
        } while (.@q != 4);
    }

    if (getq (ArtisQuests_Lloyd) == 0)
    {
        first_visit;

        closedialog;
        goodbye;
        close;
    }

    speech 4,
        l("Welcome to the Merchant Guild of Artis!"),
        l("What do you want today?");

    do
    {
        .@enora = getq (ArtisQuests_Enora);

        menuint rif (.@enora == 2, l("I'm searching some black iron ingots.")), 0,
                l("I would like to store some items."), 1,
                l("I would like to deposit some money."), 2,
                l("What is this guild for?"), 3,
                l("Does the guild has any work for me right now?"), 4,
                l("Bye."), 5;

        switch (@menuret)
        {
            case 0:
                enora_quest;
                break;
            case 1:
                openstorage;
                closedialog;
                close;
                break;
            case 2:
                bank_account;
                break;
            case 3:
                mes "";
                explain_guild;
                break;
            case 4:
                if (getq(ArtisQuests_Fexil) >= 1)
                {
                    speech 5,
                        l("There are no open task for you right now.");
                    continue;
                }

                paper_to_deliver;

                continue;
            case 5:
                break;
        }
        if (@menuret != 5)
        {
            speech 5,
                l("Something else?");
        }
    } while (@menuret != 5);

    closedialog;
    goodbye;
    close;

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