summaryrefslogtreecommitdiff
path: root/npc/merchants/alchemist.txt
blob: d2e55c918785b79cc13a96e301833f9d5f4078a2 (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
//===== rAthena Script ======================================= 
//= Alchemist Shop
//===== By: ================================================== 
//= rAthena Team
//===== Current Version: ===================================== 
//= 1.7
//===== Compatible With: ===================================== 
//= rAthena SVN
//===== Description: ========================================= 
//= Selling Alchemist Materials and Manuals
//===== Additional Comments: ================================= 
//= 1.1 fixed Medicine Bowl issue, thanx 2 MasterOfMuppets
//= 1.2 Reddozen's fixes of typos. added optional Elemental
//= Potion Guide. [Lupus]
//= 1.3 Deleted Elemental Potions Guide due to original quest [Lupus]
//= 1.4 Alchemists can now purchase 2000 Medicine Bowls at once. [SinSloth]
//= 1.5 Updated to Aegis 10.3 Standards. [L0ne_W0lf]
//= 1.6 Corrected canceling purchase. [L0ne_W0lf]
//= 1.7 Updated to match AEGIS script. [Masao]
//============================================================ 

alde_alche,31,186,3	script	Craft Book Salesman#alde	883,{

	mes "[Craft Book Salesman]";
	mes "Welcome.";
	mes "I'm here to sell";
	mes "^0000FFspecial craft books^000000 for Geneticists.";
	next;
	mes "[Craft Book Salesman]";
	mes "Geneticists have some skills";
	mes "that require craft books to activate.";
	next;
	mes "[Craft Book Salesman]";
	mes "The more craft books you have,";
	mes "the more skills you can use.";
	next;
	mes "[Craft Book Salesman]";
	mes "Please understand that";
	mes "I specialize in the sale of these special books and";
	mes "I ^FF0000don't sell other items^000000.";
	next;
	mes "[Craft Book Salesman]"
	mes "Okay then, here's the list of available craft books."
	next;
	switch(select("[Apple Bomb Craft Book] 100,000 zeny:[Pineapple Bomb Craft Book] 100,000 zeny:[Coconut Bomb Craft Book] 100,000 zeny:[Melon Bomb Craft Book] 100,000 zeny:[Banana Bomb Craft Book] 100,000 zeny:[Plant Gene Cultivation Method] 100,000 zeny:[Superior Potion Craft Manual] 100,000 zeny:[Mix Cooking Book] 100,000 zeny:[Health Improvement Research Book] 100,000 zeny:[Vigor Drink Recipe] 100,000 zeny:Close")){
	case 1:
		callsub S_SellManual,6279,100000;
		break;
	case 2:
		callsub S_SellManual,6280,100000;
		break;
	case 3:
		callsub S_SellManual,6281,100000;
		break;
	case 4:
		callsub S_SellManual,6282,100000;
		break;
	case 5:
		callsub S_SellManual,6283,100000;
		break;
	case 6:
		callsub S_SellManual,6284,100000;
		break;
	case 7:
		callsub S_SellManual,6285,100000;
		break;
	case 8:
		callsub S_SellManual,11022,100000;
		break;
	case 9:
		callsub S_SellManual,11023,100000;
		break;
	case 10:
		callsub S_SellManual,11024,100000;
		break;
	case 11:
		mes "[Craft Book Salesman]";
		mes "Thank you for your patronage.";
		mes "Please come again.";
		close;
	}

S_SellManual:
	mes "[Craft Book Salesman]";
	mes ""+getitemname(getarg(0))+"?";
	mes "That'll be "+getarg(1)+" zeny ea.";
	mes "How many of these books would you like to purchase?";
	next;
	input .@amount;
	if (.@amount == 0) {
		mes "[Craft Book Salesman]";
		mes "Would you like to see some different books?";
		close;
	}
	if (.@amount < 1 || .@amount > 99 ){
		mes "[Craft Book Salesman]";
		mes "You cannot purchase more than 100 at a time.";
		close;
	}
	mes "[Craft Book Salesman]"
	mes "You've entered "+.@amount+"x "+getitemname(getarg(0))+".";
	mes "That'll be "+getarg(1) * .@amount+" Zeny.";
	mes "Would you like to continue?"
	next;
	if (select("Yes:No") == 1) {
		if (Zeny < getarg(1) * .@amount) {
			mes "[Craft Book Salesman]";
			mes "You don't";
			mes "have enough zeny.";
			mes "Check how much zeny";
			mes "you have first.";
			close;
		}
		if (checkweight(getarg(0),.@amount) == 0){
			mes "[Craft Book Salesman]";
			mes "It doesn't seem like you can carry everything.";
			mes "Please check the space in your inventory.";
			close;
		}
		mes "[Craft Book Salesman]";
		mes "Thank you for your patronage.";
		set Zeny,Zeny - getarg(1) * .@amount;
		getitem getarg(0),.@amount;
		close;
	}
	mes "[Craft Book Salesman]";
	mes "Please take your time";
	mes "before you make your decision.";
	close;
}

alde_alche,24,188,3	script	Guild Dealer	740,{
	if (checkweight(1201,1) == 0) {
		mes "- next; a minute! -";
		mes "- Currently you are carrying -";
		mes "- too many items with you. -";
		mes "- Please come back again -";
		mes "- after you store some items into kafra storage. -";
		close;
	}
	mes "[Gever Al Sharp]";
	mes "Welcome to the";
	mes "Alchemist Union.";
	mes "How can I assist you today?";
	next;
	switch(select("Purchase materials.:Purchase a production manual.:Quit.")) {
	case 1:
		mes "[Gever Al Sharp]";
		mes "What would you like?";
		next;
		if (select("Medicine Bowl - 8 Zeny:Cancel.") == 1) {
			mes "[Gever Al Sharp]";
			mes "How many do you want?";
			mes "Enter '0' if you want to quit.";
			next;
			while(1) {
				input .@input,0,2001;
				if (.@input == 0) {
					mes "[Gever Al Sharp]";
					mes "The deal was cancelled.";
					mes "Come again next time.";
					close;
				}
				else if (.@input < 1 || .@input > 2000) {
					mes "[Gever Al Sharp]";
					mes "The number must";
					mes "be less than 2000.";
					next;
				}
				else {
					break;
				}
			}
			set .@sell,.@input * 8;
			set .@item_weight,.@input * 10;
			if (Zeny < .@sell) {
				mes "[Gever Al Sharp]";
				mes "You don't";
				mes "have enough zeny.";
				mes "Check how much zeny";
				mes "you have first.";
				close;
			}
			if ((MaxWeight - Weight) < .@item_weight) {
				mes "[Gever Al Sharp]";
				mes "It doesn't seem like";
				mes "you can carry everything.";
				mes "Please check the space";
				mes "in your inventory.";
				close;
			}
			set zeny,zeny-.@sell;
			getitem 7134,.@input; //Medicine_Bowl
			mes "[Gever Al Sharp]";
			mes "Thank you.";
			mes "Come again.";
			close;
		}
		mes "[Gever Al Sharp]";
		mes "Well then,";
		mes "come again when";
		mes "you need to purchase";
		mes "materials related to";
		mes "Alchemy, alright?";
		close;
	case 2:
		mes "[Gever Al Sharp]";
		mes "What do you need?";
		mes "Manuals are generally 100,000 zeny. But there are a couple of special manuals that will cost more.";
		next;
		switch(select("Potion Creation Guide:Alcohol Creation Guide:Bottle Grenade Creation Guide:Acid Bottle Creation Guide:Plant Bottle Creation Guide:Marine Sphere Bottle Creation Guide:Glistening Coat Creation Guide:Condensed Potion Creation Guide:Cancel Deal.")) {
		case 1:
			callsub S_SellManual,7144,100000; //Normal_Potion_Book
			break;
		case 2:
			callsub S_SellManual,7127,100000; //Alcol_Create_Book
			break;
		case 3:
			callsub S_SellManual,7128,100000; //FireBottle_Create_Book
			break;
		case 4:
			callsub S_SellManual,7129,100000; //Acid_Create_Book
			break;
		case 5:
			callsub S_SellManual,7130,100000; //Plant_Create_Book
			break;
		case 6:
			callsub S_SellManual,7131,100000; //Mine_Create_Book
			break;
		case 7:
			callsub S_SellManual,7132,100000; //Coating_Create_Book
			break;
		case 8:
			callsub S_SellManual,7133,240000; //Slim_Potion_Create_Book
			break;
		case 9:
			mes "[Gever Al Sharp]";
			mes "Well then...";
			mes "Come back if you";
			mes "ever need to buy";
			mes "a production manual.";
			close;
		}
	case 3:
		mes "[Gever Al Sharp]";
		mes "Alright then,";
		mes "have a good day.";
		close;
	}

S_SellManual:
	if (Zeny < getarg(1)) {
		mes "[Gever Al Sharp]";
		mes "You don't";
		mes "have enough zeny.";
		mes "Check how much zeny";
		mes "you have first.";
		close;
	}
	mes "[Gever Al Sharp]";
	mes ""+getitemname(getarg(0))+"?";
	mes "That'll be "+getarg(1)+" zeny.";
	next;
	if (select("Purchase.:Quit.") == 1) {
		set zeny,zeny-getarg(1);
		getitem getarg(0),1;
		mes "[Gever Al Sharp]";
		mes "Thank you for";
		mes "your patronage.";
		close;
	}
	mes "[Gever Al Sharp]";
	mes "Come again";
	mes "next time.";
	close;
}