summaryrefslogtreecommitdiff
path: root/npc/001-1/fexil.txt
blob: d66b9c31c5f5affacef39466d00b661b7a985767 (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
// Evol scripts.
// Author:
//    Reid
// Description:
//    Newbie merchant.
// Variables:
//    ArtisQuests_Fexil
// Quest states:
//    0  -- not started
//    1  -- Lloyd warned about the quest
//    2  -- Fexil explain what he needs
//    3  -- Fexil buy every fur that the pc bring to him

001-1,47,134,0	script	Fexil#001-1	NPC_ELVEN_MAN_TRADER,{

    function fexil_quest {
        speech S_LAST_NEXT,
            l("You know, the life of the merchant is hard. I really hope that Artis and the Merchant Guild will help me to succeed."),
            l("Maybe you too you could help me?"),
            l("I want to be the first merchant of this square to sell clothes made from @@s!", getitemlink(FluffyFur)),
            l("I will buy all of the fur that you will bring me at a good price, let's say, 15 E piece."),
            l("Do we have a deal?");

        switch (select(l("Ok."), l("I don't want to be part of this joke.")))
        {
            case 1:
                setq ArtisQuests_Fexil, 3;
                speech S_FIRST_BLANK_LINE | S_LAST_NEXT,
                    l("Awesome! I will wait for you here.");
                break;
            case 2:
                speech S_FIRST_BLANK_LINE | S_LAST_NEXT,
                    l("Oh... Ok, I will be around here if you change your mind.");
                break;
        }
        return;
    }

    mesn;
    mesq lg("Greetings traveler.");
    next;
    mesq l("I have some clothes and other things for you at a fine price!");
    next;
    mesq l("What I sell comes from every corner of Gasaron.");
    next;
    mesq lg("Interested?");
    next;

    if (getq(ArtisQuests_Fexil) == 1)
    {
        select(l("I have your pass from the Merchant Guild."));
        speech S_FIRST_BLANK_LINE | S_LAST_NEXT,
            l("Oh! You saved me, I was too afraid to unpack my stuff without this pass."),
            l("Hey, I remember you, we were on the same boat, you are the castaway.");

        switch (select(l("Yes I am."),
                        l("You're confusing me with someone else.")))
        {
            case 1:
                speech S_FIRST_BLANK_LINE | S_LAST_NEXT,
                    l("Oh sure I remember you."),
                    l("The travel was fine for you? It was terrible for me, I was sea-sick.");
                break;
            case 2:
                speech S_FIRST_BLANK_LINE | S_LAST_NEXT,
                    l("Ah, I didn't have much sleep, it's possible.");
                break;
        }
        setq ArtisQuests_Fexil, 2;
        fexil_quest;

        closeclientdialog;
        goodbye;
        close;
    }

    .@fexil = getq(ArtisQuests_Fexil);

    select
        l("OK, let's trade."),
        rif(.@fexil == 2, l("Do you still need help?")),
        rif(.@fexil > 2 && countitem(FluffyFur) > 0, l("I have some fur for you.")),
        l("No. Sorry.");

    switch (@menu)
    {
        case 1:
            closeclientdialog;
            shop "Bag#001-1";
            close;

        case 2:
            mes "";
            fexil_quest;
            break;

        case 3:
            speech S_FIRST_BLANK_LINE | S_LAST_NEXT,
                l("Awesome. How many of those do you want to give me?");

            do
            {
                input .@amount;
                if (.@amount < 1)
                {
                    speech S_FIRST_BLANK_LINE | S_LAST_NEXT,
                        l("Please enter a valid amount.");
                    continue;
                }
                if (.@amount > countitem(FluffyFur))
                {
                    speech S_FIRST_BLANK_LINE | S_LAST_NEXT,
                        l("You don't have enough @@s on you.", getitemlink(FluffyFur));
                    continue;
                }

                break;
            } while (1);

            .@price = 15 * .@amount;
            speech S_FIRST_BLANK_LINE | S_LAST_NEXT,
                l("Deal, I offer you @@ E!", .@price);

            delitem FluffyFur, .@amount;
            Zeny += .@price;

            break;

        case 4:
            speech S_FIRST_BLANK_LINE | S_LAST_NEXT,
                l("Oh... Well, I just started to trade... Thus my technique may not be the best."),
                lg("Anyway, if you ever feel interested, just check my bag!");
            break;
    }

    closeclientdialog;
    goodbye;
    close;

OnInit:
    .bodytype = BODYTYPE_3;
    .distance = 2;
    end;
}