[scenario]
	id=03_The_Isle_of_Anduin
	#textdomain wesnoth-httt
	name= _ "The Isle of Anduin"
	map_data="{campaigns/Heir_To_The_Throne/maps/03_The_Isle_of_Anduin.map}"
	{SCENARIO_MUSIC "wanderer.ogg"}
	{TURNS 34 24 21}

	{AFTERNOON}
	{DUSK}
	{FIRST_WATCH}
	{SECOND_WATCH}
	{DAWN}
	{MORNING}

	next_scenario=04_The_Bay_of_Pearls

	[event]
	name=prestart
		[objectives]
		side=1
			[objective]
				description= _ "Defeat the enemy leader"
				condition=win
			[/objective]
			[objective]
				description= _ "Death of Konrad"
				condition=lose
			[/objective]
			[objective]
				description= _ "Death of Delfador"
				condition=lose
			[/objective]
			[objective]
				description= _ "Turns run out"
				condition=lose
			[/objective]
		[/objectives]
	[/event]

	{BIGMAP_ISLE_OF_ANDUIN}

	[side]
	type=Commander
	description=Konrad
	user_description= _ "Konrad"
	hitpoints=45
	experience=0
	unrenamable=yes
	side=1
	canrecruit=1
	recruit=Elvish Scout,Elvish Fighter,Elvish Archer,Horseman,Elvish Shaman
	gold=140
	enemy=2
	controller=human
	[/side]

	[side]
	type=Orcish Warrior
	description=Usadar Q'kai
	user_description= _ "Usadar Q'kai"
	experience=0
	side=2
	canrecruit=1
	recruit=Orcish Grunt,Wolf Rider,Orcish Archer,Troll Whelp,Goblin Spearman
	{GOLD 60 120 180}
	enemy=1
		[ai]
		recruitment_pattern=scout,scout,fighter,fighter,archer
		{ATTACK_DEPTH 1 3 5}
		[/ai]

		#make the AI a lot more aggressive at night
		[ai]
		time_of_day=dusk,first_watch,second_watch
		aggression=0.75
		caution=0
		grouping=no
		[/ai]
	[/side]

	#make the orcs start with a whole slew of villages
#ifdef EASY
	{STARTING_VILLAGES 2 10}
#endif
#ifdef NORMAL
	{STARTING_VILLAGES 2 15}
#endif
#ifdef HARD
	{STARTING_VILLAGES 2 20}
#endif

	#if anyone moves next to the ship, they get a rebuke from Konrad
	[event]
	name=moveto
		[filter]
		side=1
		x=31,31,32
		y=9,10,11
		[/filter]
		[message]
		description=Konrad
		message= _ "This is no time to return to our vessel! We must take control of the island!"
		[/message]
	[/event]

	[event]
	name=prestart
		[store_unit]
			variable=konrad_store
			kill=yes
			[filter]
			description=Konrad
			[/filter]
		[/store_unit]
		[store_unit]
			variable=delfador_store
			kill=yes
			[filter]
			description=Delfador
			[/filter]
		[/store_unit]
	[/event]

	[event]
	name=start

	#the ship that brought them here
	[move_unit_fake]
	type=Galleon
	x=33,33,33,33,33,33,32,32,32,32,31
	y=1,2,3,4,5,6,7,8,9,10,11
	[/move_unit_fake]

	{PLACE_IMAGE units/transport/galleon.png 31 11}

	#move Konrad out of the ship and onto the keep
	[move_unit_fake]
	type=$konrad_store.type
	x=30,29,28,27,26,26
	y=11,11,11,12,12,13
	[/move_unit_fake]

	#show Konrad
	[unstore_unit]
	variable=konrad_store
	[/unstore_unit]
	{CLEAR_VARIABLE konrad_store}

	[redraw]
	[/redraw]

	#move Delfador out of the ship and onto the keep
	[move_unit_fake]
	type=$delfador_store.type
	x=30,29,28,27,26
	y=11,11,11,12,12
	[/move_unit_fake]

	#set Delfador's position
	{VARIABLE delfador_store.x 26}
	{VARIABLE delfador_store.y 12}

	#show Delfador
	[unstore_unit]
	variable=delfador_store
	[/unstore_unit]
	{CLEAR_VARIABLE delfador_store}

	[redraw]
	[/redraw]

	[message]
	speaker=narrator
	image="wesnoth-icon.png"
	message= _ "And so the party landed on the Isle of Anduin."
	[/message]
	[message]
	description=Konrad
	message= _ "So this is Anduin. It looks a little... desolate."
	[/message]
	[message]
	description=Delfador
	message= _ "I fear so, Konrad. It seems that the orcs have come even here. Here to the place where I was born, where I was trained."
	[/message]
	[message]
	description=Usadar Q'kai
	message= _ "Who is that? Oh, a party of elves has landed. We shall drive them back into the sea!"
	[/message]
	[message]
	description=Delfador
	message= _ "I did not think the orcs would have come here. This island used to be so beautiful. We must recapture it! To arms!"
	[/message]
	[/event]

	[event]
	name=moveto
		[filter]
		x,y=21,10
		side=1
		[/filter]

		[unit]
		description=Elrian
		user_description= _ "Elrian"
		type=Mage
		x=20
		y=9
		side=1
		[modifications]
			{TRAIT_LOYAL}
			{TRAIT_RESILIENT}
		[/modifications]
		[/unit]

		[message]
		speaker=unit
		message= _ "I found someone hiding in the village!"
		[/message]
		[message]
		description=Elrian
		message= _ "My lords, I have been hiding in the village from the orcs, like many of the other magi here. I pledge myself to your service; let us move swiftly to recapture the island!"
		[/message]
		[message]
		description=Delfador
		message= _ "Certainly, let us join together to fight the evil ones."
		[/message]
		[message]
		speaker=narrator
		image="wesnoth-icon.png"
		message= _ "You can now recruit magi!"
		[/message]
#ifdef EASY
		[message]
		description=Konrad
		message= _ "Surely no orc can stand against us with magi in our ranks! Their magical attacks almost always find their mark, even against well-defended troops."
		[/message]
		[message]
		description=Delfador
		message= _ "Caution, young prince. It is very difficult to train inexperienced magi in combat. When they fight on the front lines of battle, you must protect magi with stronger units else the enemy will make short work of them."
		[/message]
#endif
		[allow_recruit]
		side=1
		type=Mage
		[/allow_recruit]
	[/event]

	[event]
	name=victory
		[unit]
		x=6
		y=35
		type=Arch Mage
		description=Seimus
		user_description= _ "Seimus"
		side=1
		[modifications]
			{TRAIT_LOYAL}
		[/modifications]
		[/unit]

		# The guy does not show up on the screen without some help
		[redraw]
		[/redraw]
		[delay]
		time=1250
		[/delay]

		[message]
		description=Seimus
		message= _ "Delfador, my old master! You have saved the island from the orcs!"
		[/message]

		[message]
		description=Delfador
		message= _ "My apprentice! How did the island fall to such as these?"
		[/message]

		[message]
		description=Seimus
		message= _ "You have not heard, master Delfador? Asheviere is trying to control the entire western coast. She hired many orcs and sent them here. They were holding me until a ship could arrive to take me to Weldyn where I am to stand trial for treason for training magi!"
		[/message]

		[message]
		description=Delfador
		message= _ "We have come from fighting her forces at Blackwater. Where else has she attacked?"
		[/message]

		[message]
		description=Seimus
		message= _ "She has taken control of the Bay of Pearls, long held by the Mermen, and has turned them into slaves. There they dive for pearls by which she grows richer every day. There are even rumors that she may break the ancient treaty and attack Elensefar!"
		[/message]

		[message]
		description=Konrad
		message= _ "Can't we strike back at her? How many forces does she have at the Bay of Pearls? Can we take it back from her?"
		[/message]

		[message]
		description=Delfador
		message= _ "We must indeed go there. Let us therefore rest here a little, and then set sail for the Bay. Hopefully we will defeat her forces there!"
		[/message]

		[kill]
		description=Seimus
		[/kill]
	[/event]

	{campaigns/Heir_To_The_Throne/utils/deaths.cfg}
[/scenario]

