summaryrefslogtreecommitdiff
path: root/npc/012-5/nicholas.txt
blob: b23d567c5e85e0912db07044d578c2d3a65789d1 (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
// TMW-2 Script
// Author:
//    Jesusalva
// Description:
//    Nicholas is Hurnscald's blakcsmith. He forges some stuff, and sell other stuff.
//    Perhaps he should not forge armor? Remember he cannot forge EVERYTHING...
//
// PS.
// Iridium + Platyna        Platinum
// Gold + Coal              Gold
// Silver + Coal            Silver
// Copper + Tin             Bronze (9:1)
// Terranite + Coal         Terranite
// Iron + Coal              Iron

// Resitance and Weight increasing ores
// Lead → +++ res, ++++ wei
// Titanium → + res, + wei

// Originals: Setzer, Steel Shield, Chain Mail, Light Platemail, Warlord Plate, Warlord Boots

012-5,36,26,0	script	Nicholas	NPC_NICHOLAS,{
    goto L_Menu;

    // blacksmith_header()
    function blacksmith_header {
        mesn;
        mesq l("Very well! We have seven class of items: Wood, Iron, Terranite, Bronze, Silver, Gold and Platinum.");
        mesq l("Each of them require different items, I'll sort from weakest to strongest, so choose wisely.");
        return;
    }

    // blacksmith_create( BaseItem1, Amount, BaseItem2, Amount, PrizeItem, Price )
    function blacksmith_create {
        .@base1=getarg(0);
        .@amon1=getarg(1);
        .@base2=getarg(2);
        .@amon2=getarg(3);
        .@prize=getarg(4);
        .@price=getarg(5);

        mesn;
        mesq l("Do you want to craft @@? For that I will need @@ @@, @@ @@ and @@ gp.",
        getitemlink(.@prize), .@amon1, getitemlink(.@base1), .@amon2, getitemlink(.@base2), .@price);

        select
            l("Yes"),
            l("No");

        if (@menu == 2)
            return;

        if (countitem(.@base1) >= .@amon1 &&
            countitem(.@base2) >= .@amon2 &&
            Zeny >= .@price) {
            inventoryplace .@prize, 1;
            delitem .@base1, .@amon1;
            delitem .@base2, .@amon2;
            Zeny = Zeny - .@price;
            getitem .@prize, 1;
            .@xp=getiteminfo(.@base1, ITEMINFO_SELLPRICE)*.@amon1+getiteminfo(.@base2, ITEMINFO_SELLPRICE)*.@amon2;
            getexp .@xp, rand(1,10);

            mes "";
            mesn;
            mesq l("Many thanks! Come back soon.");
        } else {
            speech S_FIRST_BLANK_LINE,// | S_LAST_NEXT,
                    l("You don't have enough material, sorry.");
        }
        return;        
    }

L_Menu:
    mesn;
    mesq l("Hello there, I am @@, blacksmith of this fine city. What do you want to forge today?", .name$);
    mes "";
    select
        l("I just want to trade."),
        l("I want to forge Weapons!"),
        l("I want to forge Shields!"),
        l("I want to forge Quivers!"),
        l("Nothing, thanks!");

    mes "";
    switch (@menu) {
    case 1:
        openshop;
        closedialog;
        close;
        break;
    case 2:
        goto L_Weapon;
    case 3:
        goto L_Shield;
    case 4:
        goto L_Quiver;

    }
    close;










L_Weapon:
    blacksmith_header();
    select
        l("Nothing, sorry!"),
        l("Wooden Sword"),
        l("Bronze Gladius"),
        l("Iron Bug Slayer"),
        l("Iron Short Gladius");

    switch (@menu) {
    case 1:
        goto L_Menu;
    case 2:
        blacksmith_create(WoodenLog, 45, RawLog, 5, WoodenSword, 4500);
        break;
    case 3:
        blacksmith_create(CopperIngot, 18, TinIngot, 2, BronzeGladius, 5000);
        break;
    case 4:
        blacksmith_create(IronIngot, 8, Coal, 12, BugSlayer, 10000);
        break;
    case 5:
        blacksmith_create(IronIngot, 14, Coal, 18, ShortGladius, 15000);
        break;
    }
    goto L_Weapon;






L_Shield:
    blacksmith_header();
    select
        l("Nothing, sorry!"),
        l("Wooden Shield");

    switch (@menu) {
    case 1:
        goto L_Menu;
    case 2:
        blacksmith_create(WoodenLog, 40, LeatherPatch, 2, WoodenShield, 5000);
        break;
    }
    goto L_Shield;






L_Quiver:
    blacksmith_header();
    select
        l("Nothing, sorry!"),
        l("Leather Quiver"),
        l("Terranite Quiver"),
        l("Platinum Quiver");

    switch (@menu) {
    case 1:
        goto L_Menu;
    case 2:
        blacksmith_create(LeatherPatch, 35, TitaniumIngot, 1, LeatherQuiver, 20000);
        break;
    case 3:
        blacksmith_create(TerraniteOre, 210, Coal, 80, TerraniteQuiver, 30000); // TODO: Terranite Ingot
        break;
    case 4:
        blacksmith_create(PlatinumIngot, 30, IridiumIngot, 10, PlatinumQuiver, 40000);
        break;
    }
    goto L_Quiver;








OnInit:
	tradertype(NST_MARKET);
    sellitem Dagger, 4000, 5;
    sellitem SharpKnife, 2000, 10;

    .sex = G_MALE;
    .distance = 5;
    end;

OnClock0009:
OnClock0603:
OnClock1207:
OnClock1801:
    restoreshopitem Dagger, 4000, 5;
    restoreshopitem SharpKnife, 2000, 10;
    end;
}