[scenario]
	id=Ogre
	#textdomain wesnoth-ei
	name= _ "Training the Ogres"
	map_data="{campaigns/Eastern_Invasion/maps/Training_the_Ogres.map}"

	{TURNS 4 5 6}

	next_scenario=Xenophobia

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

	{DEFAULT_MUSIC_PLAYLIST}
	victory_when_enemies_defeated=no

	{campaigns/Eastern_Invasion/utils/deaths.cfg}

	[side]
	type=Lieutenant
	description=Gweddry
	user_description= _ "Gweddry"
	side=1
	canrecruit=0
	controller=human
	[/side]

	[side]
	side=2
	controller=ai
	no_leader=yes
	[/side]

#define OGRE
[unit]
type=Young Ogre
side=2
x=12
y=10
[/unit]
#enddef

	[event]
	name=prestart
		[objectives]
		side=1
			[objective]
			description= _ "Survive until end of turns"
			condition=win
			[/objective]
			[objective]
			description= _ "To add ogres to your army, keep two on the grass until end of turns"
			condition=win
			[/objective]
			[objective]
			description= _ "Death of Gweddry"
			condition=lose
			[/objective]
			[objective]
			description= _ "Death of Dacyn"
			condition=lose
			[/objective]
			[objective]
			description= _ "Death of Owaec"
			condition=lose
			[/objective]
		[/objectives]
	[/event]

	[event]
	name=start
		[recall]
		description=Dacyn
		[/recall]
		[recall]
		description=Owaec
		[/recall]
		{OGRE}
		{OGRE}
		{OGRE}
#ifdef NORMAL
		{OGRE}
#endif
#ifdef HARD
		{OGRE}
		{OGRE}
#endif
		[message]
		description=Gweddry
		message= _ "Look, we have found a pack of Ogres. We should try to capture some to train."
		[/message]
		[message]
		description=Dacyn
		message= _ "All right, we have to keep at least two of these Ogres on the grass where they can't escape until our troops get here to capture them. Then they will have to lead us to their tribe."
		[/message]
		[message]
		description=Owaec
		message= _ "We should try to surround them. Gweddry, you stay where you are. Dacyn, you go north-east. I'll go north-west."
		[/message]
		[teleport]
			[filter]
			description=Owaec
			[/filter]
		x=7
		y=7
		[/teleport]
		[teleport]
			[filter]
			description=Dacyn
			[/filter]
		x=17
		y=7
		[/teleport]
	[/event]

	[event]
	name=moveto
	first_time_only=no
		[filter]
		type=Young Ogre
		x=1-25,1-2,23-24,1-25
		y=1-2,1-20,1-20,18-20
		[/filter]
		[message]
		description=Gweddry
		message= _ "We have let one escape. Let's hope they don't all!"
		[/message]
		[kill]
		type=Young Ogre
		x=1-25,1-2,23-24,1-25
		y=1-2,1-20,1-20,18-20
		[/kill]
	[/event]

	[event]
	name=time over
		[role]
		type=Young Ogre
		role=ogre
		[/role]
		[kill]
		role=ogre
		[/kill]
		[if]
			[have_unit]
			type=Young Ogre
			[/have_unit]
			[then]
				[message]
				description=Dacyn
				message= _ "Our troops have caught up! Now, we will be able to recruit Ogres, since these will be able to convince their tribe to join us."
				[/message]
				[allow_recruit]
				type=Young Ogre
				[/allow_recruit]
			[/then]
			[else]
				[message]
				description=Gweddry
				message= _ "We didn't capture enough of the ogres here. We will have to go on without them."
				[/message]
			[/else]
		[/if]
		[endlevel]
		result=victory
		bonus=yes
		[/endlevel]
	[/event]
[/scenario]
