[scenario]
	id=A_Harrowing_Escape
	#textdomain wesnoth-trow
	name= _ "A Harrowing Escape"
	map_data="{campaigns/The_Rise_Of_Wesnoth/maps/A_Harrowing_Escape}"
	{TURNS 48 45 42}

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

	next_scenario=The_River_Road

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

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

	[story]
		[part]
			background=story/the_green_isle.png
			show_title=yes
			{DOT 212 250}
			{DOT 221 256}
			{DOT 231 261}
			{DOT 241 266}
			{CROSS 241 267}
		[/part]
	[/story]


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

	[side]
		type=Orcish Warlord
		description=Tan-Schmog
		user_description= _ "Tan-Schmog"
		side=2
		canrecruit=1
		{GOLD 80 140 200}
		team_name=orcs
		recruit=Orcish Archer, Orcish Assassin, Orcish Grunt, Wolf Rider, Goblin Spearman
		[ai]
			#{NO_SCOUTS}
			recruitment_pattern=scout,scout,fighter,fighter,archer
			recruitment_ignore_bad_movement=yes
			passive_leader=yes
			{ATTACK_DEPTH 3 4 5}
		[/ai]
		[ai]
			time_of_day=first_watch,second_watch
			aggression=0.75
			caution=0.15
			grouping=no
		[/ai]
	[/side]

	[side]
		type=Orcish Warlord
		description=Tan-NauVong
		user_description= _ "Tan-NauVong"
		side=3
		canrecruit=1
		{GOLD 80 140 200}
		team_name=orcs
		recruit=Orcish Archer, Orcish Assassin, Orcish Grunt, Wolf Rider, Goblin Spearman
		[ai]
			#{NO_SCOUTS}
			recruitment_pattern=scout,scout,fighter,fighter,archer
			recruitment_ignore_bad_movement=yes
			passive_leader=yes
			{ATTACK_DEPTH 3 4 5}
		[/ai]
		[ai]
			time_of_day=first_watch,second_watch
			aggression=0.75
			caution=0.15
			grouping=no
		[/ai]
	[/side]

	[event]
		name=prestart

		{PLACE_IMAGE (items/signpost.png) 23 38}
		{PLACE_IMAGE (items/signpost.png) 13 7}
#ifdef EASY
		{GUARD_UNIT (Orcish Grunt) (Snagakhan) ( _ "Snagakhan") 2 17 37}
		{GUARD_UNIT (Orcish Grunt) (Knafakhan) ( _ "Knafakhan") 3 19 36}
#endif
#ifdef NORMAL
		{GUARD_UNIT (Orcish Warrior) (Snagakhan) ( _ "Snagakhan") 2 17 37}
		{GUARD_UNIT (Orcish Warrior) (Knafakhan) ( _ "Knafakhan") 3 19 36}
#endif

#ifdef HARD
		{GUARD_UNIT (Orcish Warrior) (Snagakhan) ( _ "Snagakhan") 2 17 37}
		{GUARD_UNIT (Orcish Warrior) (Knafakhan) ( _ "Knafakhan") 3 19 36}
		{GUARD_UNIT (Orcish Warrior) (Hoshnak) ( _ "Hoshnak") 2 6 23}
		{GUARD_UNIT (Orcish Warrior) (Gruumogth) ( _ "Gruumogth") 3 8 22}
#endif
		[recall]
			description=Lady Outlaw
		[/recall]

		[objectives]
		side=1
			[objective]
				description= _ "Defeat all enemy leaders"
				condition=win
			[/objective]
			[objective]
				description= _ "Death of Prince Haldric"
				condition=lose
			[/objective]
			[objective]
				description= _ "Turns run out"
				condition=lose
			[/objective]
		[/objectives]
	[/event]

	[event]
		name=start
		[message]
			description=Prince Haldric
			message= _ "Argh, the orcish vanguard must have flanked us even further to the east! They're already holding the mouth of the pass. We have to get out of the mountain pass before winter comes or we're all dead meat!"
		[/message]

		[message]
			description=Prince Haldric
			message= _ "Father, I wish you were here..."
		[/message]

		[message]
			description=Lady Outlaw
			message= _ "I'd drop the sentiment and pick up your sword. There's plenty of fighting ahead of us!"
		[/message]

		[message]
			description=Tan-Schmog
			message= _ "You won't get much further boy. Grrrr!"
		[/message]
	[/event]

	[event]
		name=moveto
		[filter]
			side=1
			x=8
			y=5
		[/filter]

		[message]
			speaker=unit
			message= _ "Who goes there?"
		[/message]

		[unit]
			description=Burin the Lost
			user_description= _ "Burin the Lost"
			profile="portraits/burin.png"
			side=1
			type=Dwarvish Steelclad
			unrenamable=yes
			x=8
			y=5
			[modifications]
				{TRAIT_LOYAL}
				{TRAIT_STRONG}
			[/modifications]
		[/unit]

		[message]
			description=Burin the Lost
			message= _ "Burin, Burin the Lost. Who be ye?"
		[/message]

		[message]
			description=Prince Haldric
			message= _ "I'm Prince Haldric, we have little time to talk. We must make haste through the pass... What are you?"
		[/message]

		[message]
			description=Burin the Lost
			message= _ "I'm a dwarf! Damn fool of a boy! I got lost while exploring deep underground, almost a century ago. I've never found my way home. But it seems nice enough here."
		[/message]

		[message]
			description=Prince Haldric
			message= _ "Nice? The orcs have come, and we must flee!"
		[/message]

		[message]
			description=Burin the Lost
			message= _ "Orcs! It's been a long time since I felt the satisfying crunch of one of those under my axe. Time for a fight!"
		[/message]

		[message]
			description=Prince Haldric
			message= _ "You've fought orcs before?"
		[/message]

		[message]
			description=Burin the Lost
			message= _ "Fool boy! Where did you grow up? Enough of this, let's go get some orcs!"
		[/message]

	[/event]

	[event]
		name=time over
		[message]
			description=Prince Haldric
			message= _ "We're trapped in the pass! I can see their reinforcements! All is lost! Is that... Is that snow... We're doomed!"
		[/message]
	[/event]

	[event]
		name=moveto
		[filter]
			side=1
			x=23
			y=38
		[/filter]

		[redraw]
		[/redraw]

		[message]
			speaker=narrator
			message= _ "SE - The River Road.
SW - The Midlands."
		[/message]
		[allow_undo]
		[/allow_undo]
	[/event]

	[event]
		name=moveto
		[filter]
			side=1
			x=13
			y=7
		[/filter]

		[redraw]
		[/redraw]

		[message]
			speaker=narrator
			message= _ "GO HOME! AIN'T NUTTIN TO SEE HEER!"
		[/message]
		[allow_undo]
		[/allow_undo]
	[/event]

#define ESCAPE_VICTORY
		[message]
			description=Prince Haldric
			message= _ "Now, should I go southeast on the River Road, or southwest through the midlands? The River Road crosses the Swamp of Esten, so I doubt that even orcs would go there. The Midlands were nice, but who knows what's going on there now."

			[option]
				message= _ "I think I'll take the River Road..."
				[command]
					[message]
						description=Lady Outlaw
									message= _ "Good. The Midlands are probably an orc-infested ruin by now."
					[/message]

					[message]
						description=Burin the Lost
						message= _ "SWAMP! I'm under 5 feet tall, and I don't float! Argh, have it your way."
					[/message]
					{VARIABLE escape_choice 1}
					[endlevel]
						result=victory
						bonus=yes
						next_scenario=The_River_Road
					[/endlevel]
				[/command]
			[/option]
			[option]
				message= _ "We'll go through the Midlands..."
				[command]
					[message]
						description=Lady Outlaw
									message= _ "I suspect that the Midlands might be in ruins by now."
					[/message]

					[message]
						description=Burin the Lost
						message= _ "It's better than the swamp. I'm under 5 feet tall, and I don't float! Besides, I'd rather enjoy meeting more orcs."
					[/message]
					{VARIABLE escape_choice 2}
					[endlevel]
						result=victory
						bonus=yes
						next_scenario=The_Midlands
					[/endlevel]
				[/command]
			[/option]
		[/message]
#enddef

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

		[filter_second]
			side=1
		[/filter_second]

		{LOOT 50 1}

		[if]
			[variable]
			name=second_orc_dead
			equals=yes
			[/variable]
			[then]
			{ESCAPE_VICTORY}
			[/then]
			[else]
				[set_variable]
				name=first_orc_dead
				value=yes
				[/set_variable]
				#Give them a nasty surprise
#ifdef EASY
				[gold]
					side=3
					amount=60
				[/gold]
				{UNIT (Orcish Slayer) (Hashnak) ( _ "Hashnak") 3 25 40}

#else
				[gold]
					side=3
					amount=90
				[/gold]

				{UNIT (Orcish Slayer) (Hashnak) ( _ "Hashnak") 3 25 40}
				{UNIT (Orcish Assassin) (Grork) ( _ "Grork") 3 24 40}
				{UNIT (Orcish Assassin) (Vigdish) ( _ "Vigdish") 3 26 40}

#endif
				[message]
					description=Tan-NauVong
					message= _ "Come and get it!"
				[/message]
				[message]
					description=Hashnak
					message= _ "Die, human."
				[/message]
				[message]
					description=Prince Haldric
					message= _ "Uh-oh!"
				[/message]
			[/else]
		[/if]
	[/event]

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

		[filter_second]
			side=1
		[/filter_second]

		{LOOT 50 1}

		[if]
			[variable]
			name=first_orc_dead
			equals=yes
			[/variable]
			[then]
			{ESCAPE_VICTORY}
			[/then]
			[else]
				[set_variable]
				name=second_orc_dead
				value=yes
				[/set_variable]
				#Give them a nasty surprise

#ifdef EASY
				[gold]
					side=2
					amount=60
				[/gold]

				{UNIT (Orcish Slayer) (Hashnak) ( _ "Hashnak") 2 25 40}
#else
				[gold]
					side=2
					amount=90
				[/gold]

				{UNIT (Orcish Slayer) (Hashnak) ( _ "Hashnak") 2 25 40}
				{UNIT (Orcish Assassin) (Grork) ( _ "Grork") 2 24 40}
				{UNIT (Orcish Assassin) (Vigdish) ( _ "Vigdish") 2 26 40}
#endif
				[message]
					description=Tan-Schmog
					message= _ "I'll not go so easily!"
				[/message]
				[message]
					description=Hashnak
					message= _ "Die, human."
				[/message]
				[message]
					description=Prince Haldric
					message= _ "Uh-oh!"
				[/message]
			[/else]
		[/if]
	[/event]

	[event]
		name=victory
		[message]
			description=Prince Haldric
			message= _ "We've escaped the pass. Well, at least I know that the orcs can be beaten. Hmm, I guess that this is the last I'll see of my home... and my Father. (Sigh)"
		[/message]
		[message]
			description=Prince Haldric
			message= _ "We should make our way to Southbay. It is the largest city on the Isle. We should be able to make a stand there. Failing that, there's always Clearwater Port."
		[/message]
		{CLEAR_VARIABLE first_orc_dead}
		{CLEAR_VARIABLE second_orc_dead}
	[/event]

[/scenario]
