//===== rAthena Script =======================================
//= Milk Trader
//===== By: ==================================================
//= kobra_k88; L0ne_W0lf
//===== Current Version: =====================================
//= 1.5
//===== Compatible With: =====================================
//= rAthena SVN
//===== Description: =========================================
//= [Official Conversion]
//= Trades bottles for milk
//===== Additional Comments: =================================
//= Fully working
//= 1.1 Negative input bug fixed [Lupus]
//= 1.2 Raised the price to close zeny exploit [Lupus]
//= 1.2a Switched to Lupus's "loopless" technique.[kobra_k88]
//= 1.3 Rescripted to Aegis 10.3 standards. [L0ne_W0lf]
//= 1.4 Implemented checkweight. [L0ne_W0lf]
//= 1.5 Fixed missed variable. (bugreport:1523) [L0ne_W0lf]
//============================================================

prontera,73,140,0	script	ţ̹Ӧ	86,{
	if (checkweight(1201,1) == 0) {
		mes "[ţ̹Ӧ]";
		mes "޷Ϊṩˣ";
		mes "ΪЯĶ̫ˡ";
		mes "뽫ʱõĶŵֿ֮Ұ~";
		close;
	}
	mes "[ţ̹Ӧ]";
	mes ", ...";
	mes "Ҵ ^0000FF1ƿ^000000  ^FF000015^000000";
	mes "ôһ㽫ƿװţ̡";
	mes "ôҪҪһ£";
	next;
	if (select("пƿװţ:ȡ") == 1) {
		if (countitem(713) <= 0) {
			mes "[ţ̹Ӧ]";
			mes "...һƿûء";
			mes "û취ţ̣";
			mes "㶮...";
			close;
		}
		set .@bottles,countitem(713);
		set .@total_weight,.@bottles * 50;
		set .@total_cost,.@bottles * 15;
		if (zeny < .@Total_cost) {
			mes "[ţ̹Ӧ]";
			mes ", Һ~!";
			mes "û㹻ĽǮأ뽫ϵĿƿȫװţҪ" + .@total_cost + " ҡ";
			close;
		}
		if ((maxweight-weight) < .@total_weight) {
			mes "[ţ̹Ӧ]";
			mes "...";
			mes "ٶڳһ㱳Ŀռɡ";
			mes "װôţ̵Ļᱳġ";
			close;
		}
		set zeny,zeny-.@total_cost;
		delitem 713,.@bottles; //Empty Bottles
		getitem 519,.@bottles; //Milk
		close;
	}
	close;
}
