<?xml version="1.0" standalone="yes" ?> 
<scenario>
	<difficulty value="3"/>
	<players>
		<player control="human" faction="tech" team="1"/>
		<player control="cpu" faction="indian" team="1"/>
		<player control="cpu-easy" faction="tech" team="1"/>
		<player control="cpu" faction="magic" team="2"/>	
		<player control="cpu" faction="magic" team="2"/>	
		<player control="cpu-ultra" faction="norsemen" team="2"/>	
		<player control="cpu" faction="magic" team="2"/>	
		<player control="cpu" faction="tech" team="2"/>			
	</players>
	<map value="map_3"/>
	<tileset value="autumn"/>
	<tech-tree value="megapack_"/>
	<default-resources value="false"/>
	<default-units value="false"/>
	<fog-of-war value="true"/>
	<default-victory-conditions value="false"/>
	<scripts>
		<startup>
			--disable AI
			disableAi(1)
			disableAi(2)
			disableAi(3)
			disableAi(4)
			disableAi(5)
			disableAi(6)
			disableAi(7)
			disableConsume(0)
			disableConsume(1)
			disableConsume(2)
			disableConsume(3)
			disableConsume(4)
			disableConsume(5)
			disableConsume(6)
			disableConsume(7)

			--Start MSG
			showMessage('start1', 'game')
			showMessage('start2', 'game')
			showMessage('start3', 'game')

			clearDisplayText()
			setDisplayText('findj')

			--your units
			createUnit('you', 0, startLocation(0))
			player_unit= lastCreatedUnit()
			setCameraPosition(unitPosition(player_unit))
			createUnit('worker', 0, startLocation(0))
			worker1_unit= lastCreatedUnit()
			createUnit('worker', 0, startLocation(0))
			worker2_unit= lastCreatedUnit()

			createUnit('archer', 0, startLocation(0))
			archer1_unit= lastCreatedUnit()
			createUnit('archer', 0, startLocation(0))
			archer2_unit= lastCreatedUnit()
			createUnit('archer', 0, startLocation(0))
			archer3_unit= lastCreatedUnit()
			createUnit('archer', 0, startLocation(0))
			archer4_unit= lastCreatedUnit()
			createUnit('archer', 0, startLocation(0))
			archer5_unit= lastCreatedUnit()
			createUnit('archer', 0, startLocation(0))
			archer6_unit= lastCreatedUnit()

			createUnit('swordman', 0, startLocation(0))
			swordman1_unit= lastCreatedUnit()
			createUnit('swordman', 0, startLocation(0))
			swordman2_unit= lastCreatedUnit()
			createUnit('swordman', 0, startLocation(0))
			swordman3_unit= lastCreatedUnit()
			createUnit('swordman', 0, startLocation(0))
			swordman4_unit= lastCreatedUnit()



			--setlment units
			createUnit('tent', 1, {startLocation(1)[1] - 0, startLocation(1)[2] - 5})

			createUnit('tent', 1, {startLocation(1)[1] + 14, startLocation(1)[2] + 1})

			createUnit('reed', 1, {startLocation(1)[1] + 4, startLocation(1)[2] + 6})

			createUnit('campfire', 1, {startLocation(1)[1] - 6, startLocation(1)[2] + 1})

			createUnit('stickfighter_', 1, {startLocation(1)[1] + 4, startLocation(1)[2] + 0})
			friend1_unit= lastCreatedUnit()
			createUnit('worker_', 1, {startLocation(1)[1] + 9, startLocation(1)[2] + 9})
			friend2_unit= lastCreatedUnit()
			createUnit('bull', 1, {startLocation(1)[1] + 14, startLocation(1)[2] + 0})

			createUnit('boat', 1, {startLocation(1)[1] - 42, startLocation(1)[2] - 62})

			createUnit('worker_', 1, {startLocation(1)[1] - 40, startLocation(1)[2] - 58})
			friend0_unit= lastCreatedUnit()

			createUnit('horsefarm', 1, {startLocation(1)[1] - 60, startLocation(1)[2] + 2})

			createUnit('axe_thrower_', 1, {startLocation(1)[1] - 58, startLocation(1)[2] + 4})
			friend3_unit= lastCreatedUnit()


    			 cell_event0 = registerCellTriggerEventForUnitToUnit(player_unit,friend2_unit)
    			 cell_event1 = registerCellTriggerEventForUnitToUnit(player_unit,friend0_unit)


			 createUnit('dragon', 3, {startLocation(3)[1] - 180, startLocation(3)[2] + 100})
			 d1_unit= lastCreatedUnit()
			 createUnit('dragon', 3, {startLocation(3)[1] - 180, startLocation(3)[2] + 100})
			 d2_unit= lastCreatedUnit()
			 createUnit('dragon', 3, {startLocation(3)[1] - 180, startLocation(3)[2] + 100})
			 d3_unit= lastCreatedUnit()
			 createUnit('dragon', 3, {startLocation(3)[1] - 180, startLocation(3)[2] + 100})
			 d4_unit= lastCreatedUnit()
			 createUnit('dragon', 3, {startLocation(3)[1] - 180, startLocation(3)[2] + 100})
			 d5_unit= lastCreatedUnit()
			 createUnit('dragon', 3, {startLocation(3)[1] - 180, startLocation(3)[2] + 100})
			 d6_unit= lastCreatedUnit()
			 createUnit('dragon', 3, {startLocation(3)[1] - 180, startLocation(3)[2] + 100})
			 d7_unit= lastCreatedUnit()
			 createUnit('dragon', 3, {startLocation(3)[1] - 180, startLocation(3)[2] + 100})
			 d8_unit= lastCreatedUnit()
			 createUnit('dragon', 3, {startLocation(3)[1] - 180, startLocation(3)[2] + 100})
			 d9_unit= lastCreatedUnit()
			 createUnit('dragon', 3, {startLocation(3)[1] - 180, startLocation(3)[2] + 100})
			 d10_unit= lastCreatedUnit()


			 createUnit('clip', 3, startLocation(5))
			 clip_1_unit= lastCreatedUnit()
			 givePositionCommand(clip_1_unit, 'move', {startLocation(5)[1] - 8, startLocation(5)[2] + 21})
			 createUnit('clip', 3, startLocation(5))
			 clip_2_unit= lastCreatedUnit()
			 givePositionCommand(clip_2_unit, 'move', {startLocation(5)[1] - 6, startLocation(5)[2] + 21})
			 createUnit('clip', 3, startLocation(5))
			 clip_3_unit= lastCreatedUnit()
			 givePositionCommand(clip_3_unit, 'move', {startLocation(5)[1] - 4, startLocation(5)[2] + 21})
			 createUnit('clip', 3, startLocation(5))
			 clip_4_unit= lastCreatedUnit()
			 givePositionCommand(clip_4_unit, 'move', {startLocation(5)[1] - 2, startLocation(5)[2] + 21})
			 createUnit('clip', 3, startLocation(5))
			 clip_5_unit= lastCreatedUnit()
			 givePositionCommand(clip_5_unit, 'move', {startLocation(5)[1] - 0, startLocation(5)[2] + 21})
			 createUnit('clip', 3, startLocation(5))
			 clip_6_unit= lastCreatedUnit()
			 givePositionCommand(clip_6_unit, 'move', {startLocation(5)[1] + 2, startLocation(5)[2] + 21})
			 createUnit('clip', 3, startLocation(5))
			 clip_7_unit= lastCreatedUnit()
			 givePositionCommand(clip_7_unit, 'move', {startLocation(5)[1] + 4, startLocation(5)[2] + 21})

		</startup>

		<cellTriggerEvent>   

		       if triggeredCellEventId() == cell_event0 then 

			 showMessage('indian1', 'indian')

 		         unregisterCellTriggerEvent(cell_event0)

		       end

		       if triggeredCellEventId() == cell_event1 then 

			 showMessage('indian2', 'indian')
			 showMessage('indian3', 'indian')
			 showMessage('indian4', 'indian')

		 	 clearDisplayText()
			 setDisplayText('getr')
			 objective='getr'

 		         unregisterCellTriggerEvent(cell_event1)

		       end

		       if triggeredCellEventId() == cell_event2 then 

			 showMessage('indian5', 'indian')
			 showMessage('player1', 'you')
			 showMessage('indian6', 'indian')
			 showMessage('indian7', 'indian')

			 giveResource('wood', 0, -400); 
			 giveResource('gold', 0, -200); 

		 	 clearDisplayText()
			 setDisplayText('getf')

    			 cell_event3 = registerCellTriggerEventForUnitToUnit(player_unit,friend1_unit)
    			 cell_event4 = registerCellTriggerEventForUnitToUnit(player_unit,friend2_unit)
    			 cell_event5 = registerCellTriggerEventForUnitToUnit(player_unit,friend3_unit)

 		         unregisterCellTriggerEvent(cell_event2)

		       end

		       if triggeredCellEventId() == cell_event3 then 

			 showMessage('indian8', 'indian')
			 givePositionCommand(friend1_unit, 'move', {startLocation(1)[1] - 42, startLocation(1)[2] - 62})
 		         unregisterCellTriggerEvent(cell_event3)

		       end

		       if triggeredCellEventId() == cell_event4 then 

			 showMessage('indian9', 'indian')
			 givePositionCommand(friend2_unit, 'move', {startLocation(1)[1] - 42, startLocation(1)[2] - 62})
 		         unregisterCellTriggerEvent(cell_event4)

		       end

		       if triggeredCellEventId() == cell_event5 then 

			 showMessage('indian10', 'indian')
		 	 clearDisplayText()
			 setDisplayText('killm')
			 objective='killm'

			for i=1, 8 do
				createUnit('daemon', 3, startLocation(7))
			end
			createUnit('dragon', 3, startLocation(7))
			createUnit('golem', 3, startLocation(7))
			monster1_unit= lastCreatedUnit()

 		         unregisterCellTriggerEvent(cell_event5)

		       end

		       if triggeredCellEventId() == cell_event6 then 

			 showMessage('indian11', 'indian')
    			 cell_event7 = registerCellTriggerEventForUnitToUnit(player_unit,friend0_unit)
			 givePositionCommand(friend3_unit, 'move', {startLocation(1)[1] - 42, startLocation(1)[2] - 62})
 		         unregisterCellTriggerEvent(cell_event6)

		       end

		       if triggeredCellEventId() == cell_event7 then 

			 showMessage('indian12', 'indian')
			 showMessage('indian13', 'indian')
		 	 clearDisplayText()
			 setDisplayText('findj')
			 togglePauseGame(1);

			 morphToUnit(friend0_unit,'none',1)
			 morphToUnit(friend1_unit,'none',1)
			 morphToUnit(friend2_unit,'none',1)
			 morphToUnit(friend3_unit,'none',1)
			 morphToUnit(player_unit,'build_airship',1)
			 timer_event3 = startTimerEvent()

			 createUnit('golem', 3, {startLocation(3)[1] - 80, startLocation(3)[2] + 32})
			 createUnit('golem', 3, {startLocation(3)[1] - 70, startLocation(3)[2] + 40})
			 createUnit('golem', 3, {startLocation(3)[1] - 110, startLocation(3)[2] + 34})
			 createUnit('golem', 3, {startLocation(3)[1] - 50, startLocation(3)[2] + 0})
			 createUnit('golem', 3, {startLocation(3)[1] - 55, startLocation(3)[2] + 35})
			 createUnit('golem', 3, {startLocation(3)[1] - 80, startLocation(3)[2] - 28})
			 monster2_unit= lastCreatedUnit()

			 createUnit('dragon', 3, {startLocation(3)[1] - 200, startLocation(3)[2] + 80})
			 createUnit('dragon', 3, {startLocation(3)[1] - 185, startLocation(3)[2] + 90})
			 createUnit('dragon', 3, {startLocation(3)[1] - 170, startLocation(3)[2] + 90})
			 createUnit('dragon', 3, {startLocation(3)[1] - 155, startLocation(3)[2] + 75})
			 createUnit('dragon', 3, {startLocation(3)[1] - 140, startLocation(3)[2] + 65})
			 createUnit('dragon', 3, {startLocation(3)[1] - 123, startLocation(3)[2] + 55})
			 createUnit('dragon', 3, {startLocation(3)[1] - 122, startLocation(3)[2] + 35})
			 createUnit('dragon', 3, {startLocation(3)[1] - 108, startLocation(3)[2] + 20})
			 createUnit('dragon', 3, {startLocation(3)[1] - 100, startLocation(3)[2] + 0})
			 createUnit('dragon', 3, {startLocation(3)[1] - 0, startLocation(3)[2] + 70})
			 createUnit('dragon', 3, {startLocation(3)[1] - 30, startLocation(3)[2] + 60})

 		         unregisterCellTriggerEvent(cell_event7)

		       end

		       if triggeredCellEventId() == cell_event8 then 

			 showMessage('land', 'game')
			 showMessage('indian15', 'indian')
			 togglePauseGame(1);
    			 cell_event9 = registerCellTriggerEventForUnitToUnit(player_unit,james_unit)
			 morphToUnit(player_unit,'tech',1)
			 giveResource('gold', 1, 500); 
			 giveResource('wood', 1, 500); 
			 giveResource('food', 1, 200); 
			 giveProductionCommand(aerodrome_unit, 'none')

 		         unregisterCellTriggerEvent(cell_event8)

		       end

		       if triggeredCellEventId() == cell_event9 then 

			 showMessage('james1', 'james')
			 showMessage('player3', 'you')
			 showMessage('james2', 'james')
			 showMessage('player4', 'you')
			 showMessage('james3', 'james')
			 showMessage('player5', 'you')
			 showMessage('james4', 'james')
			 showMessage('james5', 'james')
			 showMessage('james6', 'james')


			 createUnit('castle', 7,  startLocation(6))
			 castle_cap_unit= lastCreatedUnit()
			 for i=1, 8 do
				createUnit('archer', 5, startLocation(6))
			 end
			 for i=1, 1 do
				createUnit('valkyrie', 5, startLocation(6))
			 end
			 createUnit('thor', 5, startLocation(6))

		 	 clearDisplayText()
			 setDisplayText('getmf')

			 createUnit('castle', 5,  startLocation(5))
			 castle_enm_unit= lastCreatedUnit()
			 for i=1, 8 do
				createUnit('archer', 5, startLocation(5))
			 end
			 for i=1, 5 do
				createUnit('swordman', 5, startLocation(5))
			 end
			 for i=1, 3 do
				createUnit('axe_thrower', 5, startLocation(5))
			 end
			 createUnit('thor', 5,  startLocation(5))
			 createUnit('mistletree', 5,  startLocation(5))

 		         unregisterCellTriggerEvent(cell_event9)

		       end

		       if triggeredCellEventId() == cell_event10 then 

			 showMessage('james7', 'james')
		 	 clearDisplayText()
			 setDisplayText('get')
			 timer_event0 = startTimerEvent()

 		         unregisterCellTriggerEvent(cell_event10)

		       end

		       if triggeredCellEventId() == cell_event11 then 

			 showMessage('james8', 'james')
		 	 clearDisplayText()
			 setDisplayText('win')

			 disableAi(2)
			 disableConsume(2)

			 givePositionCommand(james_unit, 'move',  {startLocation(2)[1] - 30, startLocation(2)[2] - 0})
			 timer_event1 = startTimerEvent()

			 createUnit('dragon', 3, {startLocation(0)[1] - 25, startLocation(0)[2] - 25})
			 createUnit('golem', 3, {startLocation(7)[1] - 50, startLocation(7)[2] - 55})
			 createUnit('golem', 3, {startLocation(7)[1] - 60, startLocation(7)[2] - 65})
			 createUnit('golem', 3, {startLocation(7)[1] + 21, startLocation(7)[2] - 65})
			 createUnit('dragon', 3, {startLocation(7)[1] - 15, startLocation(7)[2] - 45})
			 monster3_unit= lastCreatedUnit()
			 for i=1, 8 do
				createUnit('daemon', 3, {startLocation(7)[1] - 15, startLocation(7)[2] - 45})
			 end
			 createUnit('golem', 3, {startLocation(7)[1] + 21, startLocation(7)[2] - 65})

			 for i=1, 8 do
				createUnit('archer', 5, startLocation(1))
			 end
			 for i=1, 8 do
				createUnit('swordman', 5, startLocation(1))
			 end
			 for i=1, 3 do
				createUnit('crossbow', 5, startLocation(1))
			 end
			 for i=1, 5 do
				createUnit('battleaxe', 5, startLocation(1))
			 end
			 destroyUnit(d4_unit);
			 destroyUnit(d5_unit);
			 destroyUnit(d6_unit);
			 destroyUnit(d7_unit);
			 destroyUnit(d8_unit);
			 destroyUnit(d9_unit);
			 destroyUnit(d10_unit);

			 if archer1_unit ~= nil then
				destroyUnit(archer1_unit);
			 end
			 if archer2_unit ~= nil then
				destroyUnit(archer2_unit);
			 end
			 if archer3_unit ~= nil then
				destroyUnit(archer3_unit);
			 end
			 if archer4_unit ~= nil then
				destroyUnit(archer4_unit);
			 end
			 if archer5_unit ~= nil then
				destroyUnit(archer5_unit);
			 end
			 if archer6_unit ~= nil then
				destroyUnit(archer6_unit);
			 end

			 if swordman1_unit ~= nil then
				destroyUnit(swordman1_unit);
			 end
			 if swordman2_unit ~= nil then
				destroyUnit(swordman2_unit);
			 end
			 if swordman3_unit ~= nil then
				destroyUnit(swordman3_unit);
			 end
			 if swordman4_unit ~= nil then
				destroyUnit(swordman4_unit);
			 end

 		         unregisterCellTriggerEvent(cell_event11)

		       end

		       if triggeredCellEventId() == cell_event12 then 

				clearDisplayText()
				setPlayerAsWinner(0)
				setPlayerAsWinner(1)	
				setPlayerAsWinner(2)				
				endGame()

 		         unregisterCellTriggerEvent(cell_event12)

		       end


		</cellTriggerEvent>

		<timerTriggerEvent>

			if triggeredTimerEventId() == timer_event0 then
				if timerEventSecondsElapsed(triggeredTimerEventId()) >= 20 then

    		  	cell_event11 = registerCellTriggerEventForUnitToUnit(player_unit,james_unit)

					stopTimerEvent(timer_event0)
				end
			end

			if triggeredTimerEventId() == timer_event1 then
				if timerEventSecondsElapsed(triggeredTimerEventId()) >= 20 then

			 givePositionCommand(james_unit, 'move', startLocation(5))
			 timer_event2 = startTimerEvent()

					stopTimerEvent(timer_event1)
				end
			end

			if triggeredTimerEventId() == timer_event2 then
				if timerEventSecondsElapsed(triggeredTimerEventId()) >= 50 then

			 givePositionCommand(james_unit, 'move', startLocation(0))

			 createUnit('trigger', 0,  startLocation(0))
			 trigger_1= lastCreatedUnit()
    		  	 cell_event12 = registerCellTriggerEventForUnitToUnit(james_unit,trigger_1)

					stopTimerEvent(timer_event2)
				end
			end

			if triggeredTimerEventId() == timer_event3 then
				if timerEventSecondsElapsed(triggeredTimerEventId()) >= 2 then

			 createUnit('airship', 0, {startLocation(1)[1] - 42, startLocation(1)[2] - 62})
			 createUnit('airship', 0, {startLocation(1)[1] - 42, startLocation(1)[2] - 62})
			 createUnit('airship', 0, {startLocation(1)[1] - 42, startLocation(1)[2] - 62})
			 createUnit('airship', 0, {startLocation(1)[1] - 42, startLocation(1)[2] - 62})

					stopTimerEvent(timer_event3)
				end
			end


		</timerTriggerEvent>

		<resourceHarvested>

			if objective=='getr' and resourceAmount('wood', 0)>=400 and resourceAmount('gold', 0)>=200 then
    		  	cell_event2 = registerCellTriggerEventForUnitToUnit(player_unit,friend0_unit)
		        objective='none'
			end	
		
		</resourceHarvested>

		<unitCreatedOfType type="worker">
		
		</unitCreatedOfType>
		
		<unitDied>
			--check for starter men dying
			if lastDeadUnit()==archer1_unit then
				archer1_unit=nil
			end
			if lastDeadUnit()==archer2_unit then
				archer2_unit=nil
			end
			if lastDeadUnit()==archer3_unit then
				archer3_unit=nil
			end
			if lastDeadUnit()==archer4_unit then
				archer4_unit=nil
			end
			if lastDeadUnit()==archer5_unit then
				archer5_unit=nil
			end
			if lastDeadUnit()==archer6_unit then
				archer6_unit=nil
			end

			if lastDeadUnit()==swordman1_unit then
				swordman1_unit=nil
			end
			if lastDeadUnit()==swordman2_unit then
				swordman2_unit=nil
			end
			if lastDeadUnit()==swordman3_unit then
				swordman3_unit=nil
			end
			if lastDeadUnit()==swordman4_unit then
				swordman4_unit=nil
			end



			--check for you dying
			if lastDeadUnit()==player_unit then
				clearDisplayText()
				setPlayerAsWinner(3)
				setPlayerAsWinner(4)	
				setPlayerAsWinner(5)	
				setPlayerAsWinner(6)	
				setPlayerAsWinner(7)				
				endGame()
				workerUnit=nil
			end

			--check for friend 0 dying
			if lastDeadUnit()==friend0_unit then
				clearDisplayText()
				setPlayerAsWinner(3)
				setPlayerAsWinner(4)	
				setPlayerAsWinner(5)	
				setPlayerAsWinner(6)	
				setPlayerAsWinner(7)				
				endGame()
			end

			--check for friend 1 dying
			if lastDeadUnit()==friend1_unit then
				clearDisplayText()
				setPlayerAsWinner(3)
				setPlayerAsWinner(4)	
				setPlayerAsWinner(5)	
				setPlayerAsWinner(6)	
				setPlayerAsWinner(7)				
				endGame()
			end

			--check for friend 2 dying
			if lastDeadUnit()==friend2_unit then
				clearDisplayText()
				setPlayerAsWinner(3)
				setPlayerAsWinner(4)	
				setPlayerAsWinner(5)	
				setPlayerAsWinner(6)	
				setPlayerAsWinner(7)				
				endGame()
			end

			--check for friend 3 dying
			if lastDeadUnit()==friend3_unit then
				clearDisplayText()
				setPlayerAsWinner(3)
				setPlayerAsWinner(4)	
				setPlayerAsWinner(5)	
				setPlayerAsWinner(6)	
				setPlayerAsWinner(7)				
				endGame()
			end

			--check for james dying
			if lastDeadUnit()==james_unit then
				clearDisplayText()
				setPlayerAsWinner(3)
				setPlayerAsWinner(4)	
				setPlayerAsWinner(5)	
				setPlayerAsWinner(6)	
				setPlayerAsWinner(7)				
				endGame()
			end

			--check for monster 1 dying
			if lastDeadUnit()==monster1_unit and objective=='killm' then
			 showMessage('player2', 'you')
			 objective='none'
		 	 clearDisplayText()
			 setDisplayText('getf')
  		  	cell_event6 = registerCellTriggerEventForUnitToUnit(player_unit,friend3_unit)
			end

			--check for monster 2 dying
			if lastDeadUnit()==monster2_unit then

			 showMessage('indian14', 'indian')

			--fortress units
			createUnit('castle', 2, {startLocation(2)[1] - 1, startLocation(2)[2] - 5})
			createUnit('james', 2, {startLocation(2)[1] + 2, startLocation(2)[2] + 0})
			james_unit= lastCreatedUnit()
			createUnit('defense_tower', 2, {startLocation(2)[1] - 16, startLocation(2)[2] - 6})
			createUnit('defense_tower', 2, {startLocation(2)[1] - 8, startLocation(2)[2] - 10})

			createUnit('barracks', 2, {startLocation(2)[1] - 10, startLocation(2)[2] + 3})
			createUnit('farm', 2, {startLocation(2)[1] + 5, startLocation(2)[2] + 5})
			createUnit('blacksmith', 2, {startLocation(2)[1] + 8, startLocation(2)[2] - 3})
			createUnit('aerodrome_', 2, {startLocation(2)[1] + 16, startLocation(2)[2] + 0})
			aerodrome_unit= lastCreatedUnit()

  		  	cell_event8 = registerCellTriggerEventForUnitToUnit(player_unit,aerodrome_unit)
			end

			--check for monster 3 dying
			if lastDeadUnit()==monster3_unit then

			for i=1, 10 do
				createUnit('daemon', 3, startLocation(7))
				givePositionCommand(lastCreatedUnit(), 'attack', startLocation(1))	
			end

			end

			--check for castle
			if lastDeadUnit()==castle_cap_unit then
			 showMessage('player6', 'you')
			 giveResource('gold', 0, 500); 
			 giveResource('wood', 0, 500); 
			 giveResource('food', 0, 250); 
			 createUnit('castle', 0,  startLocation(6))

			 enableAi(5)
			 enableAi(2)
			 enableConsume(5)
			 enableConsume(0)
			 enableConsume(2)
			 giveResource('food', 2, 250); 
			 giveResource('gold', 2, 250); 
			 giveResource('gold', 5, 100); 
			 giveResource('food', 5, 250); 

			for i=1, 15 do
				createUnit('archer', 2, startLocation(2))	
			end

			end

			--check for mining grounds clear
			if lastDeadUnit()==castle_enm_unit then
		 	 clearDisplayText()
			 showMessage('player7', 'you')
  		  	 cell_event10 = registerCellTriggerEventForUnitToUnit(player_unit,james_unit)

			 destroyUnit(clip_1_unit);
			 destroyUnit(clip_2_unit);
			 destroyUnit(clip_3_unit);
			 destroyUnit(clip_4_unit);
			 destroyUnit(clip_5_unit);
			 destroyUnit(clip_6_unit);
			 destroyUnit(clip_7_unit);
			end
			
		</unitDied>		
	</scripts>		
</scenario>
