summaryrefslogtreecommitdiff
path: root/npc/009-2/trader.txt
blob: ff1076e5ec626493658b365d2b66771e68c4d828 (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
009-2,29,98,0	script	Trader	NPC115,{
    @ironprice = 1000;
    @Sulphurprice = 1200;
    @Potionprice = 500;
    if (BaseLevel >= 25) goto L_Trade;

    mes "[Trader]";
    mes "\"Hello. I came here to trade wares with the people of Hurnscald. Unfortunately for you, I've traded everything I had.\"";
    next;
    menu
        "Oh. I'll go then.", L_close,
        "You don't have anything?", L_More;

L_More:
    mes "[Trader]";
    mes "\"No. I have nothing for you. Except...\"";
    next;
    menu
        "Yes?", L_Except,
        "Ok then.",  L_close;

L_Except:
    mes "[Trader]";
    mes "\"I could teach you how to trade. It'll cost you 2GP.\"";
    next;
    menu
        "Sure.", L_Teach,
        "No thank you.", L_close;

L_Teach:
    if (Zeny < 2) goto L_NotEnoughMoney;
    Zeny = Zeny - 2;
    mes "[Trader]";
    mes "\"You can initiate trade with someone by right-clicking on them and choosing trade.";
    mes "You'll both add the items and set the GP you're putting up then press propose trade.";
    mes "After both parties have proposed their side, you can both review the trade, and then accept or reject by closing the window.\"";
    next;
    mes "[Trader]";
    mes "\"Items added to the trade cannot be removed, and so mistakes have to be dealt with by canceling the trade.";
    mes "You need to press the change button to let the other person know about GP changes.\"";
    next;
    goto L_Later;

L_Later:
    mes "[Trader]";
    mes "\"Please feel free to check back later. I'm expecting a large shipment of goods to trade.\"";
    goto L_close;

L_Trade:
    mes "[Trader]";
    mes "\"Welcome back!  My shipment came in and I have a bunch of things that I can trade now. What would you like?\"";
    goto L_Trademenu;

L_Trademenu:
    menu
        "Do you have Iron Powder?", L_Iron,
        "How about Sulphur Powder?", L_Sulphur,
        "I need Medium Healing Potions.", L_Healpots,
        "I think I have everything I need, thanks.", L_close;

L_Iron:
    mes "[Trader]";
    mes "\"I do have a few of those. I will give you 4 Iron Powders for 1 Iron Ore and " + @ironprice + "gp.\"";
    menu
        "Sure.", L_Ipowder,
        "What a ripoff!  No way!", L_close;

L_Sulphur:
    mes "[Trader]";
    mesq l("I can trade you %d %ss for %d %s and %d GP.",
           20, getitemlink(SulphurPowder), 
            1, getitemlink(PileOfAsh),
            @Sulphurprice);
    menu
        "Here you go.", L_Spowder,
        "Are you nuts?! Forget it!", L_close;

L_Healpots:
    mes "[Trader]";
    mes "\"Healing potions are always useful, but I rarely need anything larger than the small ones. I will happily trade you 1 Medium Healing Potion for 3 Small Healing Potions and " + @Potionprice + "gp.\"";
    menu
        "Alright.", L_Pots,
        "Whoa, that's way too much.", L_close;

L_Ipowder:
    if (countitem("IronOre") < 1) goto L_Missing;
    if (Zeny < @ironprice) goto L_NotEnoughMoney;
    getinventorylist;
    if (@inventorylist_count == 100 && countitem("IronOre") > 1 && countitem("IronPowder") < 1) goto L_Full;
    delitem "IronOre", 1;
    Zeny = Zeny - @ironprice;
    getitem "IronPowder", 4;
    mes "[Trader]";
    mes "\"There you go. Would you like to trade anything else?\"";
    menu
        "Yes.", L_Trademenu,
        "No.", L_No;

L_Spowder:
    if (countitem("PileOfAsh") < 1) goto L_Missing;
    if (Zeny < @Sulphurprice) goto L_NotEnoughMoney;
    getinventorylist;
    if (@inventorylist_count == 100 && countitem("PileOfAsh") > 1 && countitem("SulphurPowder") < 1) goto L_Full;
    delitem "PileOfAsh", 1;
    Zeny = Zeny - @Sulphurprice;
    getitem "SulphurPowder", 20;
    mes "[Trader]";
    mes "\"There you go. Would you like to trade anything else?\"";
    menu
        "Yes.", L_Trademenu,
        "No.", L_No;

L_Pots:
    if (countitem("SmallHealingPotion") < 3) goto L_Missing;
    if (Zeny < @Potionprice) goto L_NotEnoughMoney;
    getinventorylist;
    if (@inventorylist_count == 100 && countitem("SmallHealingPotion") > 3 && countitem("MediumHealingPotion") < 1) goto L_Full;
    delitem "SmallHealingPotion", 3;
    Zeny = Zeny - @Potionprice;
    getitem "MediumHealingPotion", 1;
    mes "[Trader]";
    mes "\"There you go. Would you like to trade anything else?\"";
    menu
        "Yes.", L_Trademenu,
        "No.", L_No;

L_Full:
    mes "[Trader]";
    mes "\"You must have been making a lot of trades...your bag is completely full!  Come back after you've made some room.\"";
    goto L_close;

L_Missing:
    mes "[Trader]";
    mes "\"It looks like you're missing some items. Please come back when you have enough to trade.\"";
    goto L_close;

L_NotEnoughMoney:
    mes "[Trader]";
    mes "\"You don't have enough money.\"";
    goto L_close;

L_No:
    mes "[Trader]";
    mes "\"Have a great day!\"";
    goto L_close;

L_close:
    @ironprice = 0;
    @Sulphurprice = 0;
    @Potionprice = 0;
    close;
}