alberta,204,176,3	script	Marcus	4_M_REINDEER,{
/*
	erasequest(30001);
	erasequest(30002);
	erasequest(30003);
	erasequest(30004);
	erasequest(30005);
	erasequest(30006);
	end;
*/		
	mes "[Retired Captain]";
	if(questprogress(30001) == 1){
		mes "Go look for Adam at the bow of the boat.";
	} else if(questprogress(30005) == 1 ){
		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]+"";
		}
		changequest(30005,30006);
		close;
	} else if(questprogress(30006) == 1){
		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]+" ":"")+""+getitemname(.item[.@i])+" "+((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;
				completequest(30006);
				close;
			}	

		close;
	} else if(questprogress(30006) == 2 ){
			mes "Congratulations! Captain "+strcharinfo(0)+". I hope you enjoy my treasure.";
			close;
	} else if(questprogress(30002) || questprogress(30003) || questprogress(30004)){
			mes "You task inside  the boat is not yet completed.";
			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 bow of the ship. Tell him that I sent you.";
		setquest(30001);
	}
	close;
OnInit:
	setarray .item[0],2226,1,7,2284,1,0,975,10,0;

	questinfo(QTYPE_QUEST,1);
	setquestinfo(QINFO_QUEST, 30001, 0);

	questinfo(QTYPE_QUEST,1);
	setquestinfo(QINFO_QUEST, 30005, 1);

	questinfo(QTYPE_QUEST,1);
	setquestinfo(QINFO_QUEST, 30006, 1);
	end;
}



alberta,169,176,5	script	 Adam	4_MAL_CAPTAIN,{
	mes "[Adam]";
	if(questprogress(30005) == 1){
		mes "The captain want's to see you.";
		close;
	}
	if(questprogress(30004) == 1 && countitem(7628) >= 1){
		mes "What brought you here. I thought you're with Engineer 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)+", the Captain wish to see you now.";
			delitem 7628,1;
			changequest(30004,30005);
		}
		close;
	} else if(questprogress(30001) == 1){
		mes "Looks like you are here for the job.";
		next;
		mes "[Adam]";
		mes "Find Gray at the deck of this ship and he will tell you what to do.";
		changequest(30001,30002);
		close;
	} else if(questprogress(30002) == 1){
		mes "I'm busy, Gray is waiting for you. Go find him on the deck below.";
		close;
	} else{
		mes "Please talk to other staff. I'm busy right here.";
		close;
	}
	end;

OnInit:
	questinfo(QTYPE_QUEST,1);
	setquestinfo(QINFO_QUEST, 30001, 1);

	questinfo(QTYPE_QUEST,1);
	setquestinfo(QINFO_QUEST, 30004, 1);
	end;

}


alb_ship,86,117,4	script	Engineer	4_M_TUFFOLD,{
	if(questprogress(30004) == 1){
		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.";
		getitembound 7628,1,4;
		set @eng_complete,1;
		set @clean,0;
		set @repair,0;
		changequest(30003,30004);
		close;
	} else if(questprogress(30002) == 1){
		mes "[Engineer Gray]";
		mes "I feel sick today.. Can you clean and repair those bunker bed for me.";
		next;
		mes "[Engineer Gray]";
		mes "Be sure that you will do your job.";
		changequest(30002,30003);
		close;		
	} else if(questprogress(30003) == 1 && @clean >= 1 && @repair > 1){
		mes "[Engineer Gray]";
		mes "Having a problem?";
		mes "Do you want me to reset all those beds?";
		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(questprogress(30003) == 1){
		mes "[Engineer Gray]";
		mes "I told you to clean and repair those beds.";
	} else {
		mes "[Engineer Gray]";
		mes "feel sea sick today..";
		close;
	}

	close;

OnInit:
	questinfo(QTYPE_QUEST,1);
	setquestinfo(QINFO_QUEST, 30002, 1);
	end;
}

alb_ship,92,89,4	script	Bunk#1	CLEAR_NPC,{
	if(questprogress(30003) == 1 ){
		mes "[Bunker Bed]";
		mes "........";
		next;
		switch(select(""+((@cannon_1 == 1)?"[^FF0000Complete^000000] Clean":"Clean")+"",""+((@cannon_2 == 1)?"[^FF0000Complete^000000] Repair":"Repair")+"")) {
		case 1:
			if(!@cannon_1){
				mes "[Bunker Bed]";
				mes "wink.. wink..";
				close2;
				set @clean,@clean+1;
				set @cannon_1,1;
				specialeffect 9;
				monster("alb_ship",92,89,"Bugs",1054,5);	
				end;
			}
			mes "[Bunker Bed]";
			mes "Status: ^FF0000Cleaned^000000";
			
			close;
		case 2:
			if(!@cannon_2){
				select("Use "+getitemname(1005)+"");
				if(countitem(1005) < 1){
					mes "[Bunker Bed]";
					mes ""+getitemname(1005)+" is required.";
					close;
				}
				mes "[Bunker Bed]";
				mes "Clang Clang.";
				close2;
				delitem 1005,1;
				set @repair,@repair+1;
				set @cannon_2,1;
				specialeffect 101;
				end;
			}
			mes "[Bunker Bed]";
			mes "Status: ^FF0000Repaired^000000";
			close;
		}
	close;

	}
OnInit:
	questinfo(QTYPE_QUEST,1);
	setquestinfo(QINFO_QUEST, 30003, 1);
	end;
}
alb_ship,92,85,4	script	Bunk#2	CLEAR_NPC,{
	if(questprogress(30003) == 1 ){
		mes "[Bunker Bed]";
		mes "........";
		next;
		switch(select(""+((@cannon_3 == 1)?"[^FF0000Complete^000000] Clean":"Clean")+"",""+((@cannon_4 == 1)?"[^FF0000Complete^000000] Repair":"Repair")+"")) {
		case 1:
			if(!@cannon_3){
				mes "[Bunker Bed]";
				mes "wink.. wink..";
				close2;
				set @clean,@clean+1;
				set @cannon_3,1;
				specialeffect 9;
				monster("alb_ship",92,85,"Bugs",1054,5);
				end;
			}
				mes "[Bunker Bed]";
				mes "Status: ^FF0000Cleaned^000000";
				close;
		end;
		case 2:
			if(!@cannon_4){
				select("Use "+getitemname(1005)+"");
				if(countitem(1005) < 1){
					mes "[Bunker Bed]";
					mes ""+getitemname(1005)+" is required.";
					close;
				}
				mes "[Bunker Bed]";
				mes "Clang Clang.";
				close2;
				delitem 1005,1;
				set @repair,@repair+1;
				set @cannon_4,1;
				specialeffect 101;
				end;
			}
				mes "[Bunker Bed]";
				mes "Status: ^FF0000Repaired^000000";
				close;
		end;
		}
	close;

	}

OnInit:
	questinfo(QTYPE_QUEST,1);
	setquestinfo(QINFO_QUEST, 30003, 1);
	end;

}
alb_ship,92,81,4	script	Bunk#3	CLEAR_NPC,{
	if(questprogress(30003) == 1 ){
		mes "[Bunker Bed]";
		mes "........";
		next;
		switch(select(""+((@cannon_5 == 1)?"[^FF0000Complete^000000] Clean":"Clean")+"",""+((@cannon_6 == 1)?"[^FF0000Complete^000000] Repair":"Repair")+"")) {
		case 1:
			if(!@cannon_5){
				mes "[Bunker Bed]";
				mes "wink.. wink..";
				close2;
				set @clean,@clean+1;
				set @cannon_5,1;
				specialeffect 9;
				monster("alb_ship",92,81,"Bugs",1054,5);
				end;
			}
				mes "[Bunker Bed]";
				mes "Status: ^FF0000Cleaned^000000";
				close;
		end;
		case 2:
			if(!@cannon_6){
				select("Use "+getitemname(1005)+"");
				if(countitem(1005) < 1){
					mes "[Bunker Bed]";
					mes ""+getitemname(1005)+" is required.";
					close;
				}
				mes "[Bunker Bed]";
				mes "Clang Clang.";
				close2;
				delitem 1005,1;
				set @repair,@repair+1;
				set @cannon_6,1;
				specialeffect 101;
				end;
			}
				mes "[Bunker Bed]";
				mes "Status: ^FF0000Repaired^000000";
				close;
		end;
		}
	close;

	}

OnInit:
	questinfo(QTYPE_QUEST,1);
	setquestinfo(QINFO_QUEST, 30003, 1);
	end;

}
alb_ship,83,82,4	script	Bunk#4	CLEAR_NPC,{
	if(questprogress(30003) == 1 ){
		mes "[Bunker Bed]";
		mes "........";
		next;
		switch(select(""+((@cannon_7 == 1)?"[^FF0000Complete^000000] Clean":"Clean")+"",""+((@cannon_8 == 1)?"[^FF0000Complete^000000] Repair":"Repair")+"")) {
		case 1:
			if(!@cannon_7){
				mes "[Bunker Bed]";
				mes "wink.. wink..";
				close2;
				set @clean,@clean+1;
				set @cannon_7,1;
				specialeffect 9;
				monster("alb_ship",83,82,"Bugs",1054,5);
				end;
			}
				mes "[Bunker Bed]";
				mes "Status: ^FF0000Cleaned^000000";
				close;
		end;
		case 2:
			if(!@cannon_8){
				select("Use "+getitemname(1005)+"");
				if(countitem(1005) < 1){
					mes "[Bunker Bed]";
					mes ""+getitemname(1005)+" is required.";
					close;
				}
				mes "[Bunker Bed]";
				mes "Clang Clang.";
				close2;
				delitem 1005,1;
				set @repair,@repair+1;
				set @cannon_8,1;
				specialeffect 101;
				end;
			}
				mes "[Bunker Bed]";
				mes "Status: ^FF0000Repaired^000000";
				close;
		end;
		}
	close;

	}

OnInit:
	questinfo(QTYPE_QUEST,1);
	setquestinfo(QINFO_QUEST, 30003, 1);
	end;

}
alb_ship,83,86,4	script	Bunk#5	CLEAR_NPC,{
	if(questprogress(30003) == 1 ){
		mes "[Bunker Bed]";
		mes "........";
		next;
		switch(select(""+((@cannon_9 == 1)?"[^FF0000Complete^000000] Clean":"Clean")+"",""+((@cannon_10 == 1)?"[^FF0000Complete^000000] Repair":"Repair")+"")) {
		case 1:
			if(!@cannon_9){
				mes "[Bunker Bed]";
				mes "wink.. wink..";
				close2;
				set @clean,@clean+1;
				set @cannon_9,1;
				specialeffect 9;
				monster("alb_ship",83,86,"Bugs",1054,5);
				end;
			}
				mes "[Bunker Bed]";
				mes "Status: ^FF0000Cleaned^000000";
				close;
		end;
		case 2:
			if(!@cannon_10){
				select("Use "+getitemname(1005)+"");
				if(countitem(1005) < 1){
					mes "[Bunker Bed]";
					mes ""+getitemname(1005)+" is required.";
					close;
				}
				mes "[Bunker Bed]";
				mes "Clang Clang.";
				close2;
				delitem 1005,1;
				set @repair,@repair+1;
				set @cannon_10,1;
				specialeffect 101;
				end;
			}
				mes "[Bunker Bed]";
				mes "Status: ^FF0000Repaired^000000";
				close;
		end;
		}
	close;

	}

OnInit:
	questinfo(QTYPE_QUEST,1);
	setquestinfo(QINFO_QUEST, 30003, 1);
	end;

}
alb_ship,83,90,4	script	Bunk#6	CLEAR_NPC,{
	if(questprogress(30003) == 1 ){
		mes "[Bunker Bed]";
		mes "........";
		next;
		switch(select(""+((@cannon_11 == 1)?"[^FF0000Complete^000000] Clean":"Clean")+"",""+((@cannon_12 == 1)?"[^FF0000Complete^000000] Repair":"Repair")+"")) {
		case 1:
			if(!@cannon_11){
				mes "[Bunker Bed]";
				mes "wink.. wink..";
				close2;
				set @clean,@clean+1;
				set @cannon_11,1;
				specialeffect 9;
				monster("alb_ship",83,90,"Bugs",1054,5);
				end;
			}
				mes "[Bunker Bed]";
				mes "Status: ^FF0000Cleaned^000000";
				close;
		end;
		case 2:
			if(!@cannon_12){
				select("Use "+getitemname(1005)+"");
				if(countitem(1005) < 1){
					mes "[Bunker Bed]";
					mes ""+getitemname(1005)+" is required.";
					close;
				}
				mes "[Bunker Bed]";
				mes "Clang Clang.";
				close2;
				delitem 1005,1;
				set @repair,@repair+1;
				set @cannon_12,1;
				specialeffect 101;
				end;
			}
				mes "[Bunker Bed]";
				mes "Status: ^FF0000Repaired^000000";
				close;
		end;
		}
	close;

	}

OnInit:
	questinfo(QTYPE_QUEST,1);
	setquestinfo(QINFO_QUEST, 30003, 1);
	end;

}

