alb_ship,172,176,3	script	Marcus	4_M_REINDEER,{
	mes "[Retired Captain]";
	if(#ACH_Quest == 1){
		mes "Go look for Captain Adam at the Izlude Airship.";
	}else if(#ACH_Quest >= 2 && #ACH_Quest <= 4){
		mes "Go back to the Airship and do your job. I will not let you take my treasure with that kind of attitude.";
	}else if(#ACH_Quest == 5){
		mes "You're back... Seems like I have to give you the final test.";
		next;
		mes "[Retired Captain]";
		mes "Okay lets start by bringing me this items.";
		for( set .@i, 0; .@i < (getarraysize(.item)); set .@i,.@i+3 ){
			mes ""+((.item[.@i+2] >= 1)?"+"+.item[.@i+2]+" ":"")+"^FF0000"+getitemname(.item[.@i])+"^000000"+((getiteminfo(.item[.@i],10) >= 1)?"["+getiteminfo(.item[.@i],10)+"]":"")+"	 x "+.item[.@i+1]+"";
		}
		set #ACH_Quest,6;
		close;
	}else if(#ACH_Quest == 6){
		mes "I told you to bring this items. Before I can give you my treasure.";
		for( set .@i, 0; .@i < (getarraysize(.item)); set .@i,.@i+3 ){
			mes ""+((.item[.@i+2] >= 1)?"+"+.item[.@i+2]+" ":"")+"^FF0000"+getitemname(.item[.@i])+"^000000"+((getiteminfo(.item[.@i],10) >= 1)?"["+getiteminfo(.item[.@i],10)+"]":"")+"	 x "+.item[.@i+1]+"";
		}
		next;
		select("I have it all together.","Still not complete.");
			if(@menu == 2){
			mes "[Retired Captain]";
			mes "Don't talk to me unless you complete it all.";
			}else if(countitem2(.item[0],1,.item[2],0,0,0,0,0) < .item[1] || countitem2(.item[3],1,.item[5],0,0,0,0,0) < .item[4] || countitem2(.item[6],1,.item[7],0,0,0,0,0) < .item[8]){
				mes "[Retired Captain]";
				mes "Some of the items I need are incomplete.";
			}else{
				mes "[Retired Captain]";
				mes "Congratulations! you've been a good captain apprentice. It's time for you to be promoted.";
				next;
				specialeffect 101;
				sleep2 2000;
				specialeffect 101;
				sleep2 2000;
				specialeffect 101;
				delitem .item[0],.item[1];
				delitem .item[3],.item[4];
				delitem2 .item[6],.item[7],1,.item[8],0,0,0,0,0,getcharid(3);
				getitem 5359,1;
				set #ACH_Quest,7;
				close;
			}	

		close;
	}else if(#ACH_Quest >= 7){
			mes "Congratulations! Captain "+strcharinfo(0)+". I hope you enjoy my treasure.";
			close;
	}else{
		mes "Hey, this is a restricted area. Why are you here? Answer me straight or I will kill you.";
		next;
		select("I'm looking for someone.","I was just passing by.");
		if(@menu == 2){
			atcommand "@die";
			mes "[Retired Captain]";
			mes "I don't what people wandering around.";
			close;
		}
		mes "[Retired Captain]";
		mes "Tell me who is it?";
		next;
		select("He knows about Captains Treasure.","I forgot.");
		if(@menu == 2){
			atcommand "@die";
			mes "[Retired Captain]";
			mes "Drink your medicine.";
			close;
		}
		mes "[Retired Captain]";
		mes "Looks like I'm the one you are looking for. Oh dear, I've been waiting for 20 years. Are you ready for the tasks?";
		next;
		select("I'm ready.","Not yet.");
		if(@menu == 2){
			atcommand "@die";
			mes "[Retired Captain]";
			mes "Leave this place, you just wasting my time.";
			close;
		}
		mes "[Retired Captain]";
		mes "Go look for Adam at the Izlude Airship. Tell him that I sent you.";
		set #ACH_Quest,1;
	}
	close;
OnInit:
	setarray .item[0],2226,1,7,2284,1,0,975,10,0;
end;
}



airplane_01,47,60,5	script	 Adam	4_MAL_CAPTAIN,{
	mes "[Adam]";
	if(#ACH_Quest == 4 && countitem(7628) >= 1){
		mes "What brought you here. I thought you're with Gray.";
		next;
		select("To give you the Master Key.");
		if(@menu == 1){
			mes "A Master Key? I've been search for it. Thank you "+strcharinfo(0)+", Marcus is waiting for you now at Alberta.";
			delitem 7628,1;
			set #ACH_Quest,5;
		}
		close;
	}else if(#ACH_Quest == 1){
		mes "Looks like you are here for the job.";
		next;
		mes "[Adam]";
		mes "Find Gray on this Airship and he will tell you what to do.";
		set #ACH_Quest,2;
	}else if(#ACH_Quest == 2){
		mes "I'm busy, Gray is waiting for you. Go find him on this Airship.";
	}else{
		mes "Please talk to other staff. I'm busy right here.";
	}
	close;
}


airplane_01,93,201,5	script	Engineer	4_M_TUFFOLD,{
	if(#eng_complete){
		mes "[Engineer Gray]";
		mes ""+strcharinfo(0)+", oh your back. nice to see you again. I hope we can work together here.";
		close;
	}else if(#ACH_Quest == 4){
		mes "[Engineer Gray]";
		mes "Don't forget to bring that master key to Adam.";
		close;
	}else if(#clean >= 6 && #repair >= 6){
		mes "[Engineer Gray]";
		mes "Good job, "+strcharinfo(0)+".";
		mes "I hope we can work together.";
		next;
		mes "[Engineer Gray]";
		mes "Ohh I forgot. Can you please give this key to Adam. He dropped this and I forgot to give it back.";
		getitem 7628,1;
		set #eng_complete,1;
		set #clean,0;
		set #repair,0;
		set #ACH_Quest,4;
		close;
	}else if(#ACH_Quest == 2){
		mes "[Engineer Gray]";
		mes "I feel sick today.. Can you clean and repair those cannons for me.";
		next;
		mes "[Engineer Gray]";
		mes "Be sure that you will do your job.";
		
		set #ACH_Quest,3;
		
	}else if(#ACH_Quest == 3 && #clean >= 1 && #repair > 1){
		mes "[Engineer Gray]";
		mes "Having a problem?";
		mes "Do you want me to reset all those cannon?";
		next;
		select("Yes","No");
		if(@menu == 1){
			specialeffect 101;
			// Cannon 1 Reset
			set #cannon_1,0;set #cannon_2,0;
			// Cannon 2 Reset
			set #cannon_3,0;set #cannon_4,0;
			// Cannon 3 Reset
			set #cannon_5,0;set #cannon_6,0;
			// Cannon 4 Reset
			set #cannon_7,0;set #cannon_8,0;
			// Cannon 5 Reset
			set #cannon_9,0;set #cannon_10,0;
			// Cannon 6 Reset
			set #cannon_11,0;set #cannon_12,0;
			// Clean
			set #clean,0;
			// Repair
			set #repair,0;
		}else{
			mes "[Engineer Gray]";
			mes "Okay, do it by yourself.";
		}
	}else if(#ACH_Quest == 3){
		mes "[Engineer Gray]";
		mes "I told you to clean and repair those cannons.";
	}
	close;

}

airplane_01,91,206,4	script	Cannon#1	CLEAR_NPC,{
	if(!#ACH_Quest){end;}
	if(#ACH_Quest == 3){
		mes "[Cannon]";
		mes "........";
		next;
		switch(select(""+((#cannon_1 == 1)?"[^FF0000Complete^000000] Clean":"Clean")+"",""+((#cannon_2 == 1)?"[^FF0000Complete^000000] Repair":"Repair")+"")) {
		case 1:
			if(!#cannon_1){
				mes "[Cannon]";
				mes "wink.. wink..";
				close2;
				set #clean,#clean+1;
				set #cannon_1,1;
				specialeffect 9;
				end;
			}
				mes "[Cannon]";
				mes "Status: ^FF0000Cleaned^000000";
				close;
		end;
		case 2:
			if(!#cannon_2){
				select("Use "+getitemname(1005)+"");
				if(countitem(1005) < 1){
					mes "[Cannon]";
					mes ""+getitemname(1005)+" is required.";
					close;
				}
				mes "[Cannon]";
				mes "Clang Clang.";
				close2;
				delitem 1005,1;
				set #repair,#repair+1;
				set #cannon_2,1;
				specialeffect 101;
				end;
			}
				mes "[Cannon]";
				mes "Status: ^FF0000Repaired^000000";
				close;
		end;
		}
	close;

	}
}
airplane_01,95,205,4	script	Cannon#2	CLEAR_NPC,{
	if(!#ACH_Quest){end;}
	if(#ACH_Quest == 3){
		mes "[Cannon]";
		mes "........";
		next;
		switch(select(""+((#cannon_3 == 1)?"[^FF0000Complete^000000] Clean":"Clean")+"",""+((#cannon_4 == 1)?"[^FF0000Complete^000000] Repair":"Repair")+"")) {
		case 1:
			if(!#cannon_3){
				mes "[Cannon]";
				mes "wink.. wink..";
				close2;
				set #clean,#clean+1;
				set #cannon_3,1;
				specialeffect 9;
				end;
			}
				mes "[Cannon]";
				mes "Status: ^FF0000Cleaned^000000";
				close;
		end;
		case 2:
			if(!#cannon_4){
				select("Use "+getitemname(1005)+"");
				if(countitem(1005) < 1){
					mes "[Cannon]";
					mes ""+getitemname(1005)+" is required.";
					close;
				}
				mes "[Cannon]";
				mes "Clang Clang.";
				close2;
				delitem 1005,1;
				set #repair,#repair+1;
				set #cannon_4,1;
				specialeffect 101;
				end;
			}
				mes "[Cannon]";
				mes "Status: ^FF0000Repaired^000000";
				close;
		end;
		}
	close;

	}
}
airplane_01,99,204,4	script	Cannon#3	CLEAR_NPC,{
	if(!#ACH_Quest){end;}
	if(#ACH_Quest == 3){
		mes "[Cannon]";
		mes "........";
		next;
		switch(select(""+((#cannon_5 == 1)?"[^FF0000Complete^000000] Clean":"Clean")+"",""+((#cannon_6 == 1)?"[^FF0000Complete^000000] Repair":"Repair")+"")) {
		case 1:
			if(!#cannon_5){
				mes "[Cannon]";
				mes "wink.. wink..";
				close2;
				set #clean,#clean+1;
				set #cannon_5,1;
				specialeffect 9;
				end;
			}
				mes "[Cannon]";
				mes "Status: ^FF0000Cleaned^000000";
				close;
		end;
		case 2:
			if(!#cannon_6){
				select("Use "+getitemname(1005)+"");
				if(countitem(1005) < 1){
					mes "[Cannon]";
					mes ""+getitemname(1005)+" is required.";
					close;
				}
				mes "[Cannon]";
				mes "Clang Clang.";
				close2;
				delitem 1005,1;
				set #repair,#repair+1;
				set #cannon_6,1;
				specialeffect 101;
				end;
			}
				mes "[Cannon]";
				mes "Status: ^FF0000Repaired^000000";
				close;
		end;
		}
	close;

	}
}
airplane_01,99,171,4	script	Cannon#4	CLEAR_NPC,{
	if(!#ACH_Quest){end;}
	if(#ACH_Quest == 3){
		mes "[Cannon]";
		mes "........";
		next;
		switch(select(""+((#cannon_7 == 1)?"[^FF0000Complete^000000] Clean":"Clean")+"",""+((#cannon_8 == 1)?"[^FF0000Complete^000000] Repair":"Repair")+"")) {
		case 1:
			if(!#cannon_7){
				mes "[Cannon]";
				mes "wink.. wink..";
				close2;
				set #clean,#clean+1;
				set #cannon_7,1;
				specialeffect 9;
				end;
			}
				mes "[Cannon]";
				mes "Status: ^FF0000Cleaned^000000";
				close;
		end;
		case 2:
			if(!#cannon_8){
				select("Use "+getitemname(1005)+"");
				if(countitem(1005) < 1){
					mes "[Cannon]";
					mes ""+getitemname(1005)+" is required.";
					close;
				}
				mes "[Cannon]";
				mes "Clang Clang.";
				close2;
				delitem 1005,1;
				set #repair,#repair+1;
				set #cannon_8,1;
				specialeffect 101;
				end;
			}
				mes "[Cannon]";
				mes "Status: ^FF0000Repaired^000000";
				close;
		end;
		}
	close;

	}
}
airplane_01,95,170,4	script	Cannon#5	CLEAR_NPC,{
	if(!#ACH_Quest){end;}
	if(#ACH_Quest == 3){
		mes "[Cannon]";
		mes "........";
		next;
		switch(select(""+((#cannon_9 == 1)?"[^FF0000Complete^000000] Clean":"Clean")+"",""+((#cannon_10 == 1)?"[^FF0000Complete^000000] Repair":"Repair")+"")) {
		case 1:
			if(!#cannon_9){
				mes "[Cannon]";
				mes "wink.. wink..";
				close2;
				set #clean,#clean+1;
				set #cannon_9,1;
				specialeffect 9;
				end;
			}
				mes "[Cannon]";
				mes "Status: ^FF0000Cleaned^000000";
				close;
		end;
		case 2:
			if(!#cannon_10){
				select("Use "+getitemname(1005)+"");
				if(countitem(1005) < 1){
					mes "[Cannon]";
					mes ""+getitemname(1005)+" is required.";
					close;
				}
				mes "[Cannon]";
				mes "Clang Clang.";
				close2;
				delitem 1005,1;
				set #repair,#repair+1;
				set #cannon_10,1;
				specialeffect 101;
				end;
			}
				mes "[Cannon]";
				mes "Status: ^FF0000Repaired^000000";
				close;
		end;
		}
	close;

	}
}
airplane_01,91,169,4	script	Cannon#6	CLEAR_NPC,{
	if(!#ACH_Quest){end;}
	if(#ACH_Quest == 3){
		mes "[Cannon]";
		mes "........";
		next;
		switch(select(""+((#cannon_11 == 1)?"[^FF0000Complete^000000] Clean":"Clean")+"",""+((#cannon_12 == 1)?"[^FF0000Complete^000000] Repair":"Repair")+"")) {
		case 1:
			if(!#cannon_11){
				mes "[Cannon]";
				mes "wink.. wink..";
				close2;
				set #clean,#clean+1;
				set #cannon_11,1;
				specialeffect 9;
				end;
			}
				mes "[Cannon]";
				mes "Status: ^FF0000Cleaned^000000";
				close;
		end;
		case 2:
			if(!#cannon_12){
				select("Use "+getitemname(1005)+"");
				if(countitem(1005) < 1){
					mes "[Cannon]";
					mes ""+getitemname(1005)+" is required.";
					close;
				}
				mes "[Cannon]";
				mes "Clang Clang.";
				close2;
				delitem 1005,1;
				set #repair,#repair+1;
				set #cannon_12,1;
				specialeffect 101;
				end;
			}
				mes "[Cannon]";
				mes "Status: ^FF0000Repaired^000000";
				close;
		end;
		}
	close;

	}
}

