// Battleground Engine


-	script	eBG_Conquest	FAKE_NPC,{
	end;

// Warp to Position
OnPCLogoutEvent:
OnPCDieEvent:
	if (compare(strcharinfo(PC_MAP), "ebg_conq0")) {
		.@team = callfunc("F_ValidateeBG", BGT_CONQ, 0);
		callfunc("F_warpDie", BGT_CONQ, .@team);
	}
	end;

OnInit:
	// Cementery Walls
	setwall("ebg_conq01", 291, 376, 8, 0, 0, "cWall1");
	setwall("ebg_conq01", 268, 376, 8, 0, 0, "cWall2");
	setwall("ebg_conq02", 93, 301, 21, 0, 0, "cWall3");
	setwall("ebg_conq02", 110, 301, 21, 0, 0, "cWall4");
	setwall("ebg_conq03", 84, 43, 6, 6, 0, "cWall5");
	setwall("ebg_conq03", 26, 43, 6, 6, 0, "cWall6");
	setwall("ebg_conq04", 121, 353, 10, 0, 0, "cWall7");
	setwall("ebg_conq04", 25, 377, 10, 6, 0, "cWall8");
	setwall("ebg_conq05", 291, 335, 7, 6, 0, "cWall9_1");
	setwall("ebg_conq05", 300, 335, 6, 6, 0, "cWall10_1");
	setwall("ebg_conq05", 291, 312, 7, 6, 0, "cWall9_2");
	setwall("ebg_conq05", 300, 312, 4, 6, 0, "cWall10_2");
	setwall("ebg_conq06", 317, 150, 8, 0, 0, "cWall11_");
	setwall("ebg_conq06", 326, 150, 8, 0, 0, "cWall12_");
	end;
	
OnBuildAll:
	.@castle = getarg(0);
	// Create Wall
	callsub(OnWallBuild, .@castle);
	// Summon Barricades
	callsub(OnBarricadeBuild, .@castle);
	// Summon Guardians
	callsub(OnGuardianSBuild, .@castle);
	// Summon Emperium
	callsub(OnEmperiumBuild, .@castle);
	return;

OnWallBuild:
	.@castle = getarg(0);
	switch(.@castle) { // Check map
		case 0:
			setwall(.Castle$, 114, 48, 13, 6, 0, "conq_wall00");
			setwall(.Castle$, 114, 51, 13, 6, 1, "conq_wall01");
			setwall(.Castle$, 114, 154, 13, 6, 1, "conq_wall02");
			setwall(.Castle$, 116, 241, 11, 6, 1, "conq_wall03");
			break;
		case 1:
			setwall(.Castle$, 290, 98, 8, 0, 0, "conq_wall00");
			setwall(.Castle$, 279, 98, 8, 0, 1, "conq_wall01");
			setwall(.Castle$, 230, 213, 6, 0, 1, "conq_wall02");
			setwall(.Castle$, 160, 141, 6, 6, 1, "conq_wall03");
			break;
		case 2:
			setwall(.Castle$, 326, 301, 6, 6, 0, "conq_wall00");
			setwall(.Castle$, 325, 277, 8, 6, 1, "conq_wall01");
			setwall(.Castle$, 200, 230, 8, 0, 1, "conq_wall02");
			setwall(.Castle$, 285, 198, 8, 0, 1, "conq_wall03");
			break;
		case 3:
			setwall(.Castle$, 238, 74, 8, 6, 0, "conq_wall00");
			setwall(.Castle$, 239, 53, 8, 6, 1, "conq_wall01");
			setwall(.Castle$, 107, 124, 6, 6, 1, "conq_wall02");
			setwall(.Castle$, 84, 171, 8, 6, 1, "conq_wall03");
			break;
		case 4:
			setwall(.Castle$, 136, 136, 8, 6, 0, "conq_wall00");
			setwall(.Castle$, 150, 223, 12, 6, 1, "conq_wall01");
			setwall(.Castle$, 125, 342, 8, 0, 1, "conq_wall02");
			setwall(.Castle$, 38, 314, 12, 6, 1, "conq_wall03");
			break;
		case 5:
			setwall(.Castle$, 138, 110, 8, 6, 0, "conq_wall00");
			setwall(.Castle$, 139, 158, 6, 6, 1, "conq_wall01");
			setwall(.Castle$, 138, 210, 8, 6, 1, "conq_wall02");
			setwall(.Castle$, 138, 263, 8, 6, 1, "conq_wall03");
			break;
	}
	return;

OnGuardianSBuild:
	.@castle = getarg(0);
	/**
	 * Save All Guardian Stone ID into .@mob[0...n-1] Array
	 */
	switch(.@castle) {
		case 0:
			.@mob[0] = bg_monster(.Defender, .Castle$, 27, 35, "1st Guardian Stone", S_EMPEL_1, "eBG_Conquest::OnGuardianStone");
			.@mob[1] = bg_monster(.Defender, .Castle$, 207, 75, "2st Guardian Stone", S_EMPEL_2, "eBG_Conquest::OnGuardianStone");
			break;
		case 1:
			.@mob[0] = bg_monster(.Defender, .Castle$, 231, 58, "1st Guardian Stone", S_EMPEL_1, "eBG_Conquest::OnGuardianStone");
			.@mob[1] = bg_monster(.Defender, .Castle$, 335, 230, "2nd Guardian Stone", S_EMPEL_2, "eBG_Conquest::OnGuardianStone");
			break;
		case 2:
			.@mob[0] = bg_monster(.Defender, .Castle$, 242, 309, "1st Guardian Stone", S_EMPEL_1, "eBG_Conquest::OnGuardianStone");
			.@mob[1] = bg_monster(.Defender, .Castle$, 376, 251, "2nd Guardian Stone", S_EMPEL_2, "eBG_Conquest::OnGuardianStone");
			break;
		case 3:
			.@mob[0] = bg_monster(.Defender, .Castle$, 210, 234, "1st Guardian Stone", S_EMPEL_1, "eBG_Conquest::OnGuardianStone");
			.@mob[1] = bg_monster(.Defender, .Castle$, 308, 189, "2nd Guardian Stone", S_EMPEL_2, "eBG_Conquest::OnGuardianStone");
			break;
		case 4:
			.@mob[0] = bg_monster(.Defender, .Castle$, 33, 168, "1st Guardian Stone", S_EMPEL_1, "eBG_Conquest::OnGuardianStone");
			.@mob[1] = bg_monster(.Defender, .Castle$, 245, 168, "2nd Guardian Stone", S_EMPEL_2, "eBG_Conquest::OnGuardianStone");
			break;
		case 5:
			.@mob[0] = bg_monster(.Defender, .Castle$, 65, 171, "1st Guardian Stone", S_EMPEL_1, "eBG_Conquest::OnGuardianStone");
			.@mob[1] = bg_monster(.Defender, .Castle$, 212, 149, "2nd Guardian Stone", S_EMPEL_2, "eBG_Conquest::OnGuardianStone");
			break;
	}
	.@count = mobcount(.Castle$, "eBG_Conquest::OnGuardianStone");
	// Make GuardianStone Immovable
	for (.@i = 0; .@i < .@count; ++.@i)
		bg_mob_move(.@mob[.@i], EBG_IMMOVABLE);
	return;
	
OnEmperiumBuild:
	.@castle = getarg(0);
	/**
	 * Save All Emperium ID into .@mob[0...n-1] Array
	 */
	switch(.@castle) {
		case 0:
			.@mob[0] = bg_monster(.Defender, .Castle$, 120, 272, "Emperium", EMPELIUM, "eBG_Conquest::OnEmperium");
			break;
		case 1:
			.@mob[0] = bg_monster(.Defender, .Castle$, 162, 193, "Emperium", EMPELIUM, "eBG_Conquest::OnEmperium");
			break;
		case 2:
			.@mob[0] = bg_monster(.Defender, .Castle$, 338, 202, "Emperium", EMPELIUM, "eBG_Conquest::OnEmperium");
			break;
		case 3:
			.@mob[0] = bg_monster(.Defender, .Castle$, 87, 219, "Emperium", EMPELIUM, "eBG_Conquest::OnEmperium");
			break;
		case 4:
			.@mob[0] = bg_monster(.Defender, .Castle$, 89, 256, "Emperium", EMPELIUM, "eBG_Conquest::OnEmperium");
			break;
		case 5:
			.@mob[0] = bg_monster(.Defender, .Castle$, 141, 293, "Emperium", EMPELIUM, "eBG_Conquest::OnEmperium");
			break;
	}
	.@count = mobcount(.Castle$, "eBG_Conquest::OnEmperium");
	// Make Emperium Immovable
	for (.@i = 0; .@i < .@count; ++.@i)
		bg_mob_move(.@mob[.@i], EBG_IMMOVABLE);
	return;


OnBarricadeBuild:
	.@castle = getarg(0);
	switch(.@castle) {
		case 0:
			// 1st/2nd Wall: 6 Barricade
			// 3rd Wall: 4 Barricades
			for (.@i = 115; .@i <= 125; .@i += 2) {
				bg_monster(.Defender, .Castle$, .@i, 49, " ", BARRICADE_, "eBG_Conquest::OnBarricade0");
				bg_monster(.Defender, .Castle$, .@i, 50, " ", BARRICADE_, "eBG_Conquest::OnBarricade1");
				bg_monster(.Defender, .Castle$, .@i, 153, " ", BARRICADE_, "eBG_Conquest::OnBarricade2");
				if (.@i <= 121) {
					bg_monster(.Defender, .Castle$, .@i+1, 240, " ", BARRICADE_, "eBG_Conquest::OnBarricade3");
				}
			}
			break;
		case 1:
			for (.@i = 98; .@i <= 104; .@i += 2) {
				bg_monster(.Defender, .Castle$, 289, .@i, " ", BARRICADE_, "eBG_Conquest::OnBarricade0");
				if (.@i <= 102) {
					bg_monster(.Defender, .Castle$, 280, .@i, " ", BARRICADE_, "eBG_Conquest::OnBarricade1");
					bg_monster(.Defender, .Castle$, 281, .@i+1, " ", BARRICADE_, "eBG_Conquest::OnBarricade1");
				}
			}
			for (.@i = 214; .@i <= 218; .@i += 2) {
				bg_monster(.Defender, .Castle$, 231, .@i, " ", BARRICADE_, "eBG_Conquest::OnBarricade2");
				bg_monster(.Defender, .Castle$, 232, .@i-1, " ", BARRICADE_, "eBG_Conquest::OnBarricade2");
			}
			for (.@i = 160; .@i <= 166; .@i += 2) {
				bg_monster(.Defender, .Castle$, .@i, 140, " ", BARRICADE_, "eBG_Conquest::OnBarricade3");
			}
			break;
		case 2:
			for (.@i = 326; .@i <= 330; .@i += 2) {
				bg_monster(.Defender, .Castle$, .@i, 300, " ", BARRICADE_, "eBG_Conquest::OnBarricade0");
				bg_monster(.Defender, .Castle$, .@i, 278, " ", BARRICADE_, "eBG_Conquest::OnBarricade1");
				bg_monster(.Defender, .Castle$, .@i+1, 279, " ", BARRICADE_, "eBG_Conquest::OnBarricade1");
			}
			for (.@i = 231; .@i <= 235; .@i += 2) {
				bg_monster(.Defender, .Castle$, 201, .@i, " ", BARRICADE_, "eBG_Conquest::OnBarricade2");
				bg_monster(.Defender, .Castle$, 202, .@i+1, " ", BARRICADE_, "eBG_Conquest::OnBarricade2");
			}
			for (.@i = 199; .@i <= 205; .@i += 2) {
				bg_monster(.Defender, .Castle$, 284, .@i, " ", BARRICADE_, "eBG_Conquest::OnBarricade3");
			}
			break;
		case 3:
			for (.@i = 239; .@i <= 245; .@i += 2) {
				bg_monster(.Defender, .Castle$, .@i, 73, " ", BARRICADE_, "eBG_Conquest::OnBarricade0");
				if (.@i <= 243) {
					bg_monster(.Defender, .Castle$, .@i, 55, " ", BARRICADE_, "eBG_Conquest::OnBarricade1");
					bg_monster(.Defender, .Castle$, .@i+1, 54, " ", BARRICADE_, "eBG_Conquest::OnBarricade1");
				}
			}
			for (.@i = 107; .@i <= 111; .@i += 2) {
				bg_monster(.Defender, .Castle$, .@i, 122, " ", BARRICADE_, "eBG_Conquest::OnBarricade2");
				bg_monster(.Defender, .Castle$, .@i+1, 123, " ", BARRICADE_, "eBG_Conquest::OnBarricade2");
			}
			for (.@i = 84; .@i <= 90; .@i += 2) {
				bg_monster(.Defender, .Castle$, .@i, 170, " ", BARRICADE_, "eBG_Conquest::OnBarricade3");
			}
			break;
		case 4:
			for (.@i = 137; .@i <= 161; .@i += 2) {
				if (.@i <= 143)
					bg_monster(.Defender, .Castle$, .@i, 137, " ", BARRICADE_, "eBG_Conquest::OnBarricade0");
				if (.@i >= 151) {
					bg_monster(.Defender, .Castle$, .@i, 222, " ", BARRICADE_, "eBG_Conquest::OnBarricade1");
				}
			}
			for (.@i = 343; .@i <= 347; .@i += 2) {
				bg_monster(.Defender, .Castle$, 126, .@i, " ", BARRICADE_, "eBG_Conquest::OnBarricade2");
				bg_monster(.Defender, .Castle$, 127, .@i+1, " ", BARRICADE_, "eBG_Conquest::OnBarricade2");
			}
			for (.@i = 40; .@i <= 46; .@i += 2) {
				bg_monster(.Defender, .Castle$, .@i, 315, " ", BARRICADE_, "eBG_Conquest::OnBarricade3");
			}
			break;
		case 5:
			for (.@i = 139; .@i <= 145; .@i += 2) {
				bg_monster(.Defender, .Castle$, .@i, 111, " ", BARRICADE_, "eBG_Conquest::OnBarricade0");
				bg_monster(.Defender, .Castle$, .@i, 262, " ", BARRICADE_, "eBG_Conquest::OnBarricade3");
				if (.@i <= 143) {
					bg_monster(.Defender, .Castle$, .@i, 156, " ", BARRICADE_, "eBG_Conquest::OnBarricade1");
					bg_monster(.Defender, .Castle$, .@i+1, 157, " ", BARRICADE_, "eBG_Conquest::OnBarricade1");
					bg_monster(.Defender, .Castle$, .@i, 208, " ", BARRICADE_, "eBG_Conquest::OnBarricade2");
					bg_monster(.Defender, .Castle$, .@i+1, 209, " ", BARRICADE_, "eBG_Conquest::OnBarricade2");
				}
			}
			break;
	}
	return;
	
OnReadyCheck:
	if ($@eBG_start[BGT_CONQ] != EBG_NOT_STARTED)
		end;

	$@eBG_start[BGT_CONQ] = EBG_RUNNING;
	
	.Castle$ = "ebg_conq0"+ ($bg_conquest_rotate + 1);

	// Attacker/Defender are set before OnBGStart
	if ($bg_conquest_attacker > 2 || $bg_conquest_attacker < 1)
		$bg_conquest_attacker = rand(1, 2);

	.Attacker = getd("$@ebg_conquest_BG_id"+ $bg_conquest_attacker);
	.Defender = $@ebg_conquest_BG_id2;

	if ($bg_conquest_attacker == 2)
		.Defender = $@ebg_conquest_BG_id1;
	
	initnpctimer;
	.time_remaining = getvariableofnpc(.bg_time[BGT_CONQ], "BG_Settings");

	donpcevent("conquest_respawn#14::OnBGStart");
	donpcevent("conquest_respawn#15::OnBGStart");
	.Score = 0;
	
	// Summon All Necessary Stones/Guardians/Emperium
	callsub(OnBuildAll, $bg_conquest_rotate);
	// ======================================
	donpcevent("::OnEmblemConquest");
	sleep 4000;
	mapannounce(.Castle$, bg_info(.Attacker, 1) + " : Move on warriors!! Let's capture this Castle!!", bc_map, bg_info(.Attacker, 2));
	sleep 4000;
	mapannounce(.Castle$, bg_info(.Defender, 1) + " : Protect the Castle and it's Defences to all cost!!", bc_map, bg_info(.Defender, 2));
	end;
	
OnGuardianStone:
	.Score++;

	if (mobcount(.Castle$, "eBG_Conquest::OnGuardianStone"))
		mapannounce(.Castle$, "Guardian Stone has fallen - 6 minutes to destroy the other Stone", bc_map, 0xFFA500);

	bg_addpoints(BG_CONQ_GUARDIAN_S, 1, 1);
	callsub(OnCheckGStone);
	end;

OnCheckGStone:
	initnpctimer;
	.time_remaining = getvariableofnpc(.bg_time[BGT_CONQ], "BG_Settings");

	if (mobcount(.Castle$, "eBG_Conquest::OnGuardianStone") == 0) {
		mapannounce(.Castle$, "Both Guardian Stones has fallen - 6 minutes to destroy the 1st Fortress Gate", bc_map, 0xFFA500);
		killmonster(.Castle$, "eBG_Conquest::OnBarricade0");
		delwall("conq_wall00");
	}
	return;

OnBarricadeFall:
	bg_addpoints BG_CONQ_BARRICADE, 1, 1;
	.@barricade = getarg(0);
	.@wall = mobcount(.Castle$, "eBG_Conquest::OnBarricade"+ .@barricade);
	if (.@wall < 1){
		initnpctimer;
		.time_remaining = getvariableofnpc(.bg_time[BGT_CONQ], "BG_Settings");
		mapannounce(.Castle$, .@barricade +""+ ((.@barricade == 1) ? "st" : ((.@barricade == 2) ? "nd" : "rd")) +" Fortress Gate has fallen - 6 minutes to destroy the "+ ((.@barricade == 1) ? "2nd" : ((.@barricade == 2) ? "3rd" : "Emperium")), bc_map, 0xFFA500);
		.Score++;
		delwall("conq_wall0"+ .@barricade);
	}
	return;

OnBarricade0:
	end;

OnBarricade1:
	callsub(OnBarricadeFall, 1);
	end;
OnBarricade2:
	callsub(OnBarricadeFall, 2);
	end;
OnBarricade3:
	callsub(OnBarricadeFall, 3);
	end;

OnEmperium:
	bg_addpoints BG_CONQ_EMPERIUM, 1, 1;
	.Score++;
	mapannounce(.Castle$, "The " + bg_info(.Attacker,0) + " army has won the Battle and captured the Castle!!", bc_map, bg_info(.Attacker, 2));
	donpcevent("eBG_Conquest::OnMatchEnd");
	end;

OnTimer60000:
	.time_remaining--;
	if (.time_remaining != 0) {
		mapannounce(.Castle$, "Battle of Conquest will ends in "+ .time_remaining +" Minutes!!", bc_map, 0xFFA500);
		initnpctimer;
		end;
	}
	mapannounce(.Castle$, "The " + bg_info(.Defender,0) + " army has won the Battle and protected the Castle!!", bc_map, bg_info(.Defender, 2));
OnMatchEnd:
OnMatchStop:
	stopnpctimer;
	donpcevent("conquest_respawn#14::OnBGStop");
	donpcevent("conquest_respawn#15::OnBGStop");
	killmonster(.Castle$, "eBG_Conquest::OnBarricade0");
	killmonster(.Castle$, "eBG_Conquest::OnBarricade1");
	killmonster(.Castle$, "eBG_Conquest::OnBarricade2");
	killmonster(.Castle$, "eBG_Conquest::OnBarricade3");
	killmonster(.Castle$, "eBG_Conquest::OnGuardianStone");
	killmonster(.Castle$, "eBG_Conquest::OnEmperium");
	$@eBG_start[BGT_CONQ] = EBG_ENDING;
	// =======================================================
	// Team Rewards
	// =======================================================
	callfunc("F_eBGReward", BGT_CONQ, $bg_conquest, 2, .Score, $bg_conquest[0] - .Score, 1, 1, 3);
	// =======================================================
	.Score = 0;
	sleep(5000);
	callfunc("F_EndeBG", "ebg_conquest", 2, "ebg_conq0"+ ($bg_conquest_rotate + 1));

	// Delete Wall(s)
	for (.@i = 0; @i <= 3; ++.@i) {
		if (checkwall("conq_wall0"+ .@i)) {
			delwall("conq_wall0"+ .@i);
		}
	}
	end;
}

// Battleground Therapist

ebg_conq01,260,383,5	duplicate(Therapist#eBG)	Therapist in battle#cq1	4_F_SISTER
ebg_conq01,299,383,5	duplicate(Therapist#eBG)	Therapist in battle#cq2	4_F_SISTER

ebg_conq02,86,315,3	duplicate(Therapist#eBG)	Therapist in battle#cq3	4_F_SISTER
ebg_conq02,117,315,3	duplicate(Therapist#eBG)	Therapist in battle#cq4	4_F_SISTER

ebg_conq03,23,50,6	duplicate(Therapist#eBG)	Therapist in battle#cq5	4_F_SISTER
ebg_conq03,92,50,6	duplicate(Therapist#eBG)	Therapist in battle#cq6	4_F_SISTER

ebg_conq04,26,385,5	duplicate(Therapist#eBG)	Therapist in battle#cq7	4_F_SISTER
ebg_conq04,122,361,5	duplicate(Therapist#eBG)	Therapist in battle#cq8	4_F_SISTER

ebg_conq05,304,342,3	duplicate(Therapist#eBG)	Therapist in battle#cq9	4_F_SISTER
ebg_conq05,304,305,3	duplicate(Therapist#eBG)	Therapist in battle#c10	4_F_SISTER

ebg_conq06,310,154,6	duplicate(Therapist#eBG)	Therapist in battle#c11	4_F_SISTER
ebg_conq06,333,154,6	duplicate(Therapist#eBG)	Therapist in battle#c12	4_F_SISTER


// Battleground Respawn

ebg_conq01,0,0,0	duplicate(respawn_script#bg)	conquest_respawn#14	HIDDEN_WARP_NPC	// Conquest_Respawn
ebg_conq01,0,0,0	duplicate(respawn_script#bg)	conquest_respawn#15	HIDDEN_WARP_NPC	// Conquest_Respawn

// Flags ebg_conq01

ebg_conq01,106,302,0	script	eBG-LF-01#01	HIDDEN_NPC,{
	if (getcharid(4) == getvariableofnpc(.Defender,"eBG_Conquest")) {
		.@index = atoi(strnpcinfo(2));
		mes("^3355FFThis is the Stronghold");
		mes("Teleport Service. Please");
		mes("choose a destination");
		mes("within the stronghold.^000000");
		.@opt = select(.menu$[.@index] +":Cancel") - 1;
		.@size = getarraysize(getd(".warp" + (.@index + 1)))/2;
		if (.@opt == .@size)
			close;
		// warp map, x, y
		warp("ebg_conq01",getd(".warp"+ (.@index + 1) +"["+ (.@opt * 2) +"]"), getd(".warp"+ (.@index + 1) +"["+ ((.@opt*2) + 1) +"]"));
	}
	end;
	
OnInit:
	setarray .menu$,"First Gate House:Second Gate House",
					"Defence Area 1-1:Defence Area 1-2",
					"Defence Area 2-1:Defence Area 2-2",
					"Defence Area 2-3:Defence Area 2-4",
					"Defence Area 2-3:Defence Area 2-4",
					"Defence Area 3-1:Defence Area 3-2",
					"Area, Centre 1:Area, Centre 2",
					"Area 1-1:Area 2-1:Area 3-1",
					"Area 1-2:Area 2-3:Area 3-2";	
	setarray .warp1,19,26,
					219,90;
	setarray .warp2,89,43,
					141,45;
	setarray .warp3,137,54,
					102,54;
	setarray .warp4,94,147,
					163,140;
	setarray .warp5,87,220,
					151,220;
	setarray .warp6,100,242,
					136,242;
	setarray .warp7,120,168,
					119,211;
	setarray .warp8,89,43,
					94,147,
					100,242;
	setarray .warp9,141,45,
					163,140,
					136,243;
	end;
}

ebg_conq01,109,302,0	duplicate(eBG-LF-01#01)	eBG-LF-02#02	HIDDEN_NPC
ebg_conq01,112,302,0	duplicate(eBG-LF-01#01)	eBG-LF-03#03	HIDDEN_NPC
ebg_conq01,115,302,0	duplicate(eBG-LF-01#01)	eBG-LF-04#04	HIDDEN_NPC
ebg_conq01,118,302,0	duplicate(eBG-LF-01#01)	eBG-LF-05#05	HIDDEN_NPC
ebg_conq01,121,302,0	duplicate(eBG-LF-01#01)	eBG-LF-06#06	HIDDEN_NPC
ebg_conq01,124,302,0	duplicate(eBG-LF-01#01)	eBG-LF-07#07	HIDDEN_NPC
ebg_conq01,127,302,0	duplicate(eBG-LF-01#01)	eBG-LF-08#08	HIDDEN_NPC
ebg_conq01,130,302,0	duplicate(eBG-LF-01#01)	eBG-LF-09#09	HIDDEN_NPC

ebg_conq01,17,45,0	script	Castle#eLF_sc06_1::eBG_LF_sc06_1	HIDDEN_NPC,{
	if (getcharid(4) == getvariableofnpc(.Defender, "eBG_Conquest")) {
		mes("^3355FFThis is the Stronghold");
		mes("Teleport Service. Would");
		mes("you like to teleport to");
		mes("the Flag Center?^000000");
		if (select("Teleport", "Cancel") == 2)
			close;
		warp("ebg_conq01",120,290);
	}
	end;

OnEmblemConquest:
	.@npc$ = strnpcinfo(2);
	if (.@npc$ == "eLF_sc06_3" || .@npc$ == "eLF_sc06_4" || .@npc$ == "eLF_sc06_7" || .@npc$ == "eLF_sc06_8")
		flagemblem(getvariableofnpc(.Defender,"eBG_Conquest"));
	end;
}

ebg_conq01,207,95,0	duplicate(eBG_LF_sc06_1)	Castle#eLF_sc06_2	HIDDEN_NPC
ebg_conq01,99,77,0	duplicate(eBG_LF_sc06_1)	Castle#eLF_sc06_5	HIDDEN_NPC
ebg_conq01,140,77,0	duplicate(eBG_LF_sc06_1)	Castle#eLF_sc06_6	HIDDEN_NPC
ebg_conq01,112,212,0	duplicate(eBG_LF_sc06_1)	Castle#eLF_sc06_9	HIDDEN_NPC
ebg_conq01,127,212,0	duplicate(eBG_LF_sc06_1)	Castle#eLF_sc06_10	HIDDEN_NPC
ebg_conq01,113,238,0	duplicate(eBG_LF_sc06_1)	Castle#eLF_sc06_11	HIDDEN_NPC
ebg_conq01,126,238,0	duplicate(eBG_LF_sc06_1)	Castle#eLF_sc06_12	HIDDEN_NPC
ebg_conq01,95,247,0	duplicate(eBG_LF_sc06_1)	Castle#eLF_sc06_13	HIDDEN_NPC
ebg_conq01,144,247,0	duplicate(eBG_LF_sc06_1)	Castle#eLF_sc06_14	HIDDEN_NPC

ebg_conq01,111,46,4	duplicate(eBG_LF_sc06_1)	Castle#eLF_sc06_3	GUILD_FLAG
ebg_conq01,129,46,4	duplicate(eBG_LF_sc06_1)	Castle#eLF_sc06_4	GUILD_FLAG
ebg_conq01,109,150,4	duplicate(eBG_LF_sc06_1)	Castle#eLF_sc06_7	GUILD_FLAG
ebg_conq01,130,150,4	duplicate(eBG_LF_sc06_1)	Castle#eLF_sc06_8	GUILD_FLAG

// Flags ebg_conq02

ebg_conq02,143,198,0	script	eBG-LF-02#11	HIDDEN_NPC,{
	if (getcharid(4) == getvariableofnpc(.Defender, "eBG_Conquest")) {
		.@index = atoi(strnpcinfo(2))-10;
		mes("^3355FFThis is the Stronghold");
		mes("Teleport Service. Please");
		mes("choose a destination");
		mes("within the stronghold.^000000");
		.@opt = select(.menu$[.@index]+":Cancel")-1;
		.@size = getarraysize(getd(".warp" + (.@index + 1)))/2;
		if (.@opt == .@size)
			close;
		warp("ebg_conq02",getd(".warp"+ (.@index + 1) +"["+ (.@opt * 2) +"]"), getd(".warp"+ (.@index + 1) +"["+ ((.@opt*2) + 1) +"]"));
	}
	end;
	
OnInit:
	setarray .menu$,"First Gate House:Second Gate House",
					"Defence Area 1-1:Defence Area 1-2",
					"Defence Area 2-1:Defence Area 2-2",
					"Defence Area 3-1:Defence Area 3-2",
					"Area, Centre 1:Area, Centre 2",
					"Area 1-1:Area 2-1:Area 3-1",
					"Area 1-2:Area 2-3:Area 3-2";
					
	setarray .warp1,235,44,
					302,233;
	setarray .warp2,317,83,
					359,83;
	setarray .warp3,283,79,
					280,122;
	setarray .warp4,215,110,
					255,215;
	setarray .warp5,338,153,
					213,226;
	setarray .warp6,317,83,
					283,79,
					215,110;
	setarray .warp7,359,83,
					280,122,
					255,215;
	end;
}

ebg_conq02,143,202,0	duplicate(eBG-LF-02#11)	eBG-LF-02#12	HIDDEN_NPC
ebg_conq02,143,206,0	duplicate(eBG-LF-02#11)	eBG-LF-03#13	HIDDEN_NPC
ebg_conq02,145,208,0	duplicate(eBG-LF-02#11)	eBG-LF-04#14	HIDDEN_NPC
ebg_conq02,180,208,0	duplicate(eBG-LF-02#11)	eBG-LF-05#15	HIDDEN_NPC
ebg_conq02,182,206,0	duplicate(eBG-LF-02#11)	eBG-LF-06#16	HIDDEN_NPC
ebg_conq02,182,202,0	duplicate(eBG-LF-02#11)	eBG-LF-07#17	HIDDEN_NPC


ebg_conq02,235,222,0	script	Andlangr#eLF_sc07_1::eBG_LF_sc07_1	HIDDEN_NPC,{
	if (getcharid(4) == getvariableofnpc(.Defender, "eBG_Conquest")) {
		mes("^3355FFThis is the Stronghold");
		mes("Teleport Service. Would");
		mes("you like to teleport to");
		mes("the Flag Center?^000000");
		if (select("Teleport", "Cancel") == 2)
			close;
		warp("ebg_conq02",136,188);
	}
	end;
}

ebg_conq02,157,136,0	duplicate(eBG_LF_sc07_1)	Andlangr#eLF_sc07_2	HIDDEN_NPC
ebg_conq02,168,136,4	duplicate(eBG_LF_sc07_1)	Andlangr#eLF_sc07_3	HIDDEN_NPC
ebg_conq02,320,232,4	duplicate(eBG_LF_sc07_1)	Andlangr#eLF_sc07_4	HIDDEN_NPC
ebg_conq02,295,109,0	duplicate(eBG_LF_sc07_1)	Andlangr#eLF_sc07_5	HIDDEN_NPC
ebg_conq02,295,92,0	duplicate(eBG_LF_sc07_1)	Andlangr#eLF_sc07_6	HIDDEN_NPC
ebg_conq02,285,90,4	duplicate(eBG_LF_sc07_1)	Andlangr#eLF_sc07_7	HIDDEN_NPC
ebg_conq02,285,190,4	duplicate(eBG_LF_sc07_1)	Andlangr#eLF_sc07_8	HIDDEN_NPC
ebg_conq02,238,66,0	duplicate(eBG_LF_sc07_1)	Andlangr#eLF_sc07_9	HIDDEN_NPC
ebg_conq02,230,45,0	duplicate(eBG_LF_sc07_1)	Andlangr#eLF_sc07_10	HIDDEN_NPC
ebg_conq02,233,120,0	duplicate(eBG_LF_sc07_1)	Andlangr#eLF_sc07_11	HIDDEN_NPC
ebg_conq02,247,120,0	duplicate(eBG_LF_sc07_1)	Andlangr#eLF_sc07_12	HIDDEN_NPC
ebg_conq02,261,162,0	duplicate(eBG_LF_sc07_1)	Andlangr#eLF_sc07_13	HIDDEN_NPC
ebg_conq02,244,162,0	duplicate(eBG_LF_sc07_1)	Andlangr#eLF_sc07_14	HIDDEN_NPC
ebg_conq02,235,207,0	duplicate(eBG_LF_sc07_1)	Andlangr#eLF_sc07_15	HIDDEN_NPC

// Flags ebg_conq03

ebg_conq03,346,211,0	script	eBG-LF-01#21	HIDDEN_NPC,{
	if (getcharid(4) == getvariableofnpc(.Defender, "eBG_Conquest")) {
		.@index = atoi(strnpcinfo(2))-20;
		mes("^3355FFThis is the Stronghold");
		mes("Teleport Service. Please");
		mes("choose a destination");
		mes("within the stronghold.^000000");
		.@opt = select(.menu$[.@index]+":Cancel")-1;
		.@size = getarraysize(getd(".warp" + (.@index + 1)))/2;
		if (.@opt == .@size)
			close;
		warp("ebg_conq03",getd(".warp"+ (.@index + 1) +"["+ (.@opt * 2) +"]"), getd(".warp"+ (.@index + 1) +"["+ ((.@opt*2) + 1) +"]"));
	}
	end;
	
OnInit:
	setarray .menu$,"First Gate House:Second Gate House",
					"Area, Centre 1",
					"Defence Area 2-1:Defence Area 2-2",
					"Area, Centre 2",
					"Defence Area 3-1:Defence Area 3-2",
					"Area, Centre 3",
					"Area 1-2:Area 2-2:Area 3-2",
					"Area 2-1:Area 2-2:Area, Centre 2",
					"Area 3-1:Area 3-2:Area, Centre 3";
					
	setarray .warp1,262,323,
					378,263;
	setarray .warp2,306,320;
	setarray .warp3,309,292,
					348,292;
	setarray .warp4,266,263;
	setarray .warp5,266,220,
					185,249;
	setarray .warp6,271,226;
	setarray .warp7,262,323,
					378,263,
					306,320;
	setarray .warp8,309,292,
					348,292,
					326,263;
	setarray .warp9,226,220,
					185,249,
					271,226;
	end;
}

ebg_conq03,346,207,0	duplicate(eBG-LF-01#21)	eBG-LF-02#22	HIDDEN_NPC
ebg_conq03,346,203,0	duplicate(eBG-LF-01#21)	eBG-LF-03#23	HIDDEN_NPC
ebg_conq03,346,199,0	duplicate(eBG-LF-01#21)	eBG-LF-04#24	HIDDEN_NPC
ebg_conq03,346,195,0	duplicate(eBG-LF-01#21)	eBG-LF-05#25	HIDDEN_NPC
ebg_conq03,346,191,0	duplicate(eBG-LF-01#21)	eBG-LF-06#26	HIDDEN_NPC
ebg_conq03,301,213,0	duplicate(eBG-LF-01#21)	eBG-LF-07#27	HIDDEN_NPC
ebg_conq03,301,209,0	duplicate(eBG-LF-01#21)	eBG-LF-08#28	HIDDEN_NPC
ebg_conq03,301,194,0	duplicate(eBG-LF-01#21)	eBG-LF-09#29	HIDDEN_NPC

ebg_conq03,335,305,0	script	Vidblainn#eLF_sc08_1::eLF_sc08_1	HIDDEN_NPC,{
	if (getcharid(4) == getvariableofnpc(.Defender, "eBG_Conquest")) {
		mes("^3355FFThis is the Stronghold");
		mes("Teleport Service. Would");
		mes("you like to teleport to");
		mes("the Flag Center?^000000");
		if (select("Teleport", "Cancel") == 2)
			close;
		warp("ebg_conq03",308,202);
	}
	end;

OnEmblemConquest:
	.@npc$ = strnpcinfo(2);
	if (.@npc$ == "eLF_sc08_12" || .@npc$ == "eLF_sc08_13" || .@npc$ == "eLF_sc08_14" || .@npc$ == "eLF_sc08_11")
		flagemblem getvariableofnpc(.Defender, "eBG_Conquest");
	end;
}

ebg_conq03,322,305,0	duplicate(eLF_sc08_1)	Vidblainn#eLF_sc08_2	HIDDEN_NPC
ebg_conq03,352,248,0	duplicate(eLF_sc08_1)	Vidblainn#eLF_sc08_3	HIDDEN_NPC
ebg_conq03,320,283,0	duplicate(eLF_sc08_1)	Vidblainn#eLF_sc08_4	HIDDEN_NPC
ebg_conq03,337,283,0	duplicate(eLF_sc08_1)	Vidblainn#eLF_sc08_5	HIDDEN_NPC
ebg_conq03,233,320,0	duplicate(eLF_sc08_1)	Vidblainn#eLF_sc08_6	HIDDEN_NPC
ebg_conq03,207,239,0	duplicate(eLF_sc08_1)	Vidblainn#eLF_sc08_7	HIDDEN_NPC
ebg_conq03,207,228,0	duplicate(eLF_sc08_1)	Vidblainn#eLF_sc08_8	HIDDEN_NPC
ebg_conq03,266,206,0	duplicate(eLF_sc08_1)	Vidblainn#eLF_sc08_9	HIDDEN_NPC
ebg_conq03,266,197,0	duplicate(eLF_sc08_1)	Vidblainn#eLF_sc08_10	HIDDEN_NPC

ebg_conq03,283,206,2	duplicate(eLF_sc08_1)	Vidblainn#eLF_sc08_11	GUILD_FLAG
ebg_conq03,283,197,2	duplicate(eLF_sc08_1)	Vidblainn#eLF_sc08_12	GUILD_FLAG
ebg_conq03,332,323,6	duplicate(eLF_sc08_1)	Vidblainn#eLF_sc08_13	GUILD_FLAG
ebg_conq03,343,323,2	duplicate(eLF_sc08_1)	Vidblainn#eLF_sc08_14	GUILD_FLAG

// Flags ebg_conq04

ebg_conq04,74,232,0	script	eBG-LF-01#31	HIDDEN_NPC,{
	if (getcharid(4) == getvariableofnpc(.Defender, "eBG_Conquest")) {
		.@index = atoi(strnpcinfo(2))-30;
		mes("^3355FFThis is the Stronghold");
		mes("Teleport Service. Please");
		mes("choose a destination");
		mes("within the stronghold.^000000");
		.@opt = select(.menu$[.@index]+":Cancel")-1;
		.@size = getarraysize(getd(".warp" + (.@index + 1)))/2;
		if (.@opt == .@size)
			close;
		warp("ebg_conq04",getd(".warp"+ (.@index + 1) +"["+ (.@opt * 2) +"]"), getd(".warp"+ (.@index + 1) +"["+ ((.@opt*2) + 1) +"]"));
	}
	end;
	
OnInit:
	setarray .menu$,"First Gate House:Second Gate House",
					"Defence Area 1-1:Defence Area 1-2",
					"Defence Area 2-1:Defence Area 2-2",
					"Defence Area 2-3:Defence Area 2-4",
					"Defence Area 3-1:Defence Area 3-2",
					"Defence Area 3-3:Defence Area 3-4",
					"Gate House Fork",
					"Area 1-1:Area 2-1:Area 3-1",
					"Area 1-2:Area 2-2:Area 3-3";
					
	setarray .warp1,158,237,
					297,248;
	setarray .warp2,197,144,
					245,103;
	setarray .warp3,256,35,
					186,26;
	setarray .warp4,146,65,
					176,111;
	setarray .warp5,94,126,
					126,126;
	setarray .warp6,68,171,
					105,182;
	setarray .warp7,233,130;
	setarray .warp8,197,144,
					256,35,
					146,65;
	setarray .warp9,245,103,
					186,26,
					68,171;
	end;
}

ebg_conq04,77,232,0	duplicate(eBG-LF-01#31)	eBG-LF-02#32	HIDDEN_NPC
ebg_conq04,80,232,0	duplicate(eBG-LF-01#31)	eBG-LF-03#33	HIDDEN_NPC
ebg_conq04,83,232,0	duplicate(eBG-LF-01#31)	eBG-LF-04#34	HIDDEN_NPC
ebg_conq04,86,232,0	duplicate(eBG-LF-01#31)	eBG-LF-05#35	HIDDEN_NPC
ebg_conq04,89,232,0	duplicate(eBG-LF-01#31)	eBG-LF-06#36	HIDDEN_NPC
ebg_conq04,92,232,0	duplicate(eBG-LF-01#31)	eBG-LF-07#37	HIDDEN_NPC
ebg_conq04,95,232,0	duplicate(eBG-LF-01#31)	eBG-LF-08#38	HIDDEN_NPC
ebg_conq04,98,232,0	duplicate(eBG-LF-01#31)	eBG-LF-09#39	HIDDEN_NPC

ebg_conq04,72,176,0	script	Mardol#eLF_ar06_1::eLF_ar06_1	HIDDEN_NPC,{
	if (getcharid(4) == getvariableofnpc(.Defender, "eBG_Conquest")) {
		mes("^3355FFThis is the Stronghold");
		mes("Teleport Service. Would");
		mes("you like to teleport to");
		mes("the Flag Center?^000000");
		if (select("Teleport", "Cancel") == 2)
			close;
		warp("ebg_conq04",67,193);
	}
	end;

OnEmblemConquest:
	.@npc$ = strnpcinfo(2);
	if (.@npc$ == "eLF_ar06_3" || .@npc$ == "eLF_ar06_03" || .@npc$ == "eLF_ar06_12" || .@npc$ == "eLF_ar06_13" || .@npc$ == "eLF_ar06_14")
		flagemblem getvariableofnpc(.Defender,"eBG_Conquest");
	end;
}

ebg_conq04,103,186,0	duplicate(eLF_ar06_1)	Mardol#eLF_ar06_2	HIDDEN_NPC
ebg_conq04,150,102,0	duplicate(eLF_ar06_1)	Mardol#eLF_ar06_4	HIDDEN_NPC
ebg_conq04,208,68,0	duplicate(eLF_ar06_1)	Mardol#eLF_ar06_5	HIDDEN_NPC
ebg_conq04,249,52,0	duplicate(eLF_ar06_1)	Mardol#eLF_ar06_6	HIDDEN_NPC
ebg_conq04,234,76,0	duplicate(eLF_ar06_1)	Mardol#eLF_ar06_7	HIDDEN_NPC
ebg_conq04,249,76,0	duplicate(eLF_ar06_1)	Mardol#eLF_ar06_8	HIDDEN_NPC
ebg_conq04,204,142,0	duplicate(eLF_ar06_1)	Mardol#eLF_ar06_9	HIDDEN_NPC
ebg_conq04,183,244,0	duplicate(eLF_ar06_1)	Mardol#eLF_ar06_10	HIDDEN_NPC
ebg_conq04,292,219,0	duplicate(eLF_ar06_1)	Mardol#eLF_ar06_11	HIDDEN_NPC

ebg_conq04,92,126,4	duplicate(eLF_ar06_1)	Mardol#eLF_ar06_3	GUILD_FLAG
ebg_conq04,127,126,4	duplicate(eLF_ar06_1)	Mardol#eLF_ar06_03	GUILD_FLAG
ebg_conq04,102,120,4	duplicate(eLF_ar06_1)	Mardol#eLF_ar06_12	GUILD_FLAG
ebg_conq04,117,120,4	duplicate(eLF_ar06_1)	Mardol#eLF_ar06_13	GUILD_FLAG
ebg_conq04,233,140,4	duplicate(eLF_ar06_1)	Mardol#eLF_ar06_14	GUILD_FLAG

// Flags ebg_conq05

ebg_conq05,98,270,0	script	eBG-LF-01#41	HIDDEN_NPC,{
	if (getcharid(4) == getvariableofnpc(.Defender, "eBG_Conquest")) {
		.@index = atoi(strnpcinfo(2))-40;
		mes("^3355FFThis is the Stronghold");
		mes("Teleport Service. Please");
		mes("choose a destination");
		mes("within the stronghold.^000000");
		.@opt = select(.menu$[.@index]+":Cancel")-1;
		.@size = getarraysize(getd(".warp" + (.@index + 1)))/2;
		if (.@opt == .@size)
			close;
		warp("ebg_conq05",getd(".warp"+ (.@index + 1) +"["+ (.@opt * 2) +"]"), getd(".warp"+ (.@index + 1) +"["+ ((.@opt*2) + 1) +"]"));
	}
	end;
	
OnInit:
	setarray .menu$,"First Gate House:Second Gate House",
					"Defence Area 1-1:Defence Area 1-2",
					"Defence Area 1-3:Defence Area 1-4",
					"Defence Area 2-1:Defence Area 2-2",
					"Defence Area 2-3:Defence Area 2-4",
					"Defence Area 3-1:Defence Area 3-2",
					"Area, Centre 1:Area, Centre 3";
					
	setarray .warp1,10,187,
					268,187;
	setarray .warp2,66,31,
					212,31;
	setarray .warp3,90,120,
					188,119;
	setarray .warp4,119,183,
					159,183;
	setarray .warp5,156,324,
					174,372;
	setarray .warp6,28,325,
					57,325;
	setarray .warp7,156,263,
					43,354;
	end;
}

ebg_conq05,98,266,0	duplicate(eBG-LF-01#41)	eBG-LF-02#42	HIDDEN_NPC
ebg_conq05,98,262,0	duplicate(eBG-LF-01#41)	eBG-LF-03#43	HIDDEN_NPC
ebg_conq05,98,258,0	duplicate(eBG-LF-01#41)	eBG-LF-04#44	HIDDEN_NPC
ebg_conq05,98,253,0	duplicate(eBG-LF-01#41)	eBG-LF-05#45	HIDDEN_NPC
ebg_conq05,98,249,0	duplicate(eBG-LF-01#41)	eBG-LF-06#46	HIDDEN_NPC
ebg_conq05,98,245,0	duplicate(eBG-LF-01#41)	eBG-LF-07#47	HIDDEN_NPC

ebg_conq05,216,92,0	script	Cyr#eLF_ar07_1::eLF_ar07_1	HIDDEN_NPC,{
	if (getcharid(4) == getvariableofnpc(.Defender, "eBG_Conquest")) {
		mes("^3355FFThis is the Stronghold");
		mes("Teleport Service. Would");
		mes("you like to teleport to");
		mes("the Flag Center?^000000");
		if (select("Teleport", "Cancel") == 2)
			close;
		warp("ebg_conq05",43,256);
	}
	end;
	
OnEmblemConquest:
	.@npc$ = strnpcinfo(2);
	if (.@npc$ == "eLF_ar07_2" || .@npc$ == "eLF_ar07_14" || .@npc$ == "eLF_ar07_15" || .@npc$ == "eLF_ar07_16")
		flagemblem getvariableofnpc(.Defender,"eBG_Conquest");
	end;
}

ebg_conq05,63,92,0	duplicate(eLF_ar07_1)	Cyr#eLF_ar07_2	HIDDEN_NPC
ebg_conq05,127,133,4	duplicate(eLF_ar07_1)	Cyr#eLF_ar07_3	HIDDEN_NPC
ebg_conq05,152,133,4	duplicate(eLF_ar07_1)	Cyr#eLF_ar07_4	HIDDEN_NPC
ebg_conq05,149,218,0	duplicate(eLF_ar07_1)	Cyr#eLF_ar07_5	HIDDEN_NPC
ebg_conq05,162,218,0	duplicate(eLF_ar07_1)	Cyr#eLF_ar07_6	HIDDEN_NPC
ebg_conq05,128,350,0	duplicate(eLF_ar07_1)	Cyr#eLF_ar07_7	HIDDEN_NPC
ebg_conq05,128,341,0	duplicate(eLF_ar07_1)	Cyr#eLF_ar07_8	HIDDEN_NPC
ebg_conq05,49,317,0	duplicate(eLF_ar07_1)	Cyr#eLF_ar07_9	HIDDEN_NPC
ebg_conq05,30,317,0	duplicate(eLF_ar07_1)	Cyr#eLF_ar07_10	HIDDEN_NPC
ebg_conq05,9,190,0	duplicate(eLF_ar07_1)	Cyr#eLF_ar07_11	HIDDEN_NPC
ebg_conq05,271,190,0	duplicate(eLF_ar07_1)	Cyr#eLF_ar07_12	HIDDEN_NPC

ebg_conq05,129,178,4	duplicate(eLF_ar07_1)	Cyr#eLF_ar07_2-2	GUILD_FLAG
ebg_conq05,149,178,4	duplicate(eLF_ar07_1)	Cyr#LF_ar07_14	GUILD_FLAG
ebg_conq05,132,38,4	duplicate(eLF_ar07_1)	Cyr#LF_ar07_15	GUILD_FLAG
ebg_conq05,147,38,4	duplicate(eLF_ar07_1)	Cyr#LF_ar07_16	GUILD_FLAG

// Flags ebg_conq06

ebg_conq06,122,314,0	script	eBG-LF-01#51	HIDDEN_NPC,{
	if (getcharid(4) == getvariableofnpc(.Defender, "eBG_Conquest")) {
		.@index = atoi(strnpcinfo(2))-50;
		mes("^3355FFThis is the Stronghold");
		mes("Teleport Service. Please");
		mes("choose a destination");
		mes("within the stronghold.^000000");
		.@opt = select(.menu$[.@index]+":Cancel")-1;
		.@size = getarraysize(getd(".warp" + (.@index + 1)))/2;
		if (.@opt == .@size)
			close;
		warp("ebg_conq06",getd(".warp"+ (.@index + 1) +"["+ (.@opt * 2) +"]"), getd(".warp"+ (.@index + 1) +"["+ ((.@opt*2) + 1) +"]"));
	}
	end;
	
OnInit:
	setarray .menu$,"First Gate House:Second Gate House",
					"Defence Area 1-1:Defence Area 1-2",
					"Defence Area 1-3:Defence Area 1-4",
					"Defence Area 2-1:Defence Area 2-2",
					"Defence Area 2-3:Defence Area 2-4",
					"Defence Area 3-1:Defence Area 3-2",
					"Defence Area 1-1:Defence Area 2-1:Defence Area 3-1",
					"Defence Area 1-2:Defence Area 2-3:Defence Area 3-2",
					"Defence Area 1-4:Defence Area 2-4";
					
	setarray .warp1,84,158,
					197,136;
	setarray .warp2,65,94,
					211,97;
	setarray .warp3,112,73,
					171,73;
	setarray .warp4,112,152,
					172,152;
	setarray .warp5,120,186,
					162,186;
	setarray .warp6,116,235,
					164,235;
	setarray .warp7,65,94,
					112,152,
					116,235;
	setarray .warp8,211,97,
					172,152,
					164,235;
	setarray .warp9,171,73,
					162,186;
	end;
}

ebg_conq06,125,314,0	duplicate(eBG-LF-01#51)	eBG-LF-02#52	HIDDEN_NPC
ebg_conq06,128,314,0	duplicate(eBG-LF-01#51)	eBG-LF-03#53	HIDDEN_NPC
ebg_conq06,131,314,0	duplicate(eBG-LF-01#51)	eBG-LF-04#54	HIDDEN_NPC
ebg_conq06,134,314,0	duplicate(eBG-LF-01#51)	eBG-LF-05#55	HIDDEN_NPC
ebg_conq06,149,314,0	duplicate(eBG-LF-01#51)	eBG-LF-06#56	HIDDEN_NPC
ebg_conq06,152,314,0	duplicate(eBG-LF-01#51)	eBG-LF-07#57	HIDDEN_NPC
ebg_conq06,155,314,0	duplicate(eBG-LF-01#51)	eBG-LF-08#58	HIDDEN_NPC
ebg_conq06,158,314,0	duplicate(eBG-LF-01#51)	eBG-LF-09#59	HIDDEN_NPC

ebg_conq06,45,158,0	script	Horn#eLF_ar08_01::eLF_ar08_01	HIDDEN_NPC,{
	if (getcharid(4) == getvariableofnpc(.Defender, "eBG_Conquest")) {
		mes("^3355FFThis is the Stronghold");
		mes("Teleport Service. Would");
		mes("you like to teleport to");
		mes("the Flag Center?^000000");
		if (select("Teleport", "Cancel") == 2)
			close;
		warp("ebg_conq06", 121, 318);
	}
	end;
	
OnEmblemConquest:
	.@npc$ = strnpcinfo(2);
	if (.@npc$ == "eLF_ar08_10" || .@npc$ == "eLF_ar08_11" || .@npc$ == "eLF_ar08_12" || .@npc$ == "eLF_ar08_13")
		flagemblem getvariableofnpc(.Defender,"eBG_Conquest");
	end;
}

ebg_conq06,226,156,0	duplicate(eLF_ar08_01)	Horn#eLF_ar08_01	HIDDEN_NPC
ebg_conq06,134,62,4	duplicate(eLF_ar08_01)	Horn#eLF_ar08_02	HIDDEN_NPC
ebg_conq06,149,62,4	duplicate(eLF_ar08_01)	Horn#eLF_ar08_03	HIDDEN_NPC
ebg_conq06,123,154,0	duplicate(eLF_ar08_01)	Horn#eLF_ar08_04	HIDDEN_NPC
ebg_conq06,160,154,0	duplicate(eLF_ar08_01)	Horn#eLF_ar08_05	HIDDEN_NPC
ebg_conq06,135,205,0	duplicate(eLF_ar08_01)	Horn#eLF_ar08_06	HIDDEN_NPC
ebg_conq06,148,205,0	duplicate(eLF_ar08_01)	Horn#eLF_ar08_07	HIDDEN_NPC
ebg_conq06,134,260,0	duplicate(eLF_ar08_01)	Horn#eLF_ar08_08	HIDDEN_NPC

ebg_conq06,148,103,4	duplicate(eLF_ar08_01)	Horn#eLF_ar08_10	GUILD_FLAG
ebg_conq06,135,103,4	duplicate(eLF_ar08_01)	Horn#eLF_ar08_11	GUILD_FLAG
ebg_conq06,63,51,7	duplicate(eLF_ar08_01)	Horn#eLF_ar08_12	GUILD_FLAG
ebg_conq06,214,51,1	duplicate(eLF_ar08_01)	Horn#eLF_ar08_13	GUILD_FLAG

// MapFlags

ebg_conq01	mapflag	battleground
ebg_conq01	mapflag	nomemo
ebg_conq01	mapflag	nosave	SavePoint
ebg_conq01	mapflag	noteleport
ebg_conq01	mapflag	nowarp
ebg_conq01	mapflag	nowarpto
ebg_conq01	mapflag	noreturn
ebg_conq01	mapflag	nobranch
ebg_conq01	mapflag	nopenalty
ebg_conq01	mapflag	nodrop

ebg_conq02	mapflag	battleground
ebg_conq02	mapflag	nomemo
ebg_conq02	mapflag	nosave	SavePoint
ebg_conq02	mapflag	noteleport
ebg_conq02	mapflag	nowarp
ebg_conq02	mapflag	nowarpto
ebg_conq02	mapflag	noreturn
ebg_conq02	mapflag	nobranch
ebg_conq02	mapflag	nopenalty
ebg_conq02	mapflag	nodrop

ebg_conq03	mapflag	battleground
ebg_conq03	mapflag	nomemo
ebg_conq03	mapflag	nosave	SavePoint
ebg_conq03	mapflag	noteleport
ebg_conq03	mapflag	nowarp
ebg_conq03	mapflag	nowarpto
ebg_conq03	mapflag	noreturn
ebg_conq03	mapflag	nobranch
ebg_conq03	mapflag	nopenalty
ebg_conq03	mapflag	nodrop

ebg_conq04	mapflag	battleground
ebg_conq04	mapflag	nomemo
ebg_conq04	mapflag	nosave	SavePoint
ebg_conq04	mapflag	noteleport
ebg_conq04	mapflag	nowarp
ebg_conq04	mapflag	nowarpto
ebg_conq04	mapflag	noreturn
ebg_conq04	mapflag	nobranch
ebg_conq04	mapflag	nopenalty
ebg_conq04	mapflag	nodrop

ebg_conq05	mapflag	battleground
ebg_conq05	mapflag	nomemo
ebg_conq05	mapflag	nosave	SavePoint
ebg_conq05	mapflag	noteleport
ebg_conq05	mapflag	nowarp
ebg_conq05	mapflag	nowarpto
ebg_conq05	mapflag	noreturn
ebg_conq05	mapflag	nobranch
ebg_conq05	mapflag	nopenalty
ebg_conq05	mapflag	nodrop

ebg_conq06	mapflag	battleground
ebg_conq06	mapflag	nomemo
ebg_conq06	mapflag	nosave	SavePoint
ebg_conq06	mapflag	noteleport
ebg_conq06	mapflag	nowarp
ebg_conq06	mapflag	nowarpto
ebg_conq06	mapflag	noreturn
ebg_conq06	mapflag	nobranch
ebg_conq06	mapflag	nopenalty
ebg_conq06	mapflag	nodrop