//===== rAthena Script ======================================= 
//= The Airship System Script
//===== By: ================================================== 
//= rAthena Dev Team
//===== Current Version: =====================================
//= 1.0
//===== Compatible With: ===================================== 
//= rAthena SVN
//===== Description: ========================================= 
//= The Airship System used in the official servers.
//===== Additional Comments: ================================= 
//= 1.0 First version.
//============================================================ 

//============================================================ 
//= Domestic Airship Route
//= ... -> Juno -> Einbroch -> Lighthalzen -> Einbroch
//= -> Juno -> Hugel -> ...
//============================================================ 

airplane,243,73,0	script	#AirshipWarp-1	45,1,1,{
	end;

OnInit:
OnHide:
	specialeffect EF_BASH;
	disablenpc strnpcinfo(0);
	end;

OnUnhide:
	enablenpc strnpcinfo(0);
	specialeffect EF_SUMMONSLAVE;
	end;

OnTouch:
	switch ($@airplanelocation) {
	case 0: warp "yuno",92,260; end;
	case 1: warp "einbroch",92,278; end;
	case 2: warp "lighthalzen",302,75; end;
	case 3: warp "hugel",181,146; end;
	}
}

airplane,243,29,0	duplicate(#AirshipWarp-1)	#AirshipWarp-2	45,1,1

airplane,1,1,0	script	Domestic_Airship	-1,{
	end;
OnInit:
	initnpctimer;
	end;
OnTimer20000:
	mapannounce "airplane","Ŀǰɿͧڷ޿.",bc_map,"0x00ff00";
	end;
OnTimer50000:
	mapannounce "airplane","һ·ɿͧҪִﰬ޿.",bc_map,"0x00ff00";
	end;
OnTimer60000:
	set $@airplanelocation,1;
	donpcevent "#AirshipWarp-1::OnUnhide";
	donpcevent "#AirshipWarp-2::OnUnhide";
	mapannounce "airplane","ѵִﰬ޿,»ÿټ.",bc_map,"0x00ff00";
	end;
OnTimer70000:
	mapannounce "airplane","ͣڰ޿,һǵķɿͧҪ.",bc_map,"0x00ff00";
	end;
OnTimer80000:
	donpcevent "#AirshipWarp-1::OnHide";
	donpcevent "#AirshipWarp-2::OnHide";
	mapannounce "airplane","ɿͧ.ǵһĿĵϣ. ",bc_map,"0x70dbdb";
	end;
OnTimer100000:
	mapannounce "airplane","Ŀǰɿͧڷϣ.",bc_map,"0x70dbdb";
	end;
OnTimer130000:
	mapannounce "airplane","һ·ɿͧҪִϣ.",bc_map,"0x70dbdb";
	end;
OnTimer140000:
	set $@airplanelocation,2;
	donpcevent "#AirshipWarp-1::OnUnhide";
	donpcevent "#AirshipWarp-2::OnUnhide";
	mapannounce "airplane","ѵִϣ,»ÿټ.",bc_map,"0x70dbdb";
	end;
OnTimer150000:
	mapannounce "airplane","ͣϣ,һǵķɿͧҪ.",bc_map,"0x70dbdb";
	end;
OnTimer160000:
	donpcevent "#AirshipWarp-1::OnHide";
	donpcevent "#AirshipWarp-2::OnHide";
	mapannounce "airplane","ɿͧ.ǵһĿĵǰ޿.",bc_map,"0x00ff00";
	end;
OnTimer180000:
	mapannounce "airplane","Ŀǰɿͧڷ޿.",bc_map,"0x00ff00";
	end;
OnTimer210000:
	mapannounce "airplane","һ·ɿͧҪִﰬ޿.",bc_map,"0x00FF00";
	end;
OnTimer220000:
	set $@airplanelocation,1;
	donpcevent "#AirshipWarp-1::OnUnhide";
	donpcevent "#AirshipWarp-2::OnUnhide";
	mapannounce "airplane","ѵִﰬ޿,»ÿټ",bc_map,"0x00ff00";
	end;
OnTimer230000:
	mapannounce "airplane","ͣڰ޿,һǵķɿͧҪ.",bc_map,"0x00ff00";
	end;
OnTimer240000:
	donpcevent "#AirshipWarp-1::OnHide";
	donpcevent "#AirshipWarp-2::OnHide";
	mapannounce "airplane","ɿͧ.ǵһĿĵŵ.",bc_map,"0xff8200";
	end;
OnTimer260000:
	mapannounce "airplane","Ŀǰɿͧڷŵ.",bc_map,"0xff8200";
	end;
OnTimer290000:
	mapannounce "airplane","һ·ɿͧҪִŵ.",bc_map,"0xff8200";
	end;
OnTimer300000:
	set $@airplanelocation,0;
	donpcevent "#AirshipWarp-1::OnUnhide";
	donpcevent "#AirshipWarp-2::OnUnhide";
	mapannounce "airplane","ѵִŵ,»ÿټ.",bc_map,"0xff8200";
	end;
OnTimer310000:
	mapannounce "airplane","ͣŵ,һǵķɿͧҪ.",bc_map,"0xff8200";
	end;
OnTimer320000:
	donpcevent "#AirshipWarp-1::OnHide";
	donpcevent "#AirshipWarp-2::OnHide";
	mapannounce "airplane","ɿͧ.ǵһĿĵǻٸ.",bc_map,"0xca4bf3";
	end;
OnTimer340000:
	mapannounce "airplane","Ŀǰɿͧڷٸ.",bc_map,"0xca4bf3";
	end;
OnTimer370000:
	mapannounce "airplane","һ·ɿͧҪִٸ.",bc_map,"0xca4bf3";
	end;
OnTimer380000:
	set $@airplanelocation,3;
	donpcevent "#AirshipWarp-1::OnUnhide";
	donpcevent "#AirshipWarp-2::OnUnhide";
	mapannounce "airplane","ѵִٸ,»ÿټ.",bc_map,"0xca4bf3";
	end;
OnTimer390000:
	mapannounce "airplane","ͣڻٸ,һǵķɿͧҪ.",bc_map,"0xca4bf3";
	end;
OnTimer400000:
	donpcevent "#AirshipWarp-1::OnHide";
	donpcevent "#AirshipWarp-2::OnHide";
	mapannounce "airplane","ɿͧ.ǵһĿĵŵ.",bc_map,"0xff8200";
	end;
OnTimer420000:
	mapannounce "airplane","Ŀǰɿͧڷŵ.",bc_map,"0xff8200";
	end;
OnTimer450000:
	mapannounce "airplane","һ·ɿͧҪִŵ.",bc_map,"0xff8200";
	end;
OnTimer460000:
	set $@airplanelocation,0;
	donpcevent "#AirshipWarp-1::OnUnhide";
	donpcevent "#AirshipWarp-2::OnUnhide";
	mapannounce "airplane","ѵִŵ,»ÿټ.",bc_map,"0xff8200";
	end;
OnTimer470000:
	mapannounce "airplane","ͣŵ,һǵķɿͧҪ.",bc_map,"0xff8200";
	end;
OnTimer480000:
	donpcevent "#AirshipWarp-1::OnHide";
	donpcevent "#AirshipWarp-2::OnHide";
	mapannounce "airplane","ɿͧ.ǵһĿĵǰ޿.",bc_map,"0x00ff00";
	stopnpctimer;
	initnpctimer;
}

airplane,240,64,5	script	Exit#airplane1a::ExitAirplane	857,{
	end;
}
airplane,247,64,5	duplicate(ExitAirplane)	Exit#airplane1b	857
airplane,240,40,1	duplicate(ExitAirplane)	Exit#airplane2a	857
airplane,247,40,1	duplicate(ExitAirplane)	Exit#airplane2b	857

airplane,100,69,3	script	Ա#ein-1	852,{
	mes "[Ա]";
	mes "ǵִȥĿĵ,";
	mes "ǰ¥».";
	mes "ллѡʹǵķ.";
	mes "ףиõһ~";
	close;
}

airplane,64,94,1	script	ͯ#ein_p	787,{
	emotion e_swt2;
	mes "[ͯ]";
	if (event_umbala >= 3) {
		mes "Ŷ,!";
		mes "-!";
		mes "ڷ!-...";
		mes "ϰ!";
	}
	else {
		mes "!";
		mes "ɢ ౽";
		mes "   .";
		mes "۹!";
	}
	close;
}

airplane,66,93,3	script	Ů#ein_p	783,{
	emotion e_dots;
	mes "[Ůʿ]";
	if (event_umbala >= 3) {
		mes ",...";
		mes "С,ע~";
		mes "ϱô";
	}
	else {
		mes "ͼ!";
		mes "Ȼ !";
		mes "ɰ η";
		mes "̫ !";
	}
	close;
}

airplane,71,91,7	script	#ein_p	789,{
	if (event_umbala >= 3) {
		mes "[ķ]";
		mes "ߵ~";
		mes "ıҾ֪㶮˵ʲô";
		mes "^333333*...!*^000000";
		next;
		emotion e_pif;
		mes "[ķ]";
		mes "Ϊɿͧҵһ.";
		mes "ԱѵԿ˷ǵĿָ֢.";
		mes "ʵô򵥵.";
		next;
		mes "[ķ]";
		mes "...";
		mes "Щ˾ǲܿ˷,";
		mes "һıŵ ^333333ưķȥ^000000.";
	}
	else {
		mes "[ķ]";
		mes "; ";
		mes "ť ͧ.";
		next;
		mes "[ķ]";
		mes "...";
		mes "......";
		next;
		emotion e_pif;
		mes "[ķ]";
		mes "ɳ ľŷ ͼ";
		mes "ͧ  ";
		mes "³. ,Ŭ";
		mes ". ,   ȿ!";
	}
	close;
}

airplane,250,58,2	script	ɿְͧԱ#airplane	67,{
	// Hugel quest addition
	if (hg_ma1 == 3) {
		mes "[ɿְͧԱ]";
		mes "ӭͧ.";
		mes "Ҫʲô?";
		next;
		select("ʶһλ?");
		mes "[ɿְͧԱ]";
		mes "Ǹ,ûнֵĳ˿.";
		close;
	}
	// Hugel quest end
	mes "[ɿְͧԱ]";
	mes "ӭͧ.";
	mes "Ҫʲô?";
	next;
	switch (select("ɿͧô::ڲʩ:ȡ")) {
	case 1:
		mes "[ɿְͧԱ]";
		mes "ѾִĿĵϢʱ,";
		mes "÷ͧϲĳ뿪ͧͿ.";
		next;
		mes "[ɿְͧԱ]";
		mes "СĴҲ,";
		mes "ͧǲѭŷɵ,";
		mes "ȵһεִȥĿĵ֮³.";
		close;
	case 2:
		mes "[ɿְͧԱ]";
		mes "Ҿڷͧǰ.";
		mes "ԺͷͧͷԱȥк.";
		close;
	case 3:
		mes "[ɿְͧԱ]";
		mes "ͧΪλ˿ṩ˸Ϸ.";
		mes ",ַ,濴ЩСϷ~";
		close;
	case 4:
		mes "[ɿְͧԱ]";
		mes "ô,ϣǷͧϵ;.";
		mes "ллѡǵķ.";
		mes "ףиõһ.";
		close;
	}
}

airplane,80,71,2	script	#01airplane	834,{
	mes "[]";
	mes "Ŷ,ð.";
	mes "һµ;,";
	mes "뿴ͬ¬-׵¼ȴ½˵ķݶ,һ°.";
	close;
}

airplane,65,63,4	script	#01airplane	714,{
	mes "[]";
	mes ",ɿͧȥȥ?";
	mes "Ҷôʱ,";
	mes "ǻûʲôڽǵ,";
	close;
}

airplane,72,34,6	script	ŵ˹#01airplane	702,{
	mes "[ŵ˹]";
	mes "ŶŶ~";
	mes "¿,˲ͬ,";
	mes "!";
	close;
}

airplane,221,158,2	script	Ա#airplane	852,{
	// Hugel quest addition
	if (hg_ma1 == 3) {
		mes "[Ա]";
		mes "һơƺ.";
		mes "ȾƾһȤ˹!Ƹ!";
		mes "뿪,ʲôҲǰ!";
		next;
		mes "[Ա]";
		mes "!ƼݻǲԵ.";
		mes "!ֻҸȾ!";
		emotion e_sob;
		next;
		select("ʶһλĳ˿?");
		mes "[Ա]";
		mes "ƷƯ,";
		mes "Ǿôһ·Ż̫˰.";
		next;
		mes "[Ա]";
		mes "...";
		mes "......";
		mes "ûô.";
		mes "ͷѱ¹.";
		mes "^FFFFFF ^000000 ֻܿЩװ˹.";
		next;
		emotion e_omg;
		mes "[Ա]";
		mes "!?˭?";
		next;
		mes "- ...û˵. -";
		close;
	}
	// Hugel quest end
	switch (rand(1,4)) {
	case 1:
		mes "[Ա]";
		mes "þûкúһϺõı.";
		mes "⹤ҪҪʱ̱Ѱ";
		next;
		mes "[Ա]";
		mes "ȾһҪʶȰ!";
		mes "һǼǲϴηżٻϢʲôʱ.";
		mes "ҾƼƿ,,ӿ,";
		mes "Ϣʽ.";
		emotion e_sob;
		close;
	case 2:
		mes "[Ա]";
		mes ",.";
		mes ",ձ֤˿Ӷ,";
		mes "лܰȫ.";
		close;
	case 3:
		mes "[Ա]";
		mes "֪ǵĴһ𾴵ļһ.";
		mes "ֵڷͧҵͷĺ.";
		mes "˭֪¹?";
		next;
		mes "[Ա]";
		mes ",ͱ˵,֪,";
		mes "С.";
		mes "Ǹʥĺ,";
		mes "ЩС¹Ϊ.";
		mes "һǸ!";
		close;
	default:
		mes "[Ա]";
		mes "֪ӷ¿Ƽ.";
		mes "ǴҴææϳͧ.";
		next;
		emotion e_omg;
		mes "[Ա]";
		mes "ǻĺ,ǰ˼˺ܶණ.";
		mes "ڷɿͧзʱ,Ϳʼѵ.";
		mes "ţ,԰?!";
		close;
	}
}

airplane,50,66,5	script	ƻ#airplane	86,{
	mes "[Ƽ]";
	mes "ӭƼƻС.";
	mes "ƻ,Ҳ԰ƻե֭.";
	next;
	switch (select("ƻ.:եƻ֭.:ʲô?:ȡ.")) {
	case 1:
		mes "[Ƽ]";
		mes "Ҫ.";
		mes " 15 zeny ,һ๺500.";
		mes "Ҫ0Ϳ.";
		next;
		while (1) {
			input .@input;
			set .@pay, .@input * 15;
			if (.@input == 0) {
				mes "[Ƽ]";
				mes "ллעҵС,";
				mes "ݰ!";
				mes "Ҫƻʱ,";
				mes "ƼС~";
				close;
			}
			else if (.@input < 1 || .@input > 500) {
				mes "[Ƽ]";
				mes "˳500.";
				mes "Ҫƻ.";
				next;
			}
			else {
				mes "[Ƽ]";
				mes "һ ^FF0000" + .@input + "^000000 ƻ";
				mes " ^FF0000" + .@pay + " Zeny^000000 zeny.";
				mes "Ը?";
				next;
				if (select("ǵ:Ҫ") == 2) {
					mes "[Ƽ]";
					mes "ллݹ";
					mes "ݰ!";
					mes "Ҫƻʱ,";
					mes "ƼС~";
					close;
				}
				break;
			}
		}
		if (Zeny < .@pay) {
			mes "[Ƽ]";
			mes "Ǹ,ûдЩƻҪǮ.";
			mes "һǮ,.";
			close;
		}
		else if (checkweight(512,.@input) == 0) {
			mes "[Ƽ]";
			mes ",ð.û㹻λ.";
			mes "һİ.";
			close;
		}
		else {
			set Zeny, Zeny - .@pay;
			getitem 512,.@input; //Apple
			mes "[Ƽ]";
			mes "ллݹ~";
			mes "ϣ";
			mes "ԺúЩƻζ~!";
			close;
		}
	case 2:
		mes "[Ƽ]";
		mes "õ,Ҫ";
		mes "^FF00003 ƻ  1 ƿ^000000";
		mes "Ҫһƿƻ֭Ļ.";
		mes "Ҫ?";
		next;
		switch (select("ǵ:Ҫ")) {
		case 1:
			if (countitem(512) < 3 || countitem(713) < 1) {
				mes "[Ƽ]";
				mes ",ûƻ֭Ĳ";
				mes "סŶ 3 ƻ,һƿ.";
				close;
			}
			else {
				mes "[Ƽ]";
				mes "õ,";
				mes "Ե";
				next;
				mes "^3355FF*ĥĥ*";
				mes "*ĥĥ*";
				mes "*...!*^000000";
				next;
				delitem 512,3; //Apple
				delitem 713,1; //Empty_Bottle
				getitem 531,1; //Apple_Juice
				mes "[Ƽ]";
				mes ",~";
				mes "ϣú!";
				mes "Ҫƻƻ֭Ļ,";
				mes ",ʱض~";
				close;
			}
		case 2:
			mes "[Ƽ]";
			mes ",ллעҵС.";
			mes "ݰ!";
			mes "Ҫƻʱ,";
			mes "ƼС~";
			close;
		}
	case 3:
		mes "[Ƽ]";
		mes "һε˺,";
		mes "ֱһ,С˯ʱжҵҵͷ,";
		mes "Ҵҵо.";
		next;
		mes "[Ƽ]";
		mes "ԭ,һƻ˯,";
		mes "һƻ䵽ͷ.";
		mes "ʱĶ,׼Ҫȥƻʱ...";
		next;
		mes "[Ƽ]";
		mes "ʱڿʱʶĵѿ,";
		mes "ȥɿͧϰæ.";
		mes "Ҿȥ,ҷЩɫϷ.";
		next;
		mes "[Ƽ]";
		mes "ʵ̫,־ⶫ,";
		mes "Ψһƻע.";
		mes ",˵,˸ҳ˸һ,";
		mes "һƻ...";
		next;
		mes "[Ƽ]";
		mes "ĸ...";
		mes "ʶ׷ʲôֵǮ,";
		mes "ӵеƻﵽ˿Կ̵ĵز!";
		mes "ҾڷɿͧϿչԼ.";
		mes ",ܹ?";
		next;
		mes "[Ƽ]";
		mes "ƻкô.";
		mes "ҲҴæ,~!";
		close;
	case 4:
		mes "[Ƽ]";
		mes "ллݷҵС.";
		mes "ݰ~";
		close;
	}
}

//============================================================ 
//= International Airship Route
//= ... -> Izlude -> Juno -> Rachel -> ...
//============================================================ 

airplane_01,243,73,0	script	#AirshipWarp-3	45,1,1,{
	end;
	
OnTouch:
	switch ($@airplanelocation2) {
	case 0: warp "ra_fild12",292,204; end;
	case 1: 
		if(checkre(0))
			warp "izlude",200,73;
		else
			warp "izlude",200,56;
		end;
	case 2: warp "yuno",12,261; end;
	}

OnInit:
OnHide:
	specialeffect EF_BASH;
	disablenpc strnpcinfo(0);
	end;
	
OnUnhide:
	enablenpc strnpcinfo(0);
	specialeffect EF_SUMMONSLAVE;
	end;
}

airplane_01,243,29,0	duplicate(#AirshipWarp-3)	#AirshipWarp-4	45,1,1

airplane_01,1,1,0	script	International_Airship	-1,{
	end;
OnInit:
OnEnable:
	initnpctimer;
	end;
OnTimer25000:
	mapannounce "airplane_01","Ŀǰɿͧڷ˹³õ;С",bc_map,"0x00ff00";
	end;
OnTimer50000:
	mapannounce "airplane_01","һ·ɿͧҪ˹³õˡ",bc_map,"0x00ff00";
	end;
OnTimer60000:
	set $@airplanelocation2,1;
	donpcevent "#AirshipWarp-3::OnUnhide";
	donpcevent "#AirshipWarp-4::OnUnhide";
	mapannounce "airplane_01","ӭ˹³õףһó̡",bc_map,"0x00ff00";
	end;
OnTimer70000:
	mapannounce "airplane_01","Ŀǰͣ˹³õҪ",bc_map,"0x00ff00";
	end;
OnTimer80000:
	donpcevent "#AirshipWarp-3::OnHide";
	donpcevent "#AirshipWarp-4::OnHide";
	mapannounce "airplane_01","ɿͧѾˣһĿĵŵ",bc_map,"0x70dbdb";
	end;
OnTimer105000:
	mapannounce "airplane_01","Ŀǰɿͧڷŵ;С",bc_map,"0x70dbdb";
	end;
OnTimer130000:
	mapannounce "airplane_01","һ·ɿͧҪŵˡ",bc_map,"0x70dbdb";
	end;
OnTimer140000:
	set $@airplanelocation2,2;
	donpcevent "#AirshipWarp-3::OnUnhide";
	donpcevent "#AirshipWarp-4::OnUnhide";
	mapannounce "airplane_01","ӭŵףһó̡",bc_map,"0x70dbdb";
	end;
OnTimer150000:
	mapannounce "airplane_01","ĿǰͣŵҪ",bc_map,"0x70dbdb";
	end;
OnTimer160000:
	donpcevent "#AirshipWarp-3::OnHide";
	donpcevent "#AirshipWarp-4::OnHide";
	mapannounce "airplane_01","ɿͧѾ뿪˵档һĿĵա",bc_map,"0xFF8200";
	end;
OnTimer185000:
	mapannounce "airplane_01","Ŀǰɿͧڷյ;С",bc_map,"0xFF8200";
	end;
OnTimer210000:
	mapannounce "airplane_01","һ·ɿͧҪˡ",bc_map,"0xFF8200";
	end;
OnTimer220000:
	set $@airplanelocation2,0;
	donpcevent "#AirshipWarp-3::OnUnhide";
	donpcevent "#AirshipWarp-4::OnUnhide";
	mapannounce "airplane_01","ӭգףһó̡",bc_map,"0xFF8200";
	end;
OnTimer230000:
	mapannounce "airplane_01","ĿǰͣգҪ",bc_map,"0xFF8200";
	end;
OnTimer240000:
	donpcevent "#AirshipWarp-3::OnHide";
	donpcevent "#AirshipWarp-4::OnHide";
	mapannounce "airplane_01","ɿͧѾˣһĿĵ˹³õ",bc_map,"0x00ff00";
	stopnpctimer;
	set .moninv, .moninv + 1;
	if (.moninv == 7) {
		if (rand(1,3) == 3) {
			donpcevent "Airship#airplane02::OnEnable";
			end;
		}
		set .moninv, 0;
	}
	initnpctimer;
	end;
}

airplane_01,240,64,5	script	#airplane_011a::ExitAirplane01	857,{
	end;
}
airplane_01,247,64,5	duplicate(ExitAirplane01)	#airplane_011b	857
airplane_01,240,40,1	duplicate(ExitAirplane01)	#airplane_012a	857
airplane_01,247,40,1	duplicate(ExitAirplane01)	#airplane_012b	857

airplane_01,250,58,2	script	ɿְͧԱ#airplane01	67,{
	mes "[ɿְͧԱ]";
	mes "ӭɿͧ.";
	mes "Ҫʲôæ.";
	next;
	switch (select("ɿͧô::ڲʩ:ȡ")) {
	case 1:
		mes "[ɿְͧԱ]";
		mes "ѾִĿĵϢʱ,";
		mes "÷ͧϲĳ뿪ͧͿ.";
		next;
		mes "[ɿְͧԱ]";
		mes "СĴҲ,";
		mes "ͧǲѭŷɵ,";
		mes "ȵһεִȥĿĵ֮³.";
		close;
	case 2:
		mes "[ɿְͧԱ]";
		mes "Ҿڷͧǰ.";
		mes "ԺͷͧͷԱȥк.";
		close;
	case 3:
		mes "[ɿְͧԱ]";
		mes "ͧΪλ˿ṩ˸Ϸ.";
		mes ",ַ,濴ЩСϷ~";
		close;
	case 4:
		mes "[ɿְͧԱ]";
		mes "ô,ϣǷͧϵ;.";
		mes "ллѡǵķ.";
		mes "ףиõһ.";
		close;
	}
}

airplane_01,50,66,5	script	ƻ#air01	86,{
	if (checkweight(1201,1) == 0) {
		mes "- ԵȰ !! -";
		mes "- ˺öණ -";
		mes "- ȼ -";
		mes "- ƻ. -";
		close;
	}
	mes "[÷]";
	mes "ӭ÷С.";
	mes "ƻ,Ҳ԰ƻե֭";
	next;
	switch (select("ƻ.:եƻ֭.:ʲô?:ȡ.")) {
	case 1:
		mes "[÷]";
                mes "Ҫ.";
		mes " 15 zeny ,һ๺500.";
		mes "Ҫ0Ϳ.";
		next;
		while (1) {
			input .@input;
			set .@pay, .@input * 15;
			if (.@input == 0) {
				mes "[÷]";
				mes "ллעҵС,";
				mes "ݰ!";
				mes "Ҫƻʱ,";
				mes "÷̵С~";
				close;
			}
			else if (.@input < 1 || .@input > 500) {
				mes "[÷]";
				mes "˳500.";
				mes "Ҫƻ.";
				next;
			}
			else {
				mes "[÷]";
				mes "һ ^FF0000" + .@input + "^000000 ƻ";
				mes " ^FF0000" + .@pay + " Zeny^000000 zeny.";
				mes "Ը?";
				next;
				if (select("ǵ:Ҫ") == 2) {
					mes "[÷]";
					mes "ллݹ";
					mes "ݰ!";
					mes "Ҫƻʱ,";
					mes "÷̵С~";
					close;
				}
				break;
			}
		}
		if (Zeny < .@pay) {
			mes "[÷]";
			mes "Ǹ,ûдЩƻҪǮ.";
			mes "һǮ,.";
			close;
		}
		else if (checkweight(512,.@input) == 0) {
			mes "[÷]";
			mes ",ð.û㹻λ.";
			mes "һİ.";
			close;
		}
		else {
			set Zeny, Zeny - .@pay;
			getitem 512,.@input; //Apple
			mes "[÷]";
			mes "ллݹ~";
			mes "ϣ";
			mes "ԺúЩƻζ~!";
			close;
		}
	case 2:
		mes "[÷]";
		mes "õ,Ҫ";
		mes "^FF00003 ƻ  1 ƿ^000000";
		mes "Ҫһƿƻ֭Ļ.";
		mes "Ҫ?";
		next;
		switch (select("ǵ:Ҫ")) {
		case 1:
			if (countitem(512) < 3 || countitem(713) < 1) {
				mes "[÷]";
				mes ",ûƻ֭Ĳ";
				mes "סŶ 3 ƻ,һƿ.";
				close;
			}
			else {
				mes "[÷]";
				mes "õ,";
				mes "Ե";
				next;
				mes "^3355FF*ĥĥ*";
				mes "*ĥĥ*";
				mes "*...!*^000000";
				next;
				delitem 512,3; //Apple
				delitem 713,1; //Empty_Bottle
				getitem 531,1; //Apple_Juice
				mes "[÷]";
				mes ",~";
				mes "ӭٴι!";
				close;
			}
		case 2:
			mes "[÷]";
			mes "ллעҵС~";
			mes "ӻ!";
			mes "Ҫƻ~";
			close;
		}
	case 3:
		mes "[÷]";
		mes "ллעҵС~";
		mes "ӻ!";
		mes "Ҫƻ~";
		close;
	}
}

airplane_01,221,158,2	script	Ա#airplane_01	852,{
	switch (rand(1,4)) {
	case 1:
		mes "[Ա]";
		mes ", 131 .";
		mes "γ, 37 .";
		mes "ǵķ.";
		close;
	case 2:
		mes "[Ա]";
		mes "ȥһƵء";
		mes "Ҫ뵼Щ鷳ġ";
		mes "ҪҪŴ״.";
		close;
	case 3:
		mes "[Ա]";
		mes "Ǹ,";
		mes "ûбʺָҷɿͧѡ.";
		mes "ҲϿ,һŬļʻԱ.";
		next;
		mes "[^ff0000^000000]";
		mes "^ff0000ι...!^000000";
		mes "^ff0000г^000000";
		mes "^ff0000ŵ㾫ڵϰ!^000000";
		next;
		mes "[Ա]";
		mes "-ǵ,!";
		mes "(û?)";
		close;
	default:
		mes "[Ա]";
		mes "Ʒĺ,";
		mes "·϶ŵĻ,̫˵.";
		next;
		mes "[Ա]";
		mes "...";
		mes "......";
		mes "ûʲô˽ҵ.";
		mes "ǵĴ '' һͷ¹..";
		mes "װ˹ʲôӶܺ.";
		next;
		emotion e_omg;
		mes "[Ա]";
		mes "Ŷ...! ! Ǳߵ!";
		mes "--;ð?!";
		close;
	}
}

airplane_01,83,61,2	script	#01airplane_01	72,2,2,{
	mes "[]";
	mes "!";
	mes "ȥң";
	mes "ֻһͷֵ¹";
	mes "Ŷ˵˵ֲ...";
	close;

OnTouch:
	emotion e_sob;
	end;
}

airplane_01,69,63,2	script	#01airplane_01	55,{
	mes "[]";
	mes "ԤƵһ,";
	mes "ṩﶥҲǸǼ.";
	mes "** ĸðҵĳʦ,ҲſԺúһ.";
	close;
}

airplane_01,71,31,2	script	ʿʯ#air_01	106,{
	mes "[ʿʯ]";
	mes "ڵȴ֮...";
	mes "ӭҵĸ!";
	next;
	mes "[ʿʯ]";
	mes "ֻǲ֪ôȷûվ.";
	mes "Ǻܿ,ܿ,";
	mes "ҵĸҪʼ!";
	close;
}

//============================================================ 
//= Typing Challenge
//============================================================ 
airplane_01,32,61,4	script	˹#ein	49,1,1,{
	mes "[˹]";
	mes "ӭ";
	mes "^ff0000ɾ˵ Ϸ^000000.";
	mes "һѸٵ,ĴϷ?";
	next;
	switch (select("һ ^ff0000ɾ˵ Ϸ^000000:֪һЩϢ:ѯ߼¼:ȡ")) {
	case 1:
		mes "[˹]";
		mes "գӭµһλսߣ";
		mes "ٶЩĸɣҪŶ";
		mes "ʼ~!";
		setarray .@line1_1$[0],	"^3cbcbccallipygian salacius lascivious^000000",
					"^3cbcbcBy the power of^000000",
					"^0000ffthkelfkskeldmsiejdlslehfndkelsheidl^000000",
					"^3cbcbcburrdingdingdingdilidingdingdingphoohudaamb^000000",
					"^3cbcbcCoboman no chikara-yumei na^000000",
					"^3cbcbcI'm the king of All Weirdos! Now^000000",
					"^3cbcbcYou give me no choice. I guess it's^000000";
		setarray .@line1_2$[0],	"^3cbcbclicentious prurient concupiscent^000000",
					"^3cbcbcp-po-poi-po-poi-poin-poing^000000",
					"^3cbcbcskemd^000000",
					"^3cbcbcandoorabambarambambambambamburanbamding^000000",
					"^3cbcbcchikara-daiookii na chikara da ze!^000000",
					"^3cbcbcyou know of my true power. Obey~!^000000",
					"^3cbcbctime for me to reveal my secret...^000000";
		setarray .@line1_3$[0],	"",
					"^3cbcbcGOD-POING. I NEVER LOSE!^000000",
					"",
					"",
					"^3cbcbcCOBO ON^000000",
					"",
					"";
		setarray .@word1$[0],	"callipygian salacius lascivious licentious prurient concupiscent",
					"By the power of p-po-poi-po-poi-poin-poing GOD-POING. I NEVER LOSE!",
					"thkelfkskeldmsiejdlslehfndkelsheidlskemd",
					"burrdingdingdingdilidingdingdingphoohudaambandoorabambarambambambambamburanbamding",
					"Coboman no chikara-yumei na chikara-daiookii na chikara da ze! COBO ON",
					"I'm the king of All Weirdos! Now you know of my true power. Obey~!",
					"You give me no choice. I guess it's time for me to reveal my secret...";
		setarray .@line2_1$[0],	"^3cbcbcuNflAPPaBLe LoVaBLe SeCreTs AnD^000000",
					"^ff1493LiGhTsPeEd RiGhT SPEed LeFT TURn^000000",
					"^ff1493hfjdkeldjsieldjshfjdjeiskdlefvbd^000000",
					"^ff1493burapaphuralanderamduanbatuhiwooi^000000",
					"^ff1493belief love luck grimace sweat rush^000000",
					"^800080opeN, Open!op3n.openOpen0p3nOpEn0pen^000000",
					"^3cbcbcfReeDoM ecstAcy JoUrnaliSm ArMplt^000000";
		setarray .@line2_2$[0],	"^3cbcbcboWLIiNg aGaINST tHe KarMA of YoUtH^000000",
					"^ff1493RiGhT BuRn OrIGInAL GaNgSteR SmACk^000000",
					"",
					"^ff1493kabamturubamdingding^000000",
					"^ff1493folktale rodimus optimus bumblebee^000000",
					"^800080`open'0Pen open? open!111OPENSESAME^000000",
					"^3cbcbcDisCoverY hEaDaChE MoonbeAmS jUsTiCE^000000";
		setarray .@word2$[0],	"uNflAPPaBLe LoVaBLe SeCreTs AnD boWLIiNg aGaINST tHe KarMA of YoUtH",
					"LiGhTsPeEd RiGhT SPEed LeFT TURn RiGhT BuRn OrIGInAL GaNgSteR SmACk",
					"hfjdkeldjsieldjshfjdjeiskdlefvbd",
					"burapaphuralanderamduanbatuhiwooikabamturubamdingding",
					"belief love luck grimace sweat rush folktale rodimus optimus bumblebee",
					"opeN, Open!op3n.openOpen0p3nOpEn0pen`open'0Pen open? open!111OPENSESAME",
					"fReeDoM ecstAcy JoUrnaliSm ArMplt DisCoverY hEaDaChE MoonbeAmS jUsTiCE";
		setarray .@letters[0],	1300,
					1250,
					1180,
					1380,
					1740,
					1440,
					1450;
		set .@wordtest, rand(7);
		next;
		mes "[Nils]";
		mes .@line1_1$[.@wordtest];
		mes .@line1_2$[.@wordtest];
		mes .@line1_3$[.@wordtest];
		set .@start_time, gettime(3)*60*60 + gettime(2)*60 + gettime(1);
		next;
		input .@save1$;
		set .@end_time, gettime(3)*60*60 + gettime(2)*60 + gettime(1);
		set .@total_time, .@end_time - .@start_time;
		mes "[Nils]";
		mes .@line2_1$[.@wordtest];
		mes .@line2_2$[.@wordtest];
		set .@start_time, gettime(3)*60*60 + gettime(2)*60 + gettime(1);
		next;
		input .@save2$;
		set .@end_time, gettime(3)*60*60 + gettime(2)*60 + gettime(1);
		set .@total_time, .@total_time + (.@start_time - .@end_time);
		set .@tasoo, (.@letters[.@wordtest] / .@total_time) * 6;
		if ((.@save1$ == .@word1$[.@wordtest]) && (.@save2$ == .@word2$[.@wordtest])) {
			mes "[˹]";
			mes "ķ ^ff0000" + .@total_time + " ^000000 Ȼ";
			mes "һķ " + .@tasoo + ".";
			next;
			if (.@tasoo >= 1300) {
				mes "[˹]";
				mes "...";
				mes "...";
				mes "˵Ļôһ˸ճ.";
				mes "´ǵò.";
				close;
			}
			if (.@tasoo >= $050320_ein_typing) {
				mes "[˹]";
				mes "ǰһ¼";
				mes " ^0000ff" + $050320_minus1_typing$ + "^000000";
				mes "һ ^0000ff" + $050320_ein_typing + "^000000 .";
				mes ", ^ff0000" + strcharinfo(0) + "^000000,";
				mes "㴴ʷ¸ߣ";
				mes "ϲϲ!";
				set $050320_minus1_typing$, strcharinfo(0);
				set $050320_ein_typing, .@tasoo;
				close;
			}
			else {
				mes "[˹]";
				mes "^0000ff" + $050320_minus1_typing$ + "^000000";
				mes "ǵǰļ¼.";
				mes "һΪ ^0000ff" + $050320_ein_typing + "^000000";
				mes "ͣ´Ҫ~";
				close;
			}
		}
		else {
			mes "[˹]";
			mes "Ŷ...";
			mes "Ǹı...";
			close;
		}
	case 2:
		mes "[˹]";
		mes " ^ff0000ɾ˵Ϸ^000000";
		mes "һҪ㾡ĸϷ.";
		mes "¼ߵֽᱻеĺ֪.";
		mes "Ҫ?!";
		next;
		mes "[˹]";
		mes ",㿴ÿ֮,";
		mes "Ҫж,";
		mes "ԲҪENTER,OKͿ.";
		close;
	case 3:
		mes "[˹]";
		mes "^0000ff" + $050320_minus1_typing$ + "^000000";
		mes "ǵǰļ¼.";
		mes "ܷΪ ^0000ff" + $050320_ein_typing + "^000000";
		mes "ͣ´Ҫ~";
		close;
	case 4:
		mes "[˹]";
		mes ",,";
		mes "^ff0000ɾ˵Ϸ^000000";
		mes "ʲôʱ򶼿.~";
		close;
	}
}

//============================================================ 
//= Apple Gambling
//============================================================ 
airplane_01,33,68,4	script	˹	74,{
	mes "[˹]";
	mes ",ǿ˹~";
	mes "ҪⳡѺõϷЩƻע?";
	next;
	callfunc "applegamble","Clarice";
	end;
}

function	script	applegamble	{

	switch (select("Ĳ!:ô?:Ҫ!")) {
	case 3:
		mes "["+getarg(0)+"]";
		mes "ʲôʱ涼.";
		mes "Ҫһĳ嶯,";
		mes "Һ.";
		close;
	case 2:
		mes "["+getarg(0)+"]";
		mes "򳬼򵥵.";
		mes ",ע.";
		mes "һע50ƻ.";
		mes "ΪЩùĶĲϷһ,";
		mes "ֻƻ~";
		next;
		mes "["+getarg(0)+"]";
		mes "ҪƻĻ,";
		mes "ȥƼطͿ,ٶ԰~";
		next;
		mes "["+getarg(0)+"]";
		mes ",ҿʼͶ2.";
		mes "Ȼ,Ҳһ2D6.";
		mes "֮,Ƕѡ:ǷͶһ";
		next;
		mes "["+getarg(0)+"]";
		mes "Ķ...ע,Ҫ.";
		mes "Ͷ12,ôͱ,Ҳ.";
		mes "Ȼ,Ͷߵ˾Ӯ.û?";
		next;
		mes "["+getarg(0)+"]";
		mes ",ǷͶӰ.";
		mes "Ȼ,Ľ,һῴǷͶεıҪ.";
		next;
		mes "["+getarg(0)+"]";
		mes "Ӯ˵Ļ,õעƻ.";
		mes "ƽֵĻ,עƻͻᱻ黹.";
		mes "㹫ƽ,԰?.";
		close;
	case 1:
		break;
	}
	mes "["+getarg(0)+"]";
	mes "Ŷ,>-<Ү!";
	mes "ôҪעƻ?һ50.";
	mes "ҪȡĻ 0 Ϳ";
	next;
	while(1) {
		input .@amount;
		if (.@amount == 0) {
			mes "["+getarg(0)+"]";
			mes "Ŷ,?";
			mes ",ôϣʱһ.";
			close;
		}
		else if (.@amount < 1 || .@amount > 50) {
			mes "["+getarg(0)+"]";
			mes "³50ע!";
			mes "ǵעҪ,";
			mes "벻Ҫ볬50.";
			next;
			continue;
		}
		mes "["+getarg(0)+"]";
		mes "ô";
		mes "עƻĿΪ ^FF0000"+.@amount+"^000000 .";
		mes "ȷһ,Բ?";
		next;
		if (select(":...") == 2) {
			mes "["+getarg(0)+"]";
			mes ",??";
			mes "ô,ҪעĿ.";
			mes "ҪȡĻ 0 Ϳ.";
			next;
			continue;
		}
		if (countitem(512) <.@amount) {
			mes "Ǹ,...ƻûŶ.";
			mes "עôԶĲ,԰?";
			next;
			continue;
		}
		delitem 512,.@amount;
		mes "["+getarg(0)+"]";
		mes "Ү!!";
		mes "ڿԿʼϷ!";
		mes ",Ͷ~";
		break;
	}
	mes "^3355FF*Rolling and rumbling*^000000";
	next;
	set .@giveapple, .@amount*2;
	set .@table1, rand(1,6);
	set .@table2, rand(1,6);
	set .@tablesub, .@table1 + .@table2;
	set .@tabletotal, .@tablesub;
	mes "["+getarg(0)+"]";
	mes " ^0000FF" + .@table1 + "^000000  ^0000FF" + .@table2 + "^000000.";
	mes "һ ^0000FF" + .@tablesub + "^000000.";
	mes "^FF0000" + strcharinfo(0) + "^000000, .";
	next;
	select("ۣܲͶӣ");
	mes "^3355FF*Rolling and rumbling*^000000";
	set .@player1, rand(1,6);
	set .@player2, rand(1,6);
	set .@playersub, .@player1 + .@player2;
	if (.@playersub > 9 && .@amount > 39) {
		set .@player1, rand(1,6);
		set .@player2, rand(1,6);
		set .@playersub, .@player1 + .@player2;
	}
	set .@playertotal, .@playersub;
	next;
	mes "["+getarg(0)+"]";
	mes "^FF0000" + strcharinfo(0) + "^000000,  ^FF0000" + .@player1 + "^000000  ^FF0000" + .@player2 + "^000000. һ ^FF0000" + .@playersub + "^000000 .";
	next;
	mes "["+getarg(0)+"]";
	if(.@playersub == .@tablesub) {
		mes "ҵ ^0000FF" + .@tablesub + "^000000 Ȼ ^FF0000" + strcharinfo(0) + "^000000,  ^FF0000" + .@playersub + "^000000. ƽ. һ?";
	} else if (.@playersub > .@tablesub) {
		mes "ҵ ^0000FF" + .@tablesub + "^000000 Ȼ ^FF0000" + strcharinfo(0) + "^000000,  ^FF0000" + .@playersub + "^000000. ^FF0000" + strcharinfo(0) + "^000000, Ӯ. һ?";
	} else if(.@tablesub > .@playersub) {
		mes "ҵ ^0000FF" + .@tablesub + "^000000 Ȼ ^FF0000" + strcharinfo(0) + "^000000,  ^FF0000" + .@playersub + "^000000. Ӯ. һ?";
	}
	next;
	switch (select("Ͷ.:ȡ.")) {
	case 1:
		mes "^3355FF*Rolling and rumbling*^000000";
		set .@player3, rand(1,6);
		set .@playertotal, .@playertotal + .@player3;
		next;
		mes "["+getarg(0)+"]";
		if (.@playertotal > 12) {
			mes "^FF0000" + strcharinfo(0) + "^000000, õ ^FF0000" + .@player3 + "^000000 ڵ ^FF0000" + .@playertotal + "^000000. 俩. Ǹ...һΰ~ò~";
			close;
		}
		else if (.@playertotal < .@tablesub) {
			mes "^FF0000" + strcharinfo(0) + "^000000,  ^FF0000" + .@player3 + "^000000  ^FF0000" + .@playertotal + "^000000. ȻͶ˵ΣǱҵ...ҲûͶεıҪ,...˼.";
			close;
		}
		else if (.@playertotal == .@tablesub) {
			if (.@tablesub > 8) {
				mes "^FF0000" + strcharinfo(0) + "^000000,  ^FF0000" + .@player3 + "^000000  ^FF0000" + .@playertotal + "^000000. Ҳðʲô...ƽְ. һκð~";
				close2;
				getitem 512,.@amount; //Apple
				end;
			}
		}
		else {
			mes "^FF0000" + strcharinfo(0) + "^000000,  ^FF0000" + .@player3 + "^000000  ^FF0000" + .@playertotal + "^000000. .";
		}
		break;
	case 2:
		mes "["+getarg(0)+"]";
		if (.@playersub > .@tablesub) {
			mes "ҿ㲻ðհ.ôҾͶһӰ.";
		}
		else if (.@playersub == .@tablesub) {
			if (.@tablesub > 8) {
				mes "ҿ㲻ðհ.Ҳ,ô,ƽ. ´һ~";
				close2;
				getitem 512,.@amount; //Apple
				end;
			}
			mes "ð.";
			mes "Ͷһ.";
		}
		else {
			mes "ʱԵĻرܷ...Ӯ..";
			mes ",İ,»һ..";
			close;
		}
		break;
	}
	next;
	mes "^3355FF*Rolling and rumbling*^000000";
	set .@table3, rand(1,6);
	set .@tabletotal, .@tabletotal + .@table3;
	next;
	mes "["+getarg(0)+"]";
	if (.@tabletotal > 12) {
		mes " ^0000FF" + .@table3 + "^000000 ڵΪ ^0000FF" + .@tabletotal + "^000000. ,Ϊҵ12. ô,ҵƻ㿩.Ŷ~ֺ˼.";
		close2;
		getitem 512,.@giveapple; //Apple
		end;
	}
	else if (.@playertotal > .@tabletotal) {
		mes "ҵõ ^0000FF" + .@table3 + "^000000 ڵΪ ^0000FF" + .@tabletotal + "^000000. һ ^FF0000" + .@playertotal + "^000000 ,,Ӯ, ^FF0000" + strcharinfo(0) + "^000000. ҵƻ.,Ȥ,һΰ.";
		close2;
		getitem 512,.@giveapple; //Apple
		end;
	}
	else if (.@playertotal == .@tabletotal) {
		mes "ҵõ ^0000FF" + .@table3 + "^000000 ڵ ^0000FF" + .@tabletotal + "^000000. һ ^FF0000" + .@playertotal + "^000000 ôǴƽ, ^FF0000" + strcharinfo(0) + "^000000. ,Ӻƻ!´һ~Ǻڴ~.";
		close2;
		getitem 512,.@amount; //Apple
		end;
	}
	else if (.@playertotal < .@tabletotal) {
		mes "Ŷ, ^0000FF" + .@table3 + "^000000 Ϊ ^0000FF" + .@tabletotal + "^000000.  ^FF0000" + .@playertotal + "^000000 ,Ŷ,, ^FF0000" + strcharinfo(0) + "^000000. Ǹ...һҲкܷĻر.";
		close;
	}
}
