//===== rAthena Script =======================================
//= Eden Group Quests - Mission [86 - 90]
//===== By: ==================================================
//= Chilly
//===== Current Version: =====================================
//= 1.5
//===== Compatible With: =====================================
//= rAthena Project
//===== Description: =========================================
//= Repetable Quests for Players between Baselevel 86 - 90.
//===== Additional Comments: =================================
//= 1.0 First Version. [Chilly]
//= 1.1 Some little improvements here and there. [Masao]
//= 1.2 Optimized. [Euphy]
//= 1.3 Updated to match the official script. [Euphy]
//= 1.4 Added support to Para_Team_Mark_ in Eden Group. [Ragno]
//= 1.5 Added use of F_HasEdenGroupMark function. [Ragno]
//============================================================

moc_para01,48,175,3	script	86-90 Mission Board	857,{
	if (!callfunc("F_HasEdenGroupMark")) {
		mes "Wait a minute!";
		mes "-You need to have an-";
		mes "-^4d4dff'Eden Group Mark'^000000-";
		mes "-to receive these missions.-";
		next;
		switch(select("Just walk away.:^0000FFEden Group^000000 missions?:How can I be a member of the ^0000FFEden Group^000000?")) {
		case 1:
			close;
		case 2:
			mes "::The Eden Group Missions";
			mes "::are basically missions";
			mes "::requested by";
			mes "::people from all around the kingdom.";
			mes "::We just categorize them.";
			next;
			mes "::In the Eden Group,";
			mes "::we sorted out the missions";
			mes "::according to the level of difficulty.";
			mes "::According to this level,";
			mes "::you can find";
			mes "::missions that";
			mes "::suit you.";
			next;
			mes "::When you are done,";
			mes "::you can come back";
			mes "::to the mission board.";
			next;
			mes "::Then you will be";
			mes "::rewarded!!";
			mes "::Simple, isn't it!!";
			mes "::No commission required!!";
			close;
		case 3:
			mes "::You can become a member";
			mes "::of the Eden Group";
			mes "::to ^0000FFLaime Evenor^000000,";
			mes "::who is waiting on the 1st floor.";
			next;
			mes "::If you become a member,";
			mes "::you will get an";
			mes "::\"^006400Eden Group Mark^000000\".";
			mes "::Then you will be able";
			mes "::to see the mission board.";
			close;
		}
	}
	if (BaseLevel < 86  || BaseLevel > 90) {
		// Quest IDs: 4167-4180
		// Quest cooldown IDs: 4198-4211
		setarray .@names$[0],
			"Dragon Tail","Spring Rabbit","Pest",
			"Bathory","Alarm",
			"Baba Yaga","Yao Jun","Firelock Soldier","Zipper Bear",
			"Ground Petite","Rafflesia","Venomous","Pitman","Yellow Novus";
		setarray .@exp[0],
			76000,82000,82000,
			72000,76000,
			72000,78000,82000,80000,
			72000,72000,72000,86000,80000;
		mes "You must be within level 86-90 to accept these missions.";
		for(set .@quest,4167; .@quest<=4180; set .@quest,.@quest+1) {
			set .@hunting, checkquest(.@quest,HUNTING);
			if (.@hunting == 0 || .@hunting == 1) {
				next;
				mes ":: You cannot proceed in";
				mes ":: ^0000FF"+.@names$[.@quest-4167]+" Hunting^000000.";
				mes ":: The registration to the mission";
				mes ":: is cancelled.";
				erasequest .@quest;
				close;
			} else if (.@hunting == 2) {
				next;
				mes ":: You added information";
				mes ":: about the mission";
				mes ":: ^0000FF"+.@names$[.@quest-4167]+" Hunting^000000";
				mes ":: on the mission board.";
				mes ":: You've got a";
				mes ":: salutary experience.";
				erasequest .@quest;
				getexp .@exp[.@quest-4167],0;
				close;
			}
		}
		close;
	}
	mes "[86-90 Mission Board]";
	mes "There are several requests on this board.";
	next;
	switch(select("^8B4513Turtle Island^000000:^8B4513Clock Tower Dungeon^000000:^8B4513Expansion Towns^000000:^8B4513Other Regions^000000")) {
	case 1:
		mes "^8B4513Turtle Island^000000.";
		mes "Which monster will you hunt or have you finished hunting?";
		next;
		switch(select("^0000FFDragon Tail^000000:^0000FFSpring Rabbit^000000:^0000FFPest^000000")) {
			case 1: callsub L_Quest,4167,"Dragon Tail",76000,"드래곤테일카드","There is a monster that only can be found on ^8B4513Turtle Island^000000.","s";
			case 2: callsub L_Quest,4168,"Spring Rabbit",82000,"스프링래빗카드","There is a monster that only can be found on ^8B4513Turtle Island^000000.","s";
			case 3: callsub L_Quest,4169,"Pest",82000,"페스트카드","There is a monster that only can be found on ^8B4513Turtle Island^000000.","s";
		}
	case 2:
		mes "^8B4513Clock Tower Dungeon^000000.";
		mes "Which monster will you hunt or have you finished hunting?";
		next;
		switch(select("^0000FFBathory^000000:^0000FFAlarm^000000")) {
			case 1: callsub L_Quest,4170,"Bathory",72000,"바소리카드","The Clock Tower Dungeon is full of dangerous monsters.";
			case 2: callsub L_Quest,4171,"Alarm",76000,"알람카드","The Clock Tower Dungeon is full of dangerous monsters.";
		}
	case 3:
		mes "^8B4513Expansion Cities^000000";
		mes "Which monster will you hunt or have you finished hunting?";
		next;
		switch(select("^0000FFBaba Yaga^000000:^0000FFYao Jun^000000:^0000FFFirelock Soldier^000000:^0000FFZipper Bear^000000")) {
			case 1: callsub L_Quest,4172,"Baba Yaga",72000,"","The witch Baba Yaga can be found in the outskirts of Moscovia.";
			case 2: callsub L_Quest,4173,"Yao Jun",117000,"혜군카드","There are human-like monsters that roam around the dungeon in Louyang.";
			case 3: callsub L_Quest,4174,"Firelock Soldier",82000,"구식조총병카드","There are human-like monsters that roam around the dungeon in Amatsu.","s";
			case 4: callsub L_Quest,4175,"Zipper Bear",120000,"지퍼베어카드","There are bear monsters swarming in the Kunlun dungeon.";
		}
	case 4:
		mes "[86-90 Mission Board]";
		mes "Here is a list of random requests to hunt monsters in other regions of Rune Midgard.";
		mes "Which monster will you hunt or have you finished hunting?";
		next;
		switch(select("^0000FFGround Petite^000000:^0000FFRafflesia^000000:^0000FFVenomous^000000:^0000FFPitman^000000:^0000FFYellow Novus^000000")) {
			case 1: callsub L_Quest,4176,"Ground Petite",72000,"지상쁘띠카드","There are dragon type monsters swarming the western region of Geffen.";
			case 2: callsub L_Quest,4177,"Rafflesia",72000,"라플레시아카드","There are plant type monsters infesting the fields of Lighthalzen.";
			case 3: callsub L_Quest,4178,"Venomous",72000,"베노머스","There are formless monsters floating around the fields of Einbroch.";
			case 4: callsub L_Quest,4179,"Pitman",86000,"핏맨","There are undead monsters pushing a cart around the fields and dungeons of Einbroch.";
			case 5: callsub L_Quest,4180,"Yellow Novus",80000,"옐로우노버스","There are yellow dragon type monsters terrorizing the fields of Hugel.";
		}
	}
	end;

//callsub L_Quest,<quest ID>,"<monster name>",<reward EXP>,"<cutin image>","<description>"{,"s"};
L_Quest:
	set .@quest1, getarg(0);
	set .@quest2, .@quest1+31;
	.@cutin$ = getarg(3);
	set .@playtime, checkquest(.@quest2,PLAYTIME);
	if (.@playtime == 0 || .@playtime == 1) {
		mes "[86-90 Mission Board]";
		mes "You need to wait 3 hours before you can take this mission again.";
		close;
	}
	set .@hunting, checkquest(.@quest1,HUNTING);
	if (.@hunting == 0 || .@hunting == 1) {
		mes "[86-90 Mission Board]";
		mes "Have you finished hunting all 30 "+getarg(1)+getarg(5,"")+" yet?";
		close;
	} else if (.@hunting == 2) {
		mes "[86-90 Mission Board]";
		mes "You have completed the hunting.";
		mes "Please accept this reward as a compensation.";
		erasequest .@quest1;
		if (.@playtime > -1) erasequest .@quest2;
		setquest .@quest2;
		getexp getarg(2),0;
		close;
	}/* else if (.@hunting == 3) {
//		recall_completequest .@quest1
		erasequest .@quest1;
		mes "[86-90 Mission Board]";
		mes "You have re-accepted the "+getarg(1)+" Hunting mission.";
		close;
	}*/ else {
		mes "[86-90 Mission Board]";
		mes getarg(4);
		next;
		if (.@cutin$ != "") cutin .@cutin$,3;
		mes "[86-90 Mission Board]";
		mes "Hunt 30 "+getarg(1)+" monsters there and post your success on this board.";
		next;
		if (.@cutin$ != "") cutin .@cutin$,255;
		if(select("I'll hunt them.:No thanks.") == 1) {
			mes "[86-90 Mission Board]";
			mes "When you have completed the mission, post it on this board and collect your reward.";
			if (.@playtime > -1) erasequest .@quest2;
			setquest .@quest1;
		}
		close;
	}
}
