[scenario]
	id=The_Fall
	#textdomain wesnoth-trow
	name= _ "The Fall"
	map_data="{campaigns/The_Rise_Of_Wesnoth/maps/The_Fall.map}"
	{TURNS 23 20 17}

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

	next_scenario=A_Harrowing_Escape

	[music]
	name="northerners.ogg"
	[/music]

	{campaigns/The_Rise_Of_Wesnoth/utils/trow-deaths.cfg}

	[story]
		[part]
			background=story/the_green_isle.png
			show_title=yes
			{CROSS 207 246}
		[/part]
	[/story]


	[side]
		type=Noble Fighter
		description=Prince Haldric
		user_description= _ "Prince Haldric"
		unrenamable=yes
		side=1
		canrecruit=1
		controller=human
		team_name=Haldric
	[/side]

	[side]
		type=Outlaw
		gender=female
		description=Wesfolk Leader
		user_description= _ "Wesfolk Leader"
		profile="portraits/lady_outlaw.png"
		side=2
		canrecruit=1
		recruit=Footpad,Poacher,Thief,Thug
		[ai]
			recruitment_pattern=fighter,fighter,archer,scout
			{NO_SCOUTS}
			aggression=0.15
			caution=0.5
			passive_leader=yes
			grouping=defensive
			{ATTACK_DEPTH 3 4 5}
		[/ai]
		{GOLD 90 130 170}
		team_name=wesfolk
	[/side]

	[side]
		type=Orcish Warlord
		description=Tan-Rarbag
		user_description= _ "Tan-Rarbag"
		side=3
		canrecruit=1
		recruit=Orcish Archer, Orcish Assassin, Orcish Grunt, Wolf Rider, Goblin Spearman
		{GOLD 180 260 350}
		team_name=orcs
		[ai]
			recruitment_pattern=scout,scout,fighter,fighter,archer
			{NO_SCOUTS}
			passive_leader=yes
			recruitment_ignore_bad_movement=yes
		[/ai]
		[ai]
			time_of_day=first_watch,second_watch
			aggression=0.75
			caution=0.0
			grouping=no
		[/ai]
	[/side]

	[side]
		type=Orcish Warrior
		description=Tan-Erang
		user_description= _ "Tan-Erang"
		side=4
		canrecruit=1
		recruit=Orcish Archer, Orcish Assassin, Orcish Grunt, Wolf Rider, Goblin Spearman
		{GOLD 160 220 310}
		team_name=orcs
		[ai]
			recruitment_pattern=scout,scout,fighter,fighter,archer
			{NO_SCOUTS}
		[/ai]
		[ai]
			time_of_day=first_watch,second_watch
			aggression=0.75
			caution=0.0
			grouping=no
		[/ai]
	[/side]

#define NORTH_GUARD X Y
		[unit]
#ifdef EASY
		type=Shock Trooper
#endif
#ifdef NORMAL
		type=Heavy Infantryman
#endif
#ifdef HARD
		type=Heavy Infantryman
#endif
		description=Eldaric's Guard
		user_description= _ "Eldaric's Guard"
		unrenamable=yes
		x={X}
		y={Y}
		[modifications]
			{TRAIT_LOYAL}
		[/modifications]
		[/unit]
#enddef

	[event]
		name=prestart

		{STARTING_VILLAGES 1 6}
		{STARTING_VILLAGES 2 7}

#ifdef EASY
		{GUARD_UNIT (Poacher) (Wesfolk) ( _ "Wesfolk") 2 11 20}
#else
		{GUARD_UNIT (Poacher) (Wesfolk) ( _ "Wesfolk") 2 11 20}
		{GUARD_UNIT (Poacher) (Wesfolk) ( _ "Wesfolk") 2 7 21}
		{GUARD_UNIT (Poacher) (Wesfolk) ( _ "Wesfolk") 2 9 22}
#endif

		[recall]
			description=King Eldaric IV
			x=28
			y=15
		[/recall]

		{NORTH_GUARD 10 6}
		{NORTH_GUARD 12 6}
		{NORTH_GUARD 12 10}

		[objectives]
		side=1
			[objective]
				description= _ "Defeat the Wesfolk Leader"
				condition=win
			[/objective]
			[objective]
				description= _ "Death of Prince Haldric"
				condition=lose
			[/objective]
			[objective]
				description= _ "Death of King Eldaric IV"
				condition=lose
			[/objective]
			[objective]
				description= _ "Orcs kill the Wesfolk Leader"
				condition=lose
			[/objective]
			[objective]
				description= _ "Turns run out"
				condition=lose
			[/objective]
		[/objectives]
	[/event]

	[event]
		name=start

		[message]
			speaker=narrator
			message= _ "Summer passes into fall, and King Eldaric fortifies his frontiers. It is not long before the first orcish scouts are spotted. War has come to the valley."
		[/message]

		[message]
			description=King Eldaric IV
			message= _ "Haldric, things have not gone well! The orcs have arrived. We met them at the north keep but they were just too many. They have flanked us to the east in the mountains. I have my personal guards holding the pass to the north, but they won't be able to last long... We must evacuate our home."
		[/message]

		[message]
			description=Prince Haldric
			message= _ "That's awful! And it only gets worse. That Wesfolk rabble has set up shop again in the south pass..."
		[/message]

		[message]
			description=King Eldaric IV
			message= _ "That's the only way out of the valley! This is a disaster! We must defeat that Wesfolk scum and flee to the south. Our home is lost... We must make haste."
		[/message]

		[message]
			description=Tan-Rarbag
			message= _ "So HUMAN, care to make your final stand?"
		[/message]

		[message]
			description=Tan-Erang
			message= _ "Die! Die! Die!"
		[/message]

		[message]
			description=Wesfolk Leader
			message= _ "This is going to get ugly..."
		[/message]
	[/event]

	[event]
		name=turn 14
		[message]
			description=King Eldaric IV
			message= _ "Hurry! Only death awaits in this valley!"
		[/message]
	[/event]

	[event]
		name=die
		[filter]
			description=Tan-Erang
		[/filter]

		[filter_second]
			side=1
		[/filter_second]

		{LOOT 75 1}
	[/event]

	[event]
		name=die
		[filter]
			description=Tan-Rarbag
		[/filter]

		[filter_second]
			side=1
		[/filter_second]

		{LOOT 75 1}
	[/event]

	[event]
		name=die

		[filter]
			description=Wesfolk Leader
		[/filter]

		[filter_second]
			side=1
		[/filter_second]

		[message]
			speaker=unit
			message= _ "Umm, I invoke the right of surren..."
		[/message]

		[message]
			description=King Eldaric IV
			message= _ "Nay! Off with your hea- - -"
		[/message]

		[message]
			speaker=unit
			message= _ "But I can help! Really! You could use me and my men's skills on the long road ahead!"
		[/message]

		[message]
			description=King Eldaric IV
			message= _ "Haldric, what say you on this matter?"
		[/message]

		[message]
			description=Prince Haldric
			message= _ "Hmm... after some thought..."

			[option]
				message= _ "I think that your skills may be useful. You may join us."
				[command]

					[message]
						description=Wesfolk Leader
									message= _ "Let there be peace between us, our survival depends on it."
					[/message]

					[allow_recruit]
					#Single line the list, check my bug
						type=Footpad
					[/allow_recruit]

					[allow_recruit]
					#Single line the list, check my bug
						type=Poacher
					[/allow_recruit]

					[allow_recruit]
					#Single line the list, check my bug
						type=Thief
					[/allow_recruit]

					[allow_recruit]
					#Single line the list, check my bug
						type=Thug
					[/allow_recruit]

					[message]
						description=Prince Haldric
						message= _ "So what shall I call you?"
					[/message]
					[message]
						description=Wesfolk Leader
									message= _ "The Lady Outlaw will do."
					[/message]
					[unit]
						description=Lady Outlaw
						user_description= _ "Lady Outlaw"
						type=Outlaw
						profile="portraits/lady_outlaw.png"
						gender=female
						unrenamable=yes
						side=1
					[/unit]
					[set_variable]
						name=have_lady
						value=1
					[/set_variable]
				[/command]
			[/option]
			[option]
				message= _ "Your word can't be trusted. Prepare to meet your Gods!"
				[command]
					[message]
						description=Wesfolk Leader
									message= _ "Arrogant fools! (Reaches into pocket) POOF!"
					[/message]

					[message]
						description=King Eldaric IV
						message= _ "Argh, she's gone. Next time, more sword, less chat."
					[/message]

					[message]
						description=Prince Haldric
						message= _ "She's clever! Maybe I made the wrong choice. Well, at least she left some of her gold behind..."
					[/message]

					[set_variable]
						name=have_lady
						value=0
					[/set_variable]
#ifdef EASY
						{LOOT 75 1}
#endif

#ifdef NORMAL
						{LOOT 50 1}
#endif

#ifdef HARD
						{LOOT 25 1}
#endif
				[/command]
			[/option]
		[/message]
		[message]
			description=King Eldaric IV
			message= _ "Son, you must lead our people through the south pass. I will remain behind to hold off these vile monsters for as long as I can."
		[/message]
		[message]
			description=Prince Haldric
			message= _ "But Father!"
		[/message]
		[message]
			id=msgT1_16
			description=King Eldaric IV
			message= _ "It's the only way. Go now, and don't look back! Luck be with you!"
		[/message]

		[endlevel]
			result=victory
			bonus=yes
		[/endlevel]

	[/event]

	[event]
		name=die
		[filter]
			description=Wesfolk Leader
		[/filter]

		[filter_second]
			side=3, 4
		[/filter_second]

		[message]
			description=King Eldaric IV
			message= _ "We're surrounded! The orcs have taken the southern pass! All is lost!"
		[/message]

		[endlevel]
			result=defeat
		[/endlevel]
	[/event]

	[event]
		name=time over
		[message]
			description=King Eldaric IV
			message= _ "We're surrounded! I can see their reinforcements! All is lost!"
		[/message]
	[/event]

	[event]
		name=moveto
		[filter]
			side=3, 4
			x=26-30
			y=13-15
		[/filter]
		[message]
			description=Prince Haldric
			message= _ "Our Home! Where shall we go!"
		[/message]
		[message]
			description=King Eldaric IV
			message= _ "There can be no looking back! We must go south."
		[/message]
	[/event]

	[event]
		name=victory
		[kill]
			description=King Eldaric IV
		[/kill]
	[/event]

[/scenario]
