[scenario]
	id=The_River_Road
	#textdomain wesnoth-trow
	name= _ "The Swamp of Esten"
	map_data="{campaigns/The_Rise_Of_Wesnoth/maps/The_River_Road}"
	{TURNS 39 36 33}

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

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

	next_scenario=The_Oldwood
	bonus=yes

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

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

	[story]
		[part]
			background=story/the_green_isle.png
			show_title=yes
			{DOT 246 271}
			{DOT 256 281}
			{DOT 261 291}
			{DOT 256 298}
			{DOT 251 306}
			{DOT 256 311}
			{DOT 266 316}
			{DOT 276 321}
			{DOT 286 326}
			{CROSS 291 322}
		[/part]
	[/story]

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

	[side]
		type=Dark Sorcerer
		description=Cleon
		user_description= _ "Cleon"
		#This is the nearest enemy, make him softer.
		side=2
		canrecruit=1
		#He's fodder boy
		recruit=Vampire Bat, Walking Corpse, Dark Adept
		[ai]
			{NO_SCOUTS}
			recruitment_pattern=scout,fighter,fighter,fighter,archer
			recruitment_ignore_bad_movement=yes
			{ATTACK_DEPTH 3 4 5}
		[/ai]
		{GOLD 80 120 160}
		team_name=cult
	[/side]

	[side]
		type=Dark Sorcerer
		description=Lollyra
		user_description= _ "Lollyra"
		side=3
		canrecruit=1
		{GOLD 130 170 210}
		[ai]
			{NO_SCOUTS}
			recruitment_ignore_bad_combat=yes
			recruitment_pattern=scout,fighter,mixed fighter,fighter,fighter,archer
			{ATTACK_DEPTH 3 4 5}
		[/ai]
#ifdef EASY
		recruit=Dark Adept, Thief, Thug, Skeleton, Skeleton Archer, Vampire Bat, Walking Corpse
#endif
#ifdef NORMAL
		recruit=Dark Adept, Rogue, Thug, Skeleton, Skeleton Archer, Vampire Bat, Walking Corpse, Ghost
#endif
#ifdef HARD
		recruit=Dark Adept, Rogue, Thug, Revenant, Skeleton Archer, Vampire Bat, Ghost, Walking Corpse
#endif
		team_name=cult
	[/side]

	[side]
		type=Dark Sorcerer
		description=Clurka
		user_description= _ "Clurka"
		side=4
		canrecruit=1
		{GOLD 130 170 210}
		[ai]
			{NO_SCOUTS}
			recruitment_ignore_bad_movement=yes
			recruitment_pattern=scout,fighter,mixed fighter,fighter,fighter,archer
			{ATTACK_DEPTH 3 4 5}
		[/ai]

#ifdef EASY
		recruit=Dark Adept, Thief, Thug, Skeleton, Skeleton Archer, Vampire Bat, Giant Scorpion, Walking Corpse
#endif
#ifdef NORMAL
		recruit=Dark Adept, Thief, Bandit, Skeleton, Skeleton Archer, Vampire Bat, Giant Scorpion, Walking Corpse
#endif
#ifdef HARD
		recruit=Dark Adept, Thief, Bandit, Skeleton, Bone Shooter, Vampire Bat, Giant Scorpion, Walking Corpse
#endif
		team_name=cult
	[/side]

	[event]
		name=prestart

		{PLACE_IMAGE (items/signpost.png) 15 31}
		{PLACE_IMAGE (misc/temple.png) 19 5}
		{PLACE_IMAGE (misc/temple.png) 30 10}
		{PLACE_IMAGE (misc/temple.png) 34 36}
		{PLACE_IMAGE (misc/temple.png) 1 26}
		{PLACE_IMAGE (misc/temple.png) 5 12}

		{GUARD_UNIT (Giant Scorpion) (Scorpion) ( _ "Scorpion") 2 26 4}
		{GUARD_UNIT (Giant Scorpion) (Scorpion) ( _ "Scorpion") 3 32 27}
		{GUARD_UNIT (Giant Scorpion) (Scorpion) ( _ "Scorpion") 4 17 35}
#ifdef NORMAL
		{GUARD_UNIT (Giant Scorpion) (Scorpion) ( _ "Scorpion") 2 13 8}
		{GUARD_UNIT (Giant Scorpion) (Scorpion) ( _ "Scorpion") 3 32 31}
		{GUARD_UNIT (Giant Scorpion) (Scorpion) ( _ "Scorpion") 4 9 34}
#endif
#ifdef HARD
		{GUARD_UNIT (Giant Scorpion) (Scorpion) ( _ "Scorpion") 2 13 8}
		{GUARD_UNIT (Giant Scorpion) (Scorpion) ( _ "Scorpion") 2 15 3}
		{GUARD_UNIT (Giant Scorpion) (Scorpion) ( _ "Scorpion") 3 32 31}
		{GUARD_UNIT (Giant Scorpion) (Scorpion) ( _ "Scorpion") 3 33 36}
		{GUARD_UNIT (Giant Scorpion) (Scorpion) ( _ "Scorpion") 4 9 34}
		{GUARD_UNIT (Giant Scorpion) (Scorpion) ( _ "Scorpion") 4 20 32}
#endif
		[recall]
			description=Lady Outlaw
		[/recall]

		[recall]
			description=Burin the Lost
		[/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
		{CLEAR_VARIABLE escape_choice}
		[message]
			speaker=narrator
			message= _ "With great trepidation Prince Haldric leads his refugee band into the Swamp of Esten. In the center of that very swamp a shroud of fog descends over Young Prince Haldric."
		[/message]

		[message]
			description=Prince Haldric
			message= _ "I have a very bad feeling about this. This awful swamp and its crazy cult... Before these troubles started we used to have to clear the swamp every spring and fall."
		[/message]

		[message]
			description=Prince Haldric
			message= _ "I suppose with the rampaging bands of murderous orcs roaming about that hasn't been done in a while."
		[/message]

		[message]
			description=Burin the Lost
			message= _ "I miss the orcs... We go all this way, and (SNIFF) what a lovely smell we have discovered."
		[/message]

		[message]
			description=Lady Outlaw
			message= _ "This is too quiet. I don't like this one bit, not one bit at all."
		[/message]

		[message]
			description=Prince Haldric
			message= _ "Wait, I think I hear something... To arms!"
		[/message]

	[/event]

	[event]
	name=moveto
		[filter]
			x=13
			y=6
			side=1
		[/filter]
		{UNIT (Giant Scorpion) (Scorpion) ( _ "Scorpion") 2 16 5}
	[/event]

	[event]
	name=moveto
		[filter]
			x=10
			y=25
			side=1
		[/filter]
		{UNIT (Giant Scorpion) (Scorpion) ( _ "Scorpion") 3 10 27}
	[/event]

	[event]
	name=moveto
		[filter]
			x=28
			y=33
			side=1
		[/filter]
		{UNIT (Giant Scorpion) (Scorpion) ( _ "Scorpion") 4 32 33}
	[/event]

#define TEMPLE_HELP X Y
	[event]
	name=moveto
		[filter]
			side=1
			x={X}
			y={Y}
		[/filter]
		[message]
			description=Prince Haldric
			message= _ "Careful, you don't know what's lurking in there!"
		[/message]
		[unit]
			side=1
			type=White Mage
			description=Minister Edmond
			user_description= _ "Minister Edmond"
			profile="portraits/edmond.png"
			unrenamable=yes
			x={X}
			y={Y}
			[modifications]
				{TRAIT_LOYAL}
				{TRAIT_STRONG}
			[/modifications]
		[/unit]
		[message]
			description=Minister Edmond
			message= _ "Back you vile--- Oh, sorry I thought you were undead. When are those goofs in Clearwater Port going to clear the swamp again?"
		[/message]
		[message]
			description=Prince Haldric
			message= _ "Maybe they'll clear it SOME TIME AFTER THE APOCALYPSE is over!"
		[/message]
		[message]
			description=Minister Edmond
			message= _ "Oooh! I take it you wouldn't mind if I helped out?"
		[/message]
	[/event]
#enddef

#define TEMPLE_TRAP X Y
	[event]
	name=moveto
		[filter]
			side=1
			x={X}
			y={Y}
		[/filter]
		[message]
			speaker=unit
			message= _ "Hey, there's somebody hidden in the temple. Ack! Hold there!"
		[/message]
		{UNDEAD_UNIT (Vampire Bat) 2 ({X}) ({Y})}
		{UNDEAD_UNIT (Walking Corpse) 3 ({X}) ({Y})}
		{UNDEAD_UNIT (Walking Corpse) 4 ({X}) ({Y})}

#ifdef HARD
		{UNDEAD_UNIT (Ghost) 2 ({X}) ({Y})}
#endif
	[/event]
#enddef

#define TEMPLE_LOOT X Y
	[event]
	name=moveto
	[filter]
		side=1
		x={X}
		y={Y}
	[/filter]

	{LOOT 50 1}
	[/event]
#enddef

	[event]
	name=start
		{RANDOM 1..3}
		[if]
			[variable]
			name=random
			numerical_equals=1
			[/variable]
			[then]
				{TEMPLE_HELP 5 12}
				{TEMPLE_TRAP 34 36}
				{TEMPLE_TRAP 19 5}
				{TEMPLE_LOOT 1 26}
				{TEMPLE_LOOT 30 10}
			[/then]
		[/if]
		[if]
			[variable]
			name=random
			numerical_equals=2
			[/variable]
			[then]
				{TEMPLE_HELP 1 26}
				{TEMPLE_TRAP 34 36}
				{TEMPLE_TRAP 5 12}
				{TEMPLE_LOOT 19 5}
				{TEMPLE_LOOT 30 10}
			[/then]
		[/if]
		[if]
			[variable]
			name=random
			numerical_equals=3
			[/variable]
			[then]
				{TEMPLE_HELP 19 5}
				{TEMPLE_TRAP 34 36}
				{TEMPLE_TRAP 1 26}
				{TEMPLE_LOOT 5 12}
				{TEMPLE_LOOT 30 10}
			[/then]
		[/if]
	[/event]



	[event]
		name=moveto
		[filter]
			side=1
			x=15
			y=31
		[/filter]

		[redraw]
		[/redraw]

		[message]
			speaker=narrator
			message= _ "SW - The Oldwood Forest.
Enter at Your Own Risk!"
		[/message]
		[allow_undo]
		[/allow_undo]
	[/event]

	[event]
	name=die
		[filter]
			description=Lollyra
		[/filter]
		[message]
			description=Lollyra
			message= _ "May I live forever in Un-death!"
		[/message]
	[/event]

	[event]
	name=die
		[filter]
			description=Clurka
		[/filter]
		[message]
			description=Clurka
			message= _ "Ohh! To be risen again!"
		[/message]
	[/event]

	[event]
	name=die
		[filter]
			description=Cleon
		[/filter]
		[message]
			description=Cleon
			message= _ "A prayer for life immortal!"
		[/message]
	[/event]

	[event]
	name=victory

		[sound]
		name=horse-canter.wav
		[/sound]

		[move_unit_fake]
			type=Knight
			x=35,34,33,32,31,30
			y=35,34,35,34,34,33
		[/move_unit_fake]

		[unit]
			side=1
			type=Knight
			description=Sir Ruddry
			user_description= _ "Sir Ruddry"
			profile="portraits/knight.png"
			unrenamable=yes
			x=30
			y=33
			[modifications]
				{TRAIT_LOYAL}
				{TRAIT_RESILIENT}
			[/modifications]
		[/unit]

		[scroll_to_unit]
			description=Sir Ruddry
			side=1
		[/scroll_to_unit]

		[message]
			description=Sir Ruddry
			message= _ "I don't know who you are, but you can't continue down this road! There is an army of those orcs bigger than any army I've ever seen just down the road!"
		[/message]

		[message]
			description=Prince Haldric
			message= _ "I'm Haldric, my father was King Eldaric IV in the lands northwest of here. Soldier, have you deserted your post?"
		[/message]

		[message]
			description=Sir Ruddry
			message= _ "No, Sir! I'm the sole survivor of the Clearwater Port expeditionary force. Trust me, you can't continue down this road, Sir. Especially with the refugees, you'll be slaughtered."
		[/message]

		[message]
			description=Prince Haldric
			message= _ "Tell me, does Clearwater Port still stand? Is the port free?"
		[/message]

		[message]
			description=Sir Ruddry
			message= _ "As far as I know, Sir. We have a large army, and they were pressing all able bodied men and boys into service when I left. That orcish army is huge, but they haven't met the main body of our forces yet."
		[/message]

		[message]
			description=Prince Haldric
			message= _ "Well, we can't go back, and the road ahead is blocked. I guess we'll have to risk it and go through the Oldwood forest, then make a break for Clearwater Port or Southbay."
		[/message]

		[message]
			description=Burin the Lost
			message= _ "Oh great, now a Forest... I should have stayed at home and took my chances with the orcs!"
		[/message]

		[message]
			description=Sir Ruddry
			message= _ "Sir, if you don't mind, I'll go with you."
		[/message]

		[message]
			description=Lady Outlaw
			message= _ "On we go..."
		[/message]
		[set_variable]
			name=last_done
			value="River"
		[/set_variable]

		{CLEAR_VARIABLE random}
	[/event]

	[event]
	name=time over
		[message]
			description=King Eldaric IV
			message= _ "We have run out of time... We'll be trapped in this swamp when winter arrives!"
		[/message]
	[/event]

[/scenario]
