///////////////////////////////////////////////////////////////////////////////
//	Land 10 Aztec Troop-Management
//	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
//	Start date:			18.08.16			By:	Boxhead
//	Update date:		31.10.16			By: Boxhead
///////////////////////////////////////////////////////////////////////////////

//-----------------------------------------------------------------------------
//	Globals
//-----------------------------------------------------------------------------

define LC10_NUM_OF_DEFENDERS				= 0 //Unused.
define LC10_NUM_OF_PLATOONS					= 37
define LC10_NUM_OF_PRISON_GUARDS			= 4
define LC10_NUM_OF_SIEGE_CATAPULTS 			= 24
define LC10_NUM_OF_WALL_ARCHERS				= 9

global LC10_Defender[LC10_NUM_OF_DEFENDERS]
global LC10_Platoon[LC10_NUM_OF_PLATOONS]
global LC10_PrisonGuard[LC10_NUM_OF_PRISON_GUARDS]
global LC10_SiegeCatapult[LC10_NUM_OF_SIEGE_CATAPULTS]
global LC10_WallArcher[LC10_NUM_OF_WALL_ARCHERS]

global PrisonPos[5]
global PlatoonPos[16]
global DefenderPos[8]
global PlatoonDefendPos[2]
global SiegePlatoonPos[10]
global AttackPos[10]
global SiegeRoute1[3]
global SiegeRoute2[3]
global SiegeRoute3[17]
global SiegeRoute4[17]
global SiegeRoute5[17]
global SiegeRoute6[12]
global SiegeRoute7[12]
global SiegeRoute8[12]
global SiegeRoute9[12]
global PlayerWallPos = 0

global PatrolRouteA[3]
global PatrolRouteB[3]
global PatrolRouteC[3]
global PatrolRouteD[3]
global PatrolRouteE[5]
global AC_ForwardRoute[5]
global WaypointsA			= 0
global WaypointsB			= 0
global WaypointsC			= 0
global WaypointsD			= 0
global WaypointsE			= 0

//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------

run script Waypoints

begin script Waypoints

start

	PrisonDialoguePos = marker at {1914.85,310.60,1870.06}
	PlayerWallPos = marker at {1458.79,238.63,757.61}

	PrisonPos[0] = marker at {1878.73,310.60,1815.72}
	PrisonPos[1] = marker at {1894.98,310.60,1860.66}
	PrisonPos[2] = marker at {1935.88,310.49,1866.35}
	PrisonPos[3] = marker at {1892.06,310.69,1767.67}
	PrisonPos[4] = marker at {1899.18,309.01,1709.33}
	
	PlatoonDefendPos[0] = marker at {1780.56,207.08,1251.66}
	PlatoonDefendPos[1] = marker at {1807.97,207.93,1215.67}
	
	PlatoonPos[0] = marker at {1402.74,210.13,1264.48}
	PlatoonPos[1] = marker at {1208.65,237.64,1475.33}
	PlatoonPos[2] = marker at {1076.05,345.80,1726.86}
	PlatoonPos[3] = marker at {1337.03,225.71,1576.31}
	PlatoonPos[4] = marker at {1442.17,255.26,1712.92}
	PlatoonPos[5] = marker at {1628.38,212.70,1010.18}
	PlatoonPos[6] = marker at {1746.54,216.28,1169.06}
	PlatoonPos[7] = marker at {1651.12,230.46,1092.36}
	PlatoonPos[8] = marker at {1267.66,253.50,1668.01}
	PlatoonPos[9] = marker at {1284.90,265.86,1695.48}
	PlatoonPos[10] = marker at {862.09,397.31,1657.59}
	PlatoonPos[11] = marker at {852.97,398.70,1719.35}
	PlatoonPos[12] = marker at {650.84,449.14,2028.12}
	PlatoonPos[13] = marker at {776.87,403.99,1742.26}
	PlatoonPos[14] = marker at {766.32,411.61,1893.17}
	PlatoonPos[15] = marker at {1594.09,228.59,789.71}
	
	SiegePlatoonPos[0] = marker at {1644.51,210.82,1025.59}
	SiegePlatoonPos[1] = marker at {1644.51,210.82,1025.59} + {5.00,0.00,5.00}
	SiegePlatoonPos[2] = marker at {961.18,385.89,1776.92}
	
	SiegeRoute1[0] = marker at {1726.23,208.12,839.71}
	SiegeRoute1[1] = marker at {1520.94,231.24,730.67}
	SiegeRoute1[2] = marker at {1495.65,233.67,736.98}
	
	SiegeRoute2[0] = marker at {1718.69,210.45,852.66}
	SiegeRoute2[1] = marker at {1628.20,228.53,803.87}
	SiegeRoute2[2] = marker at {1535.47,231.06,748.83}
	
	SiegeRoute3[0] = marker at {705.29,425.81,1974.07}
	SiegeRoute3[1] = marker at {751.01,412.86,1949.51}
	SiegeRoute3[2] = marker at {759.53,411.42,1881.10}
	SiegeRoute3[3] = marker at {770.34,404.97,1803.95}
	SiegeRoute3[4] = marker at {823.52,402.22,1752.17}
	SiegeRoute3[5] = marker at {845.23,401.12,1734.88}
	SiegeRoute3[6] = marker at {912.08,393.42,1753.88}
	SiegeRoute3[7] = marker at {938.34,391.97,1761.79}
	SiegeRoute3[8] = marker at {1027.90,367.28,1788.01}//In Town to this point
	SiegeRoute3[9] = marker at {1260.61,229.58,1462.83}
	SiegeRoute3[10] = marker at {1386.75,232.48,1563.37}
	SiegeRoute3[11] = marker at {1682.74,216.73,1371.84}
	SiegeRoute3[12] = marker at {1868.52,221.07,1113.64}
	SiegeRoute3[13] = marker at {1833.42,203.88,911.73}
	SiegeRoute3[14] = marker at {1642.19,229.43,803.73}
	SiegeRoute3[15] = marker at {1543.39,230.05,750.86}
	SiegeRoute3[16] = marker at {1482.01,235.42,745.38}
	
	SiegeRoute4[0] = marker at {705.29,425.81,1974.07}
	SiegeRoute4[1] = marker at {751.01,412.86,1949.51}
	SiegeRoute4[2] = marker at {759.53,411.42,1881.10}
	SiegeRoute4[3] = marker at {770.34,404.97,1803.95}
	SiegeRoute4[4] = marker at {823.52,402.22,1752.17}
	SiegeRoute4[5] = marker at {845.23,401.12,1734.88}
	SiegeRoute4[6] = marker at {912.08,393.42,1753.88}
	SiegeRoute4[7] = marker at {938.34,391.97,1761.79}
	SiegeRoute4[8] = marker at {1027.90,367.28,1788.01}//In Town to this point
	SiegeRoute4[9] = marker at ({1260.61,229.58,1462.83} + {3.00,0.00,3.00})
	SiegeRoute4[10] = marker at ({1386.75,232.48,1563.37} + {3.00,0.00,3.00})
	SiegeRoute4[11] = marker at ({1682.74,216.73,1371.84} + {3.00,0.00,3.00})
	SiegeRoute4[12] = marker at ({1868.52,221.07,1113.64} + {3.00,0.00,3.00})
	SiegeRoute4[13] = marker at ({1833.42,203.88,911.73} + {3.00,0.00,3.00})
	SiegeRoute4[14] = marker at ({1642.19,229.43,803.73} + {3.00,0.00,3.00})
	SiegeRoute4[15] = marker at ({1543.39,230.05,750.86} + {3.00,0.00,3.00})
	SiegeRoute4[16] = marker at ({1482.01,235.42,745.38} + {3.00,0.00,3.00})
	
	SiegeRoute5[0] = marker at {705.29,425.81,1974.07}
	SiegeRoute5[1] = marker at {751.01,412.86,1949.51}
	SiegeRoute5[2] = marker at {759.53,411.42,1881.10}
	SiegeRoute5[3] = marker at {770.34,404.97,1803.95}
	SiegeRoute5[4] = marker at {823.52,402.22,1752.17}
	SiegeRoute5[5] = marker at {845.23,401.12,1734.88}
	SiegeRoute5[6] = marker at {912.08,393.42,1753.88}
	SiegeRoute5[7] = marker at {938.34,391.97,1761.79}
	SiegeRoute5[8] = marker at {1027.90,367.28,1788.01}//In Town to this point
	SiegeRoute5[9] = marker at ({1260.61,229.58,1462.83} + {-3.00,0.00,-3.00})
	SiegeRoute5[10] = marker at ({1386.75,232.48,1563.37} + {-3.00,0.00,-3.00})
	SiegeRoute5[11] = marker at ({1682.74,216.73,1371.84} + {-3.00,0.00,-3.00})
	SiegeRoute5[12] = marker at ({1868.52,221.07,1113.64} + {-3.00,0.00,-3.00})
	SiegeRoute5[13] = marker at ({1833.42,203.88,911.73} + {-3.00,0.00,-3.00})
	SiegeRoute5[14] = marker at ({1642.19,229.43,803.73} + {-3.00,0.00,-3.00})
	SiegeRoute5[15] = marker at ({1543.39,230.05,750.86} + {-3.00,0.00,-3.00})
	SiegeRoute5[16] = marker at ({1482.01,235.42,745.38} + {-3.00,0.00,-3.00})
	
	SiegeRoute6[0] = marker at {705.29,425.81,1974.07}
	SiegeRoute6[1] = marker at {751.01,412.86,1949.51}
	SiegeRoute6[2] = marker at {759.53,411.42,1881.10}
	SiegeRoute6[3] = marker at {770.34,404.97,1803.95}
	SiegeRoute6[4] = marker at {823.52,402.22,1752.17}
	SiegeRoute6[5] = marker at {845.23,401.12,1734.88}
	SiegeRoute6[6] = marker at {912.08,393.42,1753.88}
	SiegeRoute6[7] = marker at {938.34,391.97,1761.79}
	SiegeRoute6[8] = marker at {1027.90,367.28,1788.01}//In Town to this point
	SiegeRoute6[9] = marker at {1222.89,235.45,1466.20}
	SiegeRoute6[10] = marker at {1316.14,224.36,1518.32}
	SiegeRoute6[11] = marker at {1312.74,224.81,1577.78}

	SiegeRoute7[0] = marker at {705.29,425.81,1974.07}
	SiegeRoute7[1] = marker at {751.01,412.86,1949.51}
	SiegeRoute7[2] = marker at {759.53,411.42,1881.10}
	SiegeRoute7[3] = marker at {770.34,404.97,1803.95}
	SiegeRoute7[4] = marker at {823.52,402.22,1752.17}
	SiegeRoute7[5] = marker at {845.23,401.12,1734.88}
	SiegeRoute7[6] = marker at {912.08,393.42,1753.88}
	SiegeRoute7[7] = marker at {938.34,391.97,1761.79}
	SiegeRoute7[8] = marker at {1027.90,367.28,1788.01}//In Town to this point
	SiegeRoute7[9] = marker at ({1222.89,235.45,1466.20} + {-3.00,0.00,-3.00})
	SiegeRoute7[10] = marker at ({1316.14,224.36,1518.32} + {-3.00,0.00,-3.00})
	SiegeRoute7[11] = marker at ({1312.74,224.81,1577.78} + {-3.00,0.00,-3.00})
	
	SiegeRoute8[0] = marker at {705.29,425.81,1974.07}
	SiegeRoute8[1] = marker at {751.01,412.86,1949.51}
	SiegeRoute8[2] = marker at {759.53,411.42,1881.10}
	SiegeRoute8[3] = marker at {770.34,404.97,1803.95}
	SiegeRoute8[4] = marker at {823.52,402.22,1752.17}
	SiegeRoute8[5] = marker at {845.23,401.12,1734.88}
	SiegeRoute8[6] = marker at {912.08,393.42,1753.88}
	SiegeRoute8[7] = marker at {938.34,391.97,1761.79}
	SiegeRoute8[8] = marker at {1027.90,367.28,1788.01}//In Town to this point
	SiegeRoute8[9] = marker at {1275.79,227.77,1471.93}
	SiegeRoute8[10] = marker at {1391.30,233.49,1570.89}
	SiegeRoute8[11] = marker at {1711.91,210.60,1339.46}
	
	SiegeRoute9[0] = marker at {705.29,425.81,1974.07}
	SiegeRoute9[1] = marker at {751.01,412.86,1949.51}
	SiegeRoute9[2] = marker at {759.53,411.42,1881.10}
	SiegeRoute9[3] = marker at {770.34,404.97,1803.95}
	SiegeRoute9[4] = marker at {823.52,402.22,1752.17}
	SiegeRoute9[5] = marker at {845.23,401.12,1734.88}
	SiegeRoute9[6] = marker at {912.08,393.42,1753.88}
	SiegeRoute9[7] = marker at {938.34,391.97,1761.79}
	SiegeRoute9[8] = marker at {1027.90,367.28,1788.01}//In Town to this point
	SiegeRoute9[9] = marker at ({1275.79,227.77,1471.93} + {-3.00,0.00,-3.00})
	SiegeRoute9[10] = marker at ({1391.30,233.49,1570.89} + {-3.00,0.00,-3.00})
	SiegeRoute9[11] = marker at ({1711.91,210.60,1339.46} + {-3.00,0.00,-3.00})
	
	AttackPos[0] = marker at {1503.66,234.10,753.43}
	AttackPos[1] = marker at {1628.15,227.89,809.27}
	AttackPos[2] = marker at {1481.47,234.83,739.92}
	AttackPos[3] = marker at {1644.54,229.74,802.47}
	AttackPos[4] = marker at {1317.82,222.83,1572.15}//AztecPreTown
	AttackPos[5] = marker at {1798.18,206.46,1224.80}//AztecFirstTown
	
	PatrolRouteA[0] = marker at {1205.312, 233.416, 1420.279}
	PatrolRouteA[1] = marker at {1554.823, 284.652, 1714.871}
	PatrolRouteA[2] = marker at {1403.241, 234.557, 1570.948}
	PatrolRouteB[0] = marker at {1795.434, 205.960, 1233.388}
	PatrolRouteB[1] = marker at {1956.995, 253.698, 1356.712}
	PatrolRouteB[2] = marker at {2015.100, 269.359, 1468.804}
	PatrolRouteC[0] = marker at {1757.501, 207.355, 796.654}
	PatrolRouteC[1] = marker at {1789.643, 203.331, 873.236}
	PatrolRouteC[2] = marker at {1667.162, 225.978, 806.145}
	PatrolRouteD[0] = marker at {1440.12,231.58,1517.19}
	PatrolRouteD[1] = marker at {1540.37,214.52,1421.70}
	PatrolRouteD[2] = marker at {1699.82,212.59,1368.95}
	PatrolRouteE[0] = marker at {1069.86,340.34,1687.27}
	PatrolRouteE[1] = marker at {1193.11,242.96,1484.13}
	PatrolRouteE[2] = marker at {1392.74,234.27,1576.89}
	PatrolRouteE[3] = marker at {1871.71,219.52,1125.97}
	PatrolRouteE[4] = marker at {1831.48,203.16,905.37}
	
	WaypointsA = create SCRIPT_OBJECT_TYPE_WAYPOINTROUTE at {0, 0, 0}
	WaypointsB = create SCRIPT_OBJECT_TYPE_WAYPOINTROUTE at {0, 0, 0}
	WaypointsC = create SCRIPT_OBJECT_TYPE_WAYPOINTROUTE at {0, 0, 0}
	WaypointsD = create SCRIPT_OBJECT_TYPE_WAYPOINTROUTE at {0, 0, 0}
	WaypointsE = create SCRIPT_OBJECT_TYPE_WAYPOINTROUTE at {0, 0, 0}

	add {PatrolRouteA[0]} to waypoint list WaypointsA
	add {PatrolRouteA[1]} to waypoint list WaypointsA
	add {PatrolRouteA[2]} to waypoint list WaypointsA
	add {PatrolRouteB[0]} to waypoint list WaypointsB
	add {PatrolRouteB[1]} to waypoint list WaypointsB
	add {PatrolRouteB[2]} to waypoint list WaypointsB
	add {PatrolRouteC[0]} to waypoint list WaypointsC
	add {PatrolRouteC[1]} to waypoint list WaypointsC
	add {PatrolRouteC[2]} to waypoint list WaypointsC
	add {PatrolRouteD[0]} to waypoint list WaypointsD
	add {PatrolRouteD[1]} to waypoint list WaypointsD
	add {PatrolRouteD[2]} to waypoint list WaypointsD
	add {PatrolRouteE[0]} to waypoint list WaypointsE
	add {PatrolRouteE[1]} to waypoint list WaypointsE
	add {PatrolRouteE[2]} to waypoint list WaypointsE
	add {PatrolRouteE[3]} to waypoint list WaypointsE
	add {PatrolRouteE[4]} to waypoint list WaypointsE

end script Waypoints

begin script LC10_PrisonGuard0Actions

	TestPlatoonGuards = 0
	DistanceG = 0
	disvolcano = 0
	Position1 = 0
	Position2 = 0
	Position3 = 0
	Position4 = 0
	PlayerCreature = 0
    PlayerPlatoon1 = 0
    TestSiege = 0
	oCreature = get player 0 creature
	NumPat1 = 0
	HeTeste1 = 0
	WorrNum = 0
	HomeTown = get town with id 4
	Catapult = 0
	Armory = get building ABODE_NUMBER_MELEE_ARMOURY in HomeTown min built 1.0
	ArmoryRanged = get building ABODE_NUMBER_RANGED_ARMOURY in HomeTown min built 1.0
	PlayerPlatoon1Distance = 0
	PlayerCatapultDistance = 0
	a = 0
	
start

	set LC10_PrisonGuard[0] focus to {PrisonPos[4]}

begin loop	
	
	PlayerCreature = get distance from {LC10_PrisonGuard[0]} to {oCreature}
	if PlayerCreature <= 200 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00 and LC10_PrisonGuard[0] can navigate to {oCreature}
		clear LC10_PrisonGuard[0] action queue
		begin loop
			PlayerCreature = get distance from {LC10_PrisonGuard[0]} to {oCreature}
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_MOVING_OBJECT using oCreature to LC10_PrisonGuard[0] action queue
			NumPat1 = get number of villagers in platoon LC10_PrisonGuard[0]
			until NumPat1 == 0 or SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature == 0.00 or not LC10_PrisonGuard[0] can navigate to {oCreature} or PlayerCreature > 200
		end loop
		clear LC10_PrisonGuard[0] action queue
	end if
	
	PlayerPlatoon1 = get platoon of player 0 nearest {LC10_PrisonGuard[0]} radius 200
	Catapult = get siege weapon of player 0 nearest {LC10_PrisonGuard[0]} radius 155
	if PlayerPlatoon1 exists and LC10_PrisonGuard[0] can navigate to {PlayerPlatoon1}
		clear LC10_PrisonGuard[0] action queue
		begin loop
			PlayerPlatoon1 = get platoon of player 0 nearest {LC10_PrisonGuard[0]} radius 200
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_PLATOON using PlayerPlatoon1 to LC10_PrisonGuard[0] action queue
			NumPat1 = get number of villagers in platoon LC10_PrisonGuard[0]
			HeTeste1 = get number of villagers in platoon PlayerPlatoon1
			until NumPat1 == 0 or HeTeste1 == 0 or not LC10_PrisonGuard[0] can navigate to {PlayerPlatoon1} or PlayerPlatoon1 not exists
		end loop
		clear LC10_PrisonGuard[0] action queue
	elsif Catapult exists and LC10_PrisonGuard[0] can navigate to {Catapult}
		clear LC10_PrisonGuard[0] action queue
		a = 0
		begin loop
			Catapult = get siege weapon of player 0 nearest {LC10_PrisonGuard[0]} radius 155
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_THING using Catapult to LC10_PrisonGuard[0] action queue
			NumPat1 = get number of villagers in platoon LC10_PrisonGuard[0]
			PlayerPlatoon1 = get platoon of player 0 nearest {LC10_PrisonGuard[0]} radius 200
			if PlayerPlatoon1 exists and LC10_PrisonGuard[0] can navigate to {PlayerPlatoon1}
				a = 1
			end if
			until NumPat1 == 0 or Catapult not exists or not LC10_PrisonGuard[0] can navigate to {Catapult} or a == 1 or Catapult not exists
		end loop
		a = 0
		clear LC10_PrisonGuard[0] action queue
	end if
	
	if get size of LC10_PrisonGuard[0] action queue < 1
		add action PLATOON_AGENDA_ACTION_DEFEND_POSITION using {PrisonPos[0]} to LC10_PrisonGuard[0] action queue
	end if
	
end loop

end script LC10_PrisonGuard0Actions

begin script LC10_PrisonGuard1Actions

	TestPlatoonGuards = 0
	DistanceG = 0
	disvolcano = 0
	Position1 = 0
	Position2 = 0
	Position3 = 0
	Position4 = 0
	PlayerCreature = 0
    PlayerPlatoon1 = 0
    TestSiege = 0
	oCreature = get player 0 creature
	NumPat1 = 0
	HeTeste1 = 0
	WorrNum = 0
	HomeTown = get town with id 4
	Catapult = 0
	Armory = get building ABODE_NUMBER_MELEE_ARMOURY in HomeTown min built 1.0
	ArmoryRanged = get building ABODE_NUMBER_RANGED_ARMOURY in HomeTown min built 1.0
	PlayerPlatoon1Distance = 0
	PlayerCatapultDistance = 0
	a = 0
	
start

	set LC10_PrisonGuard[1] focus to {PrisonPos[4]}

begin loop	
	
	PlayerCreature = get distance from {LC10_PrisonGuard[1]} to {oCreature}
	if PlayerCreature <= 200 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00 and LC10_PrisonGuard[1] can navigate to {oCreature}
		clear LC10_PrisonGuard[1] action queue
		begin loop
			PlayerCreature = get distance from {LC10_PrisonGuard[1]} to {oCreature}
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_MOVING_OBJECT using oCreature to LC10_PrisonGuard[1] action queue
			NumPat1 = get number of villagers in platoon LC10_PrisonGuard[1]
			until NumPat1 == 0 or SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature == 0.00 or not LC10_PrisonGuard[1] can navigate to {oCreature} or PlayerCreature > 200
		end loop
		clear LC10_PrisonGuard[1] action queue
	end if
	
	PlayerPlatoon1 = get platoon of player 0 nearest {LC10_PrisonGuard[1]} radius 200
	Catapult = get siege weapon of player 0 nearest {LC10_PrisonGuard[1]} radius 155
	if PlayerPlatoon1 exists and LC10_PrisonGuard[1] can navigate to {PlayerPlatoon1}
		clear LC10_PrisonGuard[1] action queue
		begin loop
			PlayerPlatoon1 = get platoon of player 0 nearest {LC10_PrisonGuard[1]} radius 200
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_PLATOON using PlayerPlatoon1 to LC10_PrisonGuard[1] action queue
			NumPat1 = get number of villagers in platoon LC10_PrisonGuard[1]
			HeTeste1 = get number of villagers in platoon PlayerPlatoon1
			until NumPat1 == 0 or HeTeste1 == 0 or not LC10_PrisonGuard[1] can navigate to {PlayerPlatoon1} or PlayerPlatoon1 not exists
		end loop
		clear LC10_PrisonGuard[1] action queue
	elsif Catapult exists and LC10_PrisonGuard[1] can navigate to {Catapult}
		clear LC10_PrisonGuard[1] action queue
		a = 0
		begin loop
			Catapult = get siege weapon of player 0 nearest {LC10_PrisonGuard[1]} radius 155
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_THING using Catapult to LC10_PrisonGuard[1] action queue
			NumPat1 = get number of villagers in platoon LC10_PrisonGuard[1]
			PlayerPlatoon1 = get platoon of player 0 nearest {LC10_PrisonGuard[1]} radius 200
			if PlayerPlatoon1 exists and LC10_PrisonGuard[1] can navigate to {PlayerPlatoon1}
				a = 1
			end if
			until NumPat1 == 0 or Catapult not exists or not LC10_PrisonGuard[1] can navigate to {Catapult} or a == 1 or Catapult not exists
		end loop
		a = 0
		clear LC10_PrisonGuard[1] action queue
	end if
	
	if get size of LC10_PrisonGuard[1] action queue < 1
		add action PLATOON_AGENDA_ACTION_DEFEND_POSITION using {PrisonPos[1]} to LC10_PrisonGuard[1] action queue
	end if
	
end loop

end script LC10_PrisonGuard1Actions

begin script LC10_PrisonGuard2Actions

	TestPlatoonGuards = 0
	DistanceG = 0
	disvolcano = 0
	Position1 = 0
	Position2 = 0
	Position3 = 0
	Position4 = 0
	PlayerCreature = 0
    PlayerPlatoon1 = 0
    TestSiege = 0
	oCreature = get player 0 creature
	NumPat1 = 0
	HeTeste1 = 0
	WorrNum = 0
	HomeTown = get town with id 4
	Catapult = 0
	Armory = get building ABODE_NUMBER_MELEE_ARMOURY in HomeTown min built 1.0
	ArmoryRanged = get building ABODE_NUMBER_RANGED_ARMOURY in HomeTown min built 1.0
	PlayerPlatoon1Distance = 0
	PlayerCatapultDistance = 0
	a = 0
	
start

	set LC10_PrisonGuard[2] focus to {PrisonPos[4]}

begin loop	
	
	PlayerCreature = get distance from {LC10_PrisonGuard[2]} to {oCreature}
	if PlayerCreature <= 200 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00 and LC10_PrisonGuard[2] can navigate to {oCreature}
		clear LC10_PrisonGuard[2] action queue
		begin loop
			PlayerCreature = get distance from {LC10_PrisonGuard[2]} to {oCreature}
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_MOVING_OBJECT using oCreature to LC10_PrisonGuard[2] action queue
			NumPat1 = get number of villagers in platoon LC10_PrisonGuard[2]
			until NumPat1 == 0 or SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature == 0.00 or not LC10_PrisonGuard[2] can navigate to {oCreature} or PlayerCreature > 200
		end loop
		clear LC10_PrisonGuard[2] action queue
	end if
	
	PlayerPlatoon1 = get platoon of player 0 nearest {LC10_PrisonGuard[2]} radius 200
	Catapult = get siege weapon of player 0 nearest {LC10_PrisonGuard[2]} radius 155
	if PlayerPlatoon1 exists and LC10_PrisonGuard[2] can navigate to {PlayerPlatoon1}
		clear LC10_PrisonGuard[2] action queue
		begin loop
			PlayerPlatoon1 = get platoon of player 0 nearest {LC10_PrisonGuard[2]} radius 200
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_PLATOON using PlayerPlatoon1 to LC10_PrisonGuard[2] action queue
			NumPat1 = get number of villagers in platoon LC10_PrisonGuard[2]
			HeTeste1 = get number of villagers in platoon PlayerPlatoon1
			until NumPat1 == 0 or HeTeste1 == 0 or not LC10_PrisonGuard[2] can navigate to {PlayerPlatoon1} or PlayerPlatoon1 not exists
		end loop
		clear LC10_PrisonGuard[2] action queue
	elsif Catapult exists and LC10_PrisonGuard[2] can navigate to {Catapult}
		clear LC10_PrisonGuard[2] action queue
		a = 0
		begin loop
			Catapult = get siege weapon of player 0 nearest {LC10_PrisonGuard[2]} radius 155
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_THING using Catapult to LC10_PrisonGuard[2] action queue
			NumPat1 = get number of villagers in platoon LC10_PrisonGuard[2]
			PlayerPlatoon1 = get platoon of player 0 nearest {LC10_PrisonGuard[2]} radius 200
			if PlayerPlatoon1 exists and LC10_PrisonGuard[2] can navigate to {PlayerPlatoon1}
				a = 1
			end if
			until NumPat1 == 0 or Catapult not exists or not LC10_PrisonGuard[2] can navigate to {Catapult} or a == 1 or Catapult not exists
		end loop
		clear LC10_PrisonGuard[2] action queue
		a = 0
	end if
	
	if get size of LC10_PrisonGuard[2] action queue < 1
		add action PLATOON_AGENDA_ACTION_DEFEND_POSITION using {PrisonPos[2]} to LC10_PrisonGuard[2] action queue
	end if
	
end loop

end script LC10_PrisonGuard2Actions

begin script LC10_PrisonGuard3Actions

	TestPlatoonGuards = 0
	DistanceG = 0
	disvolcano = 0
	Position1 = 0
	Position2 = 0
	Position3 = 0
	Position4 = 0
	PlayerCreature = 0
    PlayerPlatoon1 = 0
    TestSiege = 0
	oCreature = get player 0 creature
	NumPat1 = 0
	HeTeste1 = 0
	WorrNum = 0
	HomeTown = get town with id 4
	Catapult = 0
	Armory = get building ABODE_NUMBER_MELEE_ARMOURY in HomeTown min built 1.0
	ArmoryRanged = get building ABODE_NUMBER_RANGED_ARMOURY in HomeTown min built 1.0
	PlayerPlatoon1Distance = 0
	PlayerCatapultDistance = 0
	a = 0
	
start

	set LC10_PrisonGuard[3] focus to {PrisonPos[4]}

begin loop	
	
	PlayerCreature = get distance from {LC10_PrisonGuard[3]} to {oCreature}
	if PlayerCreature <= 200 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00 and LC10_PrisonGuard[3] can navigate to {oCreature}
		clear LC10_PrisonGuard[3] action queue
		begin loop
			PlayerCreature = get distance from {LC10_PrisonGuard[3]} to {oCreature}
			add action PLATOON_AGENDA_ACTION_RANGED_ATTACK using oCreature to LC10_PrisonGuard[3] action queue
			NumPat1 = get number of villagers in platoon LC10_PrisonGuard[3]
			until NumPat1 == 0 or SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature == 0.00 or not LC10_PrisonGuard[3] can navigate to {oCreature} or PlayerCreature > 200
		end loop
		clear LC10_PrisonGuard[3] action queue
	end if
	
	PlayerPlatoon1 = get platoon of player 0 nearest {LC10_PrisonGuard[3]} radius 200
	Catapult = get siege weapon of player 0 nearest {LC10_PrisonGuard[3]} radius 155
	if PlayerPlatoon1 exists and LC10_PrisonGuard[3] can navigate to {PlayerPlatoon1}
		clear LC10_PrisonGuard[3] action queue
		begin loop
			PlayerPlatoon1 = get platoon of player 0 nearest {LC10_PrisonGuard[3]} radius 200
			add action PLATOON_AGENDA_ACTION_RANGED_ATTACK using PlayerPlatoon1 to LC10_PrisonGuard[3] action queue
			NumPat1 = get number of villagers in platoon LC10_PrisonGuard[3]
			HeTeste1 = get number of villagers in platoon PlayerPlatoon1
			until NumPat1 == 0 or HeTeste1 == 0 or not LC10_PrisonGuard[3] can navigate to {PlayerPlatoon1} or PlayerPlatoon1 not exists
		end loop
		clear LC10_PrisonGuard[3] action queue
	elsif Catapult exists and LC10_PrisonGuard[3] can navigate to {Catapult}
		clear LC10_PrisonGuard[3] action queue
		a = 0
		begin loop
			Catapult = get siege weapon of player 0 nearest {LC10_PrisonGuard[3]} radius 155
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_THING using Catapult to LC10_PrisonGuard[3] action queue
			NumPat1 = get number of villagers in platoon LC10_PrisonGuard[3]
			PlayerPlatoon1 = get platoon of player 0 nearest {LC10_PrisonGuard[3]} radius 200
			if PlayerPlatoon1 exists and LC10_PrisonGuard[3] can navigate to {PlayerPlatoon1}
				a = 1
			end if
			until NumPat1 == 0 or Catapult not exists or not LC10_PrisonGuard[3] can navigate to {Catapult} or a == 1 or Catapult not exists
		end loop
		clear LC10_PrisonGuard[3] action queue
		a = 0
	end if
	
	if get size of LC10_PrisonGuard[3] action queue < 1
		add action PLATOON_AGENDA_ACTION_DEFEND_POSITION using {PrisonPos[4]} to LC10_PrisonGuard[3] action queue
	end if
	
end loop

end script LC10_PrisonGuard3Actions

begin script LC10_Platoon0Actions

	TestPlatoonGuards = 0
	DistanceG = 0
	disvolcano = 0
	Position1 = 0
	Position2 = 0
	Position3 = 0
	Position4 = 0
	PlayerCreature = 0
    PlayerPlatoon1 = 0
    TestSiege = 0
	oCreature = get player 0 creature
	NumPat1 = 0
	HeTeste1 = 0
	WorrNum = 0
	HomeTown = get town with id 4
	Catapult = 0
	Armory = get building ABODE_NUMBER_MELEE_ARMOURY in HomeTown min built 1.0
	ArmoryRanged = get building ABODE_NUMBER_RANGED_ARMOURY in HomeTown min built 1.0
	PlayerPlatoon1Distance = 0
	PlayerCatapultDistance = 0
	a = 0
	
start

begin loop	

	wait until LC10_Platoon[0] exists
	
	PlayerCreature = get distance from {LC10_Platoon[0]} to {oCreature}
	if PlayerCreature <= 200 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00 and LC10_Platoon[0] can navigate to {oCreature}
		clear LC10_Platoon[0] action queue
		begin loop
			PlayerCreature = get distance from {LC10_Platoon[0]} to {oCreature}
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_MOVING_OBJECT using oCreature to LC10_Platoon[0] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[0]
			until NumPat1 == 0 or SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature == 0.00 or not LC10_Platoon[0] can navigate to {oCreature} or PlayerCreature > 200
		end loop
		clear LC10_Platoon[0] action queue
	end if
	
	PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[0]} radius 200
	Catapult = get siege weapon of player 0 nearest {LC10_Platoon[0]} radius 155
	if PlayerPlatoon1 exists and LC10_Platoon[0] can navigate to {PlayerPlatoon1}
		clear LC10_Platoon[0] action queue
		begin loop
			PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[0]} radius 200
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_PLATOON using PlayerPlatoon1 to LC10_Platoon[0] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[0]
			HeTeste1 = get number of villagers in platoon PlayerPlatoon1
			until NumPat1 == 0 or HeTeste1 == 0 or not LC10_Platoon[0] can navigate to {PlayerPlatoon1} or PlayerPlatoon1 not exists
		end loop
		clear LC10_Platoon[0] action queue
	elsif Catapult exists and LC10_Platoon[0] can navigate to {Catapult}
		clear LC10_Platoon[0] action queue
		a = 0
		begin loop
			Catapult = get siege weapon of player 0 nearest {LC10_Platoon[0]} radius 155
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_THING using Catapult to LC10_Platoon[0] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[0]
			PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[0]} radius 200
			if PlayerPlatoon1 exists and LC10_Platoon[0] can navigate to {PlayerPlatoon1}
				a = 1
			end if
			until NumPat1 == 0 or Catapult not exists or not LC10_Platoon[0] can navigate to {Catapult} or a == 1 or Catapult not exists
		end loop
		clear LC10_Platoon[0] action queue
		a = 0
	end if
	
	if get size of LC10_Platoon[0] action queue < 1
		move LC10_Platoon[0] along WaypointsC with patrol WAYPOINTROUTE_TRAVERSAL_TYPE_CIRCULAR
	end if
	
end loop

end script LC10_Platoon0Actions

begin script LC10_Platoon1Actions

	TestPlatoonGuards = 0
	DistanceG = 0
	disvolcano = 0
	Position1 = 0
	Position2 = 0
	Position3 = 0
	Position4 = 0
	PlayerCreature = 0
    PlayerPlatoon1 = 0
    TestSiege = 0
	oCreature = get player 0 creature
	NumPat1 = 0
	HeTeste1 = 0
	WorrNum = 0
	HomeTown = get town with id 4
	Catapult = 0
	Armory = get building ABODE_NUMBER_MELEE_ARMOURY in HomeTown min built 1.0
	ArmoryRanged = get building ABODE_NUMBER_RANGED_ARMOURY in HomeTown min built 1.0
	PlayerPlatoon1Distance = 0
	PlayerCatapultDistance = 0
	a = 0
	
start

begin loop	

	wait until LC10_Platoon[1] exists
	
	PlayerCreature = get distance from {LC10_Platoon[1]} to {oCreature}
	if PlayerCreature <= 200 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00 and LC10_Platoon[1] can navigate to {oCreature}
		clear LC10_Platoon[1] action queue
		begin loop
			PlayerCreature = get distance from {LC10_Platoon[1]} to {oCreature}
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_MOVING_OBJECT using oCreature to LC10_Platoon[1] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[1]
			until NumPat1 == 0 or SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature == 0.00 or not LC10_Platoon[1] can navigate to {oCreature} or PlayerCreature > 200
		end loop
		clear LC10_Platoon[1] action queue
	end if
	
	PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[1]} radius 200
	Catapult = get siege weapon of player 0 nearest {LC10_Platoon[1]} radius 155
	if PlayerPlatoon1 exists and LC10_Platoon[1] can navigate to {PlayerPlatoon1}
		clear LC10_Platoon[1] action queue
		begin loop
			PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[1]} radius 200
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_PLATOON using PlayerPlatoon1 to LC10_Platoon[1] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[1]
			HeTeste1 = get number of villagers in platoon PlayerPlatoon1
			until NumPat1 == 0 or HeTeste1 == 0 or not LC10_Platoon[1] can navigate to {PlayerPlatoon1} or PlayerPlatoon1 not exists
		end loop
		clear LC10_Platoon[1] action queue
	elsif Catapult exists and LC10_Platoon[1] can navigate to {Catapult}
		clear LC10_Platoon[1] action queue
		a = 0
		begin loop
			Catapult = get siege weapon of player 0 nearest {LC10_Platoon[1]} radius 155
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_THING using Catapult to LC10_Platoon[1] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[1]
			PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[1]} radius 200
			if PlayerPlatoon1 exists and LC10_Platoon[1] can navigate to {PlayerPlatoon1}
				a = 1
			end if
			until NumPat1 == 0 or Catapult not exists or not LC10_Platoon[1] can navigate to {Catapult} or a == 1 or Catapult not exists
		end loop
		clear LC10_Platoon[1] action queue
		a = 0
	end if
	
	if get size of LC10_Platoon[1] action queue < 1
		move LC10_Platoon[1] along WaypointsB with patrol WAYPOINTROUTE_TRAVERSAL_TYPE_CIRCULAR
	end if
	
end loop

end script LC10_Platoon1Actions

begin script LC10_Platoon2Actions

	TestPlatoonGuards = 0
	DistanceG = 0
	disvolcano = 0
	Position1 = 0
	Position2 = 0
	Position3 = 0
	Position4 = 0
	PlayerCreature = 0
    PlayerPlatoon1 = 0
    TestSiege = 0
	oCreature = get player 0 creature
	NumPat1 = 0
	HeTeste1 = 0
	WorrNum = 0
	HomeTown = get town with id 4
	Catapult = 0
	Armory = get building ABODE_NUMBER_MELEE_ARMOURY in HomeTown min built 1.0
	ArmoryRanged = get building ABODE_NUMBER_RANGED_ARMOURY in HomeTown min built 1.0
	PlayerPlatoon1Distance = 0
	PlayerCatapultDistance = 0
	a = 0
	
start

begin loop	

	wait until LC10_Platoon[2] exists
	
	PlayerCreature = get distance from {LC10_Platoon[2]} to {oCreature}
	if PlayerCreature <= 200 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00 and LC10_Platoon[2] can navigate to {oCreature}
		clear LC10_Platoon[2] action queue
		begin loop
			PlayerCreature = get distance from {LC10_Platoon[2]} to {oCreature}
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_MOVING_OBJECT using oCreature to LC10_Platoon[2] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[2]
			until NumPat1 == 0 or SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature == 0.00 or not LC10_Platoon[2] can navigate to {oCreature} or PlayerCreature > 200
		end loop
		clear LC10_Platoon[2] action queue
	end if
	
	PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[2]} radius 200
	Catapult = get siege weapon of player 0 nearest {LC10_Platoon[2]} radius 155
	if PlayerPlatoon1 exists and LC10_Platoon[2] can navigate to {PlayerPlatoon1}
		clear LC10_Platoon[2] action queue
		begin loop
			PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[2]} radius 200
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_PLATOON using PlayerPlatoon1 to LC10_Platoon[2] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[2]
			HeTeste1 = get number of villagers in platoon PlayerPlatoon1
			until NumPat1 == 0 or HeTeste1 == 0 or not LC10_Platoon[2] can navigate to {PlayerPlatoon1} or PlayerPlatoon1 not exists
		end loop
		clear LC10_Platoon[2] action queue
	elsif Catapult exists and LC10_Platoon[2] can navigate to {Catapult}
		clear LC10_Platoon[2] action queue
		a = 0
		begin loop
			Catapult = get siege weapon of player 0 nearest {LC10_Platoon[2]} radius 155
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_THING using Catapult to LC10_Platoon[2] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[2]
			PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[2]} radius 200
			if PlayerPlatoon1 exists and LC10_Platoon[2] can navigate to {PlayerPlatoon1}
				a = 1
			end if
			until NumPat1 == 0 or Catapult not exists or not LC10_Platoon[2] can navigate to {Catapult} or a == 1 or Catapult not exists
		end loop
		clear LC10_Platoon[2] action queue
		a = 0
	end if
	
	if get size of LC10_Platoon[2] action queue < 1
		move LC10_Platoon[2] along WaypointsA with patrol WAYPOINTROUTE_TRAVERSAL_TYPE_CIRCULAR
	end if
	
end loop

end script LC10_Platoon2Actions

begin script LC10_Platoon3Actions

	TestPlatoonGuards = 0
	DistanceG = 0
	disvolcano = 0
	Position1 = 0
	Position2 = 0
	Position3 = 0
	Position4 = 0
	PlayerCreature = 0
    PlayerPlatoon1 = 0
    TestSiege = 0
	oCreature = get player 0 creature
	NumPat1 = 0
	HeTeste1 = 0
	WorrNum = 0
	HomeTown = get town with id 4
	Catapult = 0
	Armory = get building ABODE_NUMBER_MELEE_ARMOURY in HomeTown min built 1.0
	ArmoryRanged = get building ABODE_NUMBER_RANGED_ARMOURY in HomeTown min built 1.0
	PlayerPlatoon1Distance = 0
	PlayerCatapultDistance = 0
	a = 0
	
start

begin loop	

	wait until LC10_Platoon[3] exists
	
	PlayerCreature = get distance from {LC10_Platoon[3]} to {oCreature}
	if PlayerCreature <= 200 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00 and LC10_Platoon[3] can navigate to {oCreature}
		clear LC10_Platoon[3] action queue
		begin loop
			PlayerCreature = get distance from {LC10_Platoon[3]} to {oCreature}
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_MOVING_OBJECT using oCreature to LC10_Platoon[3] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[3]
			until NumPat1 == 0 or SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature == 0.00 or not LC10_Platoon[3] can navigate to {oCreature} or PlayerCreature > 200
		end loop
		clear LC10_Platoon[3] action queue
	end if
	
	PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[3]} radius 200
	Catapult = get siege weapon of player 0 nearest {LC10_Platoon[3]} radius 155
	if PlayerPlatoon1 exists and LC10_Platoon[3] can navigate to {PlayerPlatoon1}
		clear LC10_Platoon[3] action queue
		begin loop
			PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[3]} radius 200
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_PLATOON using PlayerPlatoon1 to LC10_Platoon[3] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[3]
			HeTeste1 = get number of villagers in platoon PlayerPlatoon1
			until NumPat1 == 0 or HeTeste1 == 0 or not LC10_Platoon[3] can navigate to {PlayerPlatoon1} or PlayerPlatoon1 not exists
		end loop
		clear LC10_Platoon[3] action queue
	elsif Catapult exists and LC10_Platoon[3] can navigate to {Catapult}
		clear LC10_Platoon[3] action queue
		a = 0
		begin loop
			Catapult = get siege weapon of player 0 nearest {LC10_Platoon[3]} radius 155
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_THING using Catapult to LC10_Platoon[3] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[3]
			PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[3]} radius 200
			if PlayerPlatoon1 exists and LC10_Platoon[3] can navigate to {PlayerPlatoon1}
				a = 1
			end if
			until NumPat1 == 0 or Catapult not exists or not LC10_Platoon[3] can navigate to {Catapult} or a == 1 or Catapult not exists
		end loop
		clear LC10_Platoon[3] action queue
		a = 0
	end if
	
	if get size of LC10_Platoon[3] action queue < 1
		move LC10_Platoon[3] along WaypointsD with patrol WAYPOINTROUTE_TRAVERSAL_TYPE_CIRCULAR
	end if
	
end loop

end script LC10_Platoon3Actions

begin script LC10_Platoon4Actions

	TestPlatoonGuards = 0
	DistanceG = 0
	disvolcano = 0
	Position1 = 0
	Position2 = 0
	Position3 = 0
	Position4 = 0
	PlayerCreature = 0
    PlayerPlatoon1 = 0
    TestSiege = 0
	oCreature = get player 0 creature
	NumPat1 = 0
	HeTeste1 = 0
	WorrNum = 0
	HomeTown = get town with id 4
	Catapult = 0
	Armory = get building ABODE_NUMBER_MELEE_ARMOURY in HomeTown min built 1.0
	ArmoryRanged = get building ABODE_NUMBER_RANGED_ARMOURY in HomeTown min built 1.0
	PlayerPlatoon1Distance = 0
	PlayerCatapultDistance = 0
	a = 0
	
start

	set LC10_Platoon[4] focus to {PlayerTown}

begin loop

	wait until LC10_Platoon[4] exists
	
	PlayerCreature = get distance from {LC10_Platoon[4]} to {oCreature}
	if PlayerCreature <= 200 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00 and LC10_Platoon[4] can navigate to {oCreature}
		clear LC10_Platoon[4] action queue
		begin loop
			PlayerCreature = get distance from {LC10_Platoon[4]} to {oCreature}
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_MOVING_OBJECT using oCreature to LC10_Platoon[4] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[4]
			until NumPat1 == 0 or SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature == 0.00 or not LC10_Platoon[4] can navigate to {oCreature} or PlayerCreature > 200
		end loop
		clear LC10_Platoon[4] action queue
	end if
	
	PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[4]} radius 200
	Catapult = get siege weapon of player 0 nearest {LC10_Platoon[4]} radius 155
	if PlayerPlatoon1 exists and LC10_Platoon[4] can navigate to {PlayerPlatoon1}
		clear LC10_Platoon[4] action queue
		begin loop
			PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[4]} radius 200
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_PLATOON using PlayerPlatoon1 to LC10_Platoon[4] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[4]
			HeTeste1 = get number of villagers in platoon PlayerPlatoon1
			until NumPat1 == 0 or HeTeste1 == 0 or not LC10_Platoon[4] can navigate to {PlayerPlatoon1} or PlayerPlatoon1 not exists
		end loop
		clear LC10_Platoon[4] action queue
	elsif Catapult exists and LC10_Platoon[4] can navigate to {Catapult}
		clear LC10_Platoon[4] action queue
		a = 0
		begin loop
			Catapult = get siege weapon of player 0 nearest {LC10_Platoon[4]} radius 155
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_THING using Catapult to LC10_Platoon[4] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[4]
			PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[4]} radius 200
			if PlayerPlatoon1 exists and LC10_Platoon[4] can navigate to {PlayerPlatoon1}
				a = 1
			end if
			until NumPat1 == 0 or Catapult not exists or not LC10_Platoon[4] can navigate to {Catapult} or a == 1 or Catapult not exists
		end loop
		clear LC10_Platoon[4] action queue
		a = 0
	end if
	
	if get size of LC10_Platoon[4] action queue < 1
		add action PLATOON_AGENDA_ACTION_DEFEND_POSITION using {PlatoonPos[0]} to LC10_Platoon[4] action queue
	end if
	
end loop

end script LC10_Platoon4Actions

begin script LC10_Platoon5Actions

	TestPlatoonGuards = 0
	DistanceG = 0
	disvolcano = 0
	Position1 = 0
	Position2 = 0
	Position3 = 0
	Position4 = 0
	PlayerCreature = 0
    PlayerPlatoon1 = 0
    TestSiege = 0
	oCreature = get player 0 creature
	NumPat1 = 0
	HeTeste1 = 0
	WorrNum = 0
	HomeTown = get town with id 4
	Catapult = 0
	Armory = get building ABODE_NUMBER_MELEE_ARMOURY in HomeTown min built 1.0
	ArmoryRanged = get building ABODE_NUMBER_RANGED_ARMOURY in HomeTown min built 1.0
	PlayerPlatoon1Distance = 0
	PlayerCatapultDistance = 0
	a = 0
	
start

	set LC10_Platoon[5] focus to {PlayerTown}

begin loop

	wait until LC10_Platoon[5] exists
	
	PlayerCreature = get distance from {LC10_Platoon[5]} to {oCreature}
	if PlayerCreature <= 200 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00 and LC10_Platoon[5] can navigate to {oCreature}
		clear LC10_Platoon[5] action queue
		begin loop
			PlayerCreature = get distance from {LC10_Platoon[5]} to {oCreature}
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_MOVING_OBJECT using oCreature to LC10_Platoon[5] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[5]
			until NumPat1 == 0 or SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature == 0.00 or not LC10_Platoon[5] can navigate to {oCreature} or PlayerCreature > 200
		end loop
		clear LC10_Platoon[5] action queue
	end if
	
	PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[5]} radius 200
	Catapult = get siege weapon of player 0 nearest {LC10_Platoon[5]} radius 155
	if PlayerPlatoon1 exists and LC10_Platoon[5] can navigate to {PlayerPlatoon1}
		clear LC10_Platoon[5] action queue
		begin loop
			PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[5]} radius 200
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_PLATOON using PlayerPlatoon1 to LC10_Platoon[5] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[5]
			HeTeste1 = get number of villagers in platoon PlayerPlatoon1
			until NumPat1 == 0 or HeTeste1 == 0 or not LC10_Platoon[5] can navigate to {PlayerPlatoon1} or PlayerPlatoon1 not exists
		end loop
		clear LC10_Platoon[5] action queue
	elsif Catapult exists and LC10_Platoon[5] can navigate to {Catapult}
		clear LC10_Platoon[5] action queue
		a = 0
		begin loop
			Catapult = get siege weapon of player 0 nearest {LC10_Platoon[5]} radius 155
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_THING using Catapult to LC10_Platoon[5] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[5]
			PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[5]} radius 200
			if PlayerPlatoon1 exists and LC10_Platoon[5] can navigate to {PlayerPlatoon1}
				a = 1
			end if
			until NumPat1 == 0 or Catapult not exists or not LC10_Platoon[5] can navigate to {Catapult} or a == 1 or Catapult not exists
		end loop
		clear LC10_Platoon[5] action queue
		a = 0
	end if
	
	if get size of LC10_Platoon[5] action queue < 1
		add action PLATOON_AGENDA_ACTION_DEFEND_POSITION using {PlatoonPos[1]} to LC10_Platoon[5] action queue
	end if
	
end loop

end script LC10_Platoon5Actions

begin script LC10_Platoon6Actions

	TestPlatoonGuards = 0
	DistanceG = 0
	disvolcano = 0
	Position1 = 0
	Position2 = 0
	Position3 = 0
	Position4 = 0
	PlayerCreature = 0
    PlayerPlatoon1 = 0
    TestSiege = 0
	oCreature = get player 0 creature
	NumPat1 = 0
	HeTeste1 = 0
	WorrNum = 0
	HomeTown = get town with id 4
	Catapult = 0
	Armory = get building ABODE_NUMBER_MELEE_ARMOURY in HomeTown min built 1.0
	ArmoryRanged = get building ABODE_NUMBER_RANGED_ARMOURY in HomeTown min built 1.0
	PlayerPlatoon1Distance = 0
	PlayerCatapultDistance = 0
	a = 0
	
start

	set LC10_Platoon[6] focus to {PlayerTown}

begin loop

	wait until LC10_Platoon[6] exists
	
	PlayerCreature = get distance from {LC10_Platoon[6]} to {oCreature}
	if PlayerCreature <= 200 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00 and LC10_Platoon[6] can navigate to {oCreature}
		clear LC10_Platoon[6] action queue
		begin loop
			PlayerCreature = get distance from {LC10_Platoon[6]} to {oCreature}
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_MOVING_OBJECT using oCreature to LC10_Platoon[6] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[6]
			until NumPat1 == 0 or SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature == 0.00 or not LC10_Platoon[6] can navigate to {oCreature} or PlayerCreature > 200
		end loop
		clear LC10_Platoon[6] action queue
	end if
	
	PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[6]} radius 200
	Catapult = get siege weapon of player 0 nearest {LC10_Platoon[6]} radius 155
	if PlayerPlatoon1 exists and LC10_Platoon[6] can navigate to {PlayerPlatoon1}
		clear LC10_Platoon[6] action queue
		begin loop
			PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[6]} radius 200
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_PLATOON using PlayerPlatoon1 to LC10_Platoon[6] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[6]
			HeTeste1 = get number of villagers in platoon PlayerPlatoon1
			until NumPat1 == 0 or HeTeste1 == 0 or not LC10_Platoon[6] can navigate to {PlayerPlatoon1} or PlayerPlatoon1 not exists
		end loop
		clear LC10_Platoon[6] action queue
	elsif Catapult exists and LC10_Platoon[6] can navigate to {Catapult}
		clear LC10_Platoon[6] action queue
		a = 0
		begin loop
			Catapult = get siege weapon of player 0 nearest {LC10_Platoon[6]} radius 155
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_THING using Catapult to LC10_Platoon[6] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[6]
			PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[6]} radius 200
			if PlayerPlatoon1 exists and LC10_Platoon[6] can navigate to {PlayerPlatoon1}
				a = 1
			end if
			until NumPat1 == 0 or Catapult not exists or not LC10_Platoon[6] can navigate to {Catapult} or a == 1 or Catapult not exists
		end loop
		clear LC10_Platoon[6] action queue
		a = 0
	end if
	
	if get size of LC10_Platoon[6] action queue < 1
		add action PLATOON_AGENDA_ACTION_DEFEND_POSITION using {PlatoonPos[2]} to LC10_Platoon[6] action queue
	end if
	
end loop

end script LC10_Platoon6Actions

begin script LC10_Platoon7Actions

	TestPlatoonGuards = 0
	DistanceG = 0
	disvolcano = 0
	Position1 = 0
	Position2 = 0
	Position3 = 0
	Position4 = 0
	PlayerCreature = 0
    PlayerPlatoon1 = 0
    TestSiege = 0
	oCreature = get player 0 creature
	NumPat1 = 0
	HeTeste1 = 0
	WorrNum = 0
	HomeTown = get town with id 4
	Catapult = 0
	Armory = get building ABODE_NUMBER_MELEE_ARMOURY in HomeTown min built 1.0
	ArmoryRanged = get building ABODE_NUMBER_RANGED_ARMOURY in HomeTown min built 1.0
	PlayerPlatoon1Distance = 0
	PlayerCatapultDistance = 0
	a = 0
	
start

	set LC10_Platoon[7] focus to {PlayerTown}

begin loop

	wait until LC10_Platoon[7] exists
	
	PlayerCreature = get distance from {LC10_Platoon[7]} to {oCreature}
	if PlayerCreature <= 200 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00 and LC10_Platoon[7] can navigate to {oCreature}
		clear LC10_Platoon[7] action queue
		begin loop
			PlayerCreature = get distance from {LC10_Platoon[7]} to {oCreature}
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_MOVING_OBJECT using oCreature to LC10_Platoon[7] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[7]
			until NumPat1 == 0 or SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature == 0.00 or not LC10_Platoon[7] can navigate to {oCreature} or PlayerCreature > 200
		end loop
		clear LC10_Platoon[7] action queue
	end if
	
	PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[7]} radius 200
	Catapult = get siege weapon of player 0 nearest {LC10_Platoon[7]} radius 155
	if PlayerPlatoon1 exists and LC10_Platoon[7] can navigate to {PlayerPlatoon1}
		clear LC10_Platoon[7] action queue
		begin loop
			PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[7]} radius 200
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_PLATOON using PlayerPlatoon1 to LC10_Platoon[7] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[7]
			HeTeste1 = get number of villagers in platoon PlayerPlatoon1
			until NumPat1 == 0 or HeTeste1 == 0 or not LC10_Platoon[7] can navigate to {PlayerPlatoon1} or PlayerPlatoon1 not exists
		end loop
		clear LC10_Platoon[7] action queue
	elsif Catapult exists and LC10_Platoon[7] can navigate to {Catapult}
		clear LC10_Platoon[7] action queue
		a = 0
		begin loop
			Catapult = get siege weapon of player 0 nearest {LC10_Platoon[7]} radius 155
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_THING using Catapult to LC10_Platoon[7] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[7]
			PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[7]} radius 200
			if PlayerPlatoon1 exists and LC10_Platoon[7] can navigate to {PlayerPlatoon1}
				a = 1
			end if
			until NumPat1 == 0 or Catapult not exists or not LC10_Platoon[7] can navigate to {Catapult} or a == 1 or Catapult not exists
		end loop
		clear LC10_Platoon[7] action queue
		a = 0
	end if
	
	if get size of LC10_Platoon[7] action queue < 1
		add action PLATOON_AGENDA_ACTION_DEFEND_POSITION using {PlatoonPos[3]} to LC10_Platoon[7] action queue
	end if
	
end loop

end script LC10_Platoon7Actions

begin script LC10_Platoon8Actions

	TestPlatoonGuards = 0
	DistanceG = 0
	disvolcano = 0
	Position1 = 0
	Position2 = 0
	Position3 = 0
	Position4 = 0
	PlayerCreature = 0
    PlayerPlatoon1 = 0
    TestSiege = 0
	oCreature = get player 0 creature
	NumPat1 = 0
	HeTeste1 = 0
	WorrNum = 0
	HomeTown = get town with id 4
	Catapult = 0
	Armory = get building ABODE_NUMBER_MELEE_ARMOURY in HomeTown min built 1.0
	ArmoryRanged = get building ABODE_NUMBER_RANGED_ARMOURY in HomeTown min built 1.0
	PlayerPlatoon1Distance = 0
	PlayerCatapultDistance = 0
	a = 0
	
start

	set LC10_Platoon[8] focus to {PlayerTown}

begin loop

	wait until LC10_Platoon[8] exists
	
	PlayerCreature = get distance from {LC10_Platoon[8]} to {oCreature}
	if PlayerCreature <= 200 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00 and LC10_Platoon[8] can navigate to {oCreature}
		clear LC10_Platoon[8] action queue
		begin loop
			PlayerCreature = get distance from {LC10_Platoon[8]} to {oCreature}
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_MOVING_OBJECT using oCreature to LC10_Platoon[8] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[8]
			until NumPat1 == 0 or SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature == 0.00 or not LC10_Platoon[8] can navigate to {oCreature} or PlayerCreature > 200
		end loop
		clear LC10_Platoon[8] action queue
	end if
	
	PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[8]} radius 200
	Catapult = get siege weapon of player 0 nearest {LC10_Platoon[8]} radius 155
	if PlayerPlatoon1 exists and LC10_Platoon[8] can navigate to {PlayerPlatoon1}
		clear LC10_Platoon[8] action queue
		begin loop
			PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[8]} radius 200
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_PLATOON using PlayerPlatoon1 to LC10_Platoon[8] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[8]
			HeTeste1 = get number of villagers in platoon PlayerPlatoon1
			until NumPat1 == 0 or HeTeste1 == 0 or not LC10_Platoon[8] can navigate to {PlayerPlatoon1} or PlayerPlatoon1 not exists
		end loop
		clear LC10_Platoon[8] action queue
	elsif Catapult exists and LC10_Platoon[8] can navigate to {Catapult}
		clear LC10_Platoon[8] action queue
		a = 0
		begin loop
			Catapult = get siege weapon of player 0 nearest {LC10_Platoon[8]} radius 155
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_THING using Catapult to LC10_Platoon[8] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[8]
			PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[8]} radius 200
			if PlayerPlatoon1 exists and LC10_Platoon[8] can navigate to {PlayerPlatoon1}
				a = 1
			end if
			until NumPat1 == 0 or Catapult not exists or not LC10_Platoon[8] can navigate to {Catapult} or a == 1 or Catapult not exists
		end loop
		clear LC10_Platoon[8] action queue
		a = 0
	end if
	
	if get size of LC10_Platoon[8] action queue < 1
		add action PLATOON_AGENDA_ACTION_DEFEND_POSITION using {PlatoonPos[4]} to LC10_Platoon[8] action queue
	end if
	
end loop

end script LC10_Platoon8Actions

begin script LC10_Platoon9Actions

	TestPlatoonGuards = 0
	DistanceG = 0
	disvolcano = 0
	Position1 = 0
	Position2 = 0
	Position3 = 0
	Position4 = 0
	PlayerCreature = 0
    PlayerPlatoon1 = 0
    TestSiege = 0
	oCreature = get player 0 creature
	NumPat1 = 0
	HeTeste1 = 0
	WorrNum = 0
	HomeTown = get town with id 4
	Catapult = 0
	Armory = get building ABODE_NUMBER_MELEE_ARMOURY in HomeTown min built 1.0
	ArmoryRanged = get building ABODE_NUMBER_RANGED_ARMOURY in HomeTown min built 1.0
	PlayerPlatoon1Distance = 0
	PlayerCatapultDistance = 0
	a = 0
	
start

	set LC10_Platoon[9] focus to {AztecFirstTown}

begin loop

	wait until LC10_Platoon[9] exists
	
	PlayerCreature = get distance from {LC10_Platoon[9]} to {oCreature}
	if PlayerCreature <= 150 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00 and LC10_Platoon[9] can navigate to {oCreature}
		clear LC10_Platoon[9] action queue
		begin loop
			PlayerCreature = get distance from {LC10_Platoon[9]} to {oCreature}
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_MOVING_OBJECT using oCreature to LC10_Platoon[9] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[9]
			until NumPat1 == 0 or SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature == 0.00 or not LC10_Platoon[9] can navigate to {oCreature} or PlayerCreature > 150
		end loop
		clear LC10_Platoon[9] action queue
	end if
	
	PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[9]} radius 150
	Catapult = get siege weapon of player 0 nearest {LC10_Platoon[9]} radius 100
	if PlayerPlatoon1 exists and LC10_Platoon[9] can navigate to {PlayerPlatoon1}
		clear LC10_Platoon[9] action queue
		begin loop
			PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[9]} radius 150
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_PLATOON using PlayerPlatoon1 to LC10_Platoon[9] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[9]
			HeTeste1 = get number of villagers in platoon PlayerPlatoon1
			until NumPat1 == 0 or HeTeste1 == 0 or not LC10_Platoon[9] can navigate to {PlayerPlatoon1} or PlayerPlatoon1 not exists
		end loop
		clear LC10_Platoon[9] action queue
	elsif Catapult exists and LC10_Platoon[9] can navigate to {Catapult}
		clear LC10_Platoon[9] action queue
		a = 0
		begin loop
			Catapult = get siege weapon of player 0 nearest {LC10_Platoon[9]} radius 100
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_THING using Catapult to LC10_Platoon[9] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[9]
			PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[9]} radius 150
			if PlayerPlatoon1 exists and LC10_Platoon[9] can navigate to {PlayerPlatoon1}
				a = 1
			end if
			until NumPat1 == 0 or Catapult not exists or not LC10_Platoon[9] can navigate to {Catapult} or a == 1 or Catapult not exists
		end loop
		clear LC10_Platoon[9] action queue
		a = 0
	end if
	
	if get size of LC10_Platoon[9] action queue < 1
		add action PLATOON_AGENDA_ACTION_DEFEND_POSITION using {PlatoonPos[5]} to LC10_Platoon[9] action queue
	end if
	
end loop

end script LC10_Platoon9Actions

begin script LC10_Platoon10Actions

	TestPlatoonGuards = 0
	DistanceG = 0
	disvolcano = 0
	Position1 = 0
	Position2 = 0
	Position3 = 0
	Position4 = 0
	PlayerCreature = 0
    PlayerPlatoon1 = 0
    TestSiege = 0
	oCreature = get player 0 creature
	NumPat1 = 0
	HeTeste1 = 0
	WorrNum = 0
	HomeTown = get town with id 4
	Catapult = 0
	Armory = get building ABODE_NUMBER_MELEE_ARMOURY in HomeTown min built 1.0
	ArmoryRanged = get building ABODE_NUMBER_RANGED_ARMOURY in HomeTown min built 1.0
	PlayerPlatoon1Distance = 0
	PlayerCatapultDistance = 0
	a = 0
	
start

	set LC10_Platoon[10] focus to {AztecFirstTown}

begin loop

	wait until LC10_Platoon[10] exists
	
	PlayerCreature = get distance from {LC10_Platoon[10]} to {oCreature}
	if PlayerCreature <= 150 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00 and LC10_Platoon[10] can navigate to {oCreature}
		clear LC10_Platoon[10] action queue
		begin loop
			PlayerCreature = get distance from {LC10_Platoon[10]} to {oCreature}
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_MOVING_OBJECT using oCreature to LC10_Platoon[10] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[10]
			until NumPat1 == 0 or SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature == 0.00 or not LC10_Platoon[10] can navigate to {oCreature} or PlayerCreature > 150
		end loop
		clear LC10_Platoon[10] action queue
	end if
	
	PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[10]} radius 150
	Catapult = get siege weapon of player 0 nearest {LC10_Platoon[10]} radius 100
	if PlayerPlatoon1 exists and LC10_Platoon[10] can navigate to {PlayerPlatoon1}
		clear LC10_Platoon[10] action queue
		begin loop
			PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[10]} radius 150
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_PLATOON using PlayerPlatoon1 to LC10_Platoon[10] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[10]
			HeTeste1 = get number of villagers in platoon PlayerPlatoon1
			until NumPat1 == 0 or HeTeste1 == 0 or not LC10_Platoon[10] can navigate to {PlayerPlatoon1} or PlayerPlatoon1 not exists
		end loop
		clear LC10_Platoon[10] action queue
	elsif Catapult exists and LC10_Platoon[10] can navigate to {Catapult}
		clear LC10_Platoon[10] action queue
		a = 0
		begin loop
			Catapult = get siege weapon of player 0 nearest {LC10_Platoon[10]} radius 100
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_THING using Catapult to LC10_Platoon[10] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[10]
			PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[10]} radius 150
			if PlayerPlatoon1 exists and LC10_Platoon[10] can navigate to {PlayerPlatoon1}
				a = 1
			end if
			until NumPat1 == 0 or Catapult not exists or not LC10_Platoon[10] can navigate to {Catapult} or a == 1 or Catapult not exists
		end loop
		clear LC10_Platoon[10] action queue
		a = 0
	end if
	
	if get size of LC10_Platoon[10] action queue < 1
		add action PLATOON_AGENDA_ACTION_DEFEND_POSITION using {PlatoonPos[6]} to LC10_Platoon[10] action queue
	end if
	
end loop

end script LC10_Platoon10Actions

begin script LC10_Platoon11Actions

	TestPlatoonGuards = 0
	DistanceG = 0
	disvolcano = 0
	Position1 = 0
	Position2 = 0
	Position3 = 0
	Position4 = 0
	PlayerCreature = 0
    PlayerPlatoon1 = 0
    TestSiege = 0
	oCreature = get player 0 creature
	NumPat1 = 0
	HeTeste1 = 0
	WorrNum = 0
	HomeTown = get town with id 4
	Catapult = 0
	Armory = get building ABODE_NUMBER_MELEE_ARMOURY in HomeTown min built 1.0
	ArmoryRanged = get building ABODE_NUMBER_RANGED_ARMOURY in HomeTown min built 1.0
	PlayerPlatoon1Distance = 0
	PlayerCatapultDistance = 0
	a = 0
	
start

	set LC10_Platoon[11] focus to {AztecFirstTown}

begin loop

	wait until LC10_Platoon[11] exists
	
	PlayerCreature = get distance from {LC10_Platoon[11]} to {oCreature}
	if PlayerCreature <= 150 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00 and LC10_Platoon[11] can navigate to {oCreature}
		clear LC10_Platoon[11] action queue
		begin loop
			PlayerCreature = get distance from {LC10_Platoon[11]} to {oCreature}
			add action PLATOON_AGENDA_ACTION_RANGED_ATTACK using oCreature to LC10_Platoon[11] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[11]
			until NumPat1 == 0 or SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature == 0.00 or not LC10_Platoon[11] can navigate to {oCreature} or PlayerCreature > 150
		end loop
		clear LC10_Platoon[11] action queue
	end if
	
	PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[11]} radius 150
	Catapult = get siege weapon of player 0 nearest {LC10_Platoon[11]} radius 100
	if PlayerPlatoon1 exists and LC10_Platoon[11] can navigate to {PlayerPlatoon1}
		clear LC10_Platoon[11] action queue
		begin loop
			PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[11]} radius 150
			add action PLATOON_AGENDA_ACTION_RANGED_ATTACK using PlayerPlatoon1 to LC10_Platoon[11] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[11]
			HeTeste1 = get number of villagers in platoon PlayerPlatoon1
			until NumPat1 == 0 or HeTeste1 == 0 or not LC10_Platoon[11] can navigate to {PlayerPlatoon1} or PlayerPlatoon1 not exists
		end loop
		clear LC10_Platoon[11] action queue
	elsif Catapult exists and LC10_Platoon[11] can navigate to {Catapult}
		clear LC10_Platoon[11] action queue
		a = 0
		begin loop
			Catapult = get siege weapon of player 0 nearest {LC10_Platoon[11]} radius 100
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_THING using Catapult to LC10_Platoon[11] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[11]
			PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[11]} radius 150
			if PlayerPlatoon1 exists and LC10_Platoon[11] can navigate to {PlayerPlatoon1}
				a = 1
			end if
			until NumPat1 == 0 or Catapult not exists or not LC10_Platoon[11] can navigate to {Catapult} or a == 1 or Catapult not exists
		end loop
		clear LC10_Platoon[11] action queue
		a = 0
	end if
	
	if get size of LC10_Platoon[11] action queue < 1
		add action PLATOON_AGENDA_ACTION_DEFEND_POSITION using {PlatoonPos[7]} to LC10_Platoon[11] action queue
	end if
	
end loop

end script LC10_Platoon11Actions

begin script LC10_Platoon12Actions

	TestPlatoonGuards = 0
	DistanceG = 0
	disvolcano = 0
	Position1 = 0
	Position2 = 0
	Position3 = 0
	Position4 = 0
	PlayerCreature = 0
    PlayerPlatoon1 = 0
    TestSiege = 0
	oCreature = get player 0 creature
	NumPat1 = 0
	HeTeste1 = 0
	WorrNum = 0
	HomeTown = get town with id 4
	Catapult = 0
	Armory = get building ABODE_NUMBER_MELEE_ARMOURY in HomeTown min built 1.0
	ArmoryRanged = get building ABODE_NUMBER_RANGED_ARMOURY in HomeTown min built 1.0
	PlayerPlatoon1Distance = 0
	PlayerCatapultDistance = 0
	a = 0
	
start

	set LC10_Platoon[12] focus to {AztecPreTown}

begin loop

	wait until LC10_Platoon[12] exists
	
	PlayerCreature = get distance from {LC10_Platoon[12]} to {oCreature}
	if PlayerCreature <= 150 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00 and LC10_Platoon[12] can navigate to {oCreature}
		clear LC10_Platoon[12] action queue
		begin loop
			PlayerCreature = get distance from {LC10_Platoon[12]} to {oCreature}
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_MOVING_OBJECT using oCreature to LC10_Platoon[12] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[12]
			until NumPat1 == 0 or SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature == 0.00 or not LC10_Platoon[12] can navigate to {oCreature} or PlayerCreature > 150
		end loop
		clear LC10_Platoon[12] action queue
	end if
	
	PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[12]} radius 150
	Catapult = get siege weapon of player 0 nearest {LC10_Platoon[12]} radius 100
	if PlayerPlatoon1 exists and LC10_Platoon[12] can navigate to {PlayerPlatoon1}
		clear LC10_Platoon[12] action queue
		begin loop
			PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[12]} radius 150
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_PLATOON using PlayerPlatoon1 to LC10_Platoon[12] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[12]
			HeTeste1 = get number of villagers in platoon PlayerPlatoon1
			until NumPat1 == 0 or HeTeste1 == 0 or not LC10_Platoon[12] can navigate to {PlayerPlatoon1} or PlayerPlatoon1 not exists
		end loop
		clear LC10_Platoon[12] action queue
	elsif Catapult exists and LC10_Platoon[12] can navigate to {Catapult}
		clear LC10_Platoon[12] action queue
		a = 0
		begin loop
			Catapult = get siege weapon of player 0 nearest {LC10_Platoon[12]} radius 100
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_THING using Catapult to LC10_Platoon[12] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[12]
			PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[12]} radius 150
			if PlayerPlatoon1 exists and LC10_Platoon[12] can navigate to {PlayerPlatoon1}
				a = 1
			end if
			until NumPat1 == 0 or Catapult not exists or not LC10_Platoon[12] can navigate to {Catapult} or a == 1 or Catapult not exists
		end loop
		clear LC10_Platoon[12] action queue
		a = 0
	end if
	
	if get size of LC10_Platoon[12] action queue < 1
		add action PLATOON_AGENDA_ACTION_DEFEND_POSITION using {PlatoonPos[8]} to LC10_Platoon[12] action queue
	end if
	
end loop

end script LC10_Platoon12Actions

begin script LC10_Platoon13Actions

	TestPlatoonGuards = 0
	DistanceG = 0
	disvolcano = 0
	Position1 = 0
	Position2 = 0
	Position3 = 0
	Position4 = 0
	PlayerCreature = 0
    PlayerPlatoon1 = 0
    TestSiege = 0
	oCreature = get player 0 creature
	NumPat1 = 0
	HeTeste1 = 0
	WorrNum = 0
	HomeTown = get town with id 4
	Catapult = 0
	Armory = get building ABODE_NUMBER_MELEE_ARMOURY in HomeTown min built 1.0
	ArmoryRanged = get building ABODE_NUMBER_RANGED_ARMOURY in HomeTown min built 1.0
	PlayerPlatoon1Distance = 0
	PlayerCatapultDistance = 0
	a = 0
	
start

	set LC10_Platoon[13] focus to {AztecPreTown}

begin loop

	wait until LC10_Platoon[13] exists
	
	PlayerCreature = get distance from {LC10_Platoon[13]} to {oCreature}
	if PlayerCreature <= 150 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00 and LC10_Platoon[13] can navigate to {oCreature}
		clear LC10_Platoon[13] action queue
		begin loop
			PlayerCreature = get distance from {LC10_Platoon[13]} to {oCreature}
			add action PLATOON_AGENDA_ACTION_RANGED_ATTACK using oCreature to LC10_Platoon[13] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[13]
			until NumPat1 == 0 or SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature == 0.00 or not LC10_Platoon[13] can navigate to {oCreature} or PlayerCreature > 150
		end loop
		clear LC10_Platoon[13] action queue
	end if
	
	PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[13]} radius 150
	Catapult = get siege weapon of player 0 nearest {LC10_Platoon[13]} radius 100
	if PlayerPlatoon1 exists and LC10_Platoon[13] can navigate to {PlayerPlatoon1}
		clear LC10_Platoon[13] action queue
		begin loop
			PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[13]} radius 150
			add action PLATOON_AGENDA_ACTION_RANGED_ATTACK using PlayerPlatoon1 to LC10_Platoon[13] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[13]
			HeTeste1 = get number of villagers in platoon PlayerPlatoon1
			until NumPat1 == 0 or HeTeste1 == 0 or not LC10_Platoon[13] can navigate to {PlayerPlatoon1} or PlayerPlatoon1 not exists
		end loop
		clear LC10_Platoon[13] action queue
	elsif Catapult exists and LC10_Platoon[13] can navigate to {Catapult}
		clear LC10_Platoon[13] action queue
		a = 0
		begin loop
			Catapult = get siege weapon of player 0 nearest {LC10_Platoon[13]} radius 100
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_THING using Catapult to LC10_Platoon[13] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[13]
			PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[13]} radius 150
			if PlayerPlatoon1 exists and LC10_Platoon[13] can navigate to {PlayerPlatoon1}
				a = 1
			end if
			until NumPat1 == 0 or Catapult not exists or not LC10_Platoon[13] can navigate to {Catapult} or a == 1 or Catapult not exists
		end loop
		clear LC10_Platoon[13] action queue
		a = 0
	end if
	
	if get size of LC10_Platoon[13] action queue < 1
		add action PLATOON_AGENDA_ACTION_DEFEND_POSITION using {PlatoonPos[9]} to LC10_Platoon[13] action queue
	end if
	
end loop

end script LC10_Platoon13Actions

begin script LC10_Platoon14Actions

	TestPlatoonGuards = 0
	DistanceG = 0
	disvolcano = 0
	Position1 = 0
	Position2 = 0
	Position3 = 0
	Position4 = 0
	PlayerCreature = 0
    PlayerPlatoon1 = 0
    TestSiege = 0
	oCreature = get player 0 creature
	NumPat1 = 0
	HeTeste1 = 0
	WorrNum = 0
	HomeTown = get town with id 4
	Catapult = 0
	Armory = get building ABODE_NUMBER_MELEE_ARMOURY in HomeTown min built 1.0
	ArmoryRanged = get building ABODE_NUMBER_RANGED_ARMOURY in HomeTown min built 1.0
	PlayerPlatoon1Distance = 0
	PlayerCatapultDistance = 0
	a = 0
	
start

	set LC10_Platoon[14] focus to {AztecCapital}

begin loop

	wait until LC10_Platoon[14] exists
	
	PlayerCreature = get distance from {LC10_Platoon[14]} to {oCreature}
	if PlayerCreature <= 150 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00 and LC10_Platoon[14] can navigate to {oCreature}
		clear LC10_Platoon[14] action queue
		begin loop
			PlayerCreature = get distance from {LC10_Platoon[14]} to {oCreature}
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_MOVING_OBJECT using oCreature to LC10_Platoon[14] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[14]
			until NumPat1 == 0 or SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature == 0.00 or not LC10_Platoon[14] can navigate to {oCreature} or PlayerCreature > 150
		end loop
		clear LC10_Platoon[14] action queue
	end if
	
	PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[14]} radius 150
	Catapult = get siege weapon of player 0 nearest {LC10_Platoon[14]} radius 100
	if PlayerPlatoon1 exists and LC10_Platoon[14] can navigate to {PlayerPlatoon1}
		clear LC10_Platoon[14] action queue
		begin loop
			PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[14]} radius 150
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_PLATOON using PlayerPlatoon1 to LC10_Platoon[14] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[14]
			HeTeste1 = get number of villagers in platoon PlayerPlatoon1
			until NumPat1 == 0 or HeTeste1 == 0 or not LC10_Platoon[14] can navigate to {PlayerPlatoon1} or PlayerPlatoon1 not exists
		end loop
		clear LC10_Platoon[14] action queue
	elsif Catapult exists and LC10_Platoon[14] can navigate to {Catapult}
		clear LC10_Platoon[14] action queue
		a = 0
		begin loop
			Catapult = get siege weapon of player 0 nearest {LC10_Platoon[14]} radius 100
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_THING using Catapult to LC10_Platoon[14] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[14]
			PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[14]} radius 150
			if PlayerPlatoon1 exists and LC10_Platoon[14] can navigate to {PlayerPlatoon1}
				a = 1
			end if
			until NumPat1 == 0 or Catapult not exists or not LC10_Platoon[14] can navigate to {Catapult} or a == 1 or Catapult not exists
		end loop
		clear LC10_Platoon[14] action queue
		a = 0
	end if
	
	if get size of LC10_Platoon[14] action queue < 1
		add action PLATOON_AGENDA_ACTION_DEFEND_POSITION using {PlatoonPos[10]} to LC10_Platoon[14] action queue
	end if
	
end loop

end script LC10_Platoon14Actions

begin script LC10_Platoon15Actions

	TestPlatoonGuards = 0
	DistanceG = 0
	disvolcano = 0
	Position1 = 0
	Position2 = 0
	Position3 = 0
	Position4 = 0
	PlayerCreature = 0
    PlayerPlatoon1 = 0
    TestSiege = 0
	oCreature = get player 0 creature
	NumPat1 = 0
	HeTeste1 = 0
	WorrNum = 0
	HomeTown = get town with id 4
	Catapult = 0
	Armory = get building ABODE_NUMBER_MELEE_ARMOURY in HomeTown min built 1.0
	ArmoryRanged = get building ABODE_NUMBER_RANGED_ARMOURY in HomeTown min built 1.0
	PlayerPlatoon1Distance = 0
	PlayerCatapultDistance = 0
	a = 0
	
start

	set LC10_Platoon[15] focus to {AztecCapital}

begin loop

	wait until LC10_Platoon[15] exists
	
	PlayerCreature = get distance from {LC10_Platoon[15]} to {oCreature}
	if PlayerCreature <= 150 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00 and LC10_Platoon[15] can navigate to {oCreature}
		clear LC10_Platoon[15] action queue
		begin loop
			PlayerCreature = get distance from {LC10_Platoon[15]} to {oCreature}
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_MOVING_OBJECT using oCreature to LC10_Platoon[15] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[15]
			until NumPat1 == 0 or SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature == 0.00 or not LC10_Platoon[15] can navigate to {oCreature} or PlayerCreature > 150
		end loop
		clear LC10_Platoon[15] action queue
	end if
	
	PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[15]} radius 150
	Catapult = get siege weapon of player 0 nearest {LC10_Platoon[15]} radius 100
	if PlayerPlatoon1 exists and LC10_Platoon[15] can navigate to {PlayerPlatoon1}
		clear LC10_Platoon[15] action queue
		begin loop
			PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[15]} radius 150
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_PLATOON using PlayerPlatoon1 to LC10_Platoon[15] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[15]
			HeTeste1 = get number of villagers in platoon PlayerPlatoon1
			until NumPat1 == 0 or HeTeste1 == 0 or not LC10_Platoon[15] can navigate to {PlayerPlatoon1} or PlayerPlatoon1 not exists
		end loop
		clear LC10_Platoon[15] action queue
	elsif Catapult exists and LC10_Platoon[15] can navigate to {Catapult}
		clear LC10_Platoon[15] action queue
		a = 0
		begin loop
			Catapult = get siege weapon of player 0 nearest {LC10_Platoon[15]} radius 100
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_THING using Catapult to LC10_Platoon[15] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[15]
			PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[15]} radius 150
			if PlayerPlatoon1 exists and LC10_Platoon[15] can navigate to {PlayerPlatoon1}
				a = 1
			end if
			until NumPat1 == 0 or Catapult not exists or not LC10_Platoon[15] can navigate to {Catapult} or a == 1 or Catapult not exists
		end loop
		clear LC10_Platoon[15] action queue
		a = 0
	end if
	
	if get size of LC10_Platoon[15] action queue < 1
		add action PLATOON_AGENDA_ACTION_DEFEND_POSITION using {PlatoonPos[11]} to LC10_Platoon[15] action queue
	end if
	
end loop

end script LC10_Platoon15Actions

begin script LC10_Platoon16Actions

	TestPlatoonGuards = 0
	DistanceG = 0
	disvolcano = 0
	Position1 = 0
	Position2 = 0
	Position3 = 0
	Position4 = 0
	PlayerCreature = 0
    PlayerPlatoon1 = 0
    TestSiege = 0
	oCreature = get player 0 creature
	NumPat1 = 0
	HeTeste1 = 0
	WorrNum = 0
	HomeTown = get town with id 4
	Catapult = 0
	Armory = get building ABODE_NUMBER_MELEE_ARMOURY in HomeTown min built 1.0
	ArmoryRanged = get building ABODE_NUMBER_RANGED_ARMOURY in HomeTown min built 1.0
	PlayerPlatoon1Distance = 0
	PlayerCatapultDistance = 0
	a = 0
	
start

	set LC10_Platoon[16] focus to {AztecCapital}

begin loop

	wait until LC10_Platoon[16] exists
	
	PlayerCreature = get distance from {LC10_Platoon[16]} to {oCreature}
	if PlayerCreature <= 150 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00 and LC10_Platoon[16] can navigate to {oCreature}
		clear LC10_Platoon[16] action queue
		begin loop
			PlayerCreature = get distance from {LC10_Platoon[16]} to {oCreature}
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_MOVING_OBJECT using oCreature to LC10_Platoon[16] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[16]
			until NumPat1 == 0 or SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature == 0.00 or not LC10_Platoon[16] can navigate to {oCreature} or PlayerCreature > 150
		end loop
		clear LC10_Platoon[16] action queue
	end if
	
	PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[16]} radius 150
	Catapult = get siege weapon of player 0 nearest {LC10_Platoon[16]} radius 100
	if PlayerPlatoon1 exists and LC10_Platoon[16] can navigate to {PlayerPlatoon1}
		clear LC10_Platoon[16] action queue
		begin loop
			PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[16]} radius 150
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_PLATOON using PlayerPlatoon1 to LC10_Platoon[16] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[16]
			HeTeste1 = get number of villagers in platoon PlayerPlatoon1
			until NumPat1 == 0 or HeTeste1 == 0 or not LC10_Platoon[16] can navigate to {PlayerPlatoon1} or PlayerPlatoon1 not exists
		end loop
		clear LC10_Platoon[16] action queue
	elsif Catapult exists and LC10_Platoon[16] can navigate to {Catapult}
		clear LC10_Platoon[16] action queue
		a = 0
		begin loop
			Catapult = get siege weapon of player 0 nearest {LC10_Platoon[16]} radius 100
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_THING using Catapult to LC10_Platoon[16] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[16]
			PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[16]} radius 150
			if PlayerPlatoon1 exists and LC10_Platoon[16] can navigate to {PlayerPlatoon1}
				a = 1
			end if
			until NumPat1 == 0 or Catapult not exists or not LC10_Platoon[16] can navigate to {Catapult} or a == 1 or Catapult not exists
		end loop
		clear LC10_Platoon[16] action queue
		a = 0
	end if
	
	if get size of LC10_Platoon[16] action queue < 1
		add action PLATOON_AGENDA_ACTION_DEFEND_POSITION using {PlatoonPos[12]} to LC10_Platoon[16] action queue
	end if
	
end loop

end script LC10_Platoon16Actions

begin script LC10_Platoon17Actions

	TestPlatoonGuards = 0
	DistanceG = 0
	disvolcano = 0
	Position1 = 0
	Position2 = 0
	Position3 = 0
	Position4 = 0
	PlayerCreature = 0
    PlayerPlatoon1 = 0
    TestSiege = 0
	oCreature = get player 0 creature
	NumPat1 = 0
	HeTeste1 = 0
	WorrNum = 0
	HomeTown = get town with id 4
	Catapult = 0
	Armory = get building ABODE_NUMBER_MELEE_ARMOURY in HomeTown min built 1.0
	ArmoryRanged = get building ABODE_NUMBER_RANGED_ARMOURY in HomeTown min built 1.0
	PlayerPlatoon1Distance = 0
	PlayerCatapultDistance = 0
	a = 0
	
start

	set LC10_Platoon[17] focus to {AztecCapital}

begin loop

	wait until LC10_Platoon[17] exists
	
	PlayerCreature = get distance from {LC10_Platoon[17]} to {oCreature}
	if PlayerCreature <= 150 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00 and LC10_Platoon[17] can navigate to {oCreature}
		clear LC10_Platoon[17] action queue
		begin loop
			PlayerCreature = get distance from {LC10_Platoon[17]} to {oCreature}
			add action PLATOON_AGENDA_ACTION_RANGED_ATTACK using oCreature to LC10_Platoon[17] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[17]
			until NumPat1 == 0 or SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature == 0.00 or not LC10_Platoon[17] can navigate to {oCreature} or PlayerCreature > 150
		end loop
		clear LC10_Platoon[17] action queue
	end if
	
	PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[17]} radius 150
	Catapult = get siege weapon of player 0 nearest {LC10_Platoon[17]} radius 100
	if PlayerPlatoon1 exists and LC10_Platoon[17] can navigate to {PlayerPlatoon1}
		clear LC10_Platoon[17] action queue
		begin loop
			PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[17]} radius 150
			add action PLATOON_AGENDA_ACTION_RANGED_ATTACK using PlayerPlatoon1 to LC10_Platoon[17] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[17]
			HeTeste1 = get number of villagers in platoon PlayerPlatoon1
			until NumPat1 == 0 or HeTeste1 == 0 or not LC10_Platoon[17] can navigate to {PlayerPlatoon1} or PlayerPlatoon1 not exists
		end loop
		clear LC10_Platoon[17] action queue
	elsif Catapult exists and LC10_Platoon[17] can navigate to {Catapult}
		clear LC10_Platoon[17] action queue
		a = 0
		begin loop
			Catapult = get siege weapon of player 0 nearest {LC10_Platoon[17]} radius 100
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_THING using Catapult to LC10_Platoon[17] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[17]
			PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[17]} radius 150
			if PlayerPlatoon1 exists and LC10_Platoon[17] can navigate to {PlayerPlatoon1}
				a = 1
			end if
			until NumPat1 == 0 or Catapult not exists or not LC10_Platoon[17] can navigate to {Catapult} or a == 1 or Catapult not exists
		end loop
		clear LC10_Platoon[17] action queue
		a = 0
	end if
	
	if get size of LC10_Platoon[17] action queue < 1
		add action PLATOON_AGENDA_ACTION_DEFEND_POSITION using {PlatoonPos[13]} to LC10_Platoon[17] action queue
	end if
	
end loop

end script LC10_Platoon17Actions

begin script LC10_Platoon18Actions

	TestPlatoonGuards = 0
	DistanceG = 0
	disvolcano = 0
	Position1 = 0
	Position2 = 0
	Position3 = 0
	Position4 = 0
	PlayerCreature = 0
    PlayerPlatoon1 = 0
    TestSiege = 0
	oCreature = get player 0 creature
	NumPat1 = 0
	HeTeste1 = 0
	WorrNum = 0
	HomeTown = get town with id 4
	Catapult = 0
	Armory = get building ABODE_NUMBER_MELEE_ARMOURY in HomeTown min built 1.0
	ArmoryRanged = get building ABODE_NUMBER_RANGED_ARMOURY in HomeTown min built 1.0
	PlayerPlatoon1Distance = 0
	PlayerCatapultDistance = 0
	a = 0
	
start

	set LC10_Platoon[18] focus to {AztecCapital}

begin loop

	wait until LC10_Platoon[18] exists
	
	PlayerCreature = get distance from {LC10_Platoon[18]} to {oCreature}
	if PlayerCreature <= 150 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00 and LC10_Platoon[18] can navigate to {oCreature}
		clear LC10_Platoon[18] action queue
		begin loop
			PlayerCreature = get distance from {LC10_Platoon[18]} to {oCreature}
			add action PLATOON_AGENDA_ACTION_RANGED_ATTACK using oCreature to LC10_Platoon[18] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[18]
			until NumPat1 == 0 or SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature == 0.00 or not LC10_Platoon[18] can navigate to {oCreature} or PlayerCreature > 150
		end loop
		clear LC10_Platoon[18] action queue
	end if
	
	PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[18]} radius 150
	Catapult = get siege weapon of player 0 nearest {LC10_Platoon[18]} radius 100
	if PlayerPlatoon1 exists and LC10_Platoon[18] can navigate to {PlayerPlatoon1}
		clear LC10_Platoon[18] action queue
		begin loop
			PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[18]} radius 150
			add action PLATOON_AGENDA_ACTION_RANGED_ATTACK using PlayerPlatoon1 to LC10_Platoon[18] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[18]
			HeTeste1 = get number of villagers in platoon PlayerPlatoon1
			until NumPat1 == 0 or HeTeste1 == 0 or not LC10_Platoon[18] can navigate to {PlayerPlatoon1} or PlayerPlatoon1 not exists
		end loop
		clear LC10_Platoon[18] action queue
	elsif Catapult exists and LC10_Platoon[18] can navigate to {Catapult}
		clear LC10_Platoon[18] action queue
		a = 0
		begin loop
			Catapult = get siege weapon of player 0 nearest {LC10_Platoon[18]} radius 100
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_THING using Catapult to LC10_Platoon[18] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[18]
			PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[18]} radius 150
			if PlayerPlatoon1 exists and LC10_Platoon[18] can navigate to {PlayerPlatoon1}
				a = 1
			end if
			until NumPat1 == 0 or Catapult not exists or not LC10_Platoon[18] can navigate to {Catapult} or a == 1 or Catapult not exists
		end loop
		clear LC10_Platoon[18] action queue
		a = 0
	end if
	
	if get size of LC10_Platoon[18] action queue < 1
		add action PLATOON_AGENDA_ACTION_DEFEND_POSITION using {PlatoonPos[14]} to LC10_Platoon[18] action queue
	end if
	
end loop

end script LC10_Platoon18Actions

begin script LC10_Platoon19Actions

	TestPlatoonGuards = 0
	DistanceG = 0
	disvolcano = 0
	Position1 = 0
	Position2 = 0
	Position3 = 0
	Position4 = 0
	PlayerCreature = 0
    PlayerPlatoon1 = 0
    TestSiege = 0
	oCreature = get player 0 creature
	NumPat1 = 0
	HeTeste1 = 0
	WorrNum = 0
	HomeTown = get town with id 4
	Catapult = 0
	Armory = get building ABODE_NUMBER_MELEE_ARMOURY in HomeTown min built 1.0
	ArmoryRanged = get building ABODE_NUMBER_RANGED_ARMOURY in HomeTown min built 1.0
	PlayerPlatoon1Distance = 0
	PlayerCatapultDistance = 0
	a = 0
	
start

begin loop

	wait until LC10_Platoon[19] exists
	
	PlayerCreature = get distance from {LC10_Platoon[19]} to {oCreature}
	if PlayerCreature <= 150 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00 and LC10_Platoon[19] can navigate to {oCreature}
		clear LC10_Platoon[19] action queue
		begin loop
			PlayerCreature = get distance from {LC10_Platoon[19]} to {oCreature}
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_MOVING_OBJECT using oCreature to LC10_Platoon[19] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[19]
			until NumPat1 == 0 or SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature == 0.00 or not LC10_Platoon[19] can navigate to {oCreature} or PlayerCreature > 150
		end loop
		clear LC10_Platoon[19] action queue
	end if
	
	PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[19]} radius 150
	Catapult = get siege weapon of player 0 nearest {LC10_Platoon[19]} radius 100
	if PlayerPlatoon1 exists and LC10_Platoon[19] can navigate to {PlayerPlatoon1}
		clear LC10_Platoon[19] action queue
		begin loop
			PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[19]} radius 150
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_PLATOON using PlayerPlatoon1 to LC10_Platoon[19] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[19]
			HeTeste1 = get number of villagers in platoon PlayerPlatoon1
			until NumPat1 == 0 or HeTeste1 == 0 or not LC10_Platoon[19] can navigate to {PlayerPlatoon1} or PlayerPlatoon1 not exists
		end loop
		clear LC10_Platoon[19] action queue
	elsif Catapult exists and LC10_Platoon[19] can navigate to {Catapult}
		clear LC10_Platoon[19] action queue
		a = 0
		begin loop
			Catapult = get siege weapon of player 0 nearest {LC10_Platoon[19]} radius 100
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_THING using Catapult to LC10_Platoon[19] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[19]
			PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[19]} radius 150
			if PlayerPlatoon1 exists and LC10_Platoon[19] can navigate to {PlayerPlatoon1}
				a = 1
			end if
			until NumPat1 == 0 or Catapult not exists or not LC10_Platoon[19] can navigate to {Catapult} or a == 1 or Catapult not exists
		end loop
		clear LC10_Platoon[19] action queue
		a = 0
	end if
	
	if get size of LC10_Platoon[19] action queue < 1 and not town AztecFirstTown is under takeover from player 0
		add action PLATOON_AGENDA_ACTION_DEFEND_POSITION using {PlatoonDefendPos[0]} to LC10_Platoon[19] action queue
	end if
	
end loop

end script LC10_Platoon19Actions

begin script LC10_Platoon20Actions

	TestPlatoonGuards = 0
	DistanceG = 0
	disvolcano = 0
	Position1 = 0
	Position2 = 0
	Position3 = 0
	Position4 = 0
	PlayerCreature = 0
    PlayerPlatoon1 = 0
    TestSiege = 0
	oCreature = get player 0 creature
	NumPat1 = 0
	HeTeste1 = 0
	WorrNum = 0
	HomeTown = get town with id 4
	Catapult = 0
	Armory = get building ABODE_NUMBER_MELEE_ARMOURY in HomeTown min built 1.0
	ArmoryRanged = get building ABODE_NUMBER_RANGED_ARMOURY in HomeTown min built 1.0
	PlayerPlatoon1Distance = 0
	PlayerCatapultDistance = 0
	a = 0
	
start

begin loop

	wait until LC10_Platoon[20] exists
	
	PlayerCreature = get distance from {LC10_Platoon[20]} to {oCreature}
	if PlayerCreature <= 150 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00 and LC10_Platoon[20] can navigate to {oCreature}
		clear LC10_Platoon[20] action queue
		begin loop
			PlayerCreature = get distance from {LC10_Platoon[20]} to {oCreature}
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_MOVING_OBJECT using oCreature to LC10_Platoon[20] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[20]
			until NumPat1 == 0 or SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature == 0.00 or not LC10_Platoon[20] can navigate to {oCreature} or PlayerCreature > 150
		end loop
		clear LC10_Platoon[20] action queue
	end if
	
	PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[20]} radius 150
	Catapult = get siege weapon of player 0 nearest {LC10_Platoon[20]} radius 100
	if PlayerPlatoon1 exists and LC10_Platoon[20] can navigate to {PlayerPlatoon1}
		clear LC10_Platoon[20] action queue
		begin loop
			PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[20]} radius 150
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_PLATOON using PlayerPlatoon1 to LC10_Platoon[20] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[20]
			HeTeste1 = get number of villagers in platoon PlayerPlatoon1
			until NumPat1 == 0 or HeTeste1 == 0 or not LC10_Platoon[20] can navigate to {PlayerPlatoon1} or PlayerPlatoon1 not exists
		end loop
		clear LC10_Platoon[20] action queue
	elsif Catapult exists and LC10_Platoon[20] can navigate to {Catapult}
		clear LC10_Platoon[20] action queue
		a = 0
		begin loop
			Catapult = get siege weapon of player 0 nearest {LC10_Platoon[20]} radius 100
			add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_THING using Catapult to LC10_Platoon[20] action queue
			NumPat1 = get number of villagers in platoon LC10_Platoon[20]
			PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[20]} radius 150
			if PlayerPlatoon1 exists and LC10_Platoon[20] can navigate to {PlayerPlatoon1}
				a = 1
			end if
			until NumPat1 == 0 or Catapult not exists or not LC10_Platoon[20] can navigate to {Catapult} or a == 1 or Catapult not exists
		end loop
		clear LC10_Platoon[20] action queue
		a = 0
	end if
	
	if get size of LC10_Platoon[20] action queue < 1 and not town AztecFirstTown is under takeover from player 0
		add action PLATOON_AGENDA_ACTION_DEFEND_POSITION using {PlatoonDefendPos[1]} to LC10_Platoon[20] action queue
	end if
	
end loop

end script LC10_Platoon20Actions

begin script LC10_Platoon21Actions

	oCreature = get player 0 creature
	HeTeste3 = 0
	TestCreature2 = 0
	NumPat = 0
	NumPat5 = 0
	PlayerPlatoon1 = 0
	WorrNum = 0
	oTown = get town with id 0
	oTownCentre = get building ABODE_NUMBER_TOWN_CENTRE in oTown min built 1.0
	ProPlatoonsLocation = 0
	AIPlatoon1 = 0
	Armory = 0
	Town8 = get town with id 8
	RandomActionP3 = 0
	a = 1
	Timer = create timer for 0 seconds
	GreekGateHouse1 = 0
	GreekGateHouse2 = 0
	oWall = 0
	PlayerPlatoonInRange = 0
	PlayerCatapult1 = 0
	
start

begin loop
	a = 1
	wait until LC10_SiegeCatapult[0] exists and LC10_Platoon[21] exists and ({LC10_SiegeCatapult[0]} near {AztecFirstTown} radius 300)
	disable platoon LC10_Platoon[21] camp
	begin loop
		TestCreature2 = get distance from {LC10_Platoon[21]} to {oCreature}
		if TestCreature2 <= 125 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00 and LC10_Platoon[21] can navigate to {oCreature}
			clear LC10_Platoon[21] action queue
			begin loop
				add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_MOVING_OBJECT using oCreature to LC10_Platoon[21] action queue
				NumPat5 = get number of villagers in platoon LC10_Platoon[21]
				TestCreature2 = get distance from {LC10_Platoon[21]} to {oCreature}
				until NumPat5 == 0 or SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature == 0.00 or not LC10_Platoon[21] can navigate to {oCreature} or TestCreature2 > 125
			end loop
		end if
		PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[21]} radius 125
		PlayerCatapult1 = get siege weapon of player 0 nearest {LC10_Platoon[21]} radius 100
		if PlayerPlatoon1 exists and LC10_Platoon[21] can navigate to {PlayerPlatoon1}
			clear LC10_Platoon[21] action queue
			begin loop
				add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_PLATOON using PlayerPlatoon1 to LC10_Platoon[21] action queue
				NumPat5 = get number of villagers in platoon LC10_Platoon[21]
				HeTeste3 = get number of villagers in platoon PlayerPlatoon1
				until NumPat5 == 0 or HeTeste3 == 0
			end loop
		elsif PlayerCatapult1 exists and LC10_Platoon[21] can navigate to {PlayerCatapult1}
			clear LC10_Platoon[21] action queue
			begin loop
				add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_THING using PlayerCatapult1 to LC10_Platoon[21] action queue
				NumPat5 = get number of villagers in platoon LC10_Platoon[21]
				PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[21]} radius 125
				if PlayerPlatoon1 exists and LC10_Platoon[21] can navigate to {PlayerPlatoon1}
					PlayerPlatoonInRange = 1
				end if
				until NumPat5 == 0 or PlayerCatapult1 not exists or not LC10_Platoon[21] can navigate to {PlayerCatapult1} or PlayerPlatoonInRange == 1
			end loop
			PlayerPlatoonInRange = 0
		end if
		if LC10_SiegeCatapult[0] exists
			clear LC10_Platoon[21] action queue
			add action PLATOON_AGENDA_ACTION_DEFEND_OBJECT using LC10_SiegeCatapult[0] to LC10_Platoon[21] action queue
			begin loop
				TestCreature2 = get distance from {LC10_Platoon[21]} to {oCreature}
				PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[21]} radius 125
				until TestCreature2 <= 125 or PlayerPlatoon1 exists or LC10_Platoon[21] not exists
			end loop
		end if
		until LC10_SiegeCatapult0IsAttacking == 1 or LC10_SiegeCatapult[0] not exists or LC10_Platoon[21] not exists
	end loop
	
	if LC10_SiegeCatapult[0] exists
		begin loop //Attack
			TestCreature2 = get distance from {LC10_Platoon[21]} to {oCreature}
			if TestCreature2 <= 125 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00 and LC10_Platoon[21] can navigate to {oCreature}
				clear LC10_Platoon[21] action queue
				begin loop
					add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_MOVING_OBJECT using oCreature to LC10_Platoon[21] action queue
					NumPat5 = get number of villagers in platoon LC10_Platoon[21]
					TestCreature2 = get distance from {LC10_Platoon[21]} to {oCreature}
					until NumPat5 == 0 or SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature == 0.00 or not LC10_Platoon[21] can navigate to {oCreature} or TestCreature2 > 125
				end loop
			end if
			PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[21]} radius 125
			PlayerCatapult1 = get siege weapon of player 0 nearest {LC10_Platoon[21]} radius 100
			if PlayerPlatoon1 exists and LC10_Platoon[21] can navigate to {PlayerPlatoon1}
				clear LC10_Platoon[21] action queue
				begin loop
					add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_PLATOON using PlayerPlatoon1 to LC10_Platoon[21] action queue
					NumPat5 = get number of villagers in platoon LC10_Platoon[21]
					HeTeste3 = get number of villagers in platoon PlayerPlatoon1
					until NumPat5 == 0 or HeTeste3 == 0
				end loop
			elsif PlayerCatapult1 exists and LC10_Platoon[21] can navigate to {PlayerCatapult1}
				clear LC10_Platoon[21] action queue
				begin loop
					add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_THING using PlayerCatapult1 to LC10_Platoon[21] action queue
					NumPat5 = get number of villagers in platoon LC10_Platoon[21]
					PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[21]} radius 125
					if PlayerPlatoon1 exists and LC10_Platoon[21] can navigate to {PlayerPlatoon1}
						PlayerPlatoonInRange = 1
					end if
					until NumPat5 == 0 or PlayerCatapult1 not exists or not LC10_Platoon[21] can navigate to {PlayerCatapult1} or PlayerPlatoonInRange == 1
				end loop
				PlayerPlatoonInRange = 0
			end if
			if LC10_Platoon[21] can navigate to object oTownCentre
				a = 1
				clear LC10_Platoon[21] action queue
				begin loop
					PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[21]} radius 125
					TestCreature2 = get distance from {LC10_Platoon[21]} to {oCreature}
					set LC10_Platoon[21] attack PlayerTown with severity 0.7 for takeover
					if PlayerPlatoon1 exists or TestCreature2 <= 125 or not LC10_Platoon[21] can navigate to object oTownCentre
						if PlayerPlatoon1 exists
							a = 0
						elsif TestCreature2 <= 125 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00
							a = 0
						elsif not LC10_Platoon[21] can navigate to object oTownCentre
							a = 0
						elsif LC10_Platoon[21] not exists
							a = 0
						end if
					end if
					until a == 0 or LC10_Platoon[21] not exists
				end loop
				clear LC10_Platoon[21] action queue
			elsif LC10_Platoon[21] can navigate to {AttackPos[0]}
				clear LC10_Platoon[21] action queue
				add action PLATOON_AGENDA_ACTION_DEFEND_POSITION using {AttackPos[0]} to LC10_Platoon[21] action queue
			else
				clear LC10_Platoon[21] action queue
				add action PLATOON_AGENDA_ACTION_DEFEND_POSITION using {AttackPos[1]} to LC10_Platoon[21] action queue
			end if
			until LC10_Platoon[21] not exists
		end loop
	else
		add action PLATOON_AGENDA_ACTION_DEFEND_POSITION using {SiegePlatoonPos[0]} to LC10_Platoon[21] action queue
	end if
end loop

end script LC10_Platoon21Actions

begin script LC10_Platoon22Actions

	oCreature = get player 0 creature
	HeTeste3 = 0
	TestCreature2 = 0
	NumPat = 0
	NumPat5 = 0
	PlayerPlatoon1 = 0
	WorrNum = 0
	oTown = get town with id 0
	oTownCentre = get building ABODE_NUMBER_TOWN_CENTRE in oTown min built 1.0
	ProPlatoonsLocation = 0
	AIPlatoon1 = 0
	Armory = 0
	Town8 = get town with id 8
	RandomActionP3 = 0
	a = 1
	Timer = create timer for 0 seconds
	GreekGateHouse1 = 0
	GreekGateHouse2 = 0
	oWall = 0
	PlayerCatapult1 = 0
	PlayerPlatoonInRange = 0
	
start

begin loop
	a = 1
	wait until LC10_SiegeCatapult[1] exists and LC10_Platoon[22] exists and ({LC10_SiegeCatapult[1]} near {AztecFirstTown} radius 300)
	disable platoon LC10_Platoon[22] camp
	begin loop
		TestCreature2 = get distance from {LC10_Platoon[22]} to {oCreature}
		if TestCreature2 <= 125 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00 and LC10_Platoon[22] can navigate to {oCreature}
			clear LC10_Platoon[22] action queue
			begin loop
				add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_MOVING_OBJECT using oCreature to LC10_Platoon[22] action queue
				NumPat5 = get number of villagers in platoon LC10_Platoon[22]
				TestCreature2 = get distance from {LC10_Platoon[22]} to {oCreature}
				until NumPat5 == 0 or SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature == 0.00 or not LC10_Platoon[22] can navigate to {oCreature} or TestCreature2 > 125
			end loop
		end if
		PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[22]} radius 125
		PlayerCatapult1 = get siege weapon of player 0 nearest {LC10_Platoon[22]} radius 100
		if PlayerPlatoon1 exists and LC10_Platoon[22] can navigate to {PlayerPlatoon1}
			clear LC10_Platoon[22] action queue
			begin loop
				add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_PLATOON using PlayerPlatoon1 to LC10_Platoon[22] action queue
				NumPat5 = get number of villagers in platoon LC10_Platoon[22]
				HeTeste3 = get number of villagers in platoon PlayerPlatoon1
				until NumPat5 == 0 or HeTeste3 == 0
			end loop
		elsif PlayerCatapult1 exists and LC10_Platoon[22] can navigate to {PlayerCatapult1}
			clear LC10_Platoon[22] action queue
			begin loop
				add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_THING using PlayerCatapult1 to LC10_Platoon[22] action queue
				NumPat5 = get number of villagers in platoon LC10_Platoon[22]
				PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[22]} radius 125
				if PlayerPlatoon1 exists and LC10_Platoon[22] can navigate to {PlayerPlatoon1}
					PlayerPlatoonInRange = 1
				end if
				until NumPat5 == 0 or PlayerCatapult1 not exists or not LC10_Platoon[22] can navigate to {PlayerCatapult1} or PlayerPlatoonInRange == 1
			end loop
			PlayerPlatoonInRange = 0
		end if
		if LC10_SiegeCatapult[1] exists
			clear LC10_Platoon[22] action queue
			add action PLATOON_AGENDA_ACTION_DEFEND_OBJECT using LC10_SiegeCatapult[1] to LC10_Platoon[22] action queue
			begin loop
				TestCreature2 = get distance from {LC10_Platoon[22]} to {oCreature}
				PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[22]} radius 125
				until TestCreature2 <= 125 or PlayerPlatoon1 exists or LC10_Platoon[22] not exists
			end loop
		end if
		until LC10_SiegeCatapult1IsAttacking == 1 or LC10_SiegeCatapult[1] not exists or LC10_Platoon[22] not exists
	end loop
	
	if LC10_SiegeCatapult[1] exists
		begin loop //Attack
			TestCreature2 = get distance from {LC10_Platoon[22]} to {oCreature}
			if TestCreature2 <= 125 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00 and LC10_Platoon[22] can navigate to {oCreature}
				clear LC10_Platoon[22] action queue
				begin loop
					add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_MOVING_OBJECT using oCreature to LC10_Platoon[22] action queue
					NumPat5 = get number of villagers in platoon LC10_Platoon[22]
					TestCreature2 = get distance from {LC10_Platoon[22]} to {oCreature}
					until NumPat5 == 0 or SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature == 0.00 or not LC10_Platoon[22] can navigate to {oCreature} or TestCreature2 > 125
				end loop
			end if
			PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[22]} radius 125
			PlayerCatapult1 = get siege weapon of player 0 nearest {LC10_Platoon[22]} radius 100
			if PlayerPlatoon1 exists and LC10_Platoon[22] can navigate to {PlayerPlatoon1}
				clear LC10_Platoon[22] action queue
				begin loop
					add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_PLATOON using PlayerPlatoon1 to LC10_Platoon[22] action queue
					NumPat5 = get number of villagers in platoon LC10_Platoon[22]
					HeTeste3 = get number of villagers in platoon PlayerPlatoon1
					until NumPat5 == 0 or HeTeste3 == 0
				end loop
			elsif PlayerCatapult1 exists and LC10_Platoon[22] can navigate to {PlayerCatapult1}
				clear LC10_Platoon[22] action queue
				begin loop
					add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_THING using PlayerCatapult1 to LC10_Platoon[22] action queue
					NumPat5 = get number of villagers in platoon LC10_Platoon[22]
					PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[22]} radius 125
					if PlayerPlatoon1 exists and LC10_Platoon[22] can navigate to {PlayerPlatoon1}
						PlayerPlatoonInRange = 1
					end if
					until NumPat5 == 0 or PlayerCatapult1 not exists or not LC10_Platoon[22] can navigate to {PlayerCatapult1} or PlayerPlatoonInRange == 1
				end loop
				PlayerPlatoonInRange = 0
			end if
			if LC10_Platoon[22] can navigate to object oTownCentre
				a = 1
				clear LC10_Platoon[22] action queue
				begin loop
					PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[22]} radius 125
					TestCreature2 = get distance from {LC10_Platoon[22]} to {oCreature}
					set LC10_Platoon[22] attack PlayerTown with severity 0.7 for takeover
					if PlayerPlatoon1 exists or TestCreature2 <= 125 or not LC10_Platoon[22] can navigate to object oTownCentre
						if PlayerPlatoon1 exists
							a = 0
						elsif TestCreature2 <= 125 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00
							a = 0
						elsif not LC10_Platoon[22] can navigate to object oTownCentre
							a = 0
						elsif LC10_Platoon[22] not exists
							a = 0
						end if
					end if
					until a == 0 or LC10_Platoon[22] not exists
				end loop
				clear LC10_Platoon[22] action queue
			elsif LC10_Platoon[22] can navigate to {AttackPos[2]}
				clear LC10_Platoon[22] action queue
				add action PLATOON_AGENDA_ACTION_DEFEND_POSITION using {AttackPos[2]} to LC10_Platoon[22] action queue
			else
				clear LC10_Platoon[22] action queue
				add action PLATOON_AGENDA_ACTION_DEFEND_POSITION using {AttackPos[3]} to LC10_Platoon[22] action queue
			end if
			until LC10_Platoon[22] not exists
		end loop
	else
		add action PLATOON_AGENDA_ACTION_DEFEND_POSITION using {SiegePlatoonPos[1]} to LC10_Platoon[22] action queue
	end if
end loop

end script LC10_Platoon22Actions

begin script LC10_SiegeCatapult0Actions

	PlayerCreature = 0
    PlayerPlatoon1 = 0
	oCreature = get player 0 creature
	NumPat1 = 0
	HeTeste1 = 0
	WorrNum = 0
	Town0 = get town with id 0
	Town5 = get town with id 5
	oTown = get town with id 0
	oTownCentre = get building ABODE_NUMBER_TOWN_CENTRE in Town0 min built 1.0
	Armory = get building ABODE_NUMBER_MELEE_ARMOURY in Town5 min built 1.0
	ArmoryRanged = get building ABODE_NUMBER_RANGED_ARMOURY in Town5 min built 1.0
	Player1Town = 0
	a = 1
	AISiege = 0	
	WaypointMain[7]
	WaypointRouteMain = 0
	Counter = 0
	Town8 = get town with id 8
	Catapult = 0
	AttackingTown = 2
	NumPat5 = 0
	h = 1
	Player0Town0 = 0
	Timer = create timer for 0 seconds
	oWall = 0
	GreekGateHouse1 = 0
	GreekGateHouse2 = 0
	AIPlatoon = 0
	Target = 0
	PointOn = 0
	CatapultMoveTimer1 = 5
	AttackTimer = 0
	ActionTimer = create timer for 0 seconds
	Wall1 = 0
	Wall2 = 0
	House = 0
	SiegeOnPointTimer = create timer for 0 seconds
	SiegeWeaponPoint = 0
	SiegeStucked = 0
	
start

begin loop
	a = 1
	PointOn = 0
	SiegeStucked = 0
	LC10_SiegeCatapult0IsAttacking = 0
	wait until LC10_SiegeCatapult[0] exists and LC10_Platoon[21] exists and LC10_SiegeCatapult[1] exists and LC10_Platoon[22] exists
	wait 15 seconds
	begin loop
		PlayerCreature = get distance from {LC10_SiegeCatapult[0]} to {oCreature}
		PlayerPlatoon1 = get platoon of player 0 nearest {LC10_SiegeCatapult[0]} radius 125
		Catapult = get siege weapon of player 0 nearest {LC10_SiegeCatapult[0]} radius 125
		
		if PlayerCreature > 10 and PlayerPlatoon1 not exists and Catapult not exists
			if PlayerPlatoon1 not exists
				a = 1
			elsif PlayerCreature > 10 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00
				a = 1
			elsif Catapult not exists
				a = 1
			end if
		end if
		
		if PlayerCreature <= 10 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00
			clear siege weapon LC10_SiegeCatapult[0] action queue
			a = 0
		elsif PlayerPlatoon1 exists and LC10_SiegeCatapult[0] can navigate to {PlayerPlatoon1}
			clear siege weapon LC10_SiegeCatapult[0] action queue
			a = 0
		elsif Catapult exists and LC10_SiegeCatapult[0] can navigate to {Catapult}
			clear siege weapon LC10_SiegeCatapult[0] action queue
			a = 0
		elsif PointOn != 3 and a == 1
			begin loop
				if LC10_SiegeCatapult[0] exists 
					if get SiegeOnPointTimer time remaining <= 0
						SiegeWeaponPoint = marker at {LC10_SiegeCatapult[0]}
						SiegeOnPointTimer = create timer for 65 seconds
					elsif get SiegeOnPointTimer time remaining <= 5
						if {LC10_SiegeCatapult[0]} near {SiegeWeaponPoint} radius 10
							clear siege weapon LC10_SiegeCatapult[0] action queue
							add action SIEGEWEAPON_AGENDA_ACTION_DISBAND using {LC10_SiegeCatapult[0]} to siege weapon LC10_SiegeCatapult[0] action queue//Siege just got stucked. Other possibilities to fix that wasn't successful for me.
							SiegeStucked = 1
						end if
					end if
					if get CatapultMoveTimer1 time remaining <= 0
						if get size of LC10_SiegeCatapult[0] action queue < 1

							if PointOn == 0
								if LC10_SiegeCatapult[0] can navigate to {SiegeRoute1[0]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute1[0]} to siege weapon LC10_SiegeCatapult[0] action queue
								end if
					
							elsif PointOn == 1
								if LC10_SiegeCatapult[0] can navigate to {SiegeRoute1[1]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute1[1]} to siege weapon LC10_SiegeCatapult[0] action queue
								end if

							elsif PointOn == 2
								if LC10_SiegeCatapult[0] can navigate to {SiegeRoute1[2]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute1[2]} to siege weapon LC10_SiegeCatapult[0] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute1[1]} to siege weapon LC10_SiegeCatapult[0] action queue
								end if

							CatapultMoveTimer1 = create timer for 10 seconds
							
							end if
						end if
					end if		

					if {LC10_SiegeCatapult[0]} near {SiegeRoute1[0]} radius 15 and PointOn != 1 or 60 seconds
						PointOn = 1
					elsif {LC10_SiegeCatapult[0]} near {SiegeRoute1[1]} radius 15 and PointOn != 2 or 60 seconds
						PointOn = 2
					elsif {LC10_SiegeCatapult[0]} near {SiegeRoute1[2]} radius 15 and PointOn != 3 or 60 seconds
						PointOn = 3
					elsif not LC10_SiegeCatapult[0] can navigate to {SiegeRoute1[2]} and {LC10_SiegeCatapult[0]} near {SiegeRoute1[1]} radius 15 and PointOn != 3
						PointOn = 3
					end if
				end if
			until LC10_SiegeCatapult[0] not exists or PointOn == 3 or 180 seconds
			end loop
		end if
		
		until PointOn == 3 or LC10_SiegeCatapult[0] not exists or 180 seconds
	end loop
	
	wait until VolcanoActivated == 0 and HurricaneActivated == 0
	wait 15 seconds
	
	LC10_SiegeCatapult0IsAttacking = 1
	
	wait 5 seconds
	
	UnderAttack = UnderAttack + 1
	clear siege weapon LC10_SiegeCatapult[0] action queue
	
	begin loop
		if get ActionTimer time remaining <= 0
			clear siege weapon LC10_SiegeCatapult[0] action queue
			ActionTimer = create timer for 10 seconds
			Wall1 = get wall segment nearest {PlayerWallPos} radius 150
			if Wall1 exists and PLAYER of Wall1 == 0
				Target = marker at get target from {LC10_SiegeCatapult[0]} to {Wall1} distance 10 angle 180
				clear siege weapon LC10_SiegeCatapult[0] action queue
				if Wall1 exists
					add action SIEGEWEAPON_AGENDA_ACTION_ATTACK_THING using Wall1 to siege weapon LC10_SiegeCatapult[0] action queue
				end if
			elsif Wall1 not exists
				House = get building HOUSE in PlayerTown min built 0.6
				if House exists and PLAYER of House == 0
					Target = marker at get target from {LC10_SiegeCatapult[0]} to {House} distance 10 angle 180
					clear siege weapon LC10_SiegeCatapult[0] action queue
					if House exists
						add action SIEGEWEAPON_AGENDA_ACTION_ATTACK_THING using House to siege weapon LC10_SiegeCatapult[0] action queue
					end if
				end if
			end if
		end if
		until LC10_SiegeCatapult[0] not exists
	end loop
	
	UnderAttack = UnderAttack - 1
	
	if SiegeStucked == 1
		wait 10 seconds
		if LC10_SiegeCatapult[0] not exists LC10_SiegeCatapult[0] = recruit SIEGE_BALANCE_TYPE_CATAPULT_LEVEL_5 town AztecFirstTown siege weapon end if
	end if
	
end loop

end script LC10_SiegeCatapult0Actions

begin script LC10_SiegeCatapult1Actions

	PlayerCreature = 0
    PlayerPlatoon1 = 0
	oCreature = get player 0 creature
	NumPat1 = 0
	HeTeste1 = 0
	WorrNum = 0
	Town0 = get town with id 0
	Town5 = get town with id 5
	oTown = get town with id 0
	oTownCentre = get building ABODE_NUMBER_TOWN_CENTRE in Town0 min built 1.0
	Armory = get building ABODE_NUMBER_MELEE_ARMOURY in Town5 min built 1.0
	ArmoryRanged = get building ABODE_NUMBER_RANGED_ARMOURY in Town5 min built 1.0
	Player1Town = 0
	a = 1
	AISiege = 0	
	WaypointMain[7]
	WaypointRouteMain = 0
	Counter = 0
	Town8 = get town with id 8
	Catapult = 0
	AttackingTown = 2
	NumPat5 = 0
	h = 1
	Player0Town0 = 0
	Timer = create timer for 0 seconds
	oWall = 0
	GreekGateHouse1 = 0
	GreekGateHouse2 = 0
	AIPlatoon = 0
	Target = 0
	PointOn = 0
	CatapultMoveTimer1 = 5
	AttackTimer = 0
	ActionTimer = create timer for 0 seconds
	Wall1 = 0
	Wall2 = 0
	House = 0
	SiegeOnPointTimer = create timer for 0 seconds
	SiegeWeaponPoint = 0
	SiegeStucked = 0
	
start

begin loop
	a = 1
	PointOn = 0
	SiegeStucked = 0
	LC10_SiegeCatapult1IsAttacking = 0
	wait until LC10_SiegeCatapult[1] exists and LC10_Platoon[22] exists and LC10_SiegeCatapult[0] exists and LC10_Platoon[21] exists
	wait 15 seconds
	begin loop
		PlayerCreature = get distance from {LC10_SiegeCatapult[1]} to {oCreature}
		PlayerPlatoon1 = get platoon of player 0 nearest {LC10_SiegeCatapult[1]} radius 125
		Catapult = get siege weapon of player 0 nearest {LC10_SiegeCatapult[1]} radius 125
		
		if PlayerCreature > 10 and PlayerPlatoon1 not exists and Catapult not exists
			if PlayerPlatoon1 not exists
				a = 1
			elsif PlayerCreature > 10 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00
				a = 1
			elsif Catapult not exists
				a = 1
			end if
		end if
		
		if PlayerCreature <= 10 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00
			clear siege weapon LC10_SiegeCatapult[1] action queue
			a = 0
		elsif PlayerPlatoon1 exists and LC10_SiegeCatapult[1] can navigate to {PlayerPlatoon1}
			clear siege weapon LC10_SiegeCatapult[1] action queue
			a = 0
		elsif Catapult exists and LC10_SiegeCatapult[1] can navigate to {Catapult}
			clear siege weapon LC10_SiegeCatapult[1] action queue
			a = 0
		elsif PointOn != 3 and a == 1
			begin loop
				if LC10_SiegeCatapult[1] exists 
					if get SiegeOnPointTimer time remaining <= 0
						SiegeWeaponPoint = marker at {LC10_SiegeCatapult[1]}
						SiegeOnPointTimer = create timer for 65 seconds
					elsif get SiegeOnPointTimer time remaining <= 5
						if {LC10_SiegeCatapult[1]} near {SiegeWeaponPoint} radius 10
							clear siege weapon LC10_SiegeCatapult[1] action queue
							add action SIEGEWEAPON_AGENDA_ACTION_DISBAND using {LC10_SiegeCatapult[1]} to siege weapon LC10_SiegeCatapult[1] action queue//Siege just got stucked. Other possibilities to fix that wasn't successful for me.
							SiegeStucked = 1
						end if
					end if
					if get CatapultMoveTimer1 time remaining <= 0
						if get size of LC10_SiegeCatapult[1] action queue < 1

							if PointOn == 0
								if LC10_SiegeCatapult[1] can navigate to {SiegeRoute2[0]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute2[0]} to siege weapon LC10_SiegeCatapult[1] action queue
								end if
					
							elsif PointOn == 1
								if LC10_SiegeCatapult[1] can navigate to {SiegeRoute2[1]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute2[1]} to siege weapon LC10_SiegeCatapult[1] action queue
								end if

							elsif PointOn == 2
								if LC10_SiegeCatapult[1] can navigate to {SiegeRoute2[2]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute2[2]} to siege weapon LC10_SiegeCatapult[1] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute2[1]} to siege weapon LC10_SiegeCatapult[1] action queue
								end if

							CatapultMoveTimer1 = create timer for 10 seconds
							
							end if
						end if
					end if		

					if {LC10_SiegeCatapult[1]} near {SiegeRoute2[0]} radius 15 and PointOn != 1 or 60 seconds
						PointOn = 1
					elsif {LC10_SiegeCatapult[1]} near {SiegeRoute2[1]} radius 15 and PointOn != 2 or 60 seconds
						PointOn = 2
					elsif {LC10_SiegeCatapult[1]} near {SiegeRoute2[2]} radius 15 and PointOn != 3 or 60 seconds
						PointOn = 3
					elsif not LC10_SiegeCatapult[1] can navigate to {SiegeRoute2[2]} and {LC10_SiegeCatapult[1]} near {SiegeRoute2[1]} radius 15 and PointOn != 3
						PointOn = 3
					end if
				end if
			until LC10_SiegeCatapult[1] not exists or PointOn == 3 or 180 seconds
			end loop
		end if
		
		until PointOn == 3 or LC10_SiegeCatapult[1] not exists or 180 seconds
	end loop
	
	wait until VolcanoActivated == 0 and HurricaneActivated == 0
	wait 15 seconds
	
	LC10_SiegeCatapult1IsAttacking = 1
	
	wait 5 seconds
	
	UnderAttack = UnderAttack + 1
	clear siege weapon LC10_SiegeCatapult[1] action queue
	
	begin loop
		if get ActionTimer time remaining <= 0
			clear siege weapon LC10_SiegeCatapult[1] action queue
			ActionTimer = create timer for 10 seconds
			Wall1 = get wall segment nearest {PlayerWallPos} radius 150
			if Wall1 exists and PLAYER of Wall1 == 0
				Target = marker at get target from {LC10_SiegeCatapult[1]} to {Wall1} distance 10 angle 180
				clear siege weapon LC10_SiegeCatapult[1] action queue
				if Wall1 exists
					add action SIEGEWEAPON_AGENDA_ACTION_ATTACK_THING using Wall1 to siege weapon LC10_SiegeCatapult[1] action queue
				end if
			elsif Wall1 not exists
				House = get building HOUSE in PlayerTown min built 0.6
				if House exists and PLAYER of House == 0
					Target = marker at get target from {LC10_SiegeCatapult[1]} to {House} distance 10 angle 180
					clear siege weapon LC10_SiegeCatapult[1] action queue
					if House exists
						add action SIEGEWEAPON_AGENDA_ACTION_ATTACK_THING using House to siege weapon LC10_SiegeCatapult[1] action queue
					end if
				end if
			end if
		end if
		until LC10_SiegeCatapult[1] not exists
	end loop
	
	UnderAttack = UnderAttack - 1
	
	if SiegeStucked == 1
		wait 10 seconds
		if LC10_SiegeCatapult[1] not exists LC10_SiegeCatapult[1] = recruit SIEGE_BALANCE_TYPE_CATAPULT_LEVEL_5 town AztecFirstTown siege weapon end if
	end if
	
end loop

end script LC10_SiegeCatapult1Actions

begin script LC10_Platoon29Actions

	TestPlatoonGuards = 0
	DistanceG = 0
	disvolcano = 0
	Position1 = 0
	Position2 = 0
	Position3 = 0
	Position4 = 0
	PlayerCreature = 0
    PlayerPlatoon1 = 0
    TestSiege = 0
	oCreature = get player 0 creature
	NumPat1 = 0
	HeTeste1 = 0
	WorrNum = 0
	HomeTown = get town with id 4
	Catapult = 0
	Armory = get building ABODE_NUMBER_MELEE_ARMOURY in HomeTown min built 1.0
	ArmoryRanged = get building ABODE_NUMBER_RANGED_ARMOURY in HomeTown min built 1.0
	PlayerPlatoon1Distance = 0
	PlayerCatapultDistance = 0
	a = 0
	FirstTimeRunning = 1
	
start

begin loop
	FirstTimeRunning = 1
	begin loop

		wait until LC10_Platoon[29] exists
		
		PlayerCreature = get distance from {LC10_Platoon[29]} to {oCreature}
		if PlayerCreature <= 250 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00
			clear LC10_Platoon[29] action queue
			begin loop
				PlayerCreature = get distance from {LC10_Platoon[29]} to {oCreature}
				add action PLATOON_AGENDA_ACTION_RANGED_ATTACK using oCreature to LC10_Platoon[29] action queue
				NumPat1 = get number of villagers in platoon LC10_Platoon[29]
				until NumPat1 == 0 or SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature == 0.00 or not LC10_Platoon[29] can navigate to {oCreature} or PlayerCreature > 250
			end loop
			clear LC10_Platoon[29] action queue
		end if
		
		PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[29]} radius 250
		Catapult = get siege weapon of player 0 nearest {LC10_Platoon[29]} radius 225
		if PlayerPlatoon1 exists and LC10_Platoon[29] can navigate to {PlayerPlatoon1}
			clear LC10_Platoon[29] action queue
			begin loop
				PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[29]} radius 250
				add action PLATOON_AGENDA_ACTION_RANGED_ATTACK using PlayerPlatoon1 to LC10_Platoon[29] action queue
				NumPat1 = get number of villagers in platoon LC10_Platoon[29]
				HeTeste1 = get number of villagers in platoon PlayerPlatoon1
				until NumPat1 == 0 or HeTeste1 == 0 or not LC10_Platoon[29] can navigate to {PlayerPlatoon1} or PlayerPlatoon1 not exists
			end loop
			clear LC10_Platoon[29] action queue
		elsif Catapult exists and LC10_Platoon[29] can navigate to {Catapult}
			clear LC10_Platoon[29] action queue
			a = 0
			begin loop
				Catapult = get siege weapon of player 0 nearest {LC10_Platoon[29]} radius 225
				add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_THING using Catapult to LC10_Platoon[29] action queue
				NumPat1 = get number of villagers in platoon LC10_Platoon[29]
				PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[29]} radius 250
				if PlayerPlatoon1 exists and LC10_Platoon[29] can navigate to {PlayerPlatoon1}
					a = 1
				end if
				until NumPat1 == 0 or Catapult not exists or not LC10_Platoon[29] can navigate to {Catapult} or a == 1 or Catapult not exists
			end loop
			clear LC10_Platoon[29] action queue
			a = 0
		end if
		
		if get size of LC10_Platoon[29] action queue < 1 and FirstTimeRunning == 1
			clear LC10_Platoon[29] action queue
			move LC10_Platoon[29] along WaypointsE with patrol WAYPOINTROUTE_TRAVERSAL_TYPE_FORWARDS
			FirstTimeRunning = 0
		end if
		
		if get size of LC10_Platoon[29] action queue < 1 and {LC10_Platoon[29]} not near {PlatoonPos[15]} and FirstTimeRunning == 0
			clear LC10_Platoon[29] action queue
			add action PLATOON_AGENDA_ACTION_MOVE_TO_POS_AGGRESSIVE using {PlatoonPos[15]} to LC10_Platoon[29] action queue
		end if
		
		until LC10_Platoon[29] not exists
	end loop
end loop

end script LC10_Platoon29Actions

begin script LC10_Platoon30Actions

	oCreature = get player 0 creature
	HeTeste3 = 0
	TestCreature2 = 0
	NumPat = 0
	NumPat5 = 0
	PlayerPlatoon1 = 0
	WorrNum = 0
	oTown = get town with id 0
	oTownCentre = get building ABODE_NUMBER_TOWN_CENTRE in oTown min built 1.0
	ProPlatoonsLocation = 0
	AIPlatoon1 = 0
	Armory = 0
	Town8 = get town with id 8
	RandomActionP3 = 0
	a = 1
	Timer = create timer for 0 seconds
	GreekGateHouse1 = 0
	GreekGateHouse2 = 0
	oWall = 0
	PlayerCatapult1 = 0
	PlayerPlatoonInRange = 0
	
start

begin loop
	a = 1
	wait until LC10_SiegeCatapult[2] exists and LC10_Platoon[30] exists and ({LC10_SiegeCatapult[2]} near {AztecCapital} radius 500)
	disable platoon LC10_Platoon[30] camp
	begin loop
		TestCreature2 = get distance from {LC10_Platoon[30]} to {oCreature}
		if TestCreature2 <= 125 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00 and LC10_Platoon[30] can navigate to {oCreature}
			clear LC10_Platoon[30] action queue
			begin loop
				add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_MOVING_OBJECT using oCreature to LC10_Platoon[30] action queue
				NumPat5 = get number of villagers in platoon LC10_Platoon[30]
				TestCreature2 = get distance from {LC10_Platoon[30]} to {oCreature}
				until NumPat5 == 0 or SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature == 0.00 or not LC10_Platoon[30] can navigate to {oCreature} or TestCreature2 > 125
			end loop
		end if
		PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[30]} radius 125
		PlayerCatapult1 = get siege weapon of player 0 nearest {LC10_Platoon[30]} radius 100
		if PlayerPlatoon1 exists and LC10_Platoon[30] can navigate to {PlayerPlatoon1}
			clear LC10_Platoon[30] action queue
			begin loop
				add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_PLATOON using PlayerPlatoon1 to LC10_Platoon[30] action queue
				NumPat5 = get number of villagers in platoon LC10_Platoon[30]
				HeTeste3 = get number of villagers in platoon PlayerPlatoon1
				until NumPat5 == 0 or HeTeste3 == 0
			end loop
		elsif PlayerCatapult1 exists and LC10_Platoon[30] can navigate to {PlayerCatapult1}
			clear LC10_Platoon[30] action queue
			begin loop
				add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_THING using PlayerCatapult1 to LC10_Platoon[30] action queue
				NumPat5 = get number of villagers in platoon LC10_Platoon[30]
				PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[30]} radius 125
				if PlayerPlatoon1 exists and LC10_Platoon[30] can navigate to {PlayerPlatoon1}
					PlayerPlatoonInRange = 1
				end if
				until NumPat5 == 0 or PlayerCatapult1 not exists or not LC10_Platoon[30] can navigate to {PlayerCatapult1} or PlayerPlatoonInRange == 1
			end loop
			PlayerPlatoonInRange = 0
		end if
		if LC10_SiegeCatapult[2] exists
			clear LC10_Platoon[30] action queue
			add action PLATOON_AGENDA_ACTION_DEFEND_OBJECT using LC10_SiegeCatapult[2] to LC10_Platoon[30] action queue
			begin loop
				TestCreature2 = get distance from {LC10_Platoon[30]} to {oCreature}
				PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[30]} radius 125
				until TestCreature2 <= 125 or PlayerPlatoon1 exists or LC10_Platoon[30] not exists
			end loop
		end if
		until LC10_SiegeCatapult2IsAttacking == 1 or LC10_SiegeCatapult[2] not exists or LC10_Platoon[30] not exists
	end loop
	
	if LC10_SiegeCatapult[2] exists
		begin loop //Attack
			TestCreature2 = get distance from {LC10_Platoon[30]} to {oCreature}
			if TestCreature2 <= 125 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00 and LC10_Platoon[30] can navigate to {oCreature}
				clear LC10_Platoon[30] action queue
				begin loop
					add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_MOVING_OBJECT using oCreature to LC10_Platoon[30] action queue
					NumPat5 = get number of villagers in platoon LC10_Platoon[30]
					TestCreature2 = get distance from {LC10_Platoon[30]} to {oCreature}
					until NumPat5 == 0 or SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature == 0.00 or not LC10_Platoon[30] can navigate to {oCreature} or TestCreature2 > 125
				end loop
			end if
			PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[30]} radius 125
			PlayerCatapult1 = get siege weapon of player 0 nearest {LC10_Platoon[30]} radius 100
			if PlayerPlatoon1 exists and LC10_Platoon[30] can navigate to {PlayerPlatoon1}
				clear LC10_Platoon[30] action queue
				begin loop
					add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_PLATOON using PlayerPlatoon1 to LC10_Platoon[30] action queue
					NumPat5 = get number of villagers in platoon LC10_Platoon[30]
					HeTeste3 = get number of villagers in platoon PlayerPlatoon1
					until NumPat5 == 0 or HeTeste3 == 0
				end loop
			elsif PlayerCatapult1 exists and LC10_Platoon[30] can navigate to {PlayerCatapult1}
				clear LC10_Platoon[30] action queue
				begin loop
					add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_THING using PlayerCatapult1 to LC10_Platoon[30] action queue
					NumPat5 = get number of villagers in platoon LC10_Platoon[30]
					PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[30]} radius 125
					if PlayerPlatoon1 exists and LC10_Platoon[30] can navigate to {PlayerPlatoon1}
						PlayerPlatoonInRange = 1
					end if
					until NumPat5 == 0 or PlayerCatapult1 not exists or not LC10_Platoon[30] can navigate to {PlayerCatapult1} or PlayerPlatoonInRange == 1
				end loop
				PlayerPlatoonInRange = 0
			end if
			if LC10_Platoon[30] can navigate to object oTownCentre
				a = 1
				clear LC10_Platoon[30] action queue
				begin loop
					PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[30]} radius 125
					TestCreature2 = get distance from {LC10_Platoon[30]} to {oCreature}
					set LC10_Platoon[30] attack PlayerTown with severity 0.7 for takeover
					if PlayerPlatoon1 exists or TestCreature2 <= 125 or not LC10_Platoon[30] can navigate to object oTownCentre
						if PlayerPlatoon1 exists
							a = 0
						elsif TestCreature2 <= 125 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00
							a = 0
						elsif not LC10_Platoon[30] can navigate to object oTownCentre
							a = 0
						elsif LC10_Platoon[30] not exists
							a = 0
						end if
					end if
					until a == 0 or LC10_Platoon[30] not exists
				end loop
				clear LC10_Platoon[30] action queue
			elsif LC10_Platoon[30] can navigate to {AttackPos[2]}
				clear LC10_Platoon[30] action queue
				add action PLATOON_AGENDA_ACTION_DEFEND_POSITION using {AttackPos[2]} to LC10_Platoon[30] action queue
			else
				clear LC10_Platoon[30] action queue
				add action PLATOON_AGENDA_ACTION_DEFEND_POSITION using {AttackPos[3]} to LC10_Platoon[30] action queue
			end if
			until LC10_Platoon[30] not exists
		end loop
	else
		add action PLATOON_AGENDA_ACTION_DEFEND_POSITION using {SiegePlatoonPos[2]} to LC10_Platoon[30] action queue
	end if
end loop

end script LC10_Platoon30Actions

begin script LC10_SiegeCatapult2Actions

	PlayerCreature = 0
    PlayerPlatoon1 = 0
	oCreature = get player 0 creature
	NumPat1 = 0
	HeTeste1 = 0
	WorrNum = 0
	Town0 = get town with id 0
	Town5 = get town with id 5
	oTown = get town with id 0
	oTownCentre = get building ABODE_NUMBER_TOWN_CENTRE in Town0 min built 1.0
	Armory = get building ABODE_NUMBER_MELEE_ARMOURY in Town5 min built 1.0
	ArmoryRanged = get building ABODE_NUMBER_RANGED_ARMOURY in Town5 min built 1.0
	Player1Town = 0
	a = 1
	AISiege = 0	
	WaypointMain[17]
	WaypointRouteMain = 0
	Counter = 0
	Town8 = get town with id 8
	Catapult = 0
	AttackingTown = 2
	NumPat5 = 0
	h = 1
	Player0Town0 = 0
	Timer = create timer for 0 seconds
	oWall = 0
	GreekGateHouse1 = 0
	GreekGateHouse2 = 0
	AIPlatoon = 0
	Target = 0
	PointOn = 0
	CatapultMoveTimer1 = 5
	AttackTimer = 0
	ActionTimer = create timer for 0 seconds
	Wall1 = 0
	Wall2 = 0
	House = 0
	SiegeOnPointTimer = create timer for 0 seconds
	SiegeWeaponPoint = 0
	SiegeStucked = 0
	
start

begin loop
	a = 1
	PointOn = 0
	SiegeStucked = 0
	LC10_SiegeCatapult2IsAttacking = 0
	wait until LC10_SiegeCatapult[2] exists and LC10_Platoon[30] exists
	wait 15 seconds
	begin loop
		PlayerCreature = get distance from {LC10_SiegeCatapult[2]} to {oCreature}
		PlayerPlatoon1 = get platoon of player 0 nearest {LC10_SiegeCatapult[2]} radius 125
		Catapult = get siege weapon of player 0 nearest {LC10_SiegeCatapult[2]} radius 125
		
		if PlayerCreature > 10 and PlayerPlatoon1 not exists and Catapult not exists
			if PlayerPlatoon1 not exists
				a = 1
			elsif PlayerCreature > 10 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00
				a = 1
			elsif Catapult not exists
				a = 1
			end if
		end if
		
		if PlayerCreature <= 10 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00
			clear siege weapon LC10_SiegeCatapult[2] action queue
			a = 0
		elsif PlayerPlatoon1 exists and LC10_SiegeCatapult[2] can navigate to {PlayerPlatoon1}
			clear siege weapon LC10_SiegeCatapult[2] action queue
			a = 0
		elsif Catapult exists and LC10_SiegeCatapult[2] can navigate to {Catapult}
			clear siege weapon LC10_SiegeCatapult[2] action queue
			a = 0
		elsif PointOn != 17 and a == 1
			begin loop
				if LC10_SiegeCatapult[2] exists 
					if get SiegeOnPointTimer time remaining <= 0
						SiegeWeaponPoint = marker at {LC10_SiegeCatapult[2]}
						SiegeOnPointTimer = create timer for 65 seconds
					elsif get SiegeOnPointTimer time remaining <= 5
						if {LC10_SiegeCatapult[2]} near {SiegeWeaponPoint} radius 10
							clear siege weapon LC10_SiegeCatapult[2] action queue
							add action SIEGEWEAPON_AGENDA_ACTION_DISBAND using {LC10_SiegeCatapult[3]} to siege weapon LC10_SiegeCatapult[3] action queue//Siege just got stucked. Other possibilities to fix that wasn't successful for me.
							SiegeStucked = 1
						end if
					end if
					if get CatapultMoveTimer1 time remaining <= 0
						if get size of LC10_SiegeCatapult[2] action queue < 1

							if PointOn == 0
								if LC10_SiegeCatapult[2] can navigate to {SiegeRoute3[0]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute3[0]} to siege weapon LC10_SiegeCatapult[2] action queue
								end if
					
							elsif PointOn == 1
								if LC10_SiegeCatapult[2] can navigate to {SiegeRoute3[1]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute3[1]} to siege weapon LC10_SiegeCatapult[2] action queue
								end if

							elsif PointOn == 2
								if LC10_SiegeCatapult[2] can navigate to {SiegeRoute3[2]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute3[2]} to siege weapon LC10_SiegeCatapult[2] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute3[2]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[2] action queue
								end if
								
							elsif PointOn == 3
								if LC10_SiegeCatapult[2] can navigate to {SiegeRoute3[3]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute3[3]} to siege weapon LC10_SiegeCatapult[2] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute3[3]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[2] action queue
								end if
								
							elsif PointOn == 4
								if LC10_SiegeCatapult[2] can navigate to {SiegeRoute3[4]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute3[4]} to siege weapon LC10_SiegeCatapult[2] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute3[4]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[2] action queue
								end if
								
							elsif PointOn == 5
								if LC10_SiegeCatapult[2] can navigate to {SiegeRoute3[5]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute3[5]} to siege weapon LC10_SiegeCatapult[2] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute3[5]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[2] action queue
								end if
								
							elsif PointOn == 6
								if LC10_SiegeCatapult[2] can navigate to {SiegeRoute3[6]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute3[6]} to siege weapon LC10_SiegeCatapult[2] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute3[6]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[2] action queue
								end if
								
							elsif PointOn == 7
								if LC10_SiegeCatapult[2] can navigate to {SiegeRoute3[7]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute3[7]} to siege weapon LC10_SiegeCatapult[2] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute3[7]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[2] action queue
								end if
								
							elsif PointOn == 8
								if LC10_SiegeCatapult[2] can navigate to {SiegeRoute3[8]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute3[8]} to siege weapon LC10_SiegeCatapult[2] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute3[8]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[2] action queue
								end if
								
							elsif PointOn == 9
								if LC10_SiegeCatapult[2] can navigate to {SiegeRoute3[9]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute3[9]} to siege weapon LC10_SiegeCatapult[2] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute3[9]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[2] action queue
								end if
								
							elsif PointOn == 10
								if LC10_SiegeCatapult[2] can navigate to {SiegeRoute3[10]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute3[10]} to siege weapon LC10_SiegeCatapult[2] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute3[10]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[2] action queue
								end if
								
							elsif PointOn == 11
								if LC10_SiegeCatapult[2] can navigate to {SiegeRoute3[11]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute3[11]} to siege weapon LC10_SiegeCatapult[2] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute3[11]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[2] action queue
								end if
								
							elsif PointOn == 12
								if LC10_SiegeCatapult[2] can navigate to {SiegeRoute3[12]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute3[12]} to siege weapon LC10_SiegeCatapult[2] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute3[12]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[2] action queue
								end if
								
							elsif PointOn == 13
								if LC10_SiegeCatapult[2] can navigate to {SiegeRoute3[13]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute3[13]} to siege weapon LC10_SiegeCatapult[2] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute3[13]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[2] action queue
								end if
								
							elsif PointOn == 14
								if LC10_SiegeCatapult[2] can navigate to {SiegeRoute3[14]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute3[14]} to siege weapon LC10_SiegeCatapult[2] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute3[14]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[2] action queue
								end if
								
							elsif PointOn == 15
								if LC10_SiegeCatapult[2] can navigate to {SiegeRoute3[15]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute3[15]} to siege weapon LC10_SiegeCatapult[2] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute3[15]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[2] action queue
								end if
								
							elsif PointOn == 16
								if LC10_SiegeCatapult[2] can navigate to {SiegeRoute3[16]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute3[16]} to siege weapon LC10_SiegeCatapult[2] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute3[16]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[2] action queue
								end if
								
							elsif PointOn == 17
								if LC10_SiegeCatapult[2] can navigate to {SiegeRoute3[17]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute3[17]} to siege weapon LC10_SiegeCatapult[2] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute3[17]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[2] action queue
								end if

							CatapultMoveTimer1 = create timer for 10 seconds
							
							end if
						end if
					end if		

					if {LC10_SiegeCatapult[2]} near {SiegeRoute3[0]} radius 15 and PointOn != 1
						PointOn = 1
					elsif {LC10_SiegeCatapult[2]} near {SiegeRoute3[1]} radius 15 and PointOn != 2
						PointOn = 2
					elsif {LC10_SiegeCatapult[2]} near {SiegeRoute3[2]} radius 15 and PointOn != 3
						PointOn = 3
					elsif {LC10_SiegeCatapult[2]} near {SiegeRoute3[3]} radius 15 and PointOn != 4
						PointOn = 4
					elsif {LC10_SiegeCatapult[2]} near {SiegeRoute3[4]} radius 15 and PointOn != 5
						PointOn = 5
					elsif {LC10_SiegeCatapult[2]} near {SiegeRoute3[5]} radius 15 and PointOn != 6
						PointOn = 6
					elsif {LC10_SiegeCatapult[2]} near {SiegeRoute3[6]} radius 15 and PointOn != 7
						PointOn = 7
					elsif {LC10_SiegeCatapult[2]} near {SiegeRoute3[7]} radius 15 and PointOn != 8
						PointOn = 8
					elsif {LC10_SiegeCatapult[2]} near {SiegeRoute3[8]} radius 15 and PointOn != 9
						PointOn = 9
					elsif {LC10_SiegeCatapult[2]} near {SiegeRoute3[9]} radius 15 and PointOn != 10
						PointOn = 10
					elsif {LC10_SiegeCatapult[2]} near {SiegeRoute3[10]} radius 15 and PointOn != 11
						PointOn = 11
					elsif {LC10_SiegeCatapult[2]} near {SiegeRoute3[11]} radius 15 and PointOn != 12
						PointOn = 12
					elsif {LC10_SiegeCatapult[2]} near {SiegeRoute3[12]} radius 15 and PointOn != 13
						PointOn = 13
					elsif {LC10_SiegeCatapult[2]} near {SiegeRoute3[13]} radius 15 and PointOn != 14
						PointOn = 14
					elsif {LC10_SiegeCatapult[2]} near {SiegeRoute3[14]} radius 15 and PointOn != 15
						PointOn = 15
					elsif {LC10_SiegeCatapult[2]} near {SiegeRoute3[15]} radius 15 and PointOn != 16
						PointOn = 16
					elsif {LC10_SiegeCatapult[2]} near {SiegeRoute3[16]} radius 15 and PointOn != 17
						PointOn = 17
					elsif not LC10_SiegeCatapult[2] can navigate to {SiegeRoute3[16]} and {LC10_SiegeCatapult[2]} near {SiegeRoute3[15]} radius 15 and PointOn != 17
						PointOn = 17
					end if
				end if
			until LC10_SiegeCatapult[2] not exists or PointOn == 17
			end loop
		end if
		
		until PointOn == 17 or LC10_SiegeCatapult[2] not exists
	end loop
	
	wait until VolcanoActivated == 0 and HurricaneActivated == 0
	wait 15 seconds
	
	LC10_SiegeCatapult2IsAttacking = 1
	
	wait 5 seconds
	
	UnderAttack = UnderAttack + 1
	clear siege weapon LC10_SiegeCatapult[2] action queue
	
	begin loop
		if get ActionTimer time remaining <= 0
			clear siege weapon LC10_SiegeCatapult[2] action queue
			ActionTimer = create timer for 10 seconds
			Wall1 = get wall segment nearest {PlayerWallPos} radius 150
			if Wall1 exists and PLAYER of Wall1 == 0
				Target = marker at get target from {LC10_SiegeCatapult[2]} to {Wall1} distance 10 angle 180
				clear siege weapon LC10_SiegeCatapult[2] action queue
				if Wall1 exists
					add action SIEGEWEAPON_AGENDA_ACTION_ATTACK_THING using Wall1 to siege weapon LC10_SiegeCatapult[2] action queue
				end if
			elsif Wall1 not exists
				House = get building HOUSE in PlayerTown min built 0.6
				if House exists and PLAYER of House == 0
					Target = marker at get target from {LC10_SiegeCatapult[2]} to {House} distance 10 angle 180
					clear siege weapon LC10_SiegeCatapult[2] action queue
					if House exists
						add action SIEGEWEAPON_AGENDA_ACTION_ATTACK_THING using House to siege weapon LC10_SiegeCatapult[2] action queue
					end if
				end if
			end if
		end if
		until LC10_SiegeCatapult[2] not exists
	end loop
	
	UnderAttack = UnderAttack - 1
	
	if SiegeStucked == 1
		wait 10 seconds
		if LC10_SiegeCatapult[2] not exists LC10_SiegeCatapult[2] = recruit SIEGE_BALANCE_TYPE_CATAPULT_LEVEL_5 town AztecCapital siege weapon end if
	end if
	
	
end loop

end script LC10_SiegeCatapult2Actions

begin script LC10_SiegeCatapult3Actions

	PlayerCreature = 0
    PlayerPlatoon1 = 0
	oCreature = get player 0 creature
	NumPat1 = 0
	HeTeste1 = 0
	WorrNum = 0
	Town0 = get town with id 0
	Town5 = get town with id 5
	oTown = get town with id 0
	oTownCentre = get building ABODE_NUMBER_TOWN_CENTRE in Town0 min built 1.0
	Armory = get building ABODE_NUMBER_MELEE_ARMOURY in Town5 min built 1.0
	ArmoryRanged = get building ABODE_NUMBER_RANGED_ARMOURY in Town5 min built 1.0
	Player1Town = 0
	a = 1
	AISiege = 0	
	WaypointMain[7]
	WaypointRouteMain = 0
	Counter = 0
	Town8 = get town with id 8
	Catapult = 0
	AttackingTown = 2
	NumPat5 = 0
	h = 1
	Player0Town0 = 0
	Timer = create timer for 0 seconds
	oWall = 0
	GreekGateHouse1 = 0
	GreekGateHouse2 = 0
	AIPlatoon = 0
	Target = 0
	PointOn = 0
	CatapultMoveTimer1 = 5
	AttackTimer = 0
	ActionTimer = create timer for 0 seconds
	Wall1 = 0
	Wall2 = 0
	House = 0
	SiegeOnPointTimer = create timer for 0 seconds
	SiegeWeaponPoint = 0
	SiegeStucked = 0
	
start

begin loop
	a = 1
	PointOn = 0
	SiegeStucked = 0
	wait until LC10_SiegeCatapult[3] exists and LC10_SiegeCatapult[4] exists
	wait 15 seconds
	begin loop
		PlayerCreature = get distance from {LC10_SiegeCatapult[3]} to {oCreature}
		PlayerPlatoon1 = get platoon of player 0 nearest {LC10_SiegeCatapult[3]} radius 125
		Catapult = get siege weapon of player 0 nearest {LC10_SiegeCatapult[3]} radius 125
		
		if PlayerCreature > 10 and PlayerPlatoon1 not exists and Catapult not exists
			if PlayerPlatoon1 not exists
				a = 1
			elsif PlayerCreature > 10 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00
				a = 1
			elsif Catapult not exists
				a = 1
			end if
		end if
		
		if PlayerCreature <= 10 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00
			clear siege weapon LC10_SiegeCatapult[3] action queue
			a = 0
		elsif PlayerPlatoon1 exists and LC10_SiegeCatapult[3] can navigate to {PlayerPlatoon1}
			clear siege weapon LC10_SiegeCatapult[3] action queue
			a = 0
		elsif Catapult exists and LC10_SiegeCatapult[3] can navigate to {Catapult}
			clear siege weapon LC10_SiegeCatapult[3] action queue
			a = 0
		elsif PointOn != 17 and a == 1
			begin loop
				if LC10_SiegeCatapult[3] exists 
					if get SiegeOnPointTimer time remaining <= 0
						SiegeWeaponPoint = marker at {LC10_SiegeCatapult[3]}
						SiegeOnPointTimer = create timer for 65 seconds
					elsif get SiegeOnPointTimer time remaining <= 5
						if {LC10_SiegeCatapult[3]} near {SiegeWeaponPoint} radius 10
							clear siege weapon LC10_SiegeCatapult[3] action queue
							add action SIEGEWEAPON_AGENDA_ACTION_DISBAND using {LC10_SiegeCatapult[3]} to siege weapon LC10_SiegeCatapult[3] action queue//Siege just got stucked. Other possibilities to fix that wasn't successful for me.
							SiegeStucked = 1
						end if
					end if
					if get CatapultMoveTimer1 time remaining <= 0
						if get size of LC10_SiegeCatapult[3] action queue < 1

							if PointOn == 0
								if LC10_SiegeCatapult[3] can navigate to {SiegeRoute4[0]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute4[0]} to siege weapon LC10_SiegeCatapult[3] action queue
								end if
					
							elsif PointOn == 1
								if LC10_SiegeCatapult[3] can navigate to {SiegeRoute4[1]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute4[1]} to siege weapon LC10_SiegeCatapult[3] action queue
								end if

							elsif PointOn == 2
								if LC10_SiegeCatapult[3] can navigate to {SiegeRoute4[2]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute4[2]} to siege weapon LC10_SiegeCatapult[3] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute4[2]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[3] action queue
								end if
								
							elsif PointOn == 3
								if LC10_SiegeCatapult[3] can navigate to {SiegeRoute4[3]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute4[3]} to siege weapon LC10_SiegeCatapult[3] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute4[3]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[3] action queue
								end if
								
							elsif PointOn == 4
								if LC10_SiegeCatapult[3] can navigate to {SiegeRoute4[4]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute4[4]} to siege weapon LC10_SiegeCatapult[3] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute4[4]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[3] action queue
								end if
								
							elsif PointOn == 5
								if LC10_SiegeCatapult[3] can navigate to {SiegeRoute4[5]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute4[5]} to siege weapon LC10_SiegeCatapult[3] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute4[5]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[3] action queue
								end if
								
							elsif PointOn == 6
								if LC10_SiegeCatapult[3] can navigate to {SiegeRoute4[6]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute4[6]} to siege weapon LC10_SiegeCatapult[3] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute4[6]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[3] action queue
								end if
								
							elsif PointOn == 7
								if LC10_SiegeCatapult[3] can navigate to {SiegeRoute4[7]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute4[7]} to siege weapon LC10_SiegeCatapult[3] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute4[7]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[3] action queue
								end if
								
							elsif PointOn == 8
								if LC10_SiegeCatapult[3] can navigate to {SiegeRoute4[8]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute4[8]} to siege weapon LC10_SiegeCatapult[3] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute4[8]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[3] action queue
								end if
								
							elsif PointOn == 9
								if LC10_SiegeCatapult[3] can navigate to {SiegeRoute4[9]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute4[9]} to siege weapon LC10_SiegeCatapult[3] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute4[9]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[3] action queue
								end if
								
							elsif PointOn == 10
								if LC10_SiegeCatapult[3] can navigate to {SiegeRoute4[10]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute4[10]} to siege weapon LC10_SiegeCatapult[3] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute4[10]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[3] action queue
								end if
								
							elsif PointOn == 11
								if LC10_SiegeCatapult[3] can navigate to {SiegeRoute4[11]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute4[11]} to siege weapon LC10_SiegeCatapult[3] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute4[11]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[3] action queue
								end if
								
							elsif PointOn == 12
								if LC10_SiegeCatapult[3] can navigate to {SiegeRoute4[12]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute4[12]} to siege weapon LC10_SiegeCatapult[3] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute4[12]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[3] action queue
								end if
								
							elsif PointOn == 13
								if LC10_SiegeCatapult[3] can navigate to {SiegeRoute4[13]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute4[13]} to siege weapon LC10_SiegeCatapult[3] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute4[13]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[3] action queue
								end if
								
							elsif PointOn == 14
								if LC10_SiegeCatapult[3] can navigate to {SiegeRoute4[14]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute4[14]} to siege weapon LC10_SiegeCatapult[3] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute4[14]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[3] action queue
								end if
								
							elsif PointOn == 15
								if LC10_SiegeCatapult[3] can navigate to {SiegeRoute4[15]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute4[15]} to siege weapon LC10_SiegeCatapult[3] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute4[15]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[3] action queue
								end if
								
							elsif PointOn == 16
								if LC10_SiegeCatapult[3] can navigate to {SiegeRoute4[16]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute4[16]} to siege weapon LC10_SiegeCatapult[3] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute4[16]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[3] action queue
								end if
								
							elsif PointOn == 17
								if LC10_SiegeCatapult[3] can navigate to {SiegeRoute4[17]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute4[17]} to siege weapon LC10_SiegeCatapult[3] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute4[17]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[3] action queue
								end if

							CatapultMoveTimer1 = create timer for 10 seconds
							
							end if
						end if
					end if		

					if {LC10_SiegeCatapult[3]} near {SiegeRoute4[0]} radius 15 and PointOn != 1
						PointOn = 1
					elsif {LC10_SiegeCatapult[3]} near {SiegeRoute4[1]} radius 15 and PointOn != 2
						PointOn = 2
					elsif {LC10_SiegeCatapult[3]} near {SiegeRoute4[2]} radius 15 and PointOn != 3
						PointOn = 3
					elsif {LC10_SiegeCatapult[3]} near {SiegeRoute4[3]} radius 15 and PointOn != 4
						PointOn = 4
					elsif {LC10_SiegeCatapult[3]} near {SiegeRoute4[4]} radius 15 and PointOn != 5
						PointOn = 5
					elsif {LC10_SiegeCatapult[3]} near {SiegeRoute4[5]} radius 15 and PointOn != 6
						PointOn = 6
					elsif {LC10_SiegeCatapult[3]} near {SiegeRoute4[6]} radius 15 and PointOn != 7
						PointOn = 7
					elsif {LC10_SiegeCatapult[3]} near {SiegeRoute4[7]} radius 15 and PointOn != 8
						PointOn = 8
					elsif {LC10_SiegeCatapult[3]} near {SiegeRoute4[8]} radius 15 and PointOn != 9
						PointOn = 9
					elsif {LC10_SiegeCatapult[3]} near {SiegeRoute4[9]} radius 15 and PointOn != 10
						PointOn = 10
					elsif {LC10_SiegeCatapult[3]} near {SiegeRoute4[10]} radius 15 and PointOn != 11
						PointOn = 11
					elsif {LC10_SiegeCatapult[3]} near {SiegeRoute4[11]} radius 15 and PointOn != 12
						PointOn = 12
					elsif {LC10_SiegeCatapult[3]} near {SiegeRoute4[12]} radius 15 and PointOn != 13
						PointOn = 13
					elsif {LC10_SiegeCatapult[3]} near {SiegeRoute4[13]} radius 15 and PointOn != 14
						PointOn = 14
					elsif {LC10_SiegeCatapult[3]} near {SiegeRoute4[14]} radius 15 and PointOn != 15
						PointOn = 15
					elsif {LC10_SiegeCatapult[3]} near {SiegeRoute4[15]} radius 15 and PointOn != 16
						PointOn = 16
					elsif {LC10_SiegeCatapult[3]} near {SiegeRoute4[16]} radius 15 and PointOn != 17
						PointOn = 17
					elsif not LC10_SiegeCatapult[3] can navigate to {SiegeRoute4[16]} and {LC10_SiegeCatapult[3]} near {SiegeRoute4[15]} radius 15 and PointOn != 17
						PointOn = 17
					end if
				end if
			until LC10_SiegeCatapult[3] not exists or PointOn == 17
			end loop
		end if
		
		until PointOn == 17 or LC10_SiegeCatapult[3] not exists
	end loop
	
	wait until VolcanoActivated == 0 and HurricaneActivated == 0
	wait 15 seconds
	
	wait 5 seconds
	
	UnderAttack = UnderAttack + 1
	clear siege weapon LC10_SiegeCatapult[3] action queue
	
	begin loop
		if get ActionTimer time remaining <= 0
			clear siege weapon LC10_SiegeCatapult[3] action queue
			ActionTimer = create timer for 10 seconds
			Wall1 = get wall segment nearest {PlayerWallPos} radius 150
			if Wall1 exists and PLAYER of Wall1 == 0
				Target = marker at get target from {LC10_SiegeCatapult[3]} to {Wall1} distance 10 angle 180
				clear siege weapon LC10_SiegeCatapult[3] action queue
				if Wall1 exists
					add action SIEGEWEAPON_AGENDA_ACTION_ATTACK_THING using Wall1 to siege weapon LC10_SiegeCatapult[3] action queue
				end if
			elsif Wall1 not exists
				House = get building HOUSE in PlayerTown min built 0.6
				if House exists and PLAYER of House == 0
					Target = marker at get target from {LC10_SiegeCatapult[3]} to {House} distance 10 angle 180
					clear siege weapon LC10_SiegeCatapult[3] action queue
					if House exists
						add action SIEGEWEAPON_AGENDA_ACTION_ATTACK_THING using House to siege weapon LC10_SiegeCatapult[3] action queue
					end if
				end if
			end if
		end if
		until LC10_SiegeCatapult[3] not exists
	end loop
	
	UnderAttack = UnderAttack - 1
	
	if SiegeStucked == 1
		wait 10 seconds
		if LC10_SiegeCatapult[3] not exists LC10_SiegeCatapult[3] = recruit SIEGE_BALANCE_TYPE_CATAPULT_LEVEL_5 town AztecCapital siege weapon end if
	end if
	
end loop

end script LC10_SiegeCatapult3Actions

begin script LC10_SiegeCatapult4Actions

	PlayerCreature = 0
    PlayerPlatoon1 = 0
	oCreature = get player 0 creature
	NumPat1 = 0
	HeTeste1 = 0
	WorrNum = 0
	Town0 = get town with id 0
	Town5 = get town with id 5
	oTown = get town with id 0
	oTownCentre = get building ABODE_NUMBER_TOWN_CENTRE in Town0 min built 1.0
	Armory = get building ABODE_NUMBER_MELEE_ARMOURY in Town5 min built 1.0
	ArmoryRanged = get building ABODE_NUMBER_RANGED_ARMOURY in Town5 min built 1.0
	Player1Town = 0
	a = 1
	AISiege = 0	
	WaypointMain[7]
	WaypointRouteMain = 0
	Counter = 0
	Town8 = get town with id 8
	Catapult = 0
	AttackingTown = 2
	NumPat5 = 0
	h = 1
	Player0Town0 = 0
	Timer = create timer for 0 seconds
	oWall = 0
	GreekGateHouse1 = 0
	GreekGateHouse2 = 0
	AIPlatoon = 0
	Target = 0
	PointOn = 0
	CatapultMoveTimer1 = 5
	AttackTimer = 0
	ActionTimer = create timer for 0 seconds
	Wall1 = 0
	Wall2 = 0
	House = 0
	SiegeOnPointTimer = create timer for 0 seconds
	SiegeWeaponPoint = 0
	SiegeStucked = 0
	
start

begin loop
	a = 1
	PointOn = 0
	SiegeStucked = 0
	wait until LC10_SiegeCatapult[3] exists and LC10_SiegeCatapult[4] exists
	wait 15 seconds
	begin loop
		PlayerCreature = get distance from {LC10_SiegeCatapult[4]} to {oCreature}
		PlayerPlatoon1 = get platoon of player 0 nearest {LC10_SiegeCatapult[4]} radius 125
		Catapult = get siege weapon of player 0 nearest {LC10_SiegeCatapult[4]} radius 125
		
		if PlayerCreature > 10 and PlayerPlatoon1 not exists and Catapult not exists
			if PlayerPlatoon1 not exists
				a = 1
			elsif PlayerCreature > 10 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00
				a = 1
			elsif Catapult not exists
				a = 1
			end if
		end if
		
		if PlayerCreature <= 10 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00
			clear siege weapon LC10_SiegeCatapult[4] action queue
			a = 0
		elsif PlayerPlatoon1 exists and LC10_SiegeCatapult[4] can navigate to {PlayerPlatoon1}
			clear siege weapon LC10_SiegeCatapult[4] action queue
			a = 0
		elsif Catapult exists and LC10_SiegeCatapult[4] can navigate to {Catapult}
			clear siege weapon LC10_SiegeCatapult[4] action queue
			a = 0
		elsif PointOn != 17 and a == 1
			begin loop
				if LC10_SiegeCatapult[4] exists 
					if get SiegeOnPointTimer time remaining <= 0
						SiegeWeaponPoint = marker at {LC10_SiegeCatapult[4]}
						SiegeOnPointTimer = create timer for 65 seconds
					elsif get SiegeOnPointTimer time remaining <= 5
						if {LC10_SiegeCatapult[4]} near {SiegeWeaponPoint} radius 10
							clear siege weapon LC10_SiegeCatapult[4] action queue
							add action SIEGEWEAPON_AGENDA_ACTION_DISBAND using {LC10_SiegeCatapult[4]} to siege weapon LC10_SiegeCatapult[4] action queue//Siege just got stucked. Other possibilities to fix that wasn't successful for me.
							SiegeStucked = 1
						end if
					end if
					if get CatapultMoveTimer1 time remaining <= 0
						if get size of LC10_SiegeCatapult[4] action queue < 1

							if PointOn == 0
								if LC10_SiegeCatapult[4] can navigate to {SiegeRoute5[0]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute5[0]} to siege weapon LC10_SiegeCatapult[4] action queue
								end if
					
							elsif PointOn == 1
								if LC10_SiegeCatapult[4] can navigate to {SiegeRoute5[1]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute5[1]} to siege weapon LC10_SiegeCatapult[4] action queue
								end if

							elsif PointOn == 2
								if LC10_SiegeCatapult[4] can navigate to {SiegeRoute5[2]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute5[2]} to siege weapon LC10_SiegeCatapult[4] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute5[2]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[4] action queue
								end if
								
							elsif PointOn == 3
								if LC10_SiegeCatapult[4] can navigate to {SiegeRoute5[3]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute5[3]} to siege weapon LC10_SiegeCatapult[4] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute5[3]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[4] action queue
								end if
								
							elsif PointOn == 4
								if LC10_SiegeCatapult[4] can navigate to {SiegeRoute5[4]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute5[4]} to siege weapon LC10_SiegeCatapult[4] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute5[4]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[4] action queue
								end if
								
							elsif PointOn == 5
								if LC10_SiegeCatapult[4] can navigate to {SiegeRoute5[5]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute5[5]} to siege weapon LC10_SiegeCatapult[4] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute5[5]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[4] action queue
								end if
								
							elsif PointOn == 6
								if LC10_SiegeCatapult[4] can navigate to {SiegeRoute5[6]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute5[6]} to siege weapon LC10_SiegeCatapult[4] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute5[6]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[4] action queue
								end if
								
							elsif PointOn == 7
								if LC10_SiegeCatapult[4] can navigate to {SiegeRoute5[7]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute5[7]} to siege weapon LC10_SiegeCatapult[4] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute5[7]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[4] action queue
								end if
								
							elsif PointOn == 8
								if LC10_SiegeCatapult[4] can navigate to {SiegeRoute5[8]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute5[8]} to siege weapon LC10_SiegeCatapult[4] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute5[8]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[4] action queue
								end if
								
							elsif PointOn == 9
								if LC10_SiegeCatapult[4] can navigate to {SiegeRoute5[9]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute5[9]} to siege weapon LC10_SiegeCatapult[4] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute5[9]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[4] action queue
								end if
								
							elsif PointOn == 10
								if LC10_SiegeCatapult[4] can navigate to {SiegeRoute5[10]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute5[10]} to siege weapon LC10_SiegeCatapult[4] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute5[10]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[4] action queue
								end if
								
							elsif PointOn == 11
								if LC10_SiegeCatapult[4] can navigate to {SiegeRoute5[11]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute5[11]} to siege weapon LC10_SiegeCatapult[4] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute5[11]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[4] action queue
								end if
								
							elsif PointOn == 12
								if LC10_SiegeCatapult[4] can navigate to {SiegeRoute5[12]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute5[12]} to siege weapon LC10_SiegeCatapult[4] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute5[12]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[4] action queue
								end if
								
							elsif PointOn == 13
								if LC10_SiegeCatapult[4] can navigate to {SiegeRoute5[13]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute5[13]} to siege weapon LC10_SiegeCatapult[4] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute5[13]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[4] action queue
								end if
								
							elsif PointOn == 14
								if LC10_SiegeCatapult[4] can navigate to {SiegeRoute5[14]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute5[14]} to siege weapon LC10_SiegeCatapult[4] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute5[14]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[4] action queue
								end if
								
							elsif PointOn == 15
								if LC10_SiegeCatapult[4] can navigate to {SiegeRoute5[15]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute5[15]} to siege weapon LC10_SiegeCatapult[4] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute5[15]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[4] action queue
								end if
								
							elsif PointOn == 16
								if LC10_SiegeCatapult[4] can navigate to {SiegeRoute5[16]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute5[16]} to siege weapon LC10_SiegeCatapult[4] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute5[16]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[4] action queue
								end if
								
							elsif PointOn == 17
								if LC10_SiegeCatapult[4] can navigate to {SiegeRoute5[17]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute5[17]} to siege weapon LC10_SiegeCatapult[4] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute5[17]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[4] action queue
								end if

							CatapultMoveTimer1 = create timer for 10 seconds
							
							end if
						end if
					end if		

					if {LC10_SiegeCatapult[4]} near {SiegeRoute5[0]} radius 15 and PointOn != 1
						PointOn = 1
					elsif {LC10_SiegeCatapult[4]} near {SiegeRoute5[1]} radius 15 and PointOn != 2
						PointOn = 2
					elsif {LC10_SiegeCatapult[4]} near {SiegeRoute5[2]} radius 15 and PointOn != 3
						PointOn = 3
					elsif {LC10_SiegeCatapult[4]} near {SiegeRoute5[3]} radius 15 and PointOn != 4
						PointOn = 4
					elsif {LC10_SiegeCatapult[4]} near {SiegeRoute5[4]} radius 15 and PointOn != 5
						PointOn = 5
					elsif {LC10_SiegeCatapult[4]} near {SiegeRoute5[5]} radius 15 and PointOn != 6
						PointOn = 6
					elsif {LC10_SiegeCatapult[4]} near {SiegeRoute5[6]} radius 15 and PointOn != 7
						PointOn = 7
					elsif {LC10_SiegeCatapult[4]} near {SiegeRoute5[7]} radius 15 and PointOn != 8
						PointOn = 8
					elsif {LC10_SiegeCatapult[4]} near {SiegeRoute5[8]} radius 15 and PointOn != 9
						PointOn = 9
					elsif {LC10_SiegeCatapult[4]} near {SiegeRoute5[9]} radius 15 and PointOn != 10
						PointOn = 10
					elsif {LC10_SiegeCatapult[4]} near {SiegeRoute5[10]} radius 15 and PointOn != 11
						PointOn = 11
					elsif {LC10_SiegeCatapult[4]} near {SiegeRoute5[11]} radius 15 and PointOn != 12
						PointOn = 12
					elsif {LC10_SiegeCatapult[4]} near {SiegeRoute5[12]} radius 15 and PointOn != 13
						PointOn = 13
					elsif {LC10_SiegeCatapult[4]} near {SiegeRoute5[13]} radius 15 and PointOn != 14
						PointOn = 14
					elsif {LC10_SiegeCatapult[4]} near {SiegeRoute5[14]} radius 15 and PointOn != 15
						PointOn = 15
					elsif {LC10_SiegeCatapult[4]} near {SiegeRoute5[15]} radius 15 and PointOn != 16
						PointOn = 16
					elsif {LC10_SiegeCatapult[4]} near {SiegeRoute5[16]} radius 15 and PointOn != 17
						PointOn = 17
					elsif not LC10_SiegeCatapult[4] can navigate to {SiegeRoute5[16]} and {LC10_SiegeCatapult[4]} near {SiegeRoute5[15]} radius 15 and PointOn != 17
						PointOn = 17
					end if
				end if
			until LC10_SiegeCatapult[4] not exists or PointOn == 17
			end loop
		end if
		
		until PointOn == 17 or LC10_SiegeCatapult[4] not exists
	end loop
	
	wait until VolcanoActivated == 0 and HurricaneActivated == 0
	wait 15 seconds
	
	wait 5 seconds
	
	UnderAttack = UnderAttack + 1
	clear siege weapon LC10_SiegeCatapult[4] action queue
	
	begin loop
		if get ActionTimer time remaining <= 0
			clear siege weapon LC10_SiegeCatapult[4] action queue
			ActionTimer = create timer for 10 seconds
			Wall1 = get wall segment nearest {PlayerWallPos} radius 150
			if Wall1 exists and PLAYER of Wall1 == 0
				Target = marker at get target from {LC10_SiegeCatapult[4]} to {Wall1} distance 10 angle 180
				clear siege weapon LC10_SiegeCatapult[4] action queue
				if Wall1 exists
					add action SIEGEWEAPON_AGENDA_ACTION_ATTACK_THING using Wall1 to siege weapon LC10_SiegeCatapult[4] action queue
				end if
			elsif Wall1 not exists
				House = get building HOUSE in PlayerTown min built 0.6
				if House exists and PLAYER of House == 0
					Target = marker at get target from {LC10_SiegeCatapult[4]} to {House} distance 10 angle 180
					clear siege weapon LC10_SiegeCatapult[4] action queue
					if House exists
						add action SIEGEWEAPON_AGENDA_ACTION_ATTACK_THING using House to siege weapon LC10_SiegeCatapult[4] action queue
					end if
				end if
			end if
		end if
		until LC10_SiegeCatapult[4] not exists
	end loop
	
	UnderAttack = UnderAttack - 1
	
	if SiegeStucked == 1
		wait 10 seconds
		if LC10_SiegeCatapult[4] not exists LC10_SiegeCatapult[4] = recruit SIEGE_BALANCE_TYPE_CATAPULT_LEVEL_5 town AztecCapital siege weapon end if
	end if
	
end loop

end script LC10_SiegeCatapult4Actions

begin script LC10_Platoon31Actions

	oCreature = get player 0 creature
	HeTeste3 = 0
	TestCreature2 = 0
	NumPat = 0
	NumPat5 = 0
	PlayerPlatoon1 = 0
	WorrNum = 0
	oTown = get town with id 0
	oTownCentre = get building ABODE_NUMBER_TOWN_CENTRE in oTown min built 1.0
	ProPlatoonsLocation = 0
	AIPlatoon1 = 0
	Armory = 0
	Town8 = get town with id 8
	RandomActionP3 = 0
	a = 1
	Timer = create timer for 0 seconds
	GreekGateHouse1 = 0
	GreekGateHouse2 = 0
	oWall = 0
	PlayerCatapult1 = 0
	PlayerPlatoonInRange = 0
	
start

begin loop
	a = 1
	wait until LC10_Platoon[31] exists and LC10_Platoon[32] exists
	begin loop
		TestCreature2 = get distance from {LC10_Platoon[31]} to {oCreature}
		if TestCreature2 <= 350 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00 and LC10_Platoon[31] can navigate to {oCreature}
			clear LC10_Platoon[31] action queue
			begin loop
				add action PLATOON_AGENDA_ACTION_RANGED_ATTACK using oCreature to LC10_Platoon[31] action queue
				NumPat5 = get number of villagers in platoon LC10_Platoon[31]
				TestCreature2 = get distance from {LC10_Platoon[31]} to {oCreature}
				until NumPat5 == 0 or SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature == 0.00 or not LC10_Platoon[31] can navigate to {oCreature} or TestCreature2 > 350
			end loop
		end if
		PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[31]} radius 350
		PlayerCatapult1 = get siege weapon of player 0 nearest {LC10_Platoon[31]} radius 325
		if PlayerPlatoon1 exists and LC10_Platoon[31] can navigate to {PlayerPlatoon1}
			clear LC10_Platoon[31] action queue
			begin loop
				add action PLATOON_AGENDA_ACTION_RANGED_ATTACK using PlayerPlatoon1 to LC10_Platoon[31] action queue
				NumPat5 = get number of villagers in platoon LC10_Platoon[31]
				HeTeste3 = get number of villagers in platoon PlayerPlatoon1
				until NumPat5 == 0 or HeTeste3 == 0
			end loop
		elsif PlayerCatapult1 exists and LC10_Platoon[31] can navigate to {PlayerCatapult1}
			clear LC10_Platoon[31] action queue
			begin loop
				add action PLATOON_AGENDA_ACTION_RANGED_ATTACK using PlayerCatapult1 to LC10_Platoon[31] action queue
				NumPat5 = get number of villagers in platoon LC10_Platoon[31]
				PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[31]} radius 350
				if PlayerPlatoon1 exists and LC10_Platoon[31] can navigate to {PlayerPlatoon1}
					PlayerPlatoonInRange = 1
				end if
				until NumPat5 == 0 or PlayerCatapult1 not exists or not LC10_Platoon[31] can navigate to {PlayerCatapult1} or PlayerPlatoonInRange == 1
			end loop
			PlayerPlatoonInRange = 0
		end if
		if LC10_Platoon[31] can navigate to ({AttackPos[1]} + {4.00,0.00,4.00}) and get size of LC10_Platoon[31] action queue < 1
			clear LC10_Platoon[31] action queue
			add action PLATOON_AGENDA_ACTION_DEFEND_POSITION using ({AttackPos[1]} + {4.00,0.00,4.00}) to LC10_Platoon[31] action queue
		end if
		until LC10_Platoon[31] not exists or {LC10_Platoon[31]} near ({AttackPos[1]} + {4.00,0.00,4.00})
	end loop
	
	wait until VolcanoActivated == 0 and HurricaneActivated == 0
	
	begin loop //Attack
		TestCreature2 = get distance from {LC10_Platoon[31]} to {oCreature}
		if TestCreature2 <= 350 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00 and LC10_Platoon[31] can navigate to {oCreature}
			clear LC10_Platoon[31] action queue
			begin loop
				add action PLATOON_AGENDA_ACTION_RANGED_ATTACK using oCreature to LC10_Platoon[31] action queue
				NumPat5 = get number of villagers in platoon LC10_Platoon[31]
				TestCreature2 = get distance from {LC10_Platoon[31]} to {oCreature}
				until NumPat5 == 0 or SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature == 0.00 or not LC10_Platoon[31] can navigate to {oCreature} or TestCreature2 > 350
			end loop
		end if
		PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[31]} radius 350
		PlayerCatapult1 = get siege weapon of player 0 nearest {LC10_Platoon[31]} radius 325
		if PlayerPlatoon1 exists and LC10_Platoon[31] can navigate to {PlayerPlatoon1}
			clear LC10_Platoon[31] action queue
			begin loop
				add action PLATOON_AGENDA_ACTION_RANGED_ATTACK using PlayerPlatoon1 to LC10_Platoon[31] action queue
				NumPat5 = get number of villagers in platoon LC10_Platoon[31]
				HeTeste3 = get number of villagers in platoon PlayerPlatoon1
				until NumPat5 == 0 or HeTeste3 == 0
			end loop
		elsif PlayerCatapult1 exists and LC10_Platoon[31] can navigate to {PlayerCatapult1}
			clear LC10_Platoon[31] action queue
			begin loop
				add action PLATOON_AGENDA_ACTION_RANGED_ATTACK using PlayerCatapult1 to LC10_Platoon[31] action queue
				NumPat5 = get number of villagers in platoon LC10_Platoon[31]
				PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[31]} radius 350
				if PlayerPlatoon1 exists and LC10_Platoon[31] can navigate to {PlayerPlatoon1}
					PlayerPlatoonInRange = 1
				end if
				until NumPat5 == 0 or PlayerCatapult1 not exists or not LC10_Platoon[31] can navigate to {PlayerCatapult1} or PlayerPlatoonInRange == 1
			end loop
			PlayerPlatoonInRange = 0
		end if
		if LC10_Platoon[31] can navigate to object oTownCentre
			a = 1
			clear LC10_Platoon[31] action queue
			begin loop
				PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[31]} radius 350
				TestCreature2 = get distance from {LC10_Platoon[31]} to {oCreature}
				set LC10_Platoon[31] attack PlayerTown with severity 0.7 for takeover
				if PlayerPlatoon1 exists or TestCreature2 <= 350 or not LC10_Platoon[31] can navigate to object oTownCentre
					if PlayerPlatoon1 exists
						a = 0
					elsif TestCreature2 <= 350 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00
						a = 0
					elsif not LC10_Platoon[31] can navigate to object oTownCentre
						a = 0
					elsif LC10_Platoon[31] not exists
						a = 0
					end if
				end if
				until a == 0 or LC10_Platoon[31] not exists
			end loop
			clear LC10_Platoon[31] action queue
		elsif LC10_Platoon[31] can navigate to ({AttackPos[1]} + {4.00,0.00,4.00})
			clear LC10_Platoon[31] action queue
			add action PLATOON_AGENDA_ACTION_DEFEND_POSITION using ({AttackPos[1]} + {4.00,0.00,4.00}) to LC10_Platoon[31] action queue
		end if
		until LC10_Platoon[31] not exists
	end loop
end loop

end script LC10_Platoon31Actions

begin script LC10_Platoon32Actions

	oCreature = get player 0 creature
	HeTeste3 = 0
	TestCreature2 = 0
	NumPat = 0
	NumPat5 = 0
	PlayerPlatoon1 = 0
	WorrNum = 0
	oTown = get town with id 0
	oTownCentre = get building ABODE_NUMBER_TOWN_CENTRE in oTown min built 1.0
	ProPlatoonsLocation = 0
	AIPlatoon1 = 0
	Armory = 0
	Town8 = get town with id 8
	RandomActionP3 = 0
	a = 1
	Timer = create timer for 0 seconds
	GreekGateHouse1 = 0
	GreekGateHouse2 = 0
	oWall = 0
	PlayerCatapult1 = 0
	PlayerPlatoonInRange = 0
	
start

begin loop
	a = 1
	wait until LC10_Platoon[31] exists and LC10_Platoon[32] exists
	begin loop
		TestCreature2 = get distance from {LC10_Platoon[32]} to {oCreature}
		if TestCreature2 <= 350 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00 and LC10_Platoon[32] can navigate to {oCreature}
			clear LC10_Platoon[32] action queue
			begin loop
				add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_MOVING_OBJECT using oCreature to LC10_Platoon[32] action queue
				NumPat5 = get number of villagers in platoon LC10_Platoon[32]
				TestCreature2 = get distance from {LC10_Platoon[30]} to {oCreature}
				until NumPat5 == 0 or SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature == 0.00 or not LC10_Platoon[32] can navigate to {oCreature} or TestCreature2 > 350
			end loop
		end if
		PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[32]} radius 350
		PlayerCatapult1 = get siege weapon of player 0 nearest {LC10_Platoon[32]} radius 325
		if PlayerPlatoon1 exists and LC10_Platoon[32] can navigate to {PlayerPlatoon1}
			clear LC10_Platoon[32] action queue
			begin loop
				add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_PLATOON using PlayerPlatoon1 to LC10_Platoon[32] action queue
				NumPat5 = get number of villagers in platoon LC10_Platoon[32]
				HeTeste3 = get number of villagers in platoon PlayerPlatoon1
				until NumPat5 == 0 or HeTeste3 == 0
			end loop
		elsif PlayerCatapult1 exists and LC10_Platoon[32] can navigate to {PlayerCatapult1}
			clear LC10_Platoon[32] action queue
			begin loop
				add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_THING using PlayerCatapult1 to LC10_Platoon[32] action queue
				NumPat5 = get number of villagers in platoon LC10_Platoon[32]
				PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[32]} radius 350
				if PlayerPlatoon1 exists and LC10_Platoon[32] can navigate to {PlayerPlatoon1}
					PlayerPlatoonInRange = 1
				end if
				until NumPat5 == 0 or PlayerCatapult1 not exists or not LC10_Platoon[32] can navigate to {PlayerCatapult1} or PlayerPlatoonInRange == 1
			end loop
			PlayerPlatoonInRange = 0
		end if
		if LC10_Platoon[32] can navigate to ({AttackPos[3]} + {4.00,0.00,4.00}) and get size of LC10_Platoon[32] action queue < 1
			clear LC10_Platoon[32] action queue
			add action PLATOON_AGENDA_ACTION_DEFEND_POSITION using ({AttackPos[3]} + {4.00,0.00,4.00}) to LC10_Platoon[32] action queue
		end if
		until LC10_Platoon[32] not exists or {LC10_Platoon[32]} near ({AttackPos[3]} + {4.00,0.00,4.00})
	end loop
	
	wait until VolcanoActivated == 0 and HurricaneActivated == 0
	
	begin loop //Attack
		TestCreature2 = get distance from {LC10_Platoon[32]} to {oCreature}
		if TestCreature2 <= 350 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00 and LC10_Platoon[32] can navigate to {oCreature}
			clear LC10_Platoon[32] action queue
			begin loop
				add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_MOVING_OBJECT using oCreature to LC10_Platoon[32] action queue
				NumPat5 = get number of villagers in platoon LC10_Platoon[32]
				TestCreature2 = get distance from {LC10_Platoon[30]} to {oCreature}
				until NumPat5 == 0 or SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature == 0.00 or not LC10_Platoon[32] can navigate to {oCreature} or TestCreature2 > 350
			end loop
		end if
		PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[32]} radius 350
		PlayerCatapult1 = get siege weapon of player 0 nearest {LC10_Platoon[32]} radius 325
		if PlayerPlatoon1 exists and LC10_Platoon[32] can navigate to {PlayerPlatoon1}
			clear LC10_Platoon[32] action queue
			begin loop
				add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_PLATOON using PlayerPlatoon1 to LC10_Platoon[32] action queue
				NumPat5 = get number of villagers in platoon LC10_Platoon[32]
				HeTeste3 = get number of villagers in platoon PlayerPlatoon1
				until NumPat5 == 0 or HeTeste3 == 0
			end loop
		elsif PlayerCatapult1 exists and LC10_Platoon[32] can navigate to {PlayerCatapult1}
			clear LC10_Platoon[32] action queue
			begin loop
				add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_THING using PlayerCatapult1 to LC10_Platoon[32] action queue
				NumPat5 = get number of villagers in platoon LC10_Platoon[32]
				PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[32]} radius 350
				if PlayerPlatoon1 exists and LC10_Platoon[32] can navigate to {PlayerPlatoon1}
					PlayerPlatoonInRange = 1
				end if
				until NumPat5 == 0 or PlayerCatapult1 not exists or not LC10_Platoon[32] can navigate to {PlayerCatapult1} or PlayerPlatoonInRange == 1
			end loop
			PlayerPlatoonInRange = 0
		end if
		if LC10_Platoon[32] can navigate to object oTownCentre
			a = 1
			clear LC10_Platoon[32] action queue
			begin loop
				PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[32]} radius 350
				TestCreature2 = get distance from {LC10_Platoon[32]} to {oCreature}
				set LC10_Platoon[32] attack PlayerTown with severity 0.7 for takeover
				if PlayerPlatoon1 exists or TestCreature2 <= 350 or not LC10_Platoon[32] can navigate to object oTownCentre
					if PlayerPlatoon1 exists
						a = 0
					elsif TestCreature2 <= 350 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00
						a = 0
					elsif not LC10_Platoon[32] can navigate to object oTownCentre
						a = 0
					elsif LC10_Platoon[32] not exists
						a = 0
					end if
				end if
				until a == 0 or LC10_Platoon[32] not exists
			end loop
			clear LC10_Platoon[32] action queue
		elsif LC10_Platoon[32] can navigate to ({AttackPos[3]} + {4.00,0.00,4.00})
			clear LC10_Platoon[32] action queue
			add action PLATOON_AGENDA_ACTION_DEFEND_POSITION using ({AttackPos[3]} + {4.00,0.00,4.00}) to LC10_Platoon[32] action queue
		end if
		until LC10_Platoon[32] not exists
	end loop
end loop

end script LC10_Platoon32Actions

begin script LC10_SiegeCatapult5Actions

	PlayerCreature = 0
    PlayerPlatoon1 = 0
	oCreature = get player 0 creature
	NumPat1 = 0
	HeTeste1 = 0
	WorrNum = 0
	Town0 = get town with id 0
	Town5 = get town with id 5
	oTown = get town with id 0
	oTownCentre = get building ABODE_NUMBER_TOWN_CENTRE in Town0 min built 1.0
	Armory = get building ABODE_NUMBER_MELEE_ARMOURY in Town5 min built 1.0
	ArmoryRanged = get building ABODE_NUMBER_RANGED_ARMOURY in Town5 min built 1.0
	Player1Town = 0
	a = 1
	AISiege = 0	
	WaypointMain[7]
	WaypointRouteMain = 0
	Counter = 0
	Town8 = get town with id 8
	Catapult = 0
	AttackingTown = 2
	NumPat5 = 0
	h = 1
	Player0Town0 = 0
	Timer = create timer for 0 seconds
	oWall = 0
	GreekGateHouse1 = 0
	GreekGateHouse2 = 0
	AIPlatoon = 0
	Target = 0
	PointOn = 0
	CatapultMoveTimer1 = 5
	AttackTimer = 0
	ActionTimer = create timer for 0 seconds
	Wall1 = 0
	Wall2 = 0
	House = 0
	SiegeOnPointTimer = create timer for 0 seconds
	SiegeWeaponPoint = 0
	SiegeStucked = 0
	
start

begin loop
	a = 1
	PointOn = 0
	SiegeStucked = 0
	wait 15 seconds
	begin loop
		PlayerCreature = get distance from {LC10_SiegeCatapult[5]} to {oCreature}
		PlayerPlatoon1 = get platoon of player 0 nearest {LC10_SiegeCatapult[5]} radius 125
		Catapult = get siege weapon of player 0 nearest {LC10_SiegeCatapult[5]} radius 125
		
		if PlayerCreature > 10 and PlayerPlatoon1 not exists and Catapult not exists
			if PlayerPlatoon1 not exists
				a = 1
			elsif PlayerCreature > 10 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00
				a = 1
			elsif Catapult not exists
				a = 1
			end if
		end if
		
		if PlayerCreature <= 10 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00
			clear siege weapon LC10_SiegeCatapult[5] action queue
			a = 0
		elsif PlayerPlatoon1 exists and LC10_SiegeCatapult[5] can navigate to {PlayerPlatoon1}
			clear siege weapon LC10_SiegeCatapult[5] action queue
			a = 0
		elsif Catapult exists and LC10_SiegeCatapult[5] can navigate to {Catapult}
			clear siege weapon LC10_SiegeCatapult[5] action queue
			a = 0
		elsif PointOn != 3 and a == 1
			begin loop
				if LC10_SiegeCatapult[5] exists 
					if get SiegeOnPointTimer time remaining <= 0
						SiegeWeaponPoint = marker at {LC10_SiegeCatapult[5]}
						SiegeOnPointTimer = create timer for 65 seconds
					elsif get SiegeOnPointTimer time remaining <= 5
						if {LC10_SiegeCatapult[5]} near {SiegeWeaponPoint} radius 10
							clear siege weapon LC10_SiegeCatapult[5] action queue
							add action SIEGEWEAPON_AGENDA_ACTION_DISBAND using {LC10_SiegeCatapult[5]} to siege weapon LC10_SiegeCatapult[5] action queue//Siege just got stucked. Other possibilities to fix that wasn't successful for me.
							SiegeStucked = 1
						end if
					end if
					if get CatapultMoveTimer1 time remaining <= 0
						if get size of LC10_SiegeCatapult[5] action queue < 1

							if PointOn == 0
								if LC10_SiegeCatapult[5] can navigate to ({SiegeRoute1[0]} + {3.00,0.00,3.00})
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using ({SiegeRoute1[0]} + {3.00,0.00,3.00}) to siege weapon LC10_SiegeCatapult[5] action queue
								end if
					
							elsif PointOn == 1
								if LC10_SiegeCatapult[5] can navigate to ({SiegeRoute1[1]} + {3.00,0.00,3.00})
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using ({SiegeRoute1[1]} + {3.00,0.00,3.00}) to siege weapon LC10_SiegeCatapult[5] action queue
								end if

							elsif PointOn == 2
								if LC10_SiegeCatapult[5] can navigate to ({SiegeRoute1[2]} + {3.00,0.00,3.00})
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using ({SiegeRoute1[2]} + {3.00,0.00,3.00}) to siege weapon LC10_SiegeCatapult[5] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using ({SiegeRoute1[1]} + {3.00,0.00,3.00}) to siege weapon LC10_SiegeCatapult[5] action queue
								end if

							CatapultMoveTimer1 = create timer for 10 seconds
							
							end if
						end if
					end if		

					if {LC10_SiegeCatapult[5]} near ({SiegeRoute1[0]} + {3.00,0.00,3.00}) radius 15 and PointOn != 1
						PointOn = 1
					elsif {LC10_SiegeCatapult[5]} near ({SiegeRoute1[1]} + {3.00,0.00,3.00}) radius 15 and PointOn != 2
						PointOn = 2
					elsif {LC10_SiegeCatapult[5]} near ({SiegeRoute1[2]} + {3.00,0.00,3.00}) radius 15 and PointOn != 3
						PointOn = 3
					elsif not LC10_SiegeCatapult[5] can navigate to ({SiegeRoute1[2]} + {3.00,0.00,3.00}) and {LC10_SiegeCatapult[5]} near ({SiegeRoute1[1]} + {3.00,0.00,3.00}) radius 15 and PointOn != 3
						PointOn = 3
					end if
				end if
			until LC10_SiegeCatapult[5] not exists or PointOn == 3 or 180 seconds
			end loop
		end if
		
		until PointOn == 3 or LC10_SiegeCatapult[5] not exists or 180 seconds
	end loop
	
	wait until VolcanoActivated == 0 and HurricaneActivated == 0
	wait 15 seconds
	
	wait 5 seconds
	
	UnderAttack = UnderAttack + 1
	clear siege weapon LC10_SiegeCatapult[5] action queue
	
	begin loop
		if get ActionTimer time remaining <= 0
			clear siege weapon LC10_SiegeCatapult[5] action queue
			ActionTimer = create timer for 10 seconds
			Wall1 = get wall segment nearest {PlayerWallPos} radius 150
			if Wall1 exists and PLAYER of Wall1 == 0
				Target = marker at get target from {LC10_SiegeCatapult[5]} to {Wall1} distance 10 angle 180
				clear siege weapon LC10_SiegeCatapult[5] action queue
				if Wall1 exists
					add action SIEGEWEAPON_AGENDA_ACTION_ATTACK_THING using Wall1 to siege weapon LC10_SiegeCatapult[5] action queue
				end if
			elsif Wall1 not exists
				House = get building HOUSE in PlayerTown min built 0.6
				if House exists and PLAYER of House == 0
					Target = marker at get target from {LC10_SiegeCatapult[5]} to {House} distance 10 angle 180
					clear siege weapon LC10_SiegeCatapult[5] action queue
					if House exists
						add action SIEGEWEAPON_AGENDA_ACTION_ATTACK_THING using House to siege weapon LC10_SiegeCatapult[5] action queue
					end if
				end if
			end if
		end if
		until LC10_SiegeCatapult[5] not exists
	end loop
	
	UnderAttack = UnderAttack - 1
	
	if SiegeStucked == 1
		wait 10 seconds
		if LC10_SiegeCatapult[5] not exists LC10_SiegeCatapult[5] = recruit SIEGE_BALANCE_TYPE_CATAPULT_LEVEL_5 town AztecFirstTown siege weapon end if
	end if
	
end loop

end script LC10_SiegeCatapult5Actions

begin script LC10_SiegeCatapult6Actions

	PlayerCreature = 0
    PlayerPlatoon1 = 0
	oCreature = get player 0 creature
	NumPat1 = 0
	HeTeste1 = 0
	WorrNum = 0
	Town0 = get town with id 0
	Town5 = get town with id 5
	oTown = get town with id 0
	oTownCentre = get building ABODE_NUMBER_TOWN_CENTRE in Town0 min built 1.0
	Armory = get building ABODE_NUMBER_MELEE_ARMOURY in Town5 min built 1.0
	ArmoryRanged = get building ABODE_NUMBER_RANGED_ARMOURY in Town5 min built 1.0
	Player1Town = 0
	a = 1
	AISiege = 0	
	WaypointMain[7]
	WaypointRouteMain = 0
	Counter = 0
	Town8 = get town with id 8
	Catapult = 0
	AttackingTown = 2
	NumPat5 = 0
	h = 1
	Player0Town0 = 0
	Timer = create timer for 0 seconds
	oWall = 0
	GreekGateHouse1 = 0
	GreekGateHouse2 = 0
	AIPlatoon = 0
	Target = 0
	PointOn = 0
	CatapultMoveTimer1 = 5
	AttackTimer = 0
	ActionTimer = create timer for 0 seconds
	Wall1 = 0
	Wall2 = 0
	House = 0
	SiegeOnPointTimer = create timer for 0 seconds
	SiegeWeaponPoint = 0
	SiegeStucked = 0
	
start

begin loop
	a = 1
	PointOn = 0
	SiegeStucked = 0
	wait 15 seconds
	begin loop
		PlayerCreature = get distance from {LC10_SiegeCatapult[6]} to {oCreature}
		PlayerPlatoon1 = get platoon of player 0 nearest {LC10_SiegeCatapult[6]} radius 125
		Catapult = get siege weapon of player 0 nearest {LC10_SiegeCatapult[6]} radius 125
		
		if PlayerCreature > 10 and PlayerPlatoon1 not exists and Catapult not exists
			if PlayerPlatoon1 not exists
				a = 1
			elsif PlayerCreature > 10 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00
				a = 1
			elsif Catapult not exists
				a = 1
			end if
		end if
		
		if PlayerCreature <= 10 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00
			clear siege weapon LC10_SiegeCatapult[6] action queue
			a = 0
		elsif PlayerPlatoon1 exists and LC10_SiegeCatapult[6] can navigate to {PlayerPlatoon1}
			clear siege weapon LC10_SiegeCatapult[6] action queue
			a = 0
		elsif Catapult exists and LC10_SiegeCatapult[6] can navigate to {Catapult}
			clear siege weapon LC10_SiegeCatapult[6] action queue
			a = 0
		elsif PointOn != 3 and a == 1
			begin loop
				if LC10_SiegeCatapult[6] exists 
					if get SiegeOnPointTimer time remaining <= 0
						SiegeWeaponPoint = marker at {LC10_SiegeCatapult[6]}
						SiegeOnPointTimer = create timer for 65 seconds
					elsif get SiegeOnPointTimer time remaining <= 5
						if {LC10_SiegeCatapult[6]} near {SiegeWeaponPoint} radius 10
							clear siege weapon LC10_SiegeCatapult[6] action queue
							add action SIEGEWEAPON_AGENDA_ACTION_DISBAND using {LC10_SiegeCatapult[6]} to siege weapon LC10_SiegeCatapult[6] action queue//Siege just got stucked. Other possibilities to fix that wasn't successful for me.
							SiegeStucked = 1
						end if
					end if
					if get CatapultMoveTimer1 time remaining <= 0
						if get size of LC10_SiegeCatapult[6] action queue < 1

							if PointOn == 0
								if LC10_SiegeCatapult[6] can navigate to ({SiegeRoute2[0]} + {-3.00,0.00,-3.00})
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using ({SiegeRoute2[0]} + {-3.00,0.00,-3.00}) to siege weapon LC10_SiegeCatapult[6] action queue
								end if
					
							elsif PointOn == 1
								if LC10_SiegeCatapult[6] can navigate to ({SiegeRoute2[1]} + {-3.00,0.00,-3.00})
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using ({SiegeRoute2[1]} + {-3.00,0.00,-3.00}) to siege weapon LC10_SiegeCatapult[6] action queue
								end if

							elsif PointOn == 2
								if LC10_SiegeCatapult[6] can navigate to ({SiegeRoute2[2]} + {-3.00,0.00,-3.00})
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using ({SiegeRoute2[2]} + {-3.00,0.00,-3.00}) to siege weapon LC10_SiegeCatapult[6] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using ({SiegeRoute2[1]} + {-3.00,0.00,-3.00}) to siege weapon LC10_SiegeCatapult[6] action queue
								end if

							CatapultMoveTimer1 = create timer for 10 seconds
							
							end if
						end if
					end if		

					if {LC10_SiegeCatapult[6]} near ({SiegeRoute2[0]} + {-3.00,0.00,-3.00}) radius 15 and PointOn != 1
						PointOn = 1
					elsif {LC10_SiegeCatapult[6]} near ({SiegeRoute2[1]} + {-3.00,0.00,-3.00}) radius 15 and PointOn != 2
						PointOn = 2
					elsif {LC10_SiegeCatapult[6]} near ({SiegeRoute2[2]} + {-3.00,0.00,-3.00}) radius 15 and PointOn != 3
						PointOn = 3
					elsif not LC10_SiegeCatapult[6] can navigate to ({SiegeRoute2[2]} + {-3.00,0.00,-3.00}) and {LC10_SiegeCatapult[6]} near ({SiegeRoute2[1]} + {-3.00,0.00,-3.00}) radius 15 and PointOn != 3
						PointOn = 3
					end if
				end if
			until LC10_SiegeCatapult[6] not exists or PointOn == 3 or 180 seconds
			end loop
		end if
		
		until PointOn == 3 or LC10_SiegeCatapult[6] not exists or 180 seconds
	end loop
	
	wait until VolcanoActivated == 0 and HurricaneActivated == 0
	wait 15 seconds
	
	wait 5 seconds
	
	UnderAttack = UnderAttack + 1
	clear siege weapon LC10_SiegeCatapult[6] action queue
	
	begin loop
		if get ActionTimer time remaining <= 0
			clear siege weapon LC10_SiegeCatapult[6] action queue
			ActionTimer = create timer for 10 seconds
			Wall1 = get wall segment nearest {PlayerWallPos} radius 150
			if Wall1 exists and PLAYER of Wall1 == 0
				Target = marker at get target from {LC10_SiegeCatapult[6]} to {Wall1} distance 10 angle 180
				clear siege weapon LC10_SiegeCatapult[6] action queue
				if Wall1 exists
					add action SIEGEWEAPON_AGENDA_ACTION_ATTACK_THING using Wall1 to siege weapon LC10_SiegeCatapult[6] action queue
				end if
			elsif Wall1 not exists
				House = get building HOUSE in PlayerTown min built 0.6
				if House exists and PLAYER of House == 0
					Target = marker at get target from {LC10_SiegeCatapult[6]} to {House} distance 10 angle 180
					clear siege weapon LC10_SiegeCatapult[6] action queue
					if House exists
						add action SIEGEWEAPON_AGENDA_ACTION_ATTACK_THING using House to siege weapon LC10_SiegeCatapult[6] action queue
					end if
				end if
			end if
		end if
		until LC10_SiegeCatapult[6] not exists
	end loop
	
	UnderAttack = UnderAttack - 1
	
	if SiegeStucked == 1
		wait 10 seconds
		if LC10_SiegeCatapult[6] not exists LC10_SiegeCatapult[6] = recruit SIEGE_BALANCE_TYPE_CATAPULT_LEVEL_5 town AztecFirstTown siege weapon end if
	end if
	
end loop

end script LC10_SiegeCatapult6Actions

begin script LC10_Platoon33Actions

	oCreature = get player 0 creature
	HeTeste3 = 0
	TestCreature2 = 0
	NumPat = 0
	NumPat5 = 0
	PlayerPlatoon1 = 0
	WorrNum = 0
	oTown = get town with id 0
	oTownCentre = get building ABODE_NUMBER_TOWN_CENTRE in oTown min built 1.0
	ProPlatoonsLocation = 0
	AIPlatoon1 = 0
	Armory = 0
	Town8 = get town with id 8
	RandomActionP3 = 0
	a = 1
	Timer = create timer for 0 seconds
	GreekGateHouse1 = 0
	GreekGateHouse2 = 0
	oWall = 0
	PlayerCatapult1 = 0
	PlayerPlatoonInRange = 0
	
start

begin loop
	a = 1
	wait until LC10_Platoon[33] exists and LC10_Platoon[34] exists and LC10_SiegeCatapult[7] exists and LC10_SiegeCatapult[8] exists
	begin loop
		TestCreature2 = get distance from {LC10_Platoon[33]} to {oCreature}
		if TestCreature2 <= 200 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00 and LC10_Platoon[33] can navigate to {oCreature}
			clear LC10_Platoon[33] action queue
			begin loop
				add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_MOVING_OBJECT using oCreature to LC10_Platoon[33] action queue
				NumPat5 = get number of villagers in platoon LC10_Platoon[33]
				TestCreature2 = get distance from {LC10_Platoon[30]} to {oCreature}
				until NumPat5 == 0 or SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature == 0.00 or not LC10_Platoon[33] can navigate to {oCreature} or TestCreature2 > 200
			end loop
		end if
		PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[33]} radius 200
		PlayerCatapult1 = get siege weapon of player 0 nearest {LC10_Platoon[33]} radius 175
		if PlayerPlatoon1 exists and LC10_Platoon[33] can navigate to {PlayerPlatoon1}
			clear LC10_Platoon[33] action queue
			begin loop
				add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_PLATOON using PlayerPlatoon1 to LC10_Platoon[33] action queue
				NumPat5 = get number of villagers in platoon LC10_Platoon[33]
				HeTeste3 = get number of villagers in platoon PlayerPlatoon1
				until NumPat5 == 0 or HeTeste3 == 0
			end loop
		elsif PlayerCatapult1 exists and LC10_Platoon[33] can navigate to {PlayerCatapult1}
			clear LC10_Platoon[33] action queue
			begin loop
				add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_THING using PlayerCatapult1 to LC10_Platoon[33] action queue
				NumPat5 = get number of villagers in platoon LC10_Platoon[33]
				PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[33]} radius 350
				if PlayerPlatoon1 exists and LC10_Platoon[33] can navigate to {PlayerPlatoon1}
					PlayerPlatoonInRange = 1
				end if
				until NumPat5 == 0 or PlayerCatapult1 not exists or not LC10_Platoon[33] can navigate to {PlayerCatapult1} or PlayerPlatoonInRange == 1
			end loop
			PlayerPlatoonInRange = 0
		end if
		if LC10_Platoon[33] can navigate to ({AttackPos[4]} + {6.00,0.00,6.00}) and get size of LC10_Platoon[33] action queue < 1
			clear LC10_Platoon[33] action queue
			add action PLATOON_AGENDA_ACTION_DEFEND_POSITION using ({AttackPos[4]} + {6.00,0.00,6.00}) to LC10_Platoon[33] action queue
		end if
		until LC10_Platoon[33] not exists or {LC10_Platoon[33]} near ({AttackPos[4]} + {6.00,0.00,6.00})
	end loop
	
	wait until VolcanoActivated == 0 and HurricaneActivated == 0
	
	begin loop //Attack
		TestCreature2 = get distance from {LC10_Platoon[33]} to {oCreature}
		if TestCreature2 <= 200 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00 and LC10_Platoon[33] can navigate to {oCreature}
			clear LC10_Platoon[33] action queue
			begin loop
				add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_MOVING_OBJECT using oCreature to LC10_Platoon[33] action queue
				NumPat5 = get number of villagers in platoon LC10_Platoon[33]
				TestCreature2 = get distance from {LC10_Platoon[30]} to {oCreature}
				until NumPat5 == 0 or SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature == 0.00 or not LC10_Platoon[33] can navigate to {oCreature} or TestCreature2 > 200
			end loop
		end if
		PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[33]} radius 200
		PlayerCatapult1 = get siege weapon of player 0 nearest {LC10_Platoon[33]} radius 175
		if PlayerPlatoon1 exists and LC10_Platoon[33] can navigate to {PlayerPlatoon1}
			clear LC10_Platoon[33] action queue
			begin loop
				add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_PLATOON using PlayerPlatoon1 to LC10_Platoon[33] action queue
				NumPat5 = get number of villagers in platoon LC10_Platoon[33]
				HeTeste3 = get number of villagers in platoon PlayerPlatoon1
				until NumPat5 == 0 or HeTeste3 == 0
			end loop
		elsif PlayerCatapult1 exists and LC10_Platoon[33] can navigate to {PlayerCatapult1}
			clear LC10_Platoon[33] action queue
			begin loop
				add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_THING using PlayerCatapult1 to LC10_Platoon[33] action queue
				NumPat5 = get number of villagers in platoon LC10_Platoon[33]
				PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[33]} radius 200
				if PlayerPlatoon1 exists and LC10_Platoon[33] can navigate to {PlayerPlatoon1}
					PlayerPlatoonInRange = 1
				end if
				until NumPat5 == 0 or PlayerCatapult1 not exists or not LC10_Platoon[33] can navigate to {PlayerCatapult1} or PlayerPlatoonInRange == 1
			end loop
			PlayerPlatoonInRange = 0
		end if
		if LC10_Platoon[33] can navigate to object oTownCentre
			a = 1
			clear LC10_Platoon[33] action queue
			begin loop
				PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[33]} radius 200
				TestCreature2 = get distance from {LC10_Platoon[33]} to {oCreature}
				set LC10_Platoon[33] attack AztecPreTown with severity 0.7 for takeover
				if PlayerPlatoon1 exists or TestCreature2 <= 200 or not LC10_Platoon[33] can navigate to object oTownCentre
					if PlayerPlatoon1 exists
						a = 0
					elsif TestCreature2 <= 200 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00
						a = 0
					elsif not LC10_Platoon[33] can navigate to object oTownCentre
						a = 0
					elsif LC10_Platoon[33] not exists
						a = 0
					end if
				end if
				until a == 0 or LC10_Platoon[33] not exists
			end loop
			clear LC10_Platoon[33] action queue
		elsif LC10_Platoon[33] can navigate to ({AttackPos[4]} + {8.00,0.00,8.00})
			clear LC10_Platoon[33] action queue
			add action PLATOON_AGENDA_ACTION_DEFEND_POSITION using ({AttackPos[4]} + {8.00,0.00,8.00}) to LC10_Platoon[33] action queue
		end if
		until LC10_Platoon[33] not exists
	end loop
end loop

end script LC10_Platoon33Actions

begin script LC10_Platoon34Actions

	oCreature = get player 0 creature
	HeTeste3 = 0
	TestCreature2 = 0
	NumPat = 0
	NumPat5 = 0
	PlayerPlatoon1 = 0
	WorrNum = 0
	oTown = get town with id 0
	oTownCentre = get building ABODE_NUMBER_TOWN_CENTRE in oTown min built 1.0
	ProPlatoonsLocation = 0
	AIPlatoon1 = 0
	Armory = 0
	Town8 = get town with id 8
	RandomActionP3 = 0
	a = 1
	Timer = create timer for 0 seconds
	GreekGateHouse1 = 0
	GreekGateHouse2 = 0
	oWall = 0
	PlayerCatapult1 = 0
	PlayerPlatoonInRange = 0
	
start

begin loop
	a = 1
	wait until LC10_Platoon[33] exists and LC10_Platoon[34] exists and LC10_SiegeCatapult[7] exists and LC10_SiegeCatapult[8] exists
	begin loop
		TestCreature2 = get distance from {LC10_Platoon[34]} to {oCreature}
		if TestCreature2 <= 200 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00 and LC10_Platoon[34] can navigate to {oCreature}
			clear LC10_Platoon[34] action queue
			begin loop
				add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_MOVING_OBJECT using oCreature to LC10_Platoon[34] action queue
				NumPat5 = get number of villagers in platoon LC10_Platoon[34]
				TestCreature2 = get distance from {LC10_Platoon[30]} to {oCreature}
				until NumPat5 == 0 or SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature == 0.00 or not LC10_Platoon[34] can navigate to {oCreature} or TestCreature2 > 200
			end loop
		end if
		PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[34]} radius 200
		PlayerCatapult1 = get siege weapon of player 0 nearest {LC10_Platoon[34]} radius 175
		if PlayerPlatoon1 exists and LC10_Platoon[34] can navigate to {PlayerPlatoon1}
			clear LC10_Platoon[34] action queue
			begin loop
				add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_PLATOON using PlayerPlatoon1 to LC10_Platoon[34] action queue
				NumPat5 = get number of villagers in platoon LC10_Platoon[34]
				HeTeste3 = get number of villagers in platoon PlayerPlatoon1
				until NumPat5 == 0 or HeTeste3 == 0
			end loop
		elsif PlayerCatapult1 exists and LC10_Platoon[34] can navigate to {PlayerCatapult1}
			clear LC10_Platoon[34] action queue
			begin loop
				add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_THING using PlayerCatapult1 to LC10_Platoon[34] action queue
				NumPat5 = get number of villagers in platoon LC10_Platoon[34]
				PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[34]} radius 350
				if PlayerPlatoon1 exists and LC10_Platoon[34] can navigate to {PlayerPlatoon1}
					PlayerPlatoonInRange = 1
				end if
				until NumPat5 == 0 or PlayerCatapult1 not exists or not LC10_Platoon[34] can navigate to {PlayerCatapult1} or PlayerPlatoonInRange == 1
			end loop
			PlayerPlatoonInRange = 0
		end if
		if LC10_Platoon[34] can navigate to ({AttackPos[4]} + {-6.00,0.00,-6.00}) and get size of LC10_Platoon[34] action queue < 1
			clear LC10_Platoon[34] action queue
			add action PLATOON_AGENDA_ACTION_DEFEND_POSITION using ({AttackPos[4]} + {-6.00,0.00,-6.00}) to LC10_Platoon[34] action queue
		end if
		until LC10_Platoon[34] not exists or {LC10_Platoon[34]} near ({AttackPos[4]} + {-6.00,0.00,-6.00})
	end loop
	
	wait until VolcanoActivated == 0 and HurricaneActivated == 0
	
	begin loop //Attack
		TestCreature2 = get distance from {LC10_Platoon[34]} to {oCreature}
		if TestCreature2 <= 200 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00 and LC10_Platoon[34] can navigate to {oCreature}
			clear LC10_Platoon[34] action queue
			begin loop
				add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_MOVING_OBJECT using oCreature to LC10_Platoon[34] action queue
				NumPat5 = get number of villagers in platoon LC10_Platoon[34]
				TestCreature2 = get distance from {LC10_Platoon[30]} to {oCreature}
				until NumPat5 == 0 or SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature == 0.00 or not LC10_Platoon[34] can navigate to {oCreature} or TestCreature2 > 200
			end loop
		end if
		PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[34]} radius 200
		PlayerCatapult1 = get siege weapon of player 0 nearest {LC10_Platoon[34]} radius 175
		if PlayerPlatoon1 exists and LC10_Platoon[34] can navigate to {PlayerPlatoon1}
			clear LC10_Platoon[34] action queue
			begin loop
				add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_PLATOON using PlayerPlatoon1 to LC10_Platoon[34] action queue
				NumPat5 = get number of villagers in platoon LC10_Platoon[34]
				HeTeste3 = get number of villagers in platoon PlayerPlatoon1
				until NumPat5 == 0 or HeTeste3 == 0
			end loop
		elsif PlayerCatapult1 exists and LC10_Platoon[34] can navigate to {PlayerCatapult1}
			clear LC10_Platoon[34] action queue
			begin loop
				add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_THING using PlayerCatapult1 to LC10_Platoon[34] action queue
				NumPat5 = get number of villagers in platoon LC10_Platoon[34]
				PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[34]} radius 200
				if PlayerPlatoon1 exists and LC10_Platoon[34] can navigate to {PlayerPlatoon1}
					PlayerPlatoonInRange = 1
				end if
				until NumPat5 == 0 or PlayerCatapult1 not exists or not LC10_Platoon[34] can navigate to {PlayerCatapult1} or PlayerPlatoonInRange == 1
			end loop
			PlayerPlatoonInRange = 0
		end if
		if LC10_Platoon[34] can navigate to object oTownCentre
			a = 1
			clear LC10_Platoon[34] action queue
			begin loop
				PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[34]} radius 200
				TestCreature2 = get distance from {LC10_Platoon[34]} to {oCreature}
				set LC10_Platoon[34] attack AztecPreTown with severity 0.7 for takeover
				if PlayerPlatoon1 exists or TestCreature2 <= 200 or not LC10_Platoon[34] can navigate to object oTownCentre
					if PlayerPlatoon1 exists
						a = 0
					elsif TestCreature2 <= 200 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00
						a = 0
					elsif not LC10_Platoon[34] can navigate to object oTownCentre
						a = 0
					elsif LC10_Platoon[34] not exists
						a = 0
					end if
				end if
				until a == 0 or LC10_Platoon[34] not exists
			end loop
			clear LC10_Platoon[34] action queue
		elsif LC10_Platoon[34] can navigate to ({AttackPos[4]} + {-8.00,0.00,-8.00})
			clear LC10_Platoon[34] action queue
			add action PLATOON_AGENDA_ACTION_DEFEND_POSITION using ({AttackPos[4]} + {-8.00,0.00,-8.00}) to LC10_Platoon[34] action queue
		end if
		until LC10_Platoon[34] not exists
	end loop
end loop

end script LC10_Platoon34Actions

begin script LC10_SiegeCatapult7Actions

	PlayerCreature = 0
    PlayerPlatoon1 = 0
	oCreature = get player 0 creature
	NumPat1 = 0
	HeTeste1 = 0
	WorrNum = 0
	Town0 = get town with id 0
	Town5 = get town with id 5
	oTown = get town with id 0
	oTownCentre = get building ABODE_NUMBER_TOWN_CENTRE in Town0 min built 1.0
	Armory = get building ABODE_NUMBER_MELEE_ARMOURY in Town5 min built 1.0
	ArmoryRanged = get building ABODE_NUMBER_RANGED_ARMOURY in Town5 min built 1.0
	Player1Town = 0
	a = 1
	AISiege = 0	
	WaypointMain[7]
	WaypointRouteMain = 0
	Counter = 0
	Town8 = get town with id 8
	Catapult = 0
	AttackingTown = 2
	NumPat5 = 0
	h = 1
	Player0Town0 = 0
	Timer = create timer for 0 seconds
	oWall = 0
	GreekGateHouse1 = 0
	GreekGateHouse2 = 0
	AIPlatoon = 0
	Target = 0
	PointOn = 0
	CatapultMoveTimer1 = 5
	AttackTimer = 0
	ActionTimer = create timer for 0 seconds
	Wall1 = 0
	Wall2 = 0
	House = 0
	SiegeOnPointTimer = create timer for 0 seconds
	SiegeWeaponPoint = 0
	SiegeStucked = 0
	
start

begin loop
	a = 1
	PointOn = 0
	SiegeStucked = 0
	wait until LC10_Platoon[33] exists and LC10_Platoon[34] exists and LC10_SiegeCatapult[7] exists and LC10_SiegeCatapult[8] exists
	wait 5 seconds
	begin loop
		PlayerCreature = get distance from {LC10_SiegeCatapult[7]} to {oCreature}
		PlayerPlatoon1 = get platoon of player 0 nearest {LC10_SiegeCatapult[7]} radius 125
		Catapult = get siege weapon of player 0 nearest {LC10_SiegeCatapult[7]} radius 125
		
		if PlayerCreature > 10 and PlayerPlatoon1 not exists and Catapult not exists
			if PlayerPlatoon1 not exists
				a = 1
			elsif PlayerCreature > 10 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00
				a = 1
			elsif Catapult not exists
				a = 1
			end if
		end if
		
		if PlayerCreature <= 10 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00
			clear siege weapon LC10_SiegeCatapult[7] action queue
			a = 0
		elsif PlayerPlatoon1 exists and LC10_SiegeCatapult[7] can navigate to {PlayerPlatoon1}
			clear siege weapon LC10_SiegeCatapult[7] action queue
			a = 0
		elsif Catapult exists and LC10_SiegeCatapult[7] can navigate to {Catapult}
			clear siege weapon LC10_SiegeCatapult[7] action queue
			a = 0
		elsif PointOn != 12 and a == 1
			begin loop
				if LC10_SiegeCatapult[7] exists 
					if get SiegeOnPointTimer time remaining <= 0
						SiegeWeaponPoint = marker at {LC10_SiegeCatapult[7]}
						SiegeOnPointTimer = create timer for 65 seconds
					elsif get SiegeOnPointTimer time remaining <= 5
						if {LC10_SiegeCatapult[7]} near {SiegeWeaponPoint} radius 10
							clear siege weapon LC10_SiegeCatapult[7] action queue
							add action SIEGEWEAPON_AGENDA_ACTION_DISBAND using {LC10_SiegeCatapult[7]} to siege weapon LC10_SiegeCatapult[7] action queue//Siege just got stucked. Other possibilities to fix that wasn't successful for me.
							SiegeStucked = 1
						end if
					end if
					if get CatapultMoveTimer1 time remaining <= 0
						if get size of LC10_SiegeCatapult[7] action queue < 1

							if PointOn == 0
								if LC10_SiegeCatapult[7] can navigate to {SiegeRoute6[0]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute6[0]} to siege weapon LC10_SiegeCatapult[7] action queue
								end if
					
							elsif PointOn == 1
								if LC10_SiegeCatapult[7] can navigate to {SiegeRoute6[1]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute6[1]} to siege weapon LC10_SiegeCatapult[7] action queue
								end if

							elsif PointOn == 2
								if LC10_SiegeCatapult[7] can navigate to {SiegeRoute6[2]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute6[2]} to siege weapon LC10_SiegeCatapult[7] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute6[2]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[7] action queue
								end if
								
							elsif PointOn == 3
								if LC10_SiegeCatapult[7] can navigate to {SiegeRoute6[3]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute6[3]} to siege weapon LC10_SiegeCatapult[7] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute6[3]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[7] action queue
								end if
								
							elsif PointOn == 4
								if LC10_SiegeCatapult[7] can navigate to {SiegeRoute6[4]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute6[4]} to siege weapon LC10_SiegeCatapult[7] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute6[4]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[7] action queue
								end if
								
							elsif PointOn == 5
								if LC10_SiegeCatapult[7] can navigate to {SiegeRoute6[5]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute6[5]} to siege weapon LC10_SiegeCatapult[7] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute6[5]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[7] action queue
								end if
								
							elsif PointOn == 6
								if LC10_SiegeCatapult[7] can navigate to {SiegeRoute6[6]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute6[6]} to siege weapon LC10_SiegeCatapult[7] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute6[6]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[7] action queue
								end if
								
							elsif PointOn == 7
								if LC10_SiegeCatapult[7] can navigate to {SiegeRoute6[7]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute6[7]} to siege weapon LC10_SiegeCatapult[7] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute6[7]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[7] action queue
								end if
								
							elsif PointOn == 8
								if LC10_SiegeCatapult[7] can navigate to {SiegeRoute6[8]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute6[8]} to siege weapon LC10_SiegeCatapult[7] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute6[8]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[7] action queue
								end if
								
							elsif PointOn == 9
								if LC10_SiegeCatapult[7] can navigate to {SiegeRoute6[9]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute6[9]} to siege weapon LC10_SiegeCatapult[7] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute6[9]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[7] action queue
								end if
								
							elsif PointOn == 10
								if LC10_SiegeCatapult[7] can navigate to {SiegeRoute6[10]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute6[10]} to siege weapon LC10_SiegeCatapult[7] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute6[10]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[7] action queue
								end if
								
							elsif PointOn == 11
								if LC10_SiegeCatapult[7] can navigate to {SiegeRoute6[11]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute6[11]} to siege weapon LC10_SiegeCatapult[7] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute6[11]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[7] action queue
								end if

							CatapultMoveTimer1 = create timer for 10 seconds
							
							end if
						end if
					end if		

					if {LC10_SiegeCatapult[7]} near {SiegeRoute6[0]} radius 15 and PointOn != 1
						PointOn = 1
					elsif {LC10_SiegeCatapult[7]} near {SiegeRoute6[1]} radius 15 and PointOn != 2
						PointOn = 2
					elsif {LC10_SiegeCatapult[7]} near {SiegeRoute6[2]} radius 15 and PointOn != 3
						PointOn = 3
					elsif {LC10_SiegeCatapult[7]} near {SiegeRoute6[3]} radius 15 and PointOn != 4
						PointOn = 4
					elsif {LC10_SiegeCatapult[7]} near {SiegeRoute6[4]} radius 15 and PointOn != 5
						PointOn = 5
					elsif {LC10_SiegeCatapult[7]} near {SiegeRoute6[5]} radius 15 and PointOn != 6
						PointOn = 6
					elsif {LC10_SiegeCatapult[7]} near {SiegeRoute6[6]} radius 15 and PointOn != 7
						PointOn = 7
					elsif {LC10_SiegeCatapult[7]} near {SiegeRoute6[7]} radius 15 and PointOn != 8
						PointOn = 8
					elsif {LC10_SiegeCatapult[7]} near {SiegeRoute6[8]} radius 15 and PointOn != 9
						PointOn = 9
					elsif {LC10_SiegeCatapult[7]} near {SiegeRoute6[9]} radius 15 and PointOn != 10
						PointOn = 10
					elsif {LC10_SiegeCatapult[7]} near {SiegeRoute6[10]} radius 15 and PointOn != 11
						PointOn = 11
					elsif {LC10_SiegeCatapult[7]} near {SiegeRoute6[11]} radius 15 and PointOn != 12
						PointOn = 12
					elsif not LC10_SiegeCatapult[7] can navigate to {SiegeRoute6[11]} and {LC10_SiegeCatapult[7]} near {SiegeRoute6[10]} radius 15 and PointOn != 12
						PointOn = 12
					end if
				end if
			until LC10_SiegeCatapult[7] not exists or PointOn == 12
			end loop
		end if
		
		until PointOn == 12 or LC10_SiegeCatapult[7] not exists
	end loop
	
	wait until VolcanoActivated == 0 and HurricaneActivated == 0
	wait 15 seconds
	
	wait 5 seconds
	
	UnderAttack = UnderAttack + 1
	clear siege weapon LC10_SiegeCatapult[7] action queue
	
	begin loop
		if get ActionTimer time remaining <= 0
			clear siege weapon LC10_SiegeCatapult[7] action queue
			ActionTimer = create timer for 10 seconds
			Wall1 = get wall segment nearest {LC10_SiegeCatapult[7]} radius 450
			if Wall1 exists and PLAYER of Wall1 == 0
				Target = marker at get target from {LC10_SiegeCatapult[7]} to {Wall1} distance 10 angle 180
				clear siege weapon LC10_SiegeCatapult[7] action queue
				if Wall1 exists
					add action SIEGEWEAPON_AGENDA_ACTION_ATTACK_THING using Wall1 to siege weapon LC10_SiegeCatapult[7] action queue
				end if
			elsif Wall1 not exists
				House = get building HOUSE in AztecPreTown min built 0.6
				if House exists and PLAYER of House == 0
					Target = marker at get target from {LC10_SiegeCatapult[7]} to {House} distance 10 angle 180
					clear siege weapon LC10_SiegeCatapult[7] action queue
					if House exists
						add action SIEGEWEAPON_AGENDA_ACTION_ATTACK_THING using House to siege weapon LC10_SiegeCatapult[7] action queue
					end if
				end if
			end if
		end if
		until LC10_SiegeCatapult[7] not exists
	end loop
	
	UnderAttack = UnderAttack - 1
	
	if SiegeStucked == 1
		wait 10 seconds
		if LC10_SiegeCatapult[7] not exists LC10_SiegeCatapult[7] = recruit SIEGE_BALANCE_TYPE_CATAPULT_LEVEL_5 town AztecCapital siege weapon end if
	end if
	
end loop

end script LC10_SiegeCatapult7Actions

begin script LC10_SiegeCatapult8Actions

	PlayerCreature = 0
    PlayerPlatoon1 = 0
	oCreature = get player 0 creature
	NumPat1 = 0
	HeTeste1 = 0
	WorrNum = 0
	Town0 = get town with id 0
	Town5 = get town with id 5
	oTown = get town with id 0
	oTownCentre = get building ABODE_NUMBER_TOWN_CENTRE in Town0 min built 1.0
	Armory = get building ABODE_NUMBER_MELEE_ARMOURY in Town5 min built 1.0
	ArmoryRanged = get building ABODE_NUMBER_RANGED_ARMOURY in Town5 min built 1.0
	Player1Town = 0
	a = 1
	AISiege = 0	
	WaypointMain[7]
	WaypointRouteMain = 0
	Counter = 0
	Town8 = get town with id 8
	Catapult = 0
	AttackingTown = 2
	NumPat5 = 0
	h = 1
	Player0Town0 = 0
	Timer = create timer for 0 seconds
	oWall = 0
	GreekGateHouse1 = 0
	GreekGateHouse2 = 0
	AIPlatoon = 0
	Target = 0
	PointOn = 0
	CatapultMoveTimer1 = 5
	AttackTimer = 0
	ActionTimer = create timer for 0 seconds
	Wall1 = 0
	Wall2 = 0
	House = 0
	SiegeOnPointTimer = create timer for 0 seconds
	SiegeWeaponPoint = 0
	SiegeStucked = 0
	
start

begin loop
	a = 1
	PointOn = 0
	SiegeStucked = 0
	wait until LC10_Platoon[33] exists and LC10_Platoon[34] exists and LC10_SiegeCatapult[7] exists and LC10_SiegeCatapult[8] exists
	wait 5 seconds
	begin loop
		PlayerCreature = get distance from {LC10_SiegeCatapult[8]} to {oCreature}
		PlayerPlatoon1 = get platoon of player 0 nearest {LC10_SiegeCatapult[8]} radius 125
		Catapult = get siege weapon of player 0 nearest {LC10_SiegeCatapult[8]} radius 125
		
		if PlayerCreature > 10 and PlayerPlatoon1 not exists and Catapult not exists
			if PlayerPlatoon1 not exists
				a = 1
			elsif PlayerCreature > 10 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00
				a = 1
			elsif Catapult not exists
				a = 1
			end if
		end if
		
		if PlayerCreature <= 10 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00
			clear siege weapon LC10_SiegeCatapult[8] action queue
			a = 0
		elsif PlayerPlatoon1 exists and LC10_SiegeCatapult[8] can navigate to {PlayerPlatoon1}
			clear siege weapon LC10_SiegeCatapult[8] action queue
			a = 0
		elsif Catapult exists and LC10_SiegeCatapult[8] can navigate to {Catapult}
			clear siege weapon LC10_SiegeCatapult[8] action queue
			a = 0
		elsif PointOn != 12 and a == 1
			begin loop
				if LC10_SiegeCatapult[8] exists 
					if get SiegeOnPointTimer time remaining <= 0
						SiegeWeaponPoint = marker at {LC10_SiegeCatapult[8]}
						SiegeOnPointTimer = create timer for 65 seconds
					elsif get SiegeOnPointTimer time remaining <= 5
						if {LC10_SiegeCatapult[8]} near {SiegeWeaponPoint} radius 10
							clear siege weapon LC10_SiegeCatapult[8] action queue
							add action SIEGEWEAPON_AGENDA_ACTION_DISBAND using {LC10_SiegeCatapult[8]} to siege weapon LC10_SiegeCatapult[8] action queue//Siege just got stucked. Other possibilities to fix that wasn't successful for me.
							SiegeStucked = 1
						end if
					end if
					if get CatapultMoveTimer1 time remaining <= 0
						if get size of LC10_SiegeCatapult[8] action queue < 1

							if PointOn == 0
								if LC10_SiegeCatapult[8] can navigate to {SiegeRoute7[0]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute7[0]} to siege weapon LC10_SiegeCatapult[8] action queue
								end if
					
							elsif PointOn == 1
								if LC10_SiegeCatapult[8] can navigate to {SiegeRoute7[1]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute7[1]} to siege weapon LC10_SiegeCatapult[8] action queue
								end if

							elsif PointOn == 2
								if LC10_SiegeCatapult[8] can navigate to {SiegeRoute7[2]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute7[2]} to siege weapon LC10_SiegeCatapult[8] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute7[2]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[8] action queue
								end if
								
							elsif PointOn == 3
								if LC10_SiegeCatapult[8] can navigate to {SiegeRoute7[3]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute7[3]} to siege weapon LC10_SiegeCatapult[8] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute7[3]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[8] action queue
								end if
								
							elsif PointOn == 4
								if LC10_SiegeCatapult[8] can navigate to {SiegeRoute7[4]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute7[4]} to siege weapon LC10_SiegeCatapult[8] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute7[4]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[8] action queue
								end if
								
							elsif PointOn == 5
								if LC10_SiegeCatapult[8] can navigate to {SiegeRoute7[5]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute7[5]} to siege weapon LC10_SiegeCatapult[8] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute7[5]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[8] action queue
								end if
								
							elsif PointOn == 6
								if LC10_SiegeCatapult[8] can navigate to {SiegeRoute7[6]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute7[6]} to siege weapon LC10_SiegeCatapult[8] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute7[6]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[8] action queue
								end if
								
							elsif PointOn == 7
								if LC10_SiegeCatapult[8] can navigate to {SiegeRoute7[7]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute7[7]} to siege weapon LC10_SiegeCatapult[8] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute7[7]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[8] action queue
								end if
								
							elsif PointOn == 8
								if LC10_SiegeCatapult[8] can navigate to {SiegeRoute7[8]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute7[8]} to siege weapon LC10_SiegeCatapult[8] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute7[8]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[8] action queue
								end if
								
							elsif PointOn == 9
								if LC10_SiegeCatapult[8] can navigate to {SiegeRoute7[9]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute7[9]} to siege weapon LC10_SiegeCatapult[8] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute7[9]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[8] action queue
								end if
								
							elsif PointOn == 10
								if LC10_SiegeCatapult[8] can navigate to {SiegeRoute7[10]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute7[10]} to siege weapon LC10_SiegeCatapult[8] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute7[10]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[8] action queue
								end if
								
							elsif PointOn == 11
								if LC10_SiegeCatapult[8] can navigate to {SiegeRoute7[11]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute7[11]} to siege weapon LC10_SiegeCatapult[8] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute7[11]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[8] action queue
								end if

							CatapultMoveTimer1 = create timer for 10 seconds
							
							end if
						end if
					end if		

					if {LC10_SiegeCatapult[8]} near {SiegeRoute7[0]} radius 15 and PointOn != 1
						PointOn = 1
					elsif {LC10_SiegeCatapult[8]} near {SiegeRoute7[1]} radius 15 and PointOn != 2
						PointOn = 2
					elsif {LC10_SiegeCatapult[8]} near {SiegeRoute7[2]} radius 15 and PointOn != 3
						PointOn = 3
					elsif {LC10_SiegeCatapult[8]} near {SiegeRoute7[3]} radius 15 and PointOn != 4
						PointOn = 4
					elsif {LC10_SiegeCatapult[8]} near {SiegeRoute7[4]} radius 15 and PointOn != 5
						PointOn = 5
					elsif {LC10_SiegeCatapult[8]} near {SiegeRoute7[5]} radius 15 and PointOn != 6
						PointOn = 6
					elsif {LC10_SiegeCatapult[8]} near {SiegeRoute7[6]} radius 15 and PointOn != 7
						PointOn = 7
					elsif {LC10_SiegeCatapult[8]} near {SiegeRoute7[7]} radius 15 and PointOn != 8
						PointOn = 8
					elsif {LC10_SiegeCatapult[8]} near {SiegeRoute7[8]} radius 15 and PointOn != 9
						PointOn = 9
					elsif {LC10_SiegeCatapult[8]} near {SiegeRoute7[9]} radius 15 and PointOn != 10
						PointOn = 10
					elsif {LC10_SiegeCatapult[8]} near {SiegeRoute7[10]} radius 15 and PointOn != 11
						PointOn = 11
					elsif {LC10_SiegeCatapult[8]} near {SiegeRoute7[11]} radius 15 and PointOn != 12
						PointOn = 12
					elsif not LC10_SiegeCatapult[8] can navigate to {SiegeRoute7[11]} and {LC10_SiegeCatapult[8]} near {SiegeRoute7[10]} radius 15 and PointOn != 12
						PointOn = 12
					end if
				end if
			until LC10_SiegeCatapult[8] not exists or PointOn == 12
			end loop
		end if
		
		until PointOn == 12 or LC10_SiegeCatapult[8] not exists
	end loop
	
	wait until VolcanoActivated == 0 and HurricaneActivated == 0
	wait 15 seconds
	
	wait 5 seconds
	
	UnderAttack = UnderAttack + 1
	clear siege weapon LC10_SiegeCatapult[8] action queue
	
	begin loop
		if get ActionTimer time remaining <= 0
			clear siege weapon LC10_SiegeCatapult[8] action queue
			ActionTimer = create timer for 10 seconds
			Wall1 = get wall segment nearest {LC10_SiegeCatapult[8]} radius 450
			if Wall1 exists and PLAYER of Wall1 == 0
				Target = marker at get target from {LC10_SiegeCatapult[8]} to {Wall1} distance 10 angle 180
				clear siege weapon LC10_SiegeCatapult[8] action queue
				if Wall1 exists
					add action SIEGEWEAPON_AGENDA_ACTION_ATTACK_THING using Wall1 to siege weapon LC10_SiegeCatapult[8] action queue
				end if
			elsif Wall1 not exists
				House = get building HOUSE in AztecPreTown min built 0.6
				if House exists and PLAYER of House == 0
					Target = marker at get target from {LC10_SiegeCatapult[8]} to {House} distance 10 angle 180
					clear siege weapon LC10_SiegeCatapult[8] action queue
					if House exists
						add action SIEGEWEAPON_AGENDA_ACTION_ATTACK_THING using House to siege weapon LC10_SiegeCatapult[8] action queue
					end if
				end if
			end if
		end if
		until LC10_SiegeCatapult[8] not exists
	end loop
	
	UnderAttack = UnderAttack - 1
	
	if SiegeStucked == 1
		wait 10 seconds
		if LC10_SiegeCatapult[8] not exists LC10_SiegeCatapult[8] = recruit SIEGE_BALANCE_TYPE_CATAPULT_LEVEL_5 town AztecCapital siege weapon end if
	end if
	
end loop

end script LC10_SiegeCatapult8Actions

begin script LC10_Platoon35Actions

	oCreature = get player 0 creature
	HeTeste3 = 0
	TestCreature2 = 0
	NumPat = 0
	NumPat5 = 0
	PlayerPlatoon1 = 0
	WorrNum = 0
	oTown = get town with id 0
	oTownCentre = get building ABODE_NUMBER_TOWN_CENTRE in oTown min built 1.0
	ProPlatoonsLocation = 0
	AIPlatoon1 = 0
	Armory = 0
	Town8 = get town with id 8
	RandomActionP3 = 0
	a = 1
	Timer = create timer for 0 seconds
	GreekGateHouse1 = 0
	GreekGateHouse2 = 0
	oWall = 0
	PlayerCatapult1 = 0
	PlayerPlatoonInRange = 0
	
start

begin loop
	a = 1
	wait until LC10_Platoon[35] exists and LC10_Platoon[36] exists and LC10_SiegeCatapult[9] exists and LC10_SiegeCatapult[10] exists
	begin loop
		TestCreature2 = get distance from {LC10_Platoon[35]} to {oCreature}
		if TestCreature2 <= 200 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00 and LC10_Platoon[35] can navigate to {oCreature}
			clear LC10_Platoon[35] action queue
			begin loop
				add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_MOVING_OBJECT using oCreature to LC10_Platoon[35] action queue
				NumPat5 = get number of villagers in platoon LC10_Platoon[35]
				TestCreature2 = get distance from {LC10_Platoon[30]} to {oCreature}
				until NumPat5 == 0 or SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature == 0.00 or not LC10_Platoon[35] can navigate to {oCreature} or TestCreature2 > 200
			end loop
		end if
		PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[35]} radius 200
		PlayerCatapult1 = get siege weapon of player 0 nearest {LC10_Platoon[35]} radius 175
		if PlayerPlatoon1 exists and LC10_Platoon[35] can navigate to {PlayerPlatoon1}
			clear LC10_Platoon[35] action queue
			begin loop
				add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_PLATOON using PlayerPlatoon1 to LC10_Platoon[35] action queue
				NumPat5 = get number of villagers in platoon LC10_Platoon[35]
				HeTeste3 = get number of villagers in platoon PlayerPlatoon1
				until NumPat5 == 0 or HeTeste3 == 0
			end loop
		elsif PlayerCatapult1 exists and LC10_Platoon[35] can navigate to {PlayerCatapult1}
			clear LC10_Platoon[35] action queue
			begin loop
				add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_THING using PlayerCatapult1 to LC10_Platoon[35] action queue
				NumPat5 = get number of villagers in platoon LC10_Platoon[35]
				PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[35]} radius 350
				if PlayerPlatoon1 exists and LC10_Platoon[35] can navigate to {PlayerPlatoon1}
					PlayerPlatoonInRange = 1
				end if
				until NumPat5 == 0 or PlayerCatapult1 not exists or not LC10_Platoon[35] can navigate to {PlayerCatapult1} or PlayerPlatoonInRange == 1
			end loop
			PlayerPlatoonInRange = 0
		end if
		if LC10_Platoon[35] can navigate to {AttackPos[5]} and get size of LC10_Platoon[35] action queue < 1
			clear LC10_Platoon[35] action queue
			add action PLATOON_AGENDA_ACTION_DEFEND_POSITION using {AttackPos[5]} to LC10_Platoon[35] action queue
		end if
		until LC10_Platoon[35] not exists or {LC10_Platoon[35]} near {AttackPos[5]}
	end loop
	
	wait until VolcanoActivated == 0 and HurricaneActivated == 0
	
	begin loop //Attack
		TestCreature2 = get distance from {LC10_Platoon[35]} to {oCreature}
		if TestCreature2 <= 200 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00 and LC10_Platoon[35] can navigate to {oCreature}
			clear LC10_Platoon[35] action queue
			begin loop
				add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_MOVING_OBJECT using oCreature to LC10_Platoon[35] action queue
				NumPat5 = get number of villagers in platoon LC10_Platoon[35]
				TestCreature2 = get distance from {LC10_Platoon[30]} to {oCreature}
				until NumPat5 == 0 or SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature == 0.00 or not LC10_Platoon[35] can navigate to {oCreature} or TestCreature2 > 200
			end loop
		end if
		PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[35]} radius 200
		PlayerCatapult1 = get siege weapon of player 0 nearest {LC10_Platoon[35]} radius 175
		if PlayerPlatoon1 exists and LC10_Platoon[35] can navigate to {PlayerPlatoon1}
			clear LC10_Platoon[35] action queue
			begin loop
				add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_PLATOON using PlayerPlatoon1 to LC10_Platoon[35] action queue
				NumPat5 = get number of villagers in platoon LC10_Platoon[35]
				HeTeste3 = get number of villagers in platoon PlayerPlatoon1
				until NumPat5 == 0 or HeTeste3 == 0
			end loop
		elsif PlayerCatapult1 exists and LC10_Platoon[35] can navigate to {PlayerCatapult1}
			clear LC10_Platoon[35] action queue
			begin loop
				add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_THING using PlayerCatapult1 to LC10_Platoon[35] action queue
				NumPat5 = get number of villagers in platoon LC10_Platoon[35]
				PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[35]} radius 200
				if PlayerPlatoon1 exists and LC10_Platoon[35] can navigate to {PlayerPlatoon1}
					PlayerPlatoonInRange = 1
				end if
				until NumPat5 == 0 or PlayerCatapult1 not exists or not LC10_Platoon[35] can navigate to {PlayerCatapult1} or PlayerPlatoonInRange == 1
			end loop
			PlayerPlatoonInRange = 0
		end if
		if LC10_Platoon[35] can navigate to object oTownCentre
			a = 1
			clear LC10_Platoon[35] action queue
			begin loop
				PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[35]} radius 200
				TestCreature2 = get distance from {LC10_Platoon[35]} to {oCreature}
				set LC10_Platoon[35] attack AztecPreTown with severity 0.7 for takeover
				if PlayerPlatoon1 exists or TestCreature2 <= 200 or not LC10_Platoon[35] can navigate to object oTownCentre
					if PlayerPlatoon1 exists
						a = 0
					elsif TestCreature2 <= 200 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00
						a = 0
					elsif not LC10_Platoon[35] can navigate to object oTownCentre
						a = 0
					elsif LC10_Platoon[35] not exists
						a = 0
					end if
				end if
				until a == 0 or LC10_Platoon[35] not exists
			end loop
			clear LC10_Platoon[35] action queue
		elsif LC10_Platoon[35] can navigate to {AttackPos[5]}
			clear LC10_Platoon[35] action queue
			add action PLATOON_AGENDA_ACTION_DEFEND_POSITION using {AttackPos[5]} to LC10_Platoon[35] action queue
		end if
		until LC10_Platoon[35] not exists
	end loop
end loop

end script LC10_Platoon35Actions

begin script LC10_Platoon36Actions

	oCreature = get player 0 creature
	HeTeste3 = 0
	TestCreature2 = 0
	NumPat = 0
	NumPat5 = 0
	PlayerPlatoon1 = 0
	WorrNum = 0
	oTown = get town with id 0
	oTownCentre = get building ABODE_NUMBER_TOWN_CENTRE in oTown min built 1.0
	ProPlatoonsLocation = 0
	AIPlatoon1 = 0
	Armory = 0
	Town8 = get town with id 8
	RandomActionP3 = 0
	a = 1
	Timer = create timer for 0 seconds
	GreekGateHouse1 = 0
	GreekGateHouse2 = 0
	oWall = 0
	PlayerCatapult1 = 0
	PlayerPlatoonInRange = 0
	
start

begin loop
	a = 1
	wait until LC10_Platoon[35] exists and LC10_Platoon[36] exists and LC10_SiegeCatapult[9] exists and LC10_SiegeCatapult[10] exists
	begin loop
		TestCreature2 = get distance from {LC10_Platoon[35]} to {oCreature}
		if TestCreature2 <= 200 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00 and LC10_Platoon[35] can navigate to {oCreature}
			clear LC10_Platoon[35] action queue
			begin loop
				add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_MOVING_OBJECT using oCreature to LC10_Platoon[35] action queue
				NumPat5 = get number of villagers in platoon LC10_Platoon[35]
				TestCreature2 = get distance from {LC10_Platoon[30]} to {oCreature}
				until NumPat5 == 0 or SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature == 0.00 or not LC10_Platoon[35] can navigate to {oCreature} or TestCreature2 > 200
			end loop
		end if
		PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[35]} radius 200
		PlayerCatapult1 = get siege weapon of player 0 nearest {LC10_Platoon[35]} radius 175
		if PlayerPlatoon1 exists and LC10_Platoon[35] can navigate to {PlayerPlatoon1}
			clear LC10_Platoon[35] action queue
			begin loop
				add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_PLATOON using PlayerPlatoon1 to LC10_Platoon[35] action queue
				NumPat5 = get number of villagers in platoon LC10_Platoon[35]
				HeTeste3 = get number of villagers in platoon PlayerPlatoon1
				until NumPat5 == 0 or HeTeste3 == 0
			end loop
		elsif PlayerCatapult1 exists and LC10_Platoon[35] can navigate to {PlayerCatapult1}
			clear LC10_Platoon[35] action queue
			begin loop
				add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_THING using PlayerCatapult1 to LC10_Platoon[35] action queue
				NumPat5 = get number of villagers in platoon LC10_Platoon[35]
				PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[35]} radius 350
				if PlayerPlatoon1 exists and LC10_Platoon[35] can navigate to {PlayerPlatoon1}
					PlayerPlatoonInRange = 1
				end if
				until NumPat5 == 0 or PlayerCatapult1 not exists or not LC10_Platoon[35] can navigate to {PlayerCatapult1} or PlayerPlatoonInRange == 1
			end loop
			PlayerPlatoonInRange = 0
		end if
		if LC10_Platoon[35] can navigate to ({AttackPos[5]} + {-6.00,0.00,-6.00}) and get size of LC10_Platoon[35] action queue < 1
			clear LC10_Platoon[35] action queue
			add action PLATOON_AGENDA_ACTION_DEFEND_POSITION using ({AttackPos[5]} + {-6.00,0.00,-6.00}) to LC10_Platoon[35] action queue
		end if
		until LC10_Platoon[35] not exists or {LC10_Platoon[35]} near ({AttackPos[5]} + {-6.00,0.00,-6.00})
	end loop
	
	wait until VolcanoActivated == 0 and HurricaneActivated == 0
	
	begin loop //Attack
		TestCreature2 = get distance from {LC10_Platoon[35]} to {oCreature}
		if TestCreature2 <= 200 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00 and LC10_Platoon[35] can navigate to {oCreature}
			clear LC10_Platoon[35] action queue
			begin loop
				add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_MOVING_OBJECT using oCreature to LC10_Platoon[35] action queue
				NumPat5 = get number of villagers in platoon LC10_Platoon[35]
				TestCreature2 = get distance from {LC10_Platoon[30]} to {oCreature}
				until NumPat5 == 0 or SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature == 0.00 or not LC10_Platoon[35] can navigate to {oCreature} or TestCreature2 > 200
			end loop
		end if
		PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[35]} radius 200
		PlayerCatapult1 = get siege weapon of player 0 nearest {LC10_Platoon[35]} radius 175
		if PlayerPlatoon1 exists and LC10_Platoon[35] can navigate to {PlayerPlatoon1}
			clear LC10_Platoon[35] action queue
			begin loop
				add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_PLATOON using PlayerPlatoon1 to LC10_Platoon[35] action queue
				NumPat5 = get number of villagers in platoon LC10_Platoon[35]
				HeTeste3 = get number of villagers in platoon PlayerPlatoon1
				until NumPat5 == 0 or HeTeste3 == 0
			end loop
		elsif PlayerCatapult1 exists and LC10_Platoon[35] can navigate to {PlayerCatapult1}
			clear LC10_Platoon[35] action queue
			begin loop
				add action PLATOON_AGENDA_ACTION_MELEE_ATTACK_THING using PlayerCatapult1 to LC10_Platoon[35] action queue
				NumPat5 = get number of villagers in platoon LC10_Platoon[35]
				PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[35]} radius 200
				if PlayerPlatoon1 exists and LC10_Platoon[35] can navigate to {PlayerPlatoon1}
					PlayerPlatoonInRange = 1
				end if
				until NumPat5 == 0 or PlayerCatapult1 not exists or not LC10_Platoon[35] can navigate to {PlayerCatapult1} or PlayerPlatoonInRange == 1
			end loop
			PlayerPlatoonInRange = 0
		end if
		if LC10_Platoon[35] can navigate to object oTownCentre
			a = 1
			clear LC10_Platoon[35] action queue
			begin loop
				PlayerPlatoon1 = get platoon of player 0 nearest {LC10_Platoon[35]} radius 200
				TestCreature2 = get distance from {LC10_Platoon[35]} to {oCreature}
				set LC10_Platoon[35] attack AztecPreTown with severity 0.7 for takeover
				if PlayerPlatoon1 exists or TestCreature2 <= 200 or not LC10_Platoon[35] can navigate to object oTownCentre
					if PlayerPlatoon1 exists
						a = 0
					elsif TestCreature2 <= 200 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00
						a = 0
					elsif not LC10_Platoon[35] can navigate to object oTownCentre
						a = 0
					elsif LC10_Platoon[35] not exists
						a = 0
					end if
				end if
				until a == 0 or LC10_Platoon[35] not exists
			end loop
			clear LC10_Platoon[35] action queue
		elsif LC10_Platoon[35] can navigate to ({AttackPos[5]} + {-8.00,0.00,-8.00})
			clear LC10_Platoon[35] action queue
			add action PLATOON_AGENDA_ACTION_DEFEND_POSITION using ({AttackPos[5]} + {-8.00,0.00,-8.00}) to LC10_Platoon[35] action queue
		end if
		until LC10_Platoon[35] not exists
	end loop
end loop

end script LC10_Platoon36Actions

begin script LC10_SiegeCatapult9Actions

	PlayerCreature = 0
    PlayerPlatoon1 = 0
	oCreature = get player 0 creature
	NumPat1 = 0
	HeTeste1 = 0
	WorrNum = 0
	Town0 = get town with id 0
	Town5 = get town with id 5
	oTown = get town with id 0
	oTownCentre = get building ABODE_NUMBER_TOWN_CENTRE in Town0 min built 1.0
	Armory = get building ABODE_NUMBER_MELEE_ARMOURY in Town5 min built 1.0
	ArmoryRanged = get building ABODE_NUMBER_RANGED_ARMOURY in Town5 min built 1.0
	Player1Town = 0
	a = 1
	AISiege = 0	
	WaypointMain[7]
	WaypointRouteMain = 0
	Counter = 0
	Town8 = get town with id 8
	Catapult = 0
	AttackingTown = 2
	NumPat5 = 0
	h = 1
	Player0Town0 = 0
	Timer = create timer for 0 seconds
	oWall = 0
	GreekGateHouse1 = 0
	GreekGateHouse2 = 0
	AIPlatoon = 0
	Target = 0
	PointOn = 0
	CatapultMoveTimer1 = 5
	AttackTimer = 0
	ActionTimer = create timer for 0 seconds
	Wall1 = 0
	Wall2 = 0
	House = 0
	SiegeOnPointTimer = create timer for 0 seconds
	SiegeWeaponPoint = 0
	SiegeStucked = 0
	
start

begin loop
	a = 1
	PointOn = 0
	SiegeStucked = 0
	wait until LC10_Platoon[35] exists and LC10_Platoon[36] exists and LC10_SiegeCatapult[9] exists and LC10_SiegeCatapult[10] exists
	wait 5 seconds
	begin loop
		PlayerCreature = get distance from {LC10_SiegeCatapult[9]} to {oCreature}
		PlayerPlatoon1 = get platoon of player 0 nearest {LC10_SiegeCatapult[9]} radius 125
		Catapult = get siege weapon of player 0 nearest {LC10_SiegeCatapult[9]} radius 125
		
		if PlayerCreature > 10 and PlayerPlatoon1 not exists and Catapult not exists
			if PlayerPlatoon1 not exists
				a = 1
			elsif PlayerCreature > 10 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00
				a = 1
			elsif Catapult not exists
				a = 1
			end if
		end if
		
		if PlayerCreature <= 10 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00
			clear siege weapon LC10_SiegeCatapult[9] action queue
			a = 0
		elsif PlayerPlatoon1 exists and LC10_SiegeCatapult[9] can navigate to {PlayerPlatoon1}
			clear siege weapon LC10_SiegeCatapult[9] action queue
			a = 0
		elsif Catapult exists and LC10_SiegeCatapult[9] can navigate to {Catapult}
			clear siege weapon LC10_SiegeCatapult[9] action queue
			a = 0
		elsif PointOn != 12 and a == 1
			begin loop
				if LC10_SiegeCatapult[9] exists 
					if get SiegeOnPointTimer time remaining <= 0
						SiegeWeaponPoint = marker at {LC10_SiegeCatapult[9]}
						SiegeOnPointTimer = create timer for 65 seconds
					elsif get SiegeOnPointTimer time remaining <= 5
						if {LC10_SiegeCatapult[9]} near {SiegeWeaponPoint} radius 10
							clear siege weapon LC10_SiegeCatapult[9] action queue
							add action SIEGEWEAPON_AGENDA_ACTION_DISBAND using {LC10_SiegeCatapult[9]} to siege weapon LC10_SiegeCatapult[9] action queue//Siege just got stucked. Other possibilities to fix that wasn't successful for me.
							SiegeStucked = 1
						end if
					end if
					if get CatapultMoveTimer1 time remaining <= 0
						if get size of LC10_SiegeCatapult[9] action queue < 1

							if PointOn == 0
								if LC10_SiegeCatapult[9] can navigate to {SiegeRoute8[0]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute8[0]} to siege weapon LC10_SiegeCatapult[9] action queue
								end if
					
							elsif PointOn == 1
								if LC10_SiegeCatapult[9] can navigate to {SiegeRoute8[1]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute8[1]} to siege weapon LC10_SiegeCatapult[9] action queue
								end if

							elsif PointOn == 2
								if LC10_SiegeCatapult[9] can navigate to {SiegeRoute8[2]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute8[2]} to siege weapon LC10_SiegeCatapult[9] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute8[2]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[9] action queue
								end if
								
							elsif PointOn == 3
								if LC10_SiegeCatapult[9] can navigate to {SiegeRoute8[3]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute8[3]} to siege weapon LC10_SiegeCatapult[9] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute8[3]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[9] action queue
								end if
								
							elsif PointOn == 4
								if LC10_SiegeCatapult[9] can navigate to {SiegeRoute8[4]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute8[4]} to siege weapon LC10_SiegeCatapult[9] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute8[4]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[9] action queue
								end if
								
							elsif PointOn == 5
								if LC10_SiegeCatapult[9] can navigate to {SiegeRoute8[5]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute8[5]} to siege weapon LC10_SiegeCatapult[9] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute8[5]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[9] action queue
								end if
								
							elsif PointOn == 6
								if LC10_SiegeCatapult[9] can navigate to {SiegeRoute8[6]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute8[6]} to siege weapon LC10_SiegeCatapult[9] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute8[6]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[9] action queue
								end if
								
							elsif PointOn == 7
								if LC10_SiegeCatapult[9] can navigate to {SiegeRoute8[7]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute8[7]} to siege weapon LC10_SiegeCatapult[9] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute8[7]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[9] action queue
								end if
								
							elsif PointOn == 8
								if LC10_SiegeCatapult[9] can navigate to {SiegeRoute8[8]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute8[8]} to siege weapon LC10_SiegeCatapult[9] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute8[8]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[9] action queue
								end if
								
							elsif PointOn == 9
								if LC10_SiegeCatapult[9] can navigate to {SiegeRoute8[9]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute8[9]} to siege weapon LC10_SiegeCatapult[9] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute8[9]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[9] action queue
								end if
								
							elsif PointOn == 10
								if LC10_SiegeCatapult[9] can navigate to {SiegeRoute8[10]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute8[10]} to siege weapon LC10_SiegeCatapult[9] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute8[10]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[9] action queue
								end if
								
							elsif PointOn == 11
								if LC10_SiegeCatapult[9] can navigate to {SiegeRoute8[11]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute8[11]} to siege weapon LC10_SiegeCatapult[9] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute8[11]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[9] action queue
								end if

							CatapultMoveTimer1 = create timer for 10 seconds
							
							end if
						end if
					end if		

					if {LC10_SiegeCatapult[9]} near {SiegeRoute8[0]} radius 15 and PointOn != 1
						PointOn = 1
					elsif {LC10_SiegeCatapult[9]} near {SiegeRoute8[1]} radius 15 and PointOn != 2
						PointOn = 2
					elsif {LC10_SiegeCatapult[9]} near {SiegeRoute8[2]} radius 15 and PointOn != 3
						PointOn = 3
					elsif {LC10_SiegeCatapult[9]} near {SiegeRoute8[3]} radius 15 and PointOn != 4
						PointOn = 4
					elsif {LC10_SiegeCatapult[9]} near {SiegeRoute8[4]} radius 15 and PointOn != 5
						PointOn = 5
					elsif {LC10_SiegeCatapult[9]} near {SiegeRoute8[5]} radius 15 and PointOn != 6
						PointOn = 6
					elsif {LC10_SiegeCatapult[9]} near {SiegeRoute8[6]} radius 15 and PointOn != 7
						PointOn = 7
					elsif {LC10_SiegeCatapult[9]} near {SiegeRoute8[7]} radius 15 and PointOn != 8
						PointOn = 8
					elsif {LC10_SiegeCatapult[9]} near {SiegeRoute8[8]} radius 15 and PointOn != 9
						PointOn = 9
					elsif {LC10_SiegeCatapult[9]} near {SiegeRoute8[9]} radius 15 and PointOn != 10
						PointOn = 10
					elsif {LC10_SiegeCatapult[9]} near {SiegeRoute8[10]} radius 15 and PointOn != 11
						PointOn = 11
					elsif {LC10_SiegeCatapult[9]} near {SiegeRoute8[11]} radius 15 and PointOn != 12
						PointOn = 12
					elsif not LC10_SiegeCatapult[9] can navigate to {SiegeRoute8[11]} and {LC10_SiegeCatapult[9]} near {SiegeRoute8[10]} radius 15 and PointOn != 12
						PointOn = 12
					end if
				end if
			until LC10_SiegeCatapult[9] not exists or PointOn == 12
			end loop
		end if
		
		until PointOn == 12 or LC10_SiegeCatapult[9] not exists
	end loop
	
	wait until VolcanoActivated == 0 and HurricaneActivated == 0
	wait 15 seconds
	
	wait 5 seconds
	
	UnderAttack = UnderAttack + 1
	clear siege weapon LC10_SiegeCatapult[9] action queue
	
	begin loop
		if get ActionTimer time remaining <= 0
			clear siege weapon LC10_SiegeCatapult[9] action queue
			ActionTimer = create timer for 10 seconds
			Wall1 = get wall segment nearest {LC10_SiegeCatapult[9]} radius 450
			if Wall1 exists and PLAYER of Wall1 == 0
				Target = marker at get target from {LC10_SiegeCatapult[9]} to {Wall1} distance 10 angle 180
				clear siege weapon LC10_SiegeCatapult[9] action queue
				if Wall1 exists
					add action SIEGEWEAPON_AGENDA_ACTION_ATTACK_THING using Wall1 to siege weapon LC10_SiegeCatapult[9] action queue
				end if
			elsif Wall1 not exists
				House = get building HOUSE in AztecFirstTown min built 0.6
				if House exists and PLAYER of House == 0
					Target = marker at get target from {LC10_SiegeCatapult[9]} to {House} distance 10 angle 180
					clear siege weapon LC10_SiegeCatapult[9] action queue
					if House exists
						add action SIEGEWEAPON_AGENDA_ACTION_ATTACK_THING using House to siege weapon LC10_SiegeCatapult[9] action queue
					end if
				end if
			end if
		end if
		until LC10_SiegeCatapult[9] not exists
	end loop
	
	UnderAttack = UnderAttack - 1
	
	if SiegeStucked == 1
		wait 10 seconds
		if LC10_SiegeCatapult[9] not exists LC10_SiegeCatapult[9] = recruit SIEGE_BALANCE_TYPE_CATAPULT_LEVEL_5 town AztecCapital siege weapon end if
	end if
	
end loop

end script LC10_SiegeCatapult9Actions

begin script LC10_SiegeCatapult10Actions

	PlayerCreature = 0
    PlayerPlatoon1 = 0
	oCreature = get player 0 creature
	NumPat1 = 0
	HeTeste1 = 0
	WorrNum = 0
	Town0 = get town with id 0
	Town5 = get town with id 5
	oTown = get town with id 0
	oTownCentre = get building ABODE_NUMBER_TOWN_CENTRE in Town0 min built 1.0
	Armory = get building ABODE_NUMBER_MELEE_ARMOURY in Town5 min built 1.0
	ArmoryRanged = get building ABODE_NUMBER_RANGED_ARMOURY in Town5 min built 1.0
	Player1Town = 0
	a = 1
	AISiege = 0	
	WaypointMain[7]
	WaypointRouteMain = 0
	Counter = 0
	Town8 = get town with id 8
	Catapult = 0
	AttackingTown = 2
	NumPat5 = 0
	h = 1
	Player0Town0 = 0
	Timer = create timer for 0 seconds
	oWall = 0
	GreekGateHouse1 = 0
	GreekGateHouse2 = 0
	AIPlatoon = 0
	Target = 0
	PointOn = 0
	CatapultMoveTimer1 = 5
	AttackTimer = 0
	ActionTimer = create timer for 0 seconds
	Wall1 = 0
	Wall2 = 0
	House = 0
	SiegeOnPointTimer = create timer for 0 seconds
	SiegeWeaponPoint = 0
	SiegeStucked = 0
	
start

begin loop
	a = 1
	PointOn = 0
	SiegeStucked = 0
	wait until LC10_Platoon[35] exists and LC10_Platoon[36] exists and LC10_SiegeCatapult[9] exists and LC10_SiegeCatapult[10] exists
	wait 5 seconds
	begin loop
		PlayerCreature = get distance from {LC10_SiegeCatapult[10]} to {oCreature}
		PlayerPlatoon1 = get platoon of player 0 nearest {LC10_SiegeCatapult[10]} radius 125
		Catapult = get siege weapon of player 0 nearest {LC10_SiegeCatapult[10]} radius 125
		
		if PlayerCreature > 10 and PlayerPlatoon1 not exists and Catapult not exists
			if PlayerPlatoon1 not exists
				a = 1
			elsif PlayerCreature > 10 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00
				a = 1
			elsif Catapult not exists
				a = 1
			end if
		end if
		
		if PlayerCreature <= 10 and SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of oCreature > 0.00
			clear siege weapon LC10_SiegeCatapult[10] action queue
			a = 0
		elsif PlayerPlatoon1 exists and LC10_SiegeCatapult[10] can navigate to {PlayerPlatoon1}
			clear siege weapon LC10_SiegeCatapult[10] action queue
			a = 0
		elsif Catapult exists and LC10_SiegeCatapult[10] can navigate to {Catapult}
			clear siege weapon LC10_SiegeCatapult[10] action queue
			a = 0
		elsif PointOn != 12 and a == 1
			begin loop
				if LC10_SiegeCatapult[10] exists 
					if get SiegeOnPointTimer time remaining <= 0
						SiegeWeaponPoint = marker at {LC10_SiegeCatapult[10]}
						SiegeOnPointTimer = create timer for 65 seconds
					elsif get SiegeOnPointTimer time remaining <= 5
						if {LC10_SiegeCatapult[10]} near {SiegeWeaponPoint} radius 10
							clear siege weapon LC10_SiegeCatapult[10] action queue
							add action SIEGEWEAPON_AGENDA_ACTION_DISBAND using {LC10_SiegeCatapult[10]} to siege weapon LC10_SiegeCatapult[10] action queue//Siege just got stucked. Other possibilities to fix that wasn't successful for me.
							SiegeStucked = 1
						end if
					end if
					if get CatapultMoveTimer1 time remaining <= 0
						if get size of LC10_SiegeCatapult[10] action queue < 1

							if PointOn == 0
								if LC10_SiegeCatapult[10] can navigate to {SiegeRoute9[0]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute9[0]} to siege weapon LC10_SiegeCatapult[10] action queue
								end if
					
							elsif PointOn == 1
								if LC10_SiegeCatapult[10] can navigate to {SiegeRoute9[1]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute9[1]} to siege weapon LC10_SiegeCatapult[10] action queue
								end if

							elsif PointOn == 2
								if LC10_SiegeCatapult[10] can navigate to {SiegeRoute9[2]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute9[2]} to siege weapon LC10_SiegeCatapult[10] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute9[2]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[10] action queue
								end if
								
							elsif PointOn == 3
								if LC10_SiegeCatapult[10] can navigate to {SiegeRoute9[3]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute9[3]} to siege weapon LC10_SiegeCatapult[10] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute9[3]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[10] action queue
								end if
								
							elsif PointOn == 4
								if LC10_SiegeCatapult[10] can navigate to {SiegeRoute9[4]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute9[4]} to siege weapon LC10_SiegeCatapult[10] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute9[4]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[10] action queue
								end if
								
							elsif PointOn == 5
								if LC10_SiegeCatapult[10] can navigate to {SiegeRoute9[5]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute9[5]} to siege weapon LC10_SiegeCatapult[10] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute9[5]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[10] action queue
								end if
								
							elsif PointOn == 6
								if LC10_SiegeCatapult[10] can navigate to {SiegeRoute9[6]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute9[6]} to siege weapon LC10_SiegeCatapult[10] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute9[6]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[10] action queue
								end if
								
							elsif PointOn == 7
								if LC10_SiegeCatapult[10] can navigate to {SiegeRoute9[7]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute9[7]} to siege weapon LC10_SiegeCatapult[10] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute9[7]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[10] action queue
								end if
								
							elsif PointOn == 8
								if LC10_SiegeCatapult[10] can navigate to {SiegeRoute9[8]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute9[8]} to siege weapon LC10_SiegeCatapult[10] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute9[8]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[10] action queue
								end if
								
							elsif PointOn == 9
								if LC10_SiegeCatapult[10] can navigate to {SiegeRoute9[9]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute9[9]} to siege weapon LC10_SiegeCatapult[10] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute9[9]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[10] action queue
								end if
								
							elsif PointOn == 10
								if LC10_SiegeCatapult[10] can navigate to {SiegeRoute9[10]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute9[10]} to siege weapon LC10_SiegeCatapult[10] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute9[10]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[10] action queue
								end if
								
							elsif PointOn == 11
								if LC10_SiegeCatapult[10] can navigate to {SiegeRoute9[11]}
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute9[11]} to siege weapon LC10_SiegeCatapult[10] action queue
								else
									add action SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {SiegeRoute9[11]} + {4.00,0.00,4.00} to siege weapon LC10_SiegeCatapult[10] action queue
								end if

							CatapultMoveTimer1 = create timer for 10 seconds
							
							end if
						end if
					end if		

					if {LC10_SiegeCatapult[10]} near {SiegeRoute9[0]} radius 15 and PointOn != 1
						PointOn = 1
					elsif {LC10_SiegeCatapult[10]} near {SiegeRoute9[1]} radius 15 and PointOn != 2
						PointOn = 2
					elsif {LC10_SiegeCatapult[10]} near {SiegeRoute9[2]} radius 15 and PointOn != 3
						PointOn = 3
					elsif {LC10_SiegeCatapult[10]} near {SiegeRoute9[3]} radius 15 and PointOn != 4
						PointOn = 4
					elsif {LC10_SiegeCatapult[10]} near {SiegeRoute9[4]} radius 15 and PointOn != 5
						PointOn = 5
					elsif {LC10_SiegeCatapult[10]} near {SiegeRoute9[5]} radius 15 and PointOn != 6
						PointOn = 6
					elsif {LC10_SiegeCatapult[10]} near {SiegeRoute9[6]} radius 15 and PointOn != 7
						PointOn = 7
					elsif {LC10_SiegeCatapult[10]} near {SiegeRoute9[7]} radius 15 and PointOn != 8
						PointOn = 8
					elsif {LC10_SiegeCatapult[10]} near {SiegeRoute9[8]} radius 15 and PointOn != 9
						PointOn = 9
					elsif {LC10_SiegeCatapult[10]} near {SiegeRoute9[9]} radius 15 and PointOn != 10
						PointOn = 10
					elsif {LC10_SiegeCatapult[10]} near {SiegeRoute9[10]} radius 15 and PointOn != 11
						PointOn = 11
					elsif {LC10_SiegeCatapult[10]} near {SiegeRoute9[11]} radius 15 and PointOn != 12
						PointOn = 12
					elsif not LC10_SiegeCatapult[10] can navigate to {SiegeRoute9[11]} and {LC10_SiegeCatapult[10]} near {SiegeRoute9[10]} radius 15 and PointOn != 12
						PointOn = 12
					end if
				end if
			until LC10_SiegeCatapult[10] not exists or PointOn == 12
			end loop
		end if
		
		until PointOn == 12 or LC10_SiegeCatapult[10] not exists
	end loop
	
	wait until VolcanoActivated == 0 and HurricaneActivated == 0
	wait 15 seconds
	
	wait 5 seconds
	
	UnderAttack = UnderAttack + 1
	clear siege weapon LC10_SiegeCatapult[10] action queue
	
	begin loop
		if get ActionTimer time remaining <= 0
			clear siege weapon LC10_SiegeCatapult[10] action queue
			ActionTimer = create timer for 10 seconds
			Wall1 = get wall segment nearest {LC10_SiegeCatapult[10]} radius 450
			if Wall1 exists and PLAYER of Wall1 == 0
				Target = marker at get target from {LC10_SiegeCatapult[10]} to {Wall1} distance 10 angle 180
				clear siege weapon LC10_SiegeCatapult[10] action queue
				if Wall1 exists
					add action SIEGEWEAPON_AGENDA_ACTION_ATTACK_THING using Wall1 to siege weapon LC10_SiegeCatapult[10] action queue
				end if
			elsif Wall1 not exists
				House = get building HOUSE in AztecFirstTown min built 0.6
				if House exists and PLAYER of House == 0
					Target = marker at get target from {LC10_SiegeCatapult[10]} to {House} distance 10 angle 180
					clear siege weapon LC10_SiegeCatapult[10] action queue
					if House exists
						add action SIEGEWEAPON_AGENDA_ACTION_ATTACK_THING using House to siege weapon LC10_SiegeCatapult[10] action queue
					end if
				end if
			end if
		end if
		until LC10_SiegeCatapult[10] not exists
	end loop
	
	UnderAttack = UnderAttack - 1
	
	if SiegeStucked == 1
		wait 10 seconds
		if LC10_SiegeCatapult[10] not exists LC10_SiegeCatapult[10] = recruit SIEGE_BALANCE_TYPE_CATAPULT_LEVEL_5 town AztecCapital siege weapon end if
	end if
	
end loop

end script LC10_SiegeCatapult10Actions
