summaryrefslogtreecommitdiff
path: root/npc/001-1/fexil.txt
blob: a1a0e189cdfb861713b3baab6bb8f88a42fbf900 (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 4,
            l("You know, the life of 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 @@'s clothes!", getitemlink(729)),
            l("I will buy all of the fur that you will bring me at a good price, let's say, 25E 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 5,
                    l("Awesome! I will wait for you here.");
                break;
            case 2:
                speech 5,
                    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 this archipelago.");
    next;
    mesq lg("Interested?");
    next;

    if (getq (ArtisQuests_Fexil) == 1)
    {
        select (l("I have your pass from the Merchant Guild."));
        speech 5,
            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 5,
                    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 5,
                    l("Ah, I didn't have much sleep; it's possible.");
                break;
        }
        setq ArtisQuests_Fexil, 2;
        fexil_quest;

        closedialog;
        goodbye;
        close;
    }

    .@fexil = getq(ArtisQuests_Fexil);

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

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

        case 2:
            mes "";
            fexil_quest;
            break;

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

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

                break;
            } while (1);

            .@price = 25 * .@amount;
            speech 5,
                l("Deal, I offer you @@E!", .@price);

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

            break;

        case 4:
            speech 5,
                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;
    }

    closedialog;
    goodbye;
    close;

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