//==============================================
// edit by  2005-7-21
// NXg&ץ by FPE (2006.6.27)
// Jathena++ ׾¡Ghttp://www.foxofice.net/bbs
//----------------------------------------------

function	script	airportIn	{
	mes "[ ¾]";
	mes "AnܡAڭ̯HɴѵUȫKSξAȦAȡA|ɨүAݧAݭnܡH";
	next;
	if(getarg(0)==1)
	{
		menu	"ڭniJ",A01,
			"",-;

		mes "[ A]";
		mes "ЧAUAQΧaA¥{";
		close;
		end;

A01:
		mes "[ ¾]";
		mes "QέŸOά1200ApGA渥KOfܡANKOiJAаݱzniJܡH";
		next;
		switch(select("O","n"))
		{
		case 1:	
			if(countitem(7311)<1)
			{
				if(zeny<1200)
				{
					mes "[ ¾]";
					mes "бaW{";
					close;
					end;
				}
				set zeny,zeny-1200;
				warp "airport.gat",142,49;
				end;
			}
			delitem 7311,1;
			warp "airport.gat",142,49;
			end;
			break;
		case 2:
			mes "[ A]";
			mes "ЧAUAQΧaA¥{";
			close;
			end;
			break;
		}
	}

	if(getarg(0)==2)
	{
		mes "[ ¾]";
		mes "pGAnq}SQiӪܡAnb@OγAаݱzn}ܡH";
		next;
		switch(select("O","n"))
		{
		case 1:
			warp "airport.gat",143,42;
			close;
			end;
			break;
		case 2:
			mes "[ A]";
			mes "ЧAUAQΧa,¥{";
			close;
			end;
			break;
		}
	}
}

airport.gat,158,43,4	script	 A	90,{ callfunc "airportIn",1; }						
airport.gat,144,43,4	script	 A	90,{ callfunc "airportIn",1; }
airport.gat,130,43,4	script	 A	90,{ callfunc "airportIn",1; }
airport.gat,158,50,4	script	 A	90,{ callfunc "airportIn",2; }
airport.gat,144,50,4	script	 A	90,{ callfunc "airportIn",2; }
airport.gat,130,50,4	script	 A	90,{ callfunc "airportIn",2; }

airport.gat,143,62,0	warp	einairport01	3,2,einbroch.gat,64,242
einbroch.gat,64,234,0	warp	einairport02	3,2,airport.gat,142,55
einbroch.gat,92,280,0	warp	einairport03	2,3,airplane.gat,227,60

airplane.gat,243,29,0	script	rand_Airplane_1	45,2,3,{
	if($@airwarp==1) warp "einbroch",92,276;
	if($@airwarp==0) warp "yuno",157,168;
	end;
}

airplane.gat,243,74,0	script	rand_Airplane_2	45,2,3,{
	if($@airwarp==1) warp "einbroch",92,276;
	if($@airwarp==0) warp "yuno",157,168;
	end;
}

airplane.gat,101,65,1	script	airplane	-1,{
	end;
OnInit:
	initnpctimer;
	end;
OnTimer15000:
	switch($@airplane)
	{
	case 0:
		mapannounce "airplane.gat","ڭ̥ثeabաA@UYNXoo",16;
		set $@airplane,$@airplane+1;
		break;
	case 1:
		mapannounce "airplane.gat","ŸYN_AU@ӥتO㭵ùJ",16;
		set $@airplane,$@airplane+1;
		break;
	case 2:
		mapannounce "airplane.gat","ثeŸb㭵ùJ~",16;
		mapannounce "yuno.gat","ŸAЭnfŸȵݤUZŸ",16;
		set $@airwarp,2;
		disablenpc "rand_Airplane_1";
		disablenpc "rand_Airplane_2";
		set $@airplane,$@airplane+1;
		break;
	case 3:
		mapannounce "airplane.gat","@UNnb㭵ùJ",16;
		set $@airplane,$@airplane+1;
		break;
	case 4:
		mapannounce "airplane.gat","ڭ̤wgF㭵ùJFAUȫȦA|F",16;
		mapannounce "einbroch.gat","ŸFAЭnfŸȧɶnWŸ",16;
		set $@airwarp,1;
		enablenpc "einplane";
		enablenpc "rand_Airplane_1";
		enablenpc "rand_Airplane_2";
		set $@airplane,$@airplane+1;
		break;
	case 5:
		mapannounce "airplane.gat","ڭ̥ثeab㭵ùJA@UYNXoo",16;
		set $@airplane,$@airplane+1;
		break;
	case 6:
		mapannounce "airplane.gat","ŸYN_AU@ӥتO",16;
		set $@airplane,$@airplane+1;
		break;
	case 7:
		mapannounce "airplane.gat","ثeŸbճ~",16;
		mapannounce "einbroch.gat","ŸAЭnfŸȵݤUZŸ",16;
		set $@airwarp,2;
		disablenpc "rand_Airplane_1";
		disablenpc "rand_Airplane_2";
		disablenpc "einplane";
		set $@airplane,$@airplane+1;
		break;
	case 8:
		mapannounce "airplane.gat","@UNnb",16;
		set $@airplane,$@airplane+1;
		break;
	case 9:
		mapannounce "airplane.gat","ڭ̤wgFդFAUȫȦA|F",16;
		mapannounce "yuno.gat","ŸFAЭnfŸȧɶnWŸ",16;
		set $@airwarp,0;
		enablenpc "rand_Airplane_1";
		enablenpc "rand_Airplane_2";
		set $@airplane,0;
		break;
	}
	setnpctimer 0;
	end;
}

airplane.gat,100,69,4	script	խ	852,{
	mes "[խ]";
	mes "pGAnbŸUӪܡAЧQΨWhӱAP§AfŸ,";
	mes "AӴr֪@ѡI";
	close;
	end;
}

yuno.gat,141,175,4	script	Ÿ ¾	88,{
	mes "[Ÿ ¾]";
	mes "AnAڭ̯HɴѵUȫKSξAȦAȡA|ɨүAݧAݭnܡH";
	next;
	if($@airwarp==0)
	{
		menu	"ڭnfŸ",A01,
			"",-;

		mes "[Ÿ ¾]";
		mes "бzUAQΧaA¥{";
		close;
		end;
	A01:
			mes "[Ÿ ¾]";
			mes "QέŸOά1200ApGA渥KOfܡANKOfAAufŸ~F'^FF0000㭵ùJ^000000'аݱznfŸܡH";
			next;
			switch(select("O","n"))
			{
			case 1:	
				if(countitem(7311)<1)
				{
					if(zeny<1200)
					{
						mes "[Ÿ ¾]";
						mes "бaW{";
						close;
						end;
					}
					set zeny,zeny-1200;
					warp "airplane.gat",227,60;
					end;
				}
				delitem 7311,1;
				warp "airplane.gat",227,60;
				end;
				break;
			case 2:
				mes "[Ÿ ¾]";
				mes "бzUAQΧaA¥{";
				close;
				end;
				break;
			}
	}
	else
	{
		mes "[Ÿ ¾]";
		mes "ثeŸabAеy";
		close;
		end;
	}
}

airplane.gat,50,67,4	script	NO	86,{
	mes "[NO]";
	mes "w{Aڳo̦csAīGMcīGĪAȳ~";
	next;
	menu	"ڭnʶRīG",A01,
		"ڭnīGcīG",A02,
		"AǪӪīGӤH",A03,
		"",-;

	mes "[NO]";
	mes "wzUAӡAo~";
	close;
	end;

A01:
	mes "[NO]";
	mes "пJnʶRīGƶqAīGC15A@̦hR500AYnʶRɽпJ0";
A01_1:
	next;
	input @temp;
	if(@temp==0)
	{
		mes "[NO]";
		mes "wzUAӡAo~";
		close;
		end;
	}
	if(@temp<0 || @temp>500)
	{
		mes "[NO]";
		mes "AJƶqTAЭsJ";
		goto A01_1;
	}
	set @zenytemp,@temp*15;
	mes "[NO]";
	mes "AnʶRīGƶqO^FF0000"+@temp+"^000000oAݭnIBO ^FF0000"+@zenytemp+"^000000 AATwnʶRܡH";
	next;
	switch(select("n","n"))
	{
	case 1:
		if(zeny<@zenytemp)
		{
			mes "[NO]";
			mes "AW";
			close;
			end;
		}
		if((Weight+(@temp*20))>MaxWeight)
		{
			mes "[NO]";
			mes "At";
			close;
			end;
		}
		set zeny,zeny-@zenytemp;
		getitem 512,@temp;
		mes "[NO]";
		mes "§AApGAٻݭnīGܡAwzA";
		close;
		end;
		break;
	case 2:
		mes "[NO]";
		mes "wzUAӡAo~";
		close;
		end;
		break;
	}

A02:
	mes "[NO]";
	mes "īGĻݭn";
	mes "^FF0000īG3MŲ~@^000000AЧAoǧƥ浹ڴNs@FAаݱzncīGĶܡH";
	next;
	switch(select("O","n"))
	{
	case 1:
		if(countitem(512)<3 || countitem(713)<1)
		{
			mes "[NO]";
			mes "AҾ֦ƦnOAڦAiDA@MaAݭn^FF0000īG3MŲ~1^000000AЧAoǧƥ浹ڴNs@FAƥHAӧڧa";
			close;
			end;
		}
		delitem 512,3;
		delitem 713,1;
		mes "[NO]";
		mes "§AApGAٻݭnīGĪܡAwzA";
		close;
		end;
		break;
	case 2:
		mes "[NO]";
		mes "wzUAӡAo~";
		close;
		end;
		break;
	}

A03:
	mes "[NO]";
	mes "ڥӬOӥ|Bn^A즳@Ѻۦb𩳤UήɡAMӪF豼YW";
	next;
	mes "[NO]";
	mes "~@ݡAӥ_ڹڨPOīGAںıaNOīG";
	next;
	mes "[NO]";
	mes "ڧڨ{ljFAQnYīGɡA@bŸƾy֥ͻƽЧAHڥs쭸ŸhA}F@UŸɡAo{FHīG`YlC";
	next;
	mes "[NO]";
	mes "ڤ߷QL᪺AU@BFOAҥHN~UӪīGF@AQ쨺ѤӦnFAڪīG12AA24ANo˶VĹVhF";
	next;
	mes "[NO]";
	mes "̫ᤵѧڴNDܦFīGӤHFAGƦIܡH";
	mes "SQ쨺ѤѤWUӪīGAoܤFڪRBA藍_ڻܤӪF";
	next;
	mes "[NO]";
	mes "īGqdnhY@IAާAߤwAnhīGڡAťiȪaϪ̵LīGܡAL|ˤ@TˤlAiīGOnBhhG";
	close;
	end;
}

airplane.gat,47,61,2	script	խ	833,{
	mes "[ͦ] ƨC]";
	mes "An";
	mes "ڬOo[ŸխAڥs ͦ] ƨCǡA";
	mes "[JfŸ󤣫KBɡAЦVڤa";
	next;
	switch(select("߰ݦŸƱ","ڭnd"))
	{
	case 1:
		mes "[ͦ] ƨC]";
		mes "аݧAO,Ĥ@fŸܡH";
		mes "..";
		mes "]OAQ_ڲĤ@fŸɡA";
		mes "]D`iOAS";
		next;
		mes "[ͦ] ƨC]";
		mes "iDAoӰa";
		mes "gF@}ʪoi";
		next;
		mes "[ͦ] ƨC]";
		mes "ťAc--̼w[ꪺʩm,";
		mes "L̷|IiUطs_]k";
		mes "յ۩MӪFͬܿĬO";
		next;
		mes "[ͦ] ƨC]";
		mes "ڭ̨qvow@M";
		mes "֦\hǪ̭";
		mes "ǥ'֪H',";
		mes "syXѪŪ,";
		mes "åiHCUӧF";
		next;
		mes "[ͦ] ƨC]";
		mes "ѪŸkMqvow";
		mes "㦳NǤOۻ]ƤF";
		next;
		menu	"аݬɭŸH~quܡH",-;
		mes "[ͦ] ƨC]";
		mes "oӹ";
		mes "㭵M㭵ùJp,";
		mes "~AuaAdA";
		mes "jLFCI";
		close;
		end;
		break;
	case 2:
		mes "[ͦ] ƨC]";
		mes "QdܡAв{bdA";
		mes "YndܽпJ'0'";
		next;
		input @temp$;
		if(@temp$=="0")
		{
			mes "[ͦ] ƨC]";
			mes "ݭndܦAӧڧa";
			close;
			end;
		}
		mes "["+strcharinfo(0)+"]";
		mes @temp$;
		next;
		mes "[ͦ] ƨC]";
		mes ".. OܡAکդFA";
		mes "ڷ|WϬM";
		close;
		end;
	}
}

airplane.gat,31,77,5	script	ܾKkl	853,{
	mes "[ܾK kl]";
	mes "nAn...";
	mes "ڳo@wnܺ}GA";
	mes "oīGj^..!!";
	next;
	mes "[ܾK kl]";
	mes "aI^0000ff֪Ŧ^000000!!բ!!!!!";
	next;
	mes "["+strcharinfo(0)+"]";
	mes "'HL~bFH";
	mes "~O...";
	next;
	mes "-";
	mes "SS...uuuu..lbu..";
	mes "!-";
	next;
	mes "[ͦ]";
	mes "oXӪlI`@O^FF000011^000000,";
	mes "ȤHO ^FF00005^000000";
	mes "O,ȤHzF,ܥizUAӬDԧa,A~?";
	next;
	mes "[ܾK kl]";
	mes "@@@@@@@!!!!!!!";
	mes "ثzڰڰڰڰ!!!!!!!!!";
	next;
	mes "-klݰ_ӫܿĪˤl-";
	close;
	end;
}

airplane.gat,32,68,5	script	ͦ	73,{
	mes "[ͦ]";
	mes "znܡAڪWrsͦAz@ݦbŸPLaAznnڻP@YlCڡH";
	next;
	menu	"ڭn@YlC",L_Game,
		"ڷQAYlCWh",L_rule,
		"",-;

	mes "[ͦ]";
	mes "pGzQCܽHɨӧڧaAڦbo̵ob]ZL᪺AAo";
	close;
	end;

L_Game:
	mes "[ͦ]";
	mes "бzJznU`ƶq";
L_input:
	next;
	input @tempapple_N;

	if(@tempapple_N==0)
	{
		mes "[ͦ]";
		mes "bŸL᪺ɭԨӧڳ~";
		close;
		end;
	}

	if(@tempapple_N>50 || @tempapple_N<0)
	{
		mes "[ͦ]";
		mes "zҿJ`ƶqӦhAڤMAFAбzsJ";
		goto L_input;
	}

	if(@tempapple_N>countitem(512))
	{
		mes "[ͦ]";
		mes "zҾ֦īGƶqnOAЧAsJ";
		goto L_input;
	}

	mes "[ͦ]";
	mes "zҿJ`ƶqO ^ff0000"+@tempapple_N+"^000000 OAܡH";
	next;
	menu	"O",L_GameStart,
		"O",L_reinput;

L_GameStart:
	//----------------C}l--------------------------------------------------------
	mes "[ͦ]";
	mes "naAڭ̴N}lCoAѧڨӥYl";
	delitem 512,@tempapple_N;
	next;
	mes "^bbbbbbСгͦYXlС^000000";
	mes "SS... BNBN...";
	next;
	//NPCYXӪlIƭp
	set @NPC_point1,rand(1,6);
	set @NPC_point2,rand(1,6);
	set @NPC_pointall,@NPC_point1+@NPC_point2;

	mes "[ͦ]";
	mes "YXӪlIƬO ^ff0000"+@NPC_point1+","+@NPC_point2+"^000000IAXpO ^ff0000"+@NPC_pointall+"^000000IAo ^ff0000"+strcharinfo(0)+"^000000/pjYlo";
	next;
	menu	"YXl",-;

	//aYXӪlIƭp
	set @My_point1,rand(1,6);
	set @My_point2,rand(1,6);
	set @My_pointall,@My_point1+@My_point2;

	mes "^bbbbbbС"+strcharinfo(0)+"YXlС^000000";
	mes "SS... BNBN...u";
	next;
	mes "[ͦ]";
	mes "^ff0000"+strcharinfo(0)+"^000000/pjzYXӪlIƬO";
	mes "^ff0000"+@My_point1+","+@My_point2+"^000000IAXpO^ff0000"+@My_pointall+"^000000I";
	next;

	//P_O_YĤT
	//1.pGNPCIƤj󪱮aI6I,hYAa
	if(@NPC_pointall>(@My_pointall+6))
	{
		mes "[ͦ]";
		mes "ܿѡA^ff0000"+strcharinfo(0)+"^000000/pjA{bڪIƤzhܦhAYϧAnYĤTl]WLڪIơAҥHoOڳӤFAwAUAӪ";
		close;
		end;
	}

	//2.pGNPCIƤj󵥩󪱮aI,h߰ݪaO_~
	if(@NPC_pointall>=@My_pointall)
	{
		mes "[ͦ]";
		if(@NPC_pointall>@My_pointall) mes "^ff0000"+strcharinfo(0)+"^000000/pjA{bڪIƤzhAAnYĤTlܡH";
		if(@NPC_pointall==@My_pointall) mes "^ff0000"+strcharinfo(0)+"^000000/pjA{bڭ̪IƬۦPAAnYĤTlܡH";
		next;
		if(@NPC_pointall>@My_pointall)
		{
			menu	"nAڷi@i",L_Next,
				"٬OFAڻ{F",L_My_lost;
		}
		if(@NPC_pointall==@My_pointall)
		{
			menu	"nAڷi@i",L_Next,
				"٬OFAڤYF",L_NPC_Choose;
		}
L_Next:
		set @My_point3,rand(1,6);
		set @My_pointall,@My_pointall+@My_point3;
		mes "^bbbbbbС"+strcharinfo(0)+"YXĤTlС^000000";
		mes "SS... BNBN...u...";
		next;
		mes "[ͦ]";
		mes "^ff0000"+strcharinfo(0)+"^000000/pjAozYXӪlIƬO ^ff0000"+@My_point3+"I^000000";
		mes "XpO ^ff0000"+@My_pointall+"I^000000.";
		if(@My_pointall>12)       
		{
			mes "WLF ^0000ff12I^000000AҥHoOĹFAwAUAӪ";
			close;
			end;
		}
		goto L_NPC_Choose;
L_My_lost:
		mes "[ͦ]";
		mes "^ff0000"+strcharinfo(0)+"^000000/pjAoOĹFAwAUAӪ";
		close;
		end;
	}

//NPCۦP_
L_NPC_Choose:

	//3.pGNPCIƤp󪱮aI6I,hNPC{
	if((@NPC_pointall+6)<@My_pointall) goto L_NPC_lost;

	//4.pGawgYĤTBNPCj󪱮aIơAhNPC
	if(@NPC_pointall>@My_pointall && @My_point3>0)
	{
		mes "ܿѡA^ff0000"+strcharinfo(0)+"^000000/pjA{bڪI٬OzhAwAUAӪ";
		close;
		end;
	}

	//5.NPCp󵥩󪱮aIơABSYĤTAhYĤTA_h{C
	if(@NPC_pointall<=@My_pointall)
	{
		if(@NPC_point3>0) goto L_NPC_lost;
		if(@NPC_pointall==12 && @My_pointall==12) goto L_nowinner;
		if(@My_point3>0)
		{
			mes "{bYlo";
			next;
		}
		set @NPC_point3,rand(1,6);
		set @NPC_pointall,@NPC_pointall+@NPC_point3;
		mes "^bbbbbbСгͦYXĤTlС^000000";
		mes "SS... BNBN...u";
		next;
		mes "[ͦ]";
		mes "oYXӪlIƬO ^0000ff"+@NPC_point3+"I^000000";
		mes "XpO ^0000ff"+@NPC_pointall+"I^000000";

		//NPCYĤTWLIAaӡC
		if(@NPC_pointall>12)       
		{
			mes "WLF ^0000ff12I^000000A ^ff0000"+strcharinfo(0)+"^000000/pj ĹFAߵAīGAڭ̤UA@a";
			getitem 512,(@tempapple_N*2);
			close;
			end;
		}
		else if(@NPC_pointall<@My_pointall)
		{	//NPCYĤTᤣWLIAP_Ӥ
			mes "oѦXpO ^ff0000"+@My_pointall+"I^000000 ^ff0000"+strcharinfo(0)+"^000000/pj ĹFAߵAīGAڭ̤UA@a";
			getitem 512,(@tempapple_N*2);
			close;
			end;
		}
		else if(@My_point3==0)
		{	//pGa٨SYĤTha
			if(@NPC_pointall>@My_pointall) mes "^ff0000"+strcharinfo(0)+"^000000/pjA{bڪIƤzhAAnYĤTlܡH";
			if(@NPC_pointall==@My_pointall) mes "^ff0000"+strcharinfo(0)+"^000000/pjA{bڭ̪IƬۦPAAnYĤTlܡH";
			next;
			menu	"nAڷi@i",L_Next,
				"٬OFAڻ{F",L_My_lost;
		}
		else
		{
			if(@NPC_pointall==@My_pointall)
			{
L_nowinner:
				mes "^ff0000"+strcharinfo(0)+"^000000/pjA{bڭ̪IƬۦPAMAAiH^AU`";
				getitem 512,@tempapple_N;
				close;
				end;
			}
			mes "AAZu ^ff0000"+@My_pointall+"I^000000AҥHOĹFAwAUAӪ";
			close;
			end;
		}
	}

L_NPC_lost:
	if(@My_point3>0) next;
	mes "[ͦ]";
	mes "ڻ{FA^ff0000"+strcharinfo(0)+"^000000/pjĹFAߵAīGAڭ̤UA@a";
	getitem 512,(@tempapple_N*2);
	close;
	end;
//----------------C--------------------------------------------------------

L_reinput:
	mes "[ͦ]";
	mes "бzsJ";
	goto L_input;

//----------------Cѻ--------------------------------------------------------
L_rule:
	mes "[ͦ]";
	mes "{bڨYlCWhA²A}lCɡAiHU`̦h^ff0000 50^000000 īGAMpGSīGNѥ[CF";
	next;
	mes "[ͦ]";
	mes "īGU`AUY⦸lAYXӪXpIƤj@ӡAMpGC@wsNӦnAҥHUA@]ĤT^Yl|";
	next;
	mes "[ͦ]";
	mes "nnAYlOӤHۥѡAL@AY@lAIƭYWL^ff000012^000000IɡAѶWL@謰a";
	next;
	mes "[ͦ]";
	mes "zYĤTlɡAѧAYApGYXӪIƶWL12IAYϧڤAYA]OѧڥD";
	next;
	mes "[ͦ]";
	mes "bCӪ@AiH֦Ĥ@ҤU`īGƶqAڳo˻wgܲMFa";
	close;
	end;
}