label="2p - Weldyn Channel Turn 13_Almogaver_left"
version="1.6"
completion="running"
campaign_type="multiplayer"
difficulty="NORMAL"
random_seed="2003138879"
random_calls="0"
next_underlying_unit_id="39"
end_text_duration="0"
[variables]
[/variables]
[replay]
	[command]
		[start]
		[/start]
	[/command]
	[command]
		[recruit]
			value="4"
			x="17"
			y="4"
		[/recruit]
		[random]
			value="1915306961"
		[/random]
		[random]
			value="461579701"
		[/random]
		[random]
			value="1933922609"
		[/random]
		[random]
			value="1357434037"
		[/random]
		[random]
			value="1051472731"
		[/random]
		[random]
			value="1865331068"
		[/random]
		[random]
			value="1453369054"
		[/random]
		[random]
			value="597989461"
		[/random]
		[random]
			value="1233721294"
		[/random]
		[random]
			value="1024729157"
		[/random]
		[random]
			value="182099046"
		[/random]
		[random]
			value="1227886969"
		[/random]
		[random]
			value="359962069"
		[/random]
		[random]
			value="1003392216"
		[/random]
		[random]
			value="287158063"
			[results]
				checksum="uyqOVzDO<ExdHrVAAKrGB6qDQPwqLuEDUSNIMADRBGxxpOFSryqC1rOBpDQNRqrWuTuTxCUFIDPxfDLuyOdqNHp2JuaZMrXGikJwc0bkdie+c.P93obZj,mcol3b,IXl"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="Almogaver"
			message="play fast plis"
			side="2"
		[/speak]
	[/command]
	[command]
		[recruit]
			value="7"
			x="16"
			y="3"
		[/recruit]
		[random]
			value="539947256"
		[/random]
		[random]
			value="1411253710"
		[/random]
		[random]
			value="1300380834"
		[/random]
		[random]
			value="534907472"
		[/random]
		[random]
			value="1114955223"
		[/random]
		[random]
			value="1525238422"
		[/random]
		[random]
			value="164311209"
		[/random]
		[random]
			value="240935067"
		[/random]
		[random]
			value="1293061735"
		[/random]
		[random]
			value="625890910"
		[/random]
		[random]
			value="27374029"
		[/random]
		[random]
			value="503012125"
		[/random]
		[random]
			value="1677363641"
		[/random]
		[random]
			value="1892705097"
		[/random]
		[random]
			value="1956381179"
			[results]
				checksum="86Wmq3.,tb9Th9Xh+8Om3eb898egWbi26k39>2dlaZge0f-9iPif8c7h8k-+v7e7e8fh1k<i8Sem73jI-oaGeRO,h0ybO20xxhh6<5,n30KE4<Yfd6-cbeDq5.ql>pFA"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="nigel has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[recruit]
			value="4"
			x="15"
			y="4"
		[/recruit]
		[random]
			value="20625848"
		[/random]
		[random]
			value="89809297"
		[/random]
		[random]
			value="489317422"
		[/random]
		[random]
			value="1447269307"
		[/random]
		[random]
			value="446875171"
		[/random]
		[random]
			value="1726662297"
		[/random]
		[random]
			value="554678978"
		[/random]
		[random]
			value="683249563"
		[/random]
		[random]
			value="119125906"
		[/random]
		[random]
			value="1965932689"
		[/random]
		[random]
			value="1983630398"
		[/random]
		[random]
			value="654033378"
		[/random]
		[random]
			value="933404264"
		[/random]
		[random]
			value="1361385172"
		[/random]
		[random]
			value="818344587"
			[results]
				checksum="FIxBwyUzhyBkwVHKQOq5AMPytSNtRJzMRsDuHBtnQvBFyQAVsL8qJTmQQNRqrWuTuTxCUEQDPxfDLuyOdqNHp2JuaZMrXGikJwc0bkdib+c.P93obZj,mcpd3b,IXl32"
			[/results]
		[/random]
	[/command]
	[command]
		[recruit]
			value="4"
			x="13"
			y="4"
		[/recruit]
		[random]
			value="818872916"
		[/random]
		[random]
			value="1101984945"
		[/random]
		[random]
			value="1925877554"
		[/random]
		[random]
			value="1652499604"
		[/random]
		[random]
			value="1411953445"
		[/random]
		[random]
			value="1985223618"
		[/random]
		[random]
			value="698604714"
		[/random]
		[random]
			value="577830514"
		[/random]
		[random]
			value="184244098"
		[/random]
		[random]
			value="719230563"
		[/random]
		[random]
			value="667639811"
		[/random]
		[random]
			value="673561521"
		[/random]
		[random]
			value="19016222"
		[/random]
		[random]
			value="1114514983"
		[/random]
		[random]
			value="252740170"
			[results]
				checksum="FIxBwyUzhyBkwVHKQOq5AMPytSNtRJzMRsDuHBtnQvBFyQAVsL8qJTmQQNRqrWuTuTxCUFGDPxfDLuyOdqNHp2JuaZJrXGikJwc0bkdib+c.P93obZj,mcoj3b,IXl32"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Tonix has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[recruit]
			value="7"
			x="14"
			y="3"
		[/recruit]
		[random]
			value="1354776080"
		[/random]
		[random]
			value="1140995890"
		[/random]
		[random]
			value="1554117551"
		[/random]
		[random]
			value="217267816"
		[/random]
		[random]
			value="2115111381"
		[/random]
		[random]
			value="353568714"
		[/random]
		[random]
			value="1036140732"
		[/random]
		[random]
			value="1069612678"
		[/random]
		[random]
			value="131962620"
		[/random]
		[random]
			value="541156689"
		[/random]
		[random]
			value="334082475"
		[/random]
		[random]
			value="2117186238"
		[/random]
		[random]
			value="1239761403"
		[/random]
		[random]
			value="911912989"
		[/random]
		[random]
			value="153946689"
			[results]
				checksum="86Wmq3.,tb9Th9Xh+8Om3eb898egWbi26k39>2dlaZge0f-9iPif8c7h8k-+v7e7e8fh18<i8Sem73jI-oaGeRO,h>ybO20xxhh6<5,n30KE4<Yfd6-cbePq5.ql>pFA"
			[/results]
		[/random]
	[/command]
	[command]
		[recruit]
			value="5"
			x="15"
			y="2"
		[/recruit]
		[random]
			value="796363984"
		[/random]
		[random]
			value="1830776331"
		[/random]
		[random]
			value="330530263"
		[/random]
		[random]
			value="2121912490"
		[/random]
		[random]
			value="531105503"
		[/random]
		[random]
			value="27290657"
		[/random]
		[random]
			value="326833033"
		[/random]
		[random]
			value="1885881583"
		[/random]
		[random]
			value="1168286547"
		[/random]
		[random]
			value="1880950584"
		[/random]
		[random]
			value="2103149400"
		[/random]
		[random]
			value="1135914280"
		[/random]
		[random]
			value="87035650"
		[/random]
		[random]
			value="991806484"
		[/random]
		[random]
			value="58043310"
			[results]
				checksum="8ax-d6b6xp8sjgga3aP72g3e+iBm.jefmffY-+6<ip3<5-4egW6m2lahna90i9fl5a1hh7oj8-<F-<mkj.91>I6ygXo9WjoolcACZdd9b,<-lvi1OF>M69sv8joLJwOp"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="15,14,13,13,13"
			y="3,3,4,5,6"
		[/move]
	[/command]
	[command]
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="7"
			x="13"
			y="19"
		[/recruit]
		[random]
			value="31817"
		[/random]
		[random]
			value="30761"
		[/random]
		[random]
			value="14508"
		[/random]
		[random]
			value="24621"
		[/random]
		[random]
			value="24129"
		[/random]
		[random]
			value="14125"
		[/random]
		[random]
			value="24606"
		[/random]
		[random]
			value="671"
		[/random]
		[random]
			value="22987"
		[/random]
		[random]
			value="5166"
		[/random]
		[random]
			value="29060"
		[/random]
		[random]
			value="3955"
		[/random]
		[random]
			value="16774"
		[/random]
		[random]
			value="16025"
		[/random]
		[random]
			value="10410"
			[results]
				checksum=",Ad3Y5f-Gtmsop5jHbEoRiSrOCpxE4IDyxOzzQOG.nCLyyGDmUtLNvFrwCUxRLwFwmIsr1QENmxPFHFw.RFKFnqypNLoM8mwoFomIhFlq1.CLB<<ddNv5EsLNHBNzhOI"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="7"
			x="17"
			y="19"
		[/recruit]
		[random]
			value="31830"
		[/random]
		[random]
			value="20265"
		[/random]
		[random]
			value="23996"
		[/random]
		[random]
			value="25681"
		[/random]
		[random]
			value="9045"
		[/random]
		[random]
			value="28911"
		[/random]
		[random]
			value="8037"
		[/random]
		[random]
			value="26791"
		[/random]
		[random]
			value="32676"
		[/random]
		[random]
			value="20565"
		[/random]
		[random]
			value="4985"
		[/random]
		[random]
			value="2002"
		[/random]
		[random]
			value="6438"
		[/random]
		[random]
			value="25346"
		[/random]
		[random]
			value="28950"
			[results]
				checksum=",Ad3Y5f-Gtmsmp5jHbEoRiVrOCpxE4IDyxOzzQOG.nCLyyGDmUtLNvFrwCUxRLwFwmIsr1QENmxPFHFw.RFKFnqypNLmM8mwoFomIhFlq1.CLB<<ddNv5EsLNHBNzkOI"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="0"
			x="14"
			y="19"
		[/recruit]
		[random]
			value="21787"
		[/random]
		[random]
			value="3580"
		[/random]
		[random]
			value="18591"
		[/random]
		[random]
			value="9560"
		[/random]
		[random]
			value="29682"
		[/random]
		[random]
			value="31166"
		[/random]
		[random]
			value="29628"
		[/random]
		[random]
			value="784"
		[/random]
		[random]
			value="16095"
		[/random]
		[random]
			value="26883"
		[/random]
		[random]
			value="16656"
		[/random]
		[random]
			value="10219"
		[/random]
		[random]
			value="3843"
		[/random]
		[random]
			value="3249"
		[/random]
		[random]
			value="10485"
			[results]
				checksum="pMyPwoKvbBq0MCQtxRPyPu1PqOvyvtVtPtsuCMyPNLLqFJRxvqM3FDTGMqHwEVMDODuIOJsNErPcOusOKDwebPsxOruODoP.K+zDJqnqswJL0PpQ,RvAQ30CF>hl1cth"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="0"
			x="16"
			y="19"
		[/recruit]
		[random]
			value="20171"
		[/random]
		[random]
			value="13111"
		[/random]
		[random]
			value="19629"
		[/random]
		[random]
			value="15880"
		[/random]
		[random]
			value="15088"
		[/random]
		[random]
			value="29372"
		[/random]
		[random]
			value="7037"
		[/random]
		[random]
			value="23991"
		[/random]
		[random]
			value="6853"
		[/random]
		[random]
			value="27869"
		[/random]
		[random]
			value="23938"
		[/random]
		[random]
			value="3771"
		[/random]
		[random]
			value="2504"
		[/random]
		[random]
			value="25579"
		[/random]
		[random]
			value="19793"
			[results]
				checksum="pMyPvoKvbBq0MCQtxRPyPu1PqOvyvtVtPtsuCMyPNLLqFJRxvqM3FDTGMqHwEVMDODuIOJsNEBPcOusOKDwebPsxOruODoP.K+zDJqnqswJG0PpQ,OvAQ30CF>nl1cth"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="6"
			x="15"
			y="19"
		[/recruit]
		[random]
			value="11172"
		[/random]
		[random]
			value="22859"
		[/random]
		[random]
			value="22764"
		[/random]
		[random]
			value="187"
		[/random]
		[random]
			value="5101"
		[/random]
		[random]
			value="32358"
		[/random]
		[random]
			value="18174"
		[/random]
		[random]
			value="14494"
		[/random]
		[random]
			value="5937"
		[/random]
		[random]
			value="24591"
		[/random]
		[random]
			value="6882"
		[/random]
		[random]
			value="8344"
		[/random]
		[random]
			value="18839"
		[/random]
		[random]
			value="18981"
		[/random]
		[random]
			value="6155"
			[results]
				checksum="XBfX4cmcHYau810h3t9co8gj2UWo-1,n-62ad7l9i<dX9dX-4o9W2w2-6hZd9kbd.d07gZj2f,ei>ybXfdk5k4Nw>d595,cp6dzgA.Zj4982<j3D1<4M26i7zO.<BtyI"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="7"
			x="15"
			y="21"
		[/recruit]
		[random]
			value="32403"
		[/random]
		[random]
			value="23563"
		[/random]
		[random]
			value="9609"
		[/random]
		[random]
			value="17871"
		[/random]
		[random]
			value="18289"
		[/random]
		[random]
			value="20765"
		[/random]
		[random]
			value="9876"
		[/random]
		[random]
			value="13358"
		[/random]
		[random]
			value="28943"
		[/random]
		[random]
			value="6735"
		[/random]
		[random]
			value="3098"
		[/random]
		[random]
			value="1669"
		[/random]
		[random]
			value="7820"
		[/random]
		[random]
			value="7315"
		[/random]
		[random]
			value="31830"
			[results]
				checksum=",Ad3Y5f-Gtmnrp5jHbEoRiVrOCpxE4IDyxOzzQOG.nCLyyGDmUtLNvFrwCUxRLwFwmIsr1QENmxPFHFw.RFKFnqypNQrM8mwoFomIhFlq1.CLB<<ddNv5EsLNHBNzhOI"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="15,16,17,17,17"
			y="20,19,19,18,17"
		[/move]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="2"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		[move]
			x="15,16,17,18,19,20,21,22,23,24"
			y="2,2,2,2,3,2,2,2,2,2"
		[/move]
	[/command]
	[command]
		[move]
			x="14,15,16,17,18,19,19"
			y="3,4,4,5,5,6,7"
		[/move]
	[/command]
	[command]
		[move]
			x="15,16,17,18,19,20,21,22"
			y="4,3,4,4,5,5,5,5"
		[/move]
	[/command]
	[command]
		[move]
			x="17,18,19,20,21,22,23,24"
			y="4,4,5,5,6,6,7,7"
		[/move]
	[/command]
	[command]
		[move]
			x="16,17,18,19,20,21,22,23"
			y="3,4,4,5,5,6,6,7"
		[/move]
	[/command]
	[command]
		[move]
			x="13,12,11,10,9,8,7"
			y="4,3,3,2,2,2,2"
		[/move]
	[/command]
	[command]
		[move]
			x="13,13,13"
			y="6,5,4"
		[/move]
	[/command]
	[command]
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="OrO has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="14,13,13,12,11,11"
			y="19,19,18,17,17,16"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="13,12,11,10,9,8"
			y="19,18,18,17,18,17"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="15,15,15,16,16,16,16"
			y="19,18,17,16,15,14,13"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="16,16"
			y="13,12"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="16,17,18,19,20,21"
			y="19,19,19,20,19,20"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="17,18,19,20,21,22"
			y="19,18,18,17,17,16"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Bruce has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="15,16,17,18,19,20"
			y="21,20,20,19,19,18"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="17,17,17,16,15"
			y="17,18,19,19,20"
		[/move]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="2"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		[move]
			x="24,24,24,24,23"
			y="2,3,4,5,6"
		[/move]
	[/command]
	[command]
		[move]
			x="7,7,7,7,7,7,6"
			y="2,3,4,5,6,7,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="DommE has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Dunval has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="23,23,23"
			y="6,7,8"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="KohlenJockeL has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="jmps has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="grubsteak has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="23,24,24,24,24"
			y="7,7,8,9,10"
		[/move]
	[/command]
	[command]
		[move]
			x="24,24,24,25,25"
			y="7,8,9,10,11"
		[/move]
	[/command]
	[command]
		[move]
			x="19,20,21,21,21"
			y="7,7,8,9,10"
		[/move]
	[/command]
	[command]
		[move]
			x="22,22,23,23,23,23"
			y="5,6,7,8,9,10"
		[/move]
	[/command]
	[command]
		[recruit]
			value="7"
			x="17"
			y="4"
		[/recruit]
		[random]
			value="2077566643"
		[/random]
		[random]
			value="1566031613"
		[/random]
		[random]
			value="1959711780"
		[/random]
		[random]
			value="267716301"
		[/random]
		[random]
			value="1717969663"
		[/random]
		[random]
			value="2144172821"
		[/random]
		[random]
			value="757318716"
		[/random]
		[random]
			value="937502168"
		[/random]
		[random]
			value="1139369648"
		[/random]
		[random]
			value="747172247"
		[/random]
		[random]
			value="1129545507"
		[/random]
		[random]
			value="80866301"
		[/random]
		[random]
			value="957811998"
		[/random]
		[random]
			value="1507068627"
		[/random]
		[random]
			value="213647952"
			[results]
				checksum="c4ibeoBjPXdN9277b82>Vg,h+ld6d5,0c<W-1<71YYc5-d+8873Gj8ibkh8k-+v7e7e8fh0c<i8Sem73jI-oaGeRO,h>ybO20xxhh6<5,n30KE4<Yfd6-cbfLq5.ql>p"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Skyswimsky has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="13,14,15,16"
			y="4,3,3,3"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="lololol has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="23,23,24"
			y="8,9,9"
		[/move]
	[/command]
	[command]
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[move]
			x="20,21,22,23,23"
			y="18,18,17,17,16"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="23,24"
			y="16,15"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="21,21,21,21,21"
			y="20,19,18,17,16"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="22,21,20"
			y="16,16,15"
		[/move]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="5"
			x="17"
			y="19"
		[/recruit]
		[random]
			value="8861"
		[/random]
		[random]
			value="14375"
		[/random]
		[random]
			value="15029"
		[/random]
		[random]
			value="17211"
		[/random]
		[random]
			value="11273"
		[/random]
		[random]
			value="4528"
		[/random]
		[random]
			value="19195"
		[/random]
		[random]
			value="16647"
		[/random]
		[random]
			value="5897"
		[/random]
		[random]
			value="21191"
		[/random]
		[random]
			value="29614"
		[/random]
		[random]
			value="11331"
		[/random]
		[random]
			value="10648"
		[/random]
		[random]
			value="4493"
		[/random]
		[random]
			value="31294"
			[results]
				checksum="-n9sN+-Dy+EeNQrPbGMNQXtz0Ipzwss1tysRRKOwxuoVBywHrwxEqutHtKzE>BNMxHQOHFw.RFKFnqypNKqM8mwoFomIhFlq1.CL-<<ddBfkHDONNHvMSO1I9LGCHpAC"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="11,10,9,8,7,6"
			y="16,16,17,16,16,15"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="8,8,7,6,6"
			y="17,18,19,19,20"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="16,17"
			y="12,12"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="17,17"
			y="12,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="17,17,17,16,15"
			y="11,10,9,8,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="2"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="1337hax00r has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="24,24,24,24"
			y="9,10,11,12"
		[/move]
	[/command]
	[command]
		[move]
			x="25,25,25,25,26"
			y="11,12,13,14,14"
		[/move]
	[/command]
	[command]
		[move]
			x="24,24,25,25,25"
			y="10,11,12,13,14"
		[/move]
	[/command]
	[command]
		[move]
			x="23,23,23,23,22"
			y="10,11,12,13,13"
		[/move]
	[/command]
	[command]
		[move]
			x="21,21,21,20"
			y="10,11,12,12"
		[/move]
	[/command]
	[command]
		[move]
			x="24,25,26,27,27,27,28"
			y="12,13,13,14,15,16,16"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Sonnenwind_crash has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="17,18,19,20,21,22,23"
			y="4,4,5,5,6,6,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="mnewton1 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="16,15"
			y="3,3"
		[/move]
	[/command]
	[command]
		[recruit]
			value="7"
			x="17"
			y="4"
		[/recruit]
		[random]
			value="519742658"
		[/random]
		[random]
			value="2128046092"
		[/random]
		[random]
			value="946948691"
		[/random]
		[random]
			value="1733348125"
		[/random]
		[random]
			value="1753804911"
		[/random]
		[random]
			value="438065898"
		[/random]
		[random]
			value="1439540797"
		[/random]
		[random]
			value="1768373186"
		[/random]
		[random]
			value="844376368"
		[/random]
		[random]
			value="648593301"
		[/random]
		[random]
			value="834111610"
		[/random]
		[random]
			value="343469804"
		[/random]
		[random]
			value="29794240"
		[/random]
		[random]
			value="917538671"
		[/random]
		[random]
			value="1464295236"
			[results]
				checksum="96Wmq3.,tb9Th9Xh+8Om3eb898egWbi26k39>2dlaZge0f-9iPif8c7h8k-+v7e7e8fh0c<i8Sem73jI-oaGeRO,h>ybO20xxhh6<5,n30KE4<Yfd6-cbfLq5.ql>pFA"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="subLime has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="bluey has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="cemalmomo has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="oyuncu has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="15,16"
			y="3,3"
		[/move]
	[/command]
	[command]
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="1337hax00r has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="pirrus2 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="17,18,19,20,20"
			y="19,18,18,17,16"
		[/move]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="3"
			x="17"
			y="19"
		[/recruit]
		[random]
			value="7113"
		[/random]
		[random]
			value="32036"
		[/random]
		[random]
			value="7055"
		[/random]
		[random]
			value="3405"
		[/random]
		[random]
			value="21440"
		[/random]
		[random]
			value="25936"
		[/random]
		[random]
			value="6678"
		[/random]
		[random]
			value="14031"
		[/random]
		[random]
			value="2357"
		[/random]
		[random]
			value="19266"
		[/random]
		[random]
			value="139"
		[/random]
		[random]
			value="14545"
		[/random]
		[random]
			value="26702"
		[/random]
		[random]
			value="28379"
		[/random]
		[random]
			value="601"
			[results]
				checksum="eKEMoMsJ2Sm2IxNK-ruIvyJD8uFQquOORqLQAKsDuHBwnqvBFyQvVsL8qHTmQQNRqrWuTuTxDUFLDPxfDLuyOcqNHBnCR5lyBlS<1Ip648,gYgdg-Lb7,b2<2j8d,4eh"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="6,6,6,6,6,6,6"
			y="20,19,18,17,16,15,14"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="15,14,13,12,11"
			y="9,9,9,9,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="nr5150 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="6,6,6"
			y="15,14,13"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="6,6,6,6"
			y="13,12,11,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="11,12"
			y="10,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="12,13,14"
			y="9,9,8"
		[/move]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="2"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		[move]
			x="22,22"
			y="13,14"
		[/move]
	[/command]
	[command]
		[move]
			x="22,23"
			y="14,15"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="23"
				y="15"
			[/source]
			[destination]
				x="24"
				y="15"
			[/destination]
		[/attack]
		[random]
			value="429094457"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1167624184"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="610344436"
			[results]
				chance="40"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Pandemonium has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="25,26,26,25"
			y="14,14,15,16"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="25"
				y="16"
			[/source]
			[destination]
				x="24"
				y="15"
			[/destination]
		[/attack]
		[random]
			value="726652985"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1719179717"
			[results]
				chance="40"
				damage="10"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="452043141"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1630241542"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1216872139"
			[results]
				chance="40"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1128555776"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="26,26,26,25,24"
			y="14,15,16,17,16"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="24"
				y="16"
			[/source]
			[destination]
				x="24"
				y="15"
			[/destination]
		[/attack]
		[random]
			value="1813510285"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1977050159"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="482281274"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="28,27,26,25"
			y="16,16,15,15"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="25"
				y="15"
			[/source]
			[destination]
				x="24"
				y="15"
			[/destination]
		[/attack]
		[random]
			value="1062452051"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="774641689"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="27763516"
			[results]
				chance="50"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1497463745"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1138011110"
			[results]
				chance="50"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="renaud has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="lakerer has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="20,21,22,23,24,24"
			y="12,12,12,13,13,14"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="24"
				y="14"
			[/source]
			[destination]
				x="24"
				y="15"
			[/destination]
		[/attack]
		[random]
			value="448832934"
			[results]
				chance="40"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="767506388"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1451681539"
			[results]
				chance="40"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1777460826"
			[results]
				chance="40"
				damage="12"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="452270651"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="345171807"
			[results]
				chance="40"
				damage="12"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="23,23,23,23,23,23"
			y="7,8,9,10,11,12"
		[/move]
	[/command]
	[command]
		[move]
			x="17,18,19,20,21,22,23"
			y="4,4,5,5,6,6,7"
		[/move]
	[/command]
	[command]
		[move]
			x="16,15"
			y="3,3"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Stenen_ has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[recruit]
			value="7"
			x="17"
			y="4"
		[/recruit]
		[random]
			value="1875788350"
		[/random]
		[random]
			value="1996193833"
		[/random]
		[random]
			value="1149575662"
		[/random]
		[random]
			value="322052584"
		[/random]
		[random]
			value="391659006"
		[/random]
		[random]
			value="354809167"
		[/random]
		[random]
			value="1852609688"
		[/random]
		[random]
			value="242565738"
		[/random]
		[random]
			value="1798258406"
		[/random]
		[random]
			value="370180524"
		[/random]
		[random]
			value="1943180352"
		[/random]
		[random]
			value="438731341"
		[/random]
		[random]
			value="1746029684"
		[/random]
		[random]
			value="2001140167"
		[/random]
		[random]
			value="953013350"
			[results]
				checksum="96Wmq3.,tb9Th9Xh+8Om3eb898egWbi26k39>2dlaZge0f-9iPif8c7h8k-+v7e7e8fh1l<i8Sem73jI-oaGeRO,h0ybO20xxhh6<5-i30KE4<Yfd6-cbeCq5.ql>pFA"
			[/results]
		[/random]
	[/command]
	[command]
		[recruit]
			value="7"
			x="15"
			y="4"
		[/recruit]
		[random]
			value="1876891988"
		[/random]
		[random]
			value="1138760479"
		[/random]
		[random]
			value="1339507564"
		[/random]
		[random]
			value="1582018028"
		[/random]
		[random]
			value="1381326217"
		[/random]
		[random]
			value="990282322"
		[/random]
		[random]
			value="1952198552"
		[/random]
		[random]
			value="1177022921"
		[/random]
		[random]
			value="1429013663"
		[/random]
		[random]
			value="1550744589"
		[/random]
		[random]
			value="1030679441"
		[/random]
		[random]
			value="234543365"
		[/random]
		[random]
			value="1979449190"
		[/random]
		[random]
			value="52288118"
		[/random]
		[random]
			value="1630065013"
			[results]
				checksum="86Wmq3.,tb9Th9Xh+8Om3eb898egWbi26k39>2dlaZge0f-9iPif8c7h8k-+v7e7e8fh1b<i8Sem73jI-oaGeRO,h0ybO20xxhh6<5-i30KE4<Yfd6-cbeMq5.ql>pFA"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="-stf- has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="15,16"
			y="3,3"
		[/move]
	[/command]
	[command]
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Kyadytim has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Aleksandr_Nevskiy has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="24"
				y="15"
			[/source]
			[destination]
				x="24"
				y="14"
			[/destination]
		[/attack]
		[random]
			value="26636"
			[results]
				chance="40"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="17054"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="12400"
			[results]
				chance="40"
				damage="7"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="grkan has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="20,21,21,22,23"
			y="15,15,14,13,14"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="23"
				y="14"
			[/source]
			[destination]
				x="23"
				y="15"
			[/destination]
		[/attack]
		[random]
			value="10135"
			[results]
				chance="40"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="15483"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="32739"
			[results]
				chance="40"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="18551"
			[results]
				chance="60"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="12671"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="20,21,22,23"
			y="16,17,16,16"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="23"
				y="16"
			[/source]
			[destination]
				x="23"
				y="15"
			[/destination]
		[/attack]
		[random]
			value="10364"
			[results]
				chance="70"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="32005"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="30413"
			[results]
				chance="70"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="329"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="8204"
			[results]
				chance="70"
				damage="5"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="WIF_ginozzo has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="J has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="21,22,22,23,24"
			y="16,16,17,18,17"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="24"
				y="17"
			[/source]
			[destination]
				x="24"
				y="16"
			[/destination]
		[/attack]
		[random]
			value="31094"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="8763"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="7773"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="3323"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="21183"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="17,18,19,20,21,22"
			y="19,18,18,17,17,16"
		[/move]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="7"
			x="17"
			y="19"
		[/recruit]
		[random]
			value="2123"
		[/random]
		[random]
			value="4895"
		[/random]
		[random]
			value="11544"
		[/random]
		[random]
			value="11329"
		[/random]
		[random]
			value="4668"
		[/random]
		[random]
			value="5591"
		[/random]
		[random]
			value="2711"
		[/random]
		[random]
			value="3348"
		[/random]
		[random]
			value="1302"
		[/random]
		[random]
			value="31121"
		[/random]
		[random]
			value="13769"
		[/random]
		[random]
			value="26260"
		[/random]
		[random]
			value="19597"
		[/random]
		[random]
			value="30598"
		[/random]
		[random]
			value="19993"
			[results]
				checksum=",Ad3Y5f-Gtmspp5jHbEoRiSrOCpxE4IDyxOzzQOG.nCLyyGDmUtLNvFrwCUxRLwFwmIsr1QENmxPFHFw.RFKFnqypNLpM8mwoFomIhFlq1.CLW<<ddNv5EsLNHBNzkOI"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="15,16,17,18,19,20"
			y="20,19,19,18,18,17"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="6,6,6,6,5,5"
			y="14,13,12,11,11,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="6,6,5"
			y="10,9,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Battle has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="reini has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="14,15,16,17,18"
			y="8,8,7,8,8"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="18,19,20"
			y="8,8,8"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="20,19"
			y="8,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="2"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		[move]
			x="25,24"
			y="15,14"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="24"
				y="14"
			[/source]
			[destination]
				x="24"
				y="15"
			[/destination]
		[/attack]
		[random]
			value="807265081"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1054195940"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1633491976"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="856390191"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="398858203"
			[results]
				chance="50"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="ed has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="24"
				y="16"
			[/source]
			[destination]
				x="24"
				y="15"
			[/destination]
		[/attack]
		[random]
			value="1415119662"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="459759281"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1738767131"
			[results]
				chance="40"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="25"
				y="16"
			[/source]
			[destination]
				x="24"
				y="15"
			[/destination]
		[/attack]
		[random]
			value="2045967061"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="81576782"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1430099620"
			[results]
				chance="40"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="501912437"
			[results]
				chance="40"
				damage="5"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Binks has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Dark_Beer_Adept has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="23,22,22"
			y="12,12,13"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="22"
				y="13"
			[/source]
			[destination]
				x="23"
				y="14"
			[/destination]
		[/attack]
		[random]
			value="499656293"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="771285107"
			[results]
				chance="60"
				damage="12"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="434476661"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1203121957"
			[results]
				chance="60"
				damage="12"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="7705976"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1876222401"
			[results]
				chance="60"
				damage="12"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="23,23,23,23,23,23,23"
			y="7,8,9,10,11,12,13"
		[/move]
	[/command]
	[command]
		[move]
			x="17,18,19,20,21,22,23"
			y="4,4,5,5,6,6,7"
		[/move]
	[/command]
	[command]
		[move]
			x="15,16,17,18,19,20,21,22"
			y="4,3,4,4,5,5,6,6"
		[/move]
	[/command]
	[command]
		[move]
			x="16,15"
			y="3,3"
		[/move]
	[/command]
	[command]
		[recruit]
			value="7"
			x="17"
			y="4"
		[/recruit]
		[random]
			value="748949308"
		[/random]
		[random]
			value="1478504193"
		[/random]
		[random]
			value="1365728557"
		[/random]
		[random]
			value="746942586"
		[/random]
		[random]
			value="1130558344"
		[/random]
		[random]
			value="188517417"
		[/random]
		[random]
			value="1522355651"
		[/random]
		[random]
			value="1486185727"
		[/random]
		[random]
			value="949463782"
		[/random]
		[random]
			value="124125755"
		[/random]
		[random]
			value="1848213191"
		[/random]
		[random]
			value="235479338"
		[/random]
		[random]
			value="51347067"
		[/random]
		[random]
			value="1204530975"
		[/random]
		[random]
			value="606395238"
			[results]
				checksum="96Wmq3.,tb9Th9Xh+8Om3eb898egWbi26k39>2dlaZge0f-9iPif8c7h8k-+v7e7e8fh0c<i8Sem73jI-oaGeRO,h>ybO20xxhh6<5,n30KE4<Yfd6-cbfLq5.ql>pFA"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="15,16"
			y="3,3"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="xtreme-one has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Masqurin has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[move]
			x="23,24"
			y="16,15"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="24"
				y="15"
			[/source]
			[destination]
				x="24"
				y="14"
			[/destination]
		[/attack]
		[random]
			value="16235"
			[results]
				chance="70"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="21178"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="559"
			[results]
				chance="70"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="24,23,22,22,22,23"
			y="17,18,17,16,15,15"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="23"
				y="15"
			[/source]
			[destination]
				x="24"
				y="14"
			[/destination]
		[/attack]
		[random]
			value="26207"
			[results]
				chance="50"
				damage="5"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="xtreme-one has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="17,18,19,20,21,22,23"
			y="19,18,18,18,18,17,17"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="23"
				y="17"
			[/source]
			[destination]
				x="24"
				y="16"
			[/destination]
		[/attack]
		[random]
			value="15152"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="6022"
			[results]
				chance="60"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="377"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="454"
			[results]
				chance="60"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="4681"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="22,22,23,24,25"
			y="16,15,15,14,15"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="25"
				y="15"
			[/source]
			[destination]
				x="25"
				y="16"
			[/destination]
		[/attack]
		[random]
			value="18919"
			[results]
				chance="40"
				damage="13"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="6111"
			[results]
				chance="70"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="26046"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="25071"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="22990"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="peanutwalrus has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="20,21,22,23,24"
			y="17,17,17,18,17"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="24"
				y="17"
			[/source]
			[destination]
				x="24"
				y="16"
			[/destination]
		[/attack]
		[random]
			value="23407"
			[results]
				chance="40"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="21194"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="23170"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="22994"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="10733"
			[results]
				chance="40"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Khali has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="19,19,19"
			y="9,8,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="5,6,7,8,8,9"
			y="10,9,9,8,7,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="5,6,6"
			y="9,9,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="2"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="autsida1 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="22,23,24,24"
			y="13,13,13,14"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="24"
				y="14"
			[/source]
			[destination]
				x="24"
				y="15"
			[/destination]
		[/attack]
		[random]
			value="1794917408"
			[results]
				chance="40"
				damage="10"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="701189276"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="2026033515"
			[results]
				chance="40"
				damage="10"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="24,24"
			y="16,15"
		[/move]
	[/command]
	[command]
		[move]
			x="23,22,22"
			y="13,13,14"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="22"
				y="14"
			[/source]
			[destination]
				x="23"
				y="15"
			[/destination]
		[/attack]
		[random]
			value="1034464917"
			[results]
				chance="60"
				damage="10"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1419825654"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1320797249"
			[results]
				chance="60"
				damage="10"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1340176791"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1985838365"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="mam23444 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="DommE has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="myst has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Acracio has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="24"
				y="15"
			[/source]
			[destination]
				x="23"
				y="15"
			[/destination]
		[/attack]
		[random]
			value="1383445438"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="822409802"
			[results]
				chance="30"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1226875753"
			[results]
				chance="60"
				damage="6"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="23,23,23,23,23,23,23"
			y="7,8,9,10,11,12,13"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Krasnoya_Gvardya has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="17,18,19,20,21,22,23"
			y="4,4,5,5,6,6,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="ito has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="22,23,23,23,23,23,23"
			y="6,7,8,9,10,11,12"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="ZEdLoyle has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="16,15"
			y="3,3"
		[/move]
	[/command]
	[command]
		[recruit]
			value="7"
			x="17"
			y="4"
		[/recruit]
		[random]
			value="1993567987"
		[/random]
		[random]
			value="2000578909"
		[/random]
		[random]
			value="1550107335"
		[/random]
		[random]
			value="812091889"
		[/random]
		[random]
			value="927167684"
		[/random]
		[random]
			value="1543060354"
		[/random]
		[random]
			value="2007868105"
		[/random]
		[random]
			value="1111235605"
		[/random]
		[random]
			value="1365093636"
		[/random]
		[random]
			value="1761347712"
		[/random]
		[random]
			value="114326440"
		[/random]
		[random]
			value="1343418362"
		[/random]
		[random]
			value="2005041163"
		[/random]
		[random]
			value="1984352186"
		[/random]
		[random]
			value="243223616"
			[results]
				checksum="c4ibeoBjPXdN9277b82>Vg,h+ld6d5,0c<W-1<71YYc5-d+8873Gj8ibkh8k-+v7e7e8fh1l<i8Sem73jI-oaGeRO,h0ybO20xxhh6<5-i30KE4<Yfd6-cbeCq5.ql>p"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="OwnEd has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Claw has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="kOJACK has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Him has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="15,16"
			y="3,3"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="tux has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="sergej has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Ukraneean has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Zorro_ has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="cemalmomo has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="Almogaver"
			message="past turn"
			side="2"
		[/speak]
	[/command]
	[command]
		[move]
			x="25,26,27,27,28,28,28,28"
			y="16,16,16,15,14,13,12,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="Almogaver"
			message="fast plis"
			side="2"
		[/speak]
	[/command]
	[command]
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[move]
			x="23,24"
			y="17,16"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="24"
				y="16"
			[/source]
			[destination]
				x="24"
				y="15"
			[/destination]
		[/attack]
		[random]
			value="27126"
			[results]
				chance="30"
				damage="8"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Warfall has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="joueur55200 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="25,24"
			y="15,15"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="24"
				y="15"
			[/source]
			[destination]
				x="24"
				y="14"
			[/destination]
		[/attack]
		[random]
			value="16434"
			[results]
				chance="40"
				damage="13"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="11478"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="10826"
			[results]
				chance="40"
				damage="13"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="17044"
			[results]
				chance="60"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="29360"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="19,20,21,21,22,23,24,24"
			y="7,7,8,9,9,10,10,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="24"
				y="11"
			[/source]
			[destination]
				x="23"
				y="12"
			[/destination]
		[/attack]
		[random]
			value="14577"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="5942"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="14918"
			[results]
				chance="40"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="11546"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="27756"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="16378"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="9,8,7,6"
			y="7,6,6,6"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="6"
				y="6"
			[/source]
			[destination]
				x="6"
				y="7"
			[/destination]
		[/attack]
		[random]
			value="1155"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="12886"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="8230"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="3490"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="21647"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="6,6,6"
			y="10,9,8"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="6"
				y="8"
			[/source]
			[destination]
				x="6"
				y="7"
			[/destination]
		[/attack]
		[random]
			value="368"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="32180"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="6385"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="16382"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="15299"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="24,23,23,23"
			y="17,17,16,15"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="23"
				y="15"
			[/source]
			[destination]
				x="24"
				y="14"
			[/destination]
		[/attack]
		[random]
			value="5417"
			[results]
				chance="40"
				damage="12"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="2"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="matteus has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="28,27,26,25,25,25,24"
			y="11,11,10,10,9,8,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="cemalmomo has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="High-Five has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="23,24"
			y="13,12"
		[/move]
	[/command]
	[command]
		[move]
			x="23,24,24,24,25,25"
			y="7,7,8,9,10,11"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="25"
				y="11"
			[/source]
			[destination]
				x="24"
				y="11"
			[/destination]
		[/attack]
		[random]
			value="248794825"
			[results]
				chance="40"
				damage="8"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1909106621"
			[results]
				chance="40"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="727050251"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="2039575979"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="843992684"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1020652495"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="23,22,22,23,24"
			y="12,11,10,10,10"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="24"
				y="10"
			[/source]
			[destination]
				x="24"
				y="11"
			[/destination]
		[/attack]
		[random]
			value="827236318"
			[results]
				chance="40"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1881513349"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1092803803"
			[results]
				chance="40"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1116416381"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="776105721"
			[results]
				chance="40"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1558264106"
			[results]
				chance="40"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Coriolan has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="24"
				y="12"
			[/source]
			[destination]
				x="24"
				y="11"
			[/destination]
		[/attack]
		[random]
			value="1284258938"
			[results]
				chance="40"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1103614173"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1523070765"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1445547669"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="115918752"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1909516803"
			[results]
				chance="30"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="MrHase has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="22,22,22,23"
			y="14,13,12,12"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="23"
				y="12"
			[/source]
			[destination]
				x="24"
				y="11"
			[/destination]
		[/attack]
		[random]
			value="54632544"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="474605413"
			[results]
				chance="40"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1053711928"
			[results]
				chance="40"
				damage="8"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="content has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="17,17,18,19,19"
			y="4,5,5,6,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Orhan has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="16,15"
			y="3,3"
		[/move]
	[/command]
	[command]
		[recruit]
			value="4"
			x="13"
			y="4"
		[/recruit]
		[random]
			value="1592686296"
		[/random]
		[random]
			value="487898758"
		[/random]
		[random]
			value="1180020374"
		[/random]
		[random]
			value="566489751"
		[/random]
		[random]
			value="514614315"
		[/random]
		[random]
			value="1359349309"
		[/random]
		[random]
			value="1063585679"
		[/random]
		[random]
			value="1031688786"
		[/random]
		[random]
			value="70168799"
		[/random]
		[random]
			value="1116542786"
		[/random]
		[random]
			value="192207482"
		[/random]
		[random]
			value="545077386"
		[/random]
		[random]
			value="972902541"
		[/random]
		[random]
			value="1693082909"
		[/random]
		[random]
			value="585226186"
			[results]
				checksum="FIxBwyUzhyBkwVHKQOq5AMPytSNtRJzMRsDuHBtnQvBFyQAVsL8qJTmQQNRqrWuTuTxCUEQDPxfDLuyOdqNHp2JuaZJrXGikJwc0bkdie+c.P93obZj,mcpd3b,IXl32"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="15,14,13,12,11"
			y="3,3,4,3,3"
		[/move]
	[/command]
	[command]
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[move]
			x="24,24,23,22,22"
			y="15,14,14,13,12"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="22"
				y="12"
			[/source]
			[destination]
				x="23"
				y="12"
			[/destination]
		[/attack]
		[random]
			value="23372"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="11563"
			[results]
				chance="70"
				damage="2"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="24149"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="10441"
			[results]
				chance="70"
				damage="2"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="10182"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="24,24,24,25,25"
			y="16,15,14,14,13"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="25"
				y="13"
			[/source]
			[destination]
				x="24"
				y="12"
			[/destination]
		[/attack]
		[random]
			value="18061"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="5544"
			[results]
				chance="50"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="15022"
			[results]
				chance="30"
				damage="10"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="16426"
			[results]
				chance="50"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="24471"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="2109"
			[results]
				chance="50"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="autsida1 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="23,23,24"
			y="15,14,13"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="24"
				y="13"
			[/source]
			[destination]
				x="24"
				y="12"
			[/destination]
		[/attack]
		[random]
			value="31806"
			[results]
				chance="30"
				damage="15"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="articaine has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="6,5"
			y="6,6"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="5,4"
			y="6,6"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="4,5"
			y="6,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="5"
				y="7"
			[/source]
			[destination]
				x="6"
				y="7"
			[/destination]
		[/attack]
		[random]
			value="18394"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="7334"
			[results]
				chance="60"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="27089"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="19931"
			[results]
				chance="60"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="30277"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="6,7"
			y="8,8"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="7"
				y="8"
			[/source]
			[destination]
				x="6"
				y="7"
			[/destination]
		[/attack]
		[random]
			value="25219"
			[results]
				chance="30"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="25330"
			[results]
				chance="60"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="20581"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="31055"
			[results]
				chance="60"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="7611"
			[results]
				chance="30"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="2"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Coriolan_ has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="13,12,11,10,9,9"
			y="4,4,5,5,6,7"
		[/move]
	[/command]
	[command]
		[move]
			x="11,12,13"
			y="3,3,4"
		[/move]
	[/command]
	[command]
		[recruit]
			value="4"
			x="17"
			y="4"
		[/recruit]
		[random]
			value="639768831"
		[/random]
		[random]
			value="2107205627"
		[/random]
		[random]
			value="559942082"
		[/random]
		[random]
			value="600324672"
		[/random]
		[random]
			value="1020502346"
		[/random]
		[random]
			value="921256875"
		[/random]
		[random]
			value="778331962"
		[/random]
		[random]
			value="1625132587"
		[/random]
		[random]
			value="1214124618"
		[/random]
		[random]
			value="801633402"
		[/random]
		[random]
			value="267183009"
		[/random]
		[random]
			value="1616878502"
		[/random]
		[random]
			value="254214546"
		[/random]
		[random]
			value="1039625730"
		[/random]
		[random]
			value="909355802"
			[results]
				checksum="uyqOVzDO<ExdHrVAAKrGB6qDQPwqLuEDUSNIMADRBGxxpOFSryqC1rOBpDQNRqrWuTuTxCUFMDPxfDLuyOdqNHp2JuaZJrXGikJwc0bkdie+c.P93obZj,mcoh3b,IXl"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="24,24,24,24,24,24"
			y="7,6,5,4,3,2"
		[/move]
	[/command]
	[command]
		[move]
			x="24,24,24,24,23,23,22"
			y="10,9,8,7,7,6,5"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="WIF_Anubis has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="23,23,23,23,23,24"
			y="12,11,10,9,8,7"
		[/move]
	[/command]
	[command]
		[move]
			x="25,25,25,25,25"
			y="11,10,9,8,7"
		[/move]
	[/command]
	[command]
		[move]
			x="13,12,12,11"
			y="4,4,5,6"
		[/move]
	[/command]
	[command]
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[move]
			x="22,22,22,22,22,23"
			y="12,11,10,9,8,8"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="23"
				y="8"
			[/source]
			[destination]
				x="24"
				y="7"
			[/destination]
		[/attack]
		[random]
			value="18197"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="24601"
			[results]
				chance="70"
				damage="2"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="6679"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="13065"
			[results]
				chance="70"
				damage="2"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="5141"
			[results]
				chance="70"
				damage="2"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="25,24,24,24"
			y="13,13,14,15"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="24,24,24,23,22,21"
			y="13,14,15,16,16,17"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="5,4,3,2,2,2,2"
			y="7,7,8,8,9,10,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="7,7,7,7,7,7,7"
			y="8,9,10,11,12,13,14"
		[/move]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="2"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		[move]
			x="17,18,19,20,21,22,22"
			y="4,4,5,5,6,6,7"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="22"
				y="7"
			[/source]
			[destination]
				x="23"
				y="8"
			[/destination]
		[/attack]
		[random]
			value="1472398401"
			[results]
				chance="70"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="237347635"
			[results]
				chance="70"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Kalis has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="19,20,21,22"
			y="7,7,8,8"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="22"
				y="8"
			[/source]
			[destination]
				x="23"
				y="8"
			[/destination]
		[/attack]
		[random]
			value="1053469981"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1706715587"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="630393730"
			[results]
				chance="70"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1871208577"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="520016528"
			[results]
				chance="70"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="24"
				y="7"
			[/source]
			[destination]
				x="23"
				y="8"
			[/destination]
		[/attack]
		[random]
			value="805842654"
			[results]
				chance="70"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1762219929"
			[results]
				chance="30"
				damage="13"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="221986900"
			[results]
				chance="70"
				damage="5"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="22,21,20,19"
			y="5,6,6,7"
		[/move]
	[/command]
	[command]
		[move]
			x="25,24,23,22"
			y="7,6,6,5"
		[/move]
	[/command]
	[command]
		[move]
			x="6,6,6,6,6,6,6"
			y="7,8,9,10,11,12,13"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="6"
				y="13"
			[/source]
			[destination]
				x="7"
				y="14"
			[/destination]
		[/attack]
		[random]
			value="1416261882"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="718469094"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="2145530438"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="219016437"
			[results]
				chance="40"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="9,9,9,8,8,8,8,7"
			y="7,8,9,9,10,11,12,13"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="sergej has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="7"
				y="13"
			[/source]
			[destination]
				x="7"
				y="14"
			[/destination]
		[/attack]
		[random]
			value="1331217404"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1619980517"
			[results]
				chance="40"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="2013522305"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1011960094"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="xplorer has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="11,12,12,13"
			y="6,5,4,4"
		[/move]
	[/command]
	[command]
		[recruit]
			value="4"
			x="14"
			y="3"
		[/recruit]
		[random]
			value="836255440"
		[/random]
		[random]
			value="611335639"
		[/random]
		[random]
			value="883945883"
		[/random]
		[random]
			value="416235163"
		[/random]
		[random]
			value="1528327565"
		[/random]
		[random]
			value="1419203608"
		[/random]
		[random]
			value="668472673"
		[/random]
		[random]
			value="1793478734"
		[/random]
		[random]
			value="1533425770"
		[/random]
		[random]
			value="1122100656"
		[/random]
		[random]
			value="1086724500"
		[/random]
		[random]
			value="1176246933"
		[/random]
		[random]
			value="263471002"
		[/random]
		[random]
			value="246008922"
		[/random]
		[random]
			value="480948022"
			[results]
				checksum="FIxBwyUzhyBkwVHKQOq5AMPytSNtRJzMRsDuHBtnQvBFyQAVsL8qJTmQQNRqrWuTuTxCUEQDPxfDLuyOdqNHp2JuaZJrXGikJwc0bkdie+c.P93obZj,mcpd3b,IXl32"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="13,12,11"
			y="4,4,4"
		[/move]
	[/command]
	[command]
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[move]
			x="2,3,4,5,6,7"
			y="11,12,11,12,11,12"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="7"
				y="12"
			[/source]
			[destination]
				x="7"
				y="13"
			[/destination]
		[/attack]
		[random]
			value="19381"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="8714"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="15633"
			[results]
				chance="40"
				damage="10"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="22258"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1100"
			[results]
				chance="40"
				damage="10"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="7"
				y="14"
			[/source]
			[destination]
				x="7"
				y="13"
			[/destination]
		[/attack]
		[random]
			value="9063"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="28377"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="19093"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="6143"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="27609"
			[results]
				chance="40"
				damage="7"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="21,20,19,18,17"
			y="17,17,18,18,19"
		[/move]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="7"
			x="13"
			y="19"
		[/recruit]
		[random]
			value="23628"
		[/random]
		[random]
			value="12856"
		[/random]
		[random]
			value="12906"
		[/random]
		[random]
			value="6314"
		[/random]
		[random]
			value="11096"
		[/random]
		[random]
			value="30000"
		[/random]
		[random]
			value="23405"
		[/random]
		[random]
			value="16662"
		[/random]
		[random]
			value="23531"
		[/random]
		[random]
			value="10545"
		[/random]
		[random]
			value="9344"
		[/random]
		[random]
			value="5083"
		[/random]
		[random]
			value="16869"
		[/random]
		[random]
			value="9128"
		[/random]
		[random]
			value="23083"
			[results]
				checksum=",Ad3Y5f-Gtmsmp5jHbEoRiVrOCpxE4IDyxOzzQOG.nCLyyGDmUtLNvFrwCUxRLwFwmIsr1QENmxPFHFw.RFKFnqypNLmM8mwoFomIhFlq1.CLB<<ddNv5EsLNHBNzkOI"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="3"
			x="16"
			y="19"
		[/recruit]
		[random]
			value="26663"
		[/random]
		[random]
			value="9152"
		[/random]
		[random]
			value="14343"
		[/random]
		[random]
			value="11436"
		[/random]
		[random]
			value="26176"
		[/random]
		[random]
			value="12080"
		[/random]
		[random]
			value="32458"
		[/random]
		[random]
			value="11880"
		[/random]
		[random]
			value="11064"
		[/random]
		[random]
			value="7422"
		[/random]
		[random]
			value="11644"
		[/random]
		[random]
			value="12094"
		[/random]
		[random]
			value="8756"
		[/random]
		[random]
			value="27341"
		[/random]
		[random]
			value="19973"
			[results]
				checksum="eKEMoMsJ2Sm2IxNK-ruIvyJD8uFQquOORqLQAKsDuHBwnqvBFyQvVsL8qHTmQQNRqrWuTuTxDUFLDPxfDLuyOcqNHBnCR5lyBlS<1Ip648,gYmdg-Lb7,b2<2j8d,4eh"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="3"
			x="15"
			y="19"
		[/recruit]
		[random]
			value="22105"
		[/random]
		[random]
			value="14215"
		[/random]
		[random]
			value="18880"
		[/random]
		[random]
			value="22521"
		[/random]
		[random]
			value="27665"
		[/random]
		[random]
			value="2865"
		[/random]
		[random]
			value="5253"
		[/random]
		[random]
			value="6560"
		[/random]
		[random]
			value="26493"
		[/random]
		[random]
			value="25864"
		[/random]
		[random]
			value="31478"
		[/random]
		[random]
			value="429"
		[/random]
		[random]
			value="30580"
		[/random]
		[random]
			value="3601"
		[/random]
		[random]
			value="24911"
			[results]
				checksum="eKEMoMsJ2Sm2IxNK-ruIvyJD8uFQquOORqLQAKsDuHBwnqvBFyQvVsL8qHTmQQNRqrWuTuTxDUFLDPxfDLuyOcqNHBnCR5lyBlS<1Ip648,gYgdg-Lb7,b2<2j8d,4eh"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="7"
			x="15"
			y="20"
		[/recruit]
		[random]
			value="24055"
		[/random]
		[random]
			value="24828"
		[/random]
		[random]
			value="18253"
		[/random]
		[random]
			value="16621"
		[/random]
		[random]
			value="7748"
		[/random]
		[random]
			value="30667"
		[/random]
		[random]
			value="26111"
		[/random]
		[random]
			value="31929"
		[/random]
		[random]
			value="24441"
		[/random]
		[random]
			value="8606"
		[/random]
		[random]
			value="15982"
		[/random]
		[random]
			value="5876"
		[/random]
		[random]
			value="13938"
		[/random]
		[random]
			value="31475"
		[/random]
		[random]
			value="10737"
			[results]
				checksum=",Ad3Y5f-Gtmnrp5jHbEoRiVrOCpxE4IDyxOzzQOG.nCLyyGDmUtLNvFrwCUxRLwFwmIsr1QENmxPFHFw.RFKFnqypNQrM8mwoFomIhFlq1.CLB<<ddNv5EsLNHBNzhOI"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="0"
			x="15"
			y="21"
		[/recruit]
		[random]
			value="22344"
		[/random]
		[random]
			value="26931"
		[/random]
		[random]
			value="29258"
		[/random]
		[random]
			value="5292"
		[/random]
		[random]
			value="17925"
		[/random]
		[random]
			value="13355"
		[/random]
		[random]
			value="16402"
		[/random]
		[random]
			value="17027"
		[/random]
		[random]
			value="3374"
		[/random]
		[random]
			value="10726"
		[/random]
		[random]
			value="17794"
		[/random]
		[random]
			value="9618"
		[/random]
		[random]
			value="5161"
		[/random]
		[random]
			value="26047"
		[/random]
		[random]
			value="31705"
			[results]
				checksum="pMyPwoKvbBq0MCQtxRPyPu1PqOvyvtVtPtsuCMyPNLLqFJRxvqM3FDTGMqHwEVMDODuIOJsNEnPcOusOKDwebPsxOruODoP.K+zDJqnqswJL0PpQ,OvAQ30CF>dl1cth"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Ukraneean has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="17,18"
			y="19,18"
		[/move]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="2"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		[move]
			x="14,13,12,11,10,9,8,8,7"
			y="3,4,4,5,5,6,6,7,8"
		[/move]
	[/command]
	[command]
		[move]
			x="6,6"
			y="13,14"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="6"
				y="14"
			[/source]
			[destination]
				x="7"
				y="14"
			[/destination]
		[/attack]
		[random]
			value="927060426"
			[results]
				chance="60"
				damage="6"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="WX30 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="11,12,13"
			y="4,3,4"
		[/move]
	[/command]
	[command]
		[move]
			x="13,14,15"
			y="4,3,3"
		[/move]
	[/command]
	[command]
		[recruit]
			value="4"
			x="13"
			y="4"
		[/recruit]
		[random]
			value="418012392"
		[/random]
		[random]
			value="603081377"
		[/random]
		[random]
			value="952173815"
		[/random]
		[random]
			value="1225922009"
		[/random]
		[random]
			value="293613510"
		[/random]
		[random]
			value="1220530524"
		[/random]
		[random]
			value="1511436292"
		[/random]
		[random]
			value="1882151263"
		[/random]
		[random]
			value="922204933"
		[/random]
		[random]
			value="1576410439"
		[/random]
		[random]
			value="135960350"
		[/random]
		[random]
			value="290183839"
		[/random]
		[random]
			value="39196329"
		[/random]
		[random]
			value="461439479"
		[/random]
		[random]
			value="1375782489"
			[results]
				checksum="FTxBwyUzhyBkwVHKQOq5AMPytSNtRJzMRsDuHBtnQvBFyQAVsL8qJTmQQNRqrWuTuTxCUFLDPxfDLuyOdqNHp2JuaZMrXGikJwc0bkdib+c.P93obZj,mcoe3b,IXl32"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Tal has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="22,22,22"
			y="7,8,9"
		[/move]
	[/command]
	[command]
		[move]
			x="22,22,22,22,22"
			y="9,10,11,12,13"
		[/move]
	[/command]
	[command]
		[move]
			x="22,22,22,23,23,24"
			y="8,9,10,11,12,12"
		[/move]
	[/command]
	[command]
		[move]
			x="19,20,21,21,22,22,22"
			y="7,7,8,9,9,10,11"
		[/move]
	[/command]
	[command]
		[move]
			x="22,22,23,23,23,23,23"
			y="5,6,7,8,9,10,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Idalgo has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="24,24,24,24,24,24,24,24"
			y="2,3,4,5,6,7,8,9"
		[/move]
	[/command]
	[command]
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="MrHase2 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="15,15,14,13,12,11,10"
			y="21,20,19,19,18,19,18"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="13,12,11,10,9,8"
			y="19,18,18,17,18,17"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="7,7,8,8,8"
			y="12,13,13,14,15"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="15,16,17,18,19,20"
			y="19,19,19,18,18,17"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="16,17,18,19,20,21"
			y="19,19,18,18,17,17"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="15,16,17,18,19,20"
			y="20,19,19,19,19,18"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="18,17"
			y="18,19"
		[/move]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="2"
			x="16"
			y="19"
		[/recruit]
		[random]
			value="1411"
		[/random]
		[random]
			value="2278"
		[/random]
		[random]
			value="1864"
		[/random]
		[random]
			value="8118"
		[/random]
		[random]
			value="21537"
		[/random]
		[random]
			value="21614"
		[/random]
		[random]
			value="30413"
		[/random]
		[random]
			value="29199"
		[/random]
		[random]
			value="13466"
		[/random]
		[random]
			value="32186"
		[/random]
		[random]
			value="9990"
		[/random]
		[random]
			value="14411"
		[/random]
		[random]
			value="19314"
		[/random]
		[random]
			value="12747"
		[/random]
		[random]
			value="323"
			[results]
				checksum="RVQsCRORlSP,DLsxDMMfFuzJRDJCyOyPpHMVsOIMzEOKRzPuHEfJqwNzzmyJIhVwVwSxvKtMAS8wEVRB+JCszfJzd4kC+rc<MF13amk4yil5K7b35>-yp,+<8,eyb6ac"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="17,18,19,20,21"
			y="19,18,18,17,18"
		[/move]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="2"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		[move]
			x="7,7,7,7,7,7,7,8"
			y="8,9,10,11,12,13,14,14"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="8"
				y="14"
			[/source]
			[destination]
				x="8"
				y="15"
			[/destination]
		[/attack]
		[random]
			value="1347947765"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1807767764"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1399691487"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="6,6"
			y="14,15"
		[/move]
	[/command]
	[command]
		[move]
			x="13,12,11,10,9,8,8,8"
			y="4,4,5,5,6,6,7,8"
		[/move]
	[/command]
	[command]
		[recruit]
			value="7"
			x="13"
			y="4"
		[/recruit]
		[random]
			value="275111781"
		[/random]
		[random]
			value="1639964790"
		[/random]
		[random]
			value="2077556826"
		[/random]
		[random]
			value="1314560790"
		[/random]
		[random]
			value="344985443"
		[/random]
		[random]
			value="279594191"
		[/random]
		[random]
			value="1885981058"
		[/random]
		[random]
			value="979358297"
		[/random]
		[random]
			value="1319302414"
		[/random]
		[random]
			value="341524738"
		[/random]
		[random]
			value="1017962613"
		[/random]
		[random]
			value="1622825992"
		[/random]
		[random]
			value="636443244"
		[/random]
		[random]
			value="554773203"
		[/random]
		[random]
			value="2125618692"
			[results]
				checksum="c4ibeoBjPXdN9277b82>Vg,h+ld6d5,0c<W-1<71YYc5-d+8873Gj8ibkh8k-+v7e7e8fh0c<i8Sem73jI-oaGeRO,h>ybO20xxhh6<5,n30KE4<Yfd6-cbfLq5.ql>p"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="22,21,20"
			y="13,14,14"
		[/move]
	[/command]
	[command]
		[move]
			x="20,19,18,18,17"
			y="14,15,15,16,17"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Sergi0 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="23,23,23,23,22,22,23"
			y="11,12,13,14,14,15,16"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="vampek has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="22,23,23,24,25,25"
			y="11,12,13,13,14,15"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="25"
				y="15"
			[/source]
			[destination]
				x="24"
				y="15"
			[/destination]
		[/attack]
		[random]
			value="1715059527"
			[results]
				chance="40"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1628331874"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="532904100"
			[results]
				chance="40"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1995286280"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="489544118"
			[results]
				chance="40"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1032283867"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Ukraneean has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="23"
				y="16"
			[/source]
			[destination]
				x="24"
				y="15"
			[/destination]
		[/attack]
		[random]
			value="1878314657"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="2010766958"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="104255810"
			[results]
				chance="40"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="742475914"
			[results]
				chance="40"
				damage="12"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="978004900"
			[results]
				chance="40"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1214835006"
			[results]
				chance="40"
				damage="12"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="24,24,24,24,24,24"
			y="9,10,11,12,13,14"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="24"
				y="14"
			[/source]
			[destination]
				x="24"
				y="15"
			[/destination]
		[/attack]
		[random]
			value="28329406"
			[results]
				chance="40"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="644530420"
			[results]
				chance="40"
				damage="5"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="24,24,24,24"
			y="12,13,14,15"
		[/move]
	[/command]
	[command]
		[move]
			x="24,24,24,24,24,24"
			y="7,8,9,10,11,12"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="MrYoung has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="lakerer has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[move]
			x="20,21,21,22"
			y="17,17,16,15"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="22"
				y="15"
			[/source]
			[destination]
				x="23"
				y="16"
			[/destination]
		[/attack]
		[random]
			value="29154"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="24859"
			[results]
				chance="70"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="17480"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="4855"
			[results]
				chance="70"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="29306"
			[results]
				chance="70"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="21,22,23,24,24"
			y="17,17,18,17,16"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="24"
				y="16"
			[/source]
			[destination]
				x="23"
				y="16"
			[/destination]
		[/attack]
		[random]
			value="15574"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="18566"
			[results]
				chance="70"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="31550"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="6783"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="18478"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="20,19,19,18"
			y="18,18,17,16"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="18"
				y="16"
			[/source]
			[destination]
				x="17"
				y="17"
			[/destination]
		[/attack]
		[random]
			value="6459"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="17490"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="8694"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="19674"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="28426"
			[results]
				chance="30"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="16,16,16,16,17"
			y="19,18,17,16,16"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="17"
				y="16"
			[/source]
			[destination]
				x="17"
				y="17"
			[/destination]
		[/attack]
		[random]
			value="7695"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="21464"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="28979"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="31359"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="10150"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="13830"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="21,20,19,18,17"
			y="18,18,18,18,18"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="17"
				y="18"
			[/source]
			[destination]
				x="17"
				y="17"
			[/destination]
		[/attack]
		[random]
			value="26808"
			[results]
				chance="30"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="16120"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="28284"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="16004"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="23988"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="8,7,6,5,5"
			y="17,17,17,17,16"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="5"
				y="16"
			[/source]
			[destination]
				x="6"
				y="15"
			[/destination]
		[/attack]
		[random]
			value="32054"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="26311"
			[results]
				chance="50"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="12127"
			[results]
				chance="30"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="8985"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="18609"
			[results]
				chance="30"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="10,9,8,7,6"
			y="18,18,17,17,16"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="6"
				y="16"
			[/source]
			[destination]
				x="6"
				y="15"
			[/destination]
		[/attack]
		[random]
			value="11166"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="13872"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="7262"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="32551"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="30621"
			[results]
				chance="30"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="8,7"
			y="15,15"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="7"
				y="15"
			[/source]
			[destination]
				x="6"
				y="15"
			[/destination]
		[/attack]
		[random]
			value="1581"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="2878"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="20423"
			[results]
				chance="30"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="11852"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="3053"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="doh has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="2"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		[move]
			x="8,8"
			y="14,15"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="8"
				y="15"
			[/source]
			[destination]
				x="7"
				y="15"
			[/destination]
		[/attack]
		[random]
			value="898298502"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1741549117"
			[results]
				chance="30"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1503500596"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="8,8,8,8,8,8,8"
			y="8,9,10,11,12,13,14"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="8"
				y="14"
			[/source]
			[destination]
				x="7"
				y="15"
			[/destination]
		[/attack]
		[random]
			value="952545616"
			[results]
				chance="40"
				damage="10"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="131271456"
			[results]
				chance="60"
				damage="6"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="6,6,6,6,6,7,7,7,7"
			y="15,14,13,12,11,11,10,9,8"
		[/move]
	[/command]
	[command]
		[move]
			x="13,12,11,10,9,8,8"
			y="4,4,5,5,6,6,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Malemolente has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[recruit]
			value="7"
			x="13"
			y="4"
		[/recruit]
		[random]
			value="905882218"
		[/random]
		[random]
			value="1463293078"
		[/random]
		[random]
			value="659213492"
		[/random]
		[random]
			value="1392103933"
		[/random]
		[random]
			value="8951491"
		[/random]
		[random]
			value="196331227"
		[/random]
		[random]
			value="1568666152"
		[/random]
		[random]
			value="1213898118"
		[/random]
		[random]
			value="185814669"
		[/random]
		[random]
			value="789574732"
		[/random]
		[random]
			value="1747269073"
		[/random]
		[random]
			value="1357114524"
		[/random]
		[random]
			value="2105281597"
		[/random]
		[random]
			value="1848165844"
		[/random]
		[random]
			value="839963922"
			[results]
				checksum="86Wmq3.,tb9Th9Xh+8Om3eb898egWbi26k39>2dlaZge0f-9iPif8c7h8k-+v7e7e8fh18<i8Sem73jI-oaGeRO,h>ybO20xxhh6<5,n30KE4<Yfd6-cbePq5.ql>pFA"
			[/results]
		[/random]
	[/command]
	[command]
		[recruit]
			value="7"
			x="14"
			y="3"
		[/recruit]
		[random]
			value="365454566"
		[/random]
		[random]
			value="1929046257"
		[/random]
		[random]
			value="1221091528"
		[/random]
		[random]
			value="1024668059"
		[/random]
		[random]
			value="1173666542"
		[/random]
		[random]
			value="1230043019"
		[/random]
		[random]
			value="1220999286"
		[/random]
		[random]
			value="594849047"
		[/random]
		[random]
			value="296457490"
		[/random]
		[random]
			value="1406813955"
		[/random]
		[random]
			value="1384423779"
		[/random]
		[random]
			value="2043726563"
		[/random]
		[random]
			value="616444832"
		[/random]
		[random]
			value="1342221729"
		[/random]
		[random]
			value="1744408759"
			[results]
				checksum="86Wmq3.,tb9Th9Xh+8Om3eb898egWbi26k39>2dlaZge0f-9iPif8c7h8k-+v7e7e8fh1b<i8Sem73jI-oaGeRO,h0ybO20xxhh6<5-i30KE4<Yfd6-cbeMq5.ql>pFA"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="WIF_Anubis has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Quetz has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="15,14,13,12,12,11"
			y="3,3,4,4,5,6"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="i_am_myself has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="25,24,24,23,23,23,23,23"
			y="15,14,13,13,12,11,10,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Medan has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="17"
				y="17"
			[/source]
			[destination]
				x="17"
				y="16"
			[/destination]
		[/attack]
		[random]
			value="1857917594"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="956142530"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Almogaver has left the game."
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="KnightKunibert takes control of side 2."
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Warfall has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="solange has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="Coriolan_"
			message="lol, was für ein Vollheld"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Coriolan_ takes control of side 2."
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="PapaSmurf has logged into the lobby"
		[/speak]
	[/command]
	[command]
		undo="no"
		[speak]
			id="KnightKunibert"
			message="pls wait ..."
			side="1"
		[/speak]
	[/command]
[/replay]
[snapshot]
	campaign_type="multiplayer"
	completion="running"
	current_tod="0"
#textdomain wesnoth-multiplayer
	description=_ "This vital supply route has played a key role in many of Wesnoth's greatest battles."
	difficulty="NORMAL"
	end_text_duration="0"
	experience_modifier="70"
	hash="ni><w8>Ksy9E6lpej<-R7zqNgF0HH1GU14mLcPs+Y0>x<lui3JMr96tqaCJ+gLs7vdDsR,OV+p41UARdwDMp8w8hABAeHRqXh0zHL5LEGp<BJU2ovj4yzohfX.yffdE0"
	id="multiplayer_Weldyn_Channel"
	label="2p - Weldyn Channel"
	map_data="border_size=1
usage=map

Ss          , Hh          , Rp          , Ss          , Gs^Fp       , Hh          , Rp          , Rp          , Hh          , Ss          , Ss          , Gg          , Hh          , Hh          , Gs^Fms      , Ss          , Gg          , Hh          , Ww          , Ww          , Wo          , Wo          , Ww          , Wwf         , Hh          , Hh          , Hh          , Hh          , Ss          , Hh          , Hh          
Gg          , Gg^Fet      , Rp          , Mm          , Gs^Fp       , Ss          , Rp          , Gs^Fp       , Gg^Fet      , Gs^Fms      , Mm          , Gs^Fp       , Gg          , Gs^Fds      , Hh          , Gs^Fp       , Hh          , Gg          , Ww          , Wo          , Wo          , Ww          , Gs^Fp       , Gg^Fet      , Gs^Fms      , Mm          , Ss          , Mm          , Hh          , Gs^Fp       , Ss          
Gg          , Gg          , Gg          , Rp          , Rp          , Rp          , Gg          , Gg^Ve       , Gg          , Hh          , Gg          , Gg          , Re          , Gg          , Re          , Ch          , Mm          , Ww          , Wo          , Wo          , Ww          , Ww          , Mm          , Ss          , Ss^Vhs      , Hh          , Gs^Fp       , Hh          , Gs^Fms      , Gg^Fet      , Gg          
Gs^Fms      , Gg          , Gg          , Gg          , Rp          , Gg          , Gg          , Gg          , Re          , Mm          , Re          , Re          , Re          , Re          , Ch          , 1 Kh        , Ch          , Ww          , Ww          , Ww          , Gs^Fp       , Hh          , Hh          , Gs^Fp       , Gg          , Gg          , Gg          , Gg          , Gg          , Hh          , Gg          
Hh          , Gs^Fp       , Rp          , Rp          , Re^Uf       , Gs^Fds      , Re          , Re          , Gg          , Re          , Gg          , Gg          , Gg          , Kh          , Gg          , Ch          , Wwf         , Kh          , Ww^Bw\      , Gg          , Gg          , Gg          , Gg          , Gg          , Re          , Re^Uf       , Mm          , Gg          , Gg          , Gg          , Gg          
Hh          , Hh          , Rp          , Mm          , Gs^Fp       , Re          , Re          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Ww          , Ww          , Wwf         , Gg          , Gg          , Gg          , Gg          , Gg^Vh       , Gg          , Re          , Ss          , Hh          , Gs^Fp       , Re          , Gg          , Gg          
Gs^Fp       , Rp          , Mm          , Hh          , Re          , Re          , Gg          , Gg          , Gg          , Gg          , Gg^Uf       , Hh          , Hh          , Gg^Ve       , Ww          , Ww          , Ww          , Gg          , Ss          , Gs^Fp       , Gg          , Gg          , Gg          , Gg          , Gg          , Re          , Re          , Re^Uf       , Re          , Gg          , Gg          
Rp          , Rp          , Re          , Re          , Gg          , Gg          , Gg^Vh       , Gg          , Gg          , Gs^Fds      , Hh          , Mm          , Gg          , Gs^Fp       , Ww          , Wo          , Ww          , Gg          , Gs^Fp       , Ss^Vhs      , Ww          , Mm          , Hh          , Gg          , Gg^Ve       , Gs^Fms      , Gg          , Re          , Gg          , Gg          , Gg          
Gs^Fp       , Re          , Re          , Gg          , Gs^Fp       , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Ww          , Ww          , Wo          , Wo          , Wo          , Ww          , Ww          , Ww          , Ww          , Wwf         , Rp          , Gg          , Gg          , Gg          , Gg          , Gg          , Mm          , Gg^Uf       , Hh          
Gg          , Re          , Re          , Hh          , Ss          , Ggf^Uf      , Gg          , Gg          , Gs^Fms      , Ggf         , Gg          , Gg          , Ww          , Ww          , Wo          , Wo          , Mm^Xm       , Wo          , Wo          , Wo          , Ww          , Wwf         , Wwf         , Rp          , Rp          , Gg          , Gs^Fp       , Hh          , Gg^Fet      , Hh          , Gg          
Wwf         , Gg          , Gg          , Gs^Fms      , Mm          , Hh          , Hh          , Gg          , Gg          , Mm          , Hh          , Ww          , Ww          , Wo          , Wo          , Hh          , Mm^Xm       , Wo          , Wo          , Wo          , Ww          , Gs^Fp       , Rp          , Wwf         , Wwf         , Gg          , Rp          , Rp          , Rp          , Gg          , Gg          
Rp          , Wwf         , Wwf         , Gg          , Wwf         , Wwf         , Wwf         , Rp          , Gg          , Hh          , Ww          , Ww          , Wo          , Ww          , Wwr         , Mm^Xm       , Wwr         , Wo          , Wo          , Ww          , Ww          , Gg          , Gg          , Rp          , Wwf         , Rp          , Wwf         , Wwf         , Wwf         , Rp          , Rp          
Gg          , Rp          , Rp          , Wwf         , Rp          , Rp          , Wwf         , Rp          , Rp          , Gg          , Ww          , Ww          , Wo          , Wo          , Mm^Xm       , Mm^Xm       , Wo          , Ww          , Ww          , Ww          , Hh          , Hh          , Gg          , Rp          , Hh          , Wwf         , Mm          , Gg          , Gg          , Wwf         , Wwf         
Gs^Fds      , Gg          , Gg^Fet      , Rp          , Gs^Fms      , Gg          , Rp          , Wwf         , Wwf         , Gs^Fp       , Ww          , Wo          , Wo          , Wo          , Mm^Xm       , Hh          , Wo          , Wo          , Ww          , Ww          , Gg          , Mm          , Gs^Fms      , Gg          , Gg          , Hh          , Ss          , Gs^Fp       , Re          , Gg          , Gg          
Hh          , Hh          , Mm          , Hh          , Gg          , Gg          , Gg          , Rp          , Rp          , Wwf         , Ww          , Wo          , Ww          , Wo          , Wo          , Wo          , Wo          , Ww          , Ww          , Gg          , Gg          , Ggf         , Gg          , Gg          , Gg          , Ggf^Uf      , Gg^Fet      , Hh          , Re          , Re          , Gs^Fp       
Gs^Fds      , Ggf^Uf      , Gg          , Gg          , Gg          , Gg          , Gg^Ve       , Gg          , Hh          , Wwf         , Ww          , Ww          , Gs^Fp       , Ww          , Ww          , Wo          , Ww          , Ww          , Gg          , Gg          , Hh          , Gg          , Gg          , Gg          , Gg^Vh       , Gg          , Gg          , Gg          , Re          , Re          , Rp          
Gg          , Gg          , Re          , Re          , Re          , Gs^Fms      , Gg          , Gg          , Gg          , Mm          , Gg          , Ss^Vhs      , Ss          , Gg          , Ww          , Wo          , Ww          , Gs^Fp       , Hh          , Mm          , Ggf^Uf      , Gs^Fp       , Gg          , Gg          , Gg          , Gg          , Re          , Re          , Mm          , Rp          , Gs^Fp       
Gg          , Gg          , Re          , Re^Uf       , Hh          , Re          , Re          , Gg          , Gg^Vh       , Gg          , Gg          , Gs^Fp       , Gg          , Gg          , Ww          , Ww          , Gg          , Gg^Ve       , Gg          , Hh          , Gg          , Gg          , Gg          , Gg          , Ggf         , Re          , Gs^Fds      , Hh          , Rp          , Rp          , Hh          
Gg          , Gg          , Gg          , Gs^Fp       , Mm          , Ss          , Re          , Gg          , Gg          , Gg          , Gg          , Gg          , Ww^Bw\      , Wwf         , Wwf         , Ww          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Re          , Re          , Re^Uf       , Mm          , Rp          , Hh          , Hh          
Gg          , Gg          , Gg          , Gg          , Gg          , Re^Uf       , Gg          , Gg          , Hh          , Gg          , Gs^Fp       , Gg          , Ww          , Kh          , Ch          , Ch          , Ch          , Kh          , Gg          , Gg          , Re          , Re          , Re          , Re          , Gg          , Gs^Fp       , Rp          , Rp          , Gg          , Gs^Fms      , Gg          
Gs^Fds      , Gg          , Gs^Fp       , Gg          , Gs^Fp       , Gg          , Ss^Vhs      , Gs^Fp       , Mm          , Hh          , Ww          , Ww          , Wo          , Ww          , Mm          , 2 Kh        , Re          , Re          , Re          , Re          , Gg          , Gg^Ve       , Gg          , Gg          , Gg          , Gg          , Rp          , Gg          , Gg          , Gg          , Gg          
Ss          , Gg^Fet      , Ss          , Hh          , Mm          , Hh          , Gs^Fms      , Ss          , Gs^Fp       , Ww          , Wo          , Wo          , Ww          , Ww          , Hh          , Ch          , Gs^Fds      , Gg          , Gs^Fms      , Mm          , Gg^Fet      , Hh          , Mm          , Hh          , Rp          , Rp          , Gs^Fp       , Rp          , Rp          , Gg          , Gg          
Hh          , Hh          , Gs^Fms      , Gs^Fp       , Hh          , Ss          , Mm          , Gg^Fet      , Ww          , Ww          , Wo          , Wo          , Ww          , Hh          , Gs^Fp       , Gg^Fet      , Gs^Fms      , Hh          , Mm          , Hh          , Gs^Fp       , Ss          , Hh          , Gs^Fp       , Rp          , Ss          , Ss          , Hh          , Mm          , Rp          , Gg          
Hh          , Gs^Fms      , Hh          , Ss          , Hh          , Hh          , Wwf         , Ww          , Wo          , Wo          , Ww          , Ww          , Hh          , Gg          , Hh          , Hh          , Ss          , Hh          , Hh          , Gs^Fms      , Ss          , Hh          , Rp          , Rp          , Gg          , Hh          , Hh          , Gs^Fp       , Ss          , Rp          , Hh          
"
	mp_countdown="yes"
	mp_countdown_action_bonus="20"
	mp_countdown_init_time="270"
	mp_countdown_reservoir_time="270"
	mp_countdown_turn_bonus="200"
	mp_fog="yes"
	mp_shroud="no"
	mp_use_map_settings="yes"
	mp_village_gold="2"
	name=_ "2p - Weldyn Channel"
	next_underlying_unit_id="39"
#textdomain wesnoth
	objectives=_ "Victory:
@Defeat enemy leader(s)"
	observer="yes"
	playing_team="0"
	random_calls="0"
	random_seed="2003138879"
	random_start_time="no"
	snapshot="yes"
	turn_at="13"
	turns="-1"
	unit_wml_ids="Bowman,Dwarvish Thunderguard,Fencer,Footpad,Gryphon Rider,Heavy Infantryman,Mage,Merman Fighter,Pikeman,Spearman,Thief,era_events"
	version="1.6"
	[side]
		action_bonus_count="5"
		aggression="0.5"
		allow_player="yes"
		caution="0.25"
		colour="1"
		controller="human"
		countdown_time="159046"
		current_player="KnightKunibert"
		disallow_observers="no"
		fog="yes"
		global_recruitment_pattern="fighter,fighter,fighter,mixed fighter,archer,scout"
		gold="1"
		hidden="no"
		id="KnightKunibert1"
		income="0"
		leader_value="3"
		name="KnightKunibert"
		no_leader="yes"
		number_of_possible_recruits_to_force_recruit="3.1"
		objectives=_ "Victory:
@Defeat enemy leader(s)"
		objectives_changed="no"
		recruit="Dwarvish Fighter,Dwarvish Guardsman,Dwarvish Thunderer,Dwarvish Ulfserker,Footpad,Gryphon Rider,Poacher,Thief"
		recruitment_pattern="fighter,fighter,fighter,mixed fighter,archer,scout"
		save_id="KnightKunibert1"
		share_maps="no"
		share_view="yes"
		shroud="no"
		side="1"
		start_gold="100"
		team_name="north"
#textdomain wesnoth-multiplayer
		user_team_name=_ "teamname^North"
		village_gold="2"
		village_value="1"
		villages_per_scout="8"
		[ai]
			recruitment_pattern="fighter,fighter,fighter,mixed fighter,archer,scout"
			villages_per_scout="8"
			[team_formula]
				rulebase="fai 'recruitment.fai'
		# ===== Some general functions used later ==== #

def sumarize_values( input_map )
	sum(
		values(input_map)
	);

def lowest_value( input_map )
	choose( input_map, -value ).value;

def highest_value( input_map )
	choose( input_map, value ).value;

def change_numbers_to_percents( input_map )
	map( input_map, 
		(value*100) / highest_value(input_map) 
	);

def add_number_to_values( input_map, number )
	map( input_map, 
		value + number 
	);

#make sure we have only positive values in a map #

def make_positive_only( input_map )
	if( lowest_value( input_map ) < 0, 
		add_number_to_values( 
			input_map, 
			abs(lowest_value(input_map))
		), 
		input_map 
	);

def sumarize_maps_values( map_A, map_B )
	map( map_A + map_B, 
		value + map_A[key]
	);

		#===== Evaluation how good unit is on a map ===== #

# ==1==  evaluate average defense #
#gives map where key is id of terrain, and value is number of hexes of that terrain on a gamemap#

def locations_map(ai*) 
	tomap( 
		map( 
			map.terrain, 
			id 
		) 
	);

#filters terrain map, min_percent it minimal % of map that terrain has to occupy to be considered in later evaluations# 

def filtered_locations_map(ai*, min_percent)
	filter( 
		locations_map(ai) , 
		value >  (map.w * map.h) / ( 100 / min_percent ) 
	);

#returns average defense of the unit #

def unit_average_defense(ai*, unit, terrain_min_percent )
	sum( 
		values( 
			map(
				filtered_locations_map(ai,terrain_min_percent), 
				defense_on( 
					unit, 
					find(map.terrain,id=key).loc
				) *
				value
			) 
		) 
	) / 
	sum(
		values(
			filtered_locations_map(
				ai,
				terrain_min_percent
			)
		)
	);

#returns map of units from units_list and their average defense (more -> better) #

def map_units_average_defense(ai*, units_list, terrain_min_percent) 
	tomap(
		map( 
			units_list, 
			id 
		), 
		map( 
			units_list, 'unit', 
			unit_average_defense(
				ai, 
				unit, 
				terrain_min_percent 
			) 
		) 
	);

def units_average_defense(ai*, units_list, terrain_min_percent)
	sum(
		map( 
			units_list, 'unit', 
			unit_average_defense(
				ai, 
				unit, 
				terrain_min_percent 
			) 
		) 
	) /
	size(
		units_list
	);


# ==2== TODO: evaluate unit effectivness based on movement points and movement cost#


		#===== Evaluation of game state - how good is ai doing ===== #

# ==1== based on unit cost and current amount of gold #
# returns number between 0 and 100 where: 0 we are losing, 100 we are winning #

def units_cost_gold_eval(ai*)
	min(
		[
			(
				(
					sum(
						map(
							allies, 'team', 
							sum(
								map(
									units_of_side[team], 
									cost
								)
							) + 
							teams[team].gold 
						)
					) * 
					100
				) / 
				sum(
					map(
						enemies, 'team', 
						sum(
							map(
								units_of_side[team], 
								cost
							)
						) + 
						max(
							[teams[team].gold, 0]
						) 
					)
				)
			) / 2,
			100
		]
	);

# ==2== based on village possession #

def count_allied_villages(ai*)
	sum(
		map(
			allies, 'side', 
			size(
				villages_of_side[side]
			)
		)
	);

def count_enemy_villages(ai*)
	sum(
		map(
			enemies, 'side', 
			size(
				villages_of_side[side]
			)
		)
	);

# multipled by 1000 to increase precision #

def village_evaluation(ai*)
	(
		50000 + 
		(
			count_allied_villages(ai) - 
			count_enemy_villages(ai)
		) * 
		(
			50000 /
			size(
				villages
			)
		)
	) /
	1000;

# ==3== combined 2 of the above #

def eval(ai*)
	( 
		units_cost_gold_eval(ai) + 
		village_evaluation(ai)
	) / 
	2;

		#===== Evaluation how effective my units are against the enemy ===== #

#==1==  basic evaluation #

# evaluate how much damage unit can inflict - how much damage unit can get#

def evaluate_attacker_against_opponents(ai*, unit, enemy_units)
	sum( 
		map( 
			enemy_units, 'enemy_unit', 
			sum(
				map(
					[
						max_possible_damage_with_retaliation( unit, enemy_unit )
					],
					max(
						[
							self[0] - self[2],
							self[1] - self[3]
						]
					)
				) 
			)
		)
	);

def evaluate_defender_against_opponents(ai*, unit, enemy_units)
	-sum( 
		map( 
			enemy_units, 'enemy_unit', 
			sum(
				map(
					[
						max_possible_damage_with_retaliation( enemy_unit, unit )
					],
					max(
						[
							self[0] - self[2],
							self[1] - self[3]
						]
					)
				)
			)
		)
	);

def units_hp_map(ai*, units)
	tomap( 
		map(
			units, 
			id
		), 
		map( 
			units, 
			hitpoints
		)
	);

#in case side's gold is more than 50, add units that side can recruit to the side's unit list#

def create_side_unit_list(ai*, side)
	if( 
		teams[side].gold > 50, 
		recruits_of_side[side], 
		[]
	) + 
	units_of_side[side];

def evaluate_my_recruits_as_attackers(ai*)
	tomap( 
		map(
			my_recruits, 
			id
		), 
		map(
			my_recruits, 'my_unit',
			sum(
				map(
					enemies, 'enemy_side',
					evaluate_attacker_against_opponents(
						ai,
						my_unit,
						create_side_unit_list(
							ai, 
							enemy_side
						)
					)
				)
			)
		)
	);

def evaluate_my_recruits_as_defenders(ai*)
	tomap(
		map(
			my_recruits, 
			id
		),
		map( 
			my_recruits, 'my_unit',
			sum(
				map(
					enemies, 'enemy_side',
					evaluate_defender_against_opponents(
						ai,
						my_unit,
						create_side_unit_list(
							ai,
							enemy_side
						)
					)
				)
			)
		)
	);


# === 2 ===  now consider abilities and weapon specials  #

def abilities_weights()
	['skirmisher' -> 15, 'ambush' -> 10, 'nightstalk' -> 20, 'regenerates' -> 20, 'healing' -> 15, 'curing' -> 10, 'leadership' -> 20, 'illumination' -> 15, 'teleport' -> 10, 'steadfast' -> 15 ];

def weapon_specials_weights()
	[ 'backstab' -> 20 ,'slow' -> 10 ,'berserk' -> 20 ,'stones' -> 60 ,'plague' -> 10 ,'marksman' -> 30 ,'magical' -> 40 ,'charge' -> 30 ,'drains' -> 30,  'firststrike' -> 10, 'poison' -> 25 ];

def apply_abilities_weights( units_map )
	map( 
		units_map, 
		value +
		(
			value * 
			max(
				map(
					get_unit_type( key ).abilities, 'ability',
					abilities_weights()[ability]
				)
			)
		) / 100
	);

def apply_weapon_specials_weights( units_map )
	map(
		units_map, 
		value +
		(
			value *
			max(
				map(
					get_unit_type( key ).attacks, 'attack',
					vars.weapon_specials[attack.special]
				)
			)
		) / 100
	);

# since undead units don't get random traits and are balanced with that, we need to lower their evaluation a bit to match fairly the living units #

def undead_malus( units_map )
	map( 
		units_map, 
		if(
			get_unit_type(key).undead,
			( value * 90 ) / 100,
			value 
		)
	);

# === 3 ===  pit 1 and 2 together  #

def evaluate_attackers(ai*)
	change_numbers_to_percents(
		apply_abilities_weights(
			apply_weapon_specials_weights(
				undead_malus( 
					make_positive_only(
						evaluate_my_recruits_as_attackers( ai )	
					)
				)
			)
		)
	);

def evaluate_defenders(ai*)
	map(
		map(
			change_numbers_to_percents(
				apply_abilities_weights(
					apply_weapon_specials_weights(
						undead_malus( 
							make_positive_only(
								evaluate_my_recruits_as_defenders( ai )	
							)
						)
					)
				)
			),
			value / 3
		), 
		value +
		map(
			change_numbers_to_percents(
				units_hp_map(
					ai,
					my_recruits
				)
			),
		value * 2 / 3
		)[key]
	);

	#=========== we have evaluation of game state and units, time to combine them: ==========#
		#=========	recruitment_list_builder	=========#

def rlb_apply_eval(eval, attackers_map, defenders_map, offset)
	map(
		sumarize_maps_values(
			map(
				attackers_map, 
				value * (eval+offset)
			),
			map(
				defenders_map,
				value * ( (100 - eval) - offset )
			)
		),
		value / 100
	);

def rlb_remove_lowest( input_map, percent)
	filter(
		input_map, 
		value > 
		(
			(
				percent * sumarize_values(input_map)
			) / 100
		)
	);

def rlb_first_step(eval, attackers_map, defenders_map, offset)
	rlb_remove_lowest(
		rlb_apply_eval(
			eval,
			attackers_map,
			defenders_map,
			offset
		),
		10
	);

def recruitment_list_builder(eval, attackers_map, defenders_map)
	map(
		rlb_first_step(
			eval,
			attackers_map,
			defenders_map,
			40
		),
		(
			(
				value * 100
			) / 
			sumarize_values(
				rlb_first_step(
					eval,
					attackers_map,
					defenders_map,
					40
				)
			)
		)
	);

		# ========== choose the unit to recruit now ========= #

def unit_chooser(ai*,unit_map) 
	choose(
		keys(unit_map), 'unit_type',
		unit_map[unit_type] - 
		(
			(
				100 * 
				size(
					filter(
						my_units, 
						type = unit_type
					)
				)
			) / 
			size(my_units)
		)
	);

def unit_map_cost_filter(ai*, unit_map)
	filter( unit_map,
		get_unit_type(key).cost < my_side.gold
	);

		# ==========	Main formula section 	========== #

def initialize_weapon_specials_map(ai*)
	if(vars.weapon_specials_init != turn,
		[
			set_var('weapon_specials_init', turn),
			set_var('weapon_specials',
				map(
					weapon_specials_weights(),
					if( key = 'magical',
						units_average_defense(ai, enemy_units, 10),
						if( key = 'marksman',
							units_average_defense(ai, enemy_units, 10) - 10,
							value
						)
					)
				)
			)
		],
		[]
	);

def create_recruits_map(ai*)
	if(vars.recruits_map_creator != turn,
		[
			set_var('recruits_map_creator', turn ),
			set_var('recruits_map',
				debug_print('final unit evaluation: ', recruitment_list_builder(
					debug_print('current AI evaluation (0-100): ', eval(ai)),
					debug_print('attackers evaluation: ',evaluate_attackers(ai)),
					debug_print('defenders evaluation: ',evaluate_defenders(ai))
				))
			)
		],
		[]
	);

def castle_space(ai*)
	filter( map( castle_locs( my_leader.loc ), 'location', if( unit_at( location ), 1, 0 ) ), self = 0  ).size;

if(vars.turn_initialized = turn,
		if( my_leader.loc = nearest_keep( my_leader.loc ),
			if( 
				get_unit_type(
					choose(
						vars.recruits_map,
						-get_unit_type(key).cost
					).key
				).cost <
				my_side.gold,
				if( castle_space(self),
					recruit(debug_print(
						unit_chooser(
							self,
							unit_map_cost_filter(
								self,
								vars.recruits_map
							)
						)
					)),
					fallback()
				),
				fallback() 
			),
			if( my_leader.movement_left > 0,
				move( my_leader.loc, nearest_keep( my_leader.loc ) ),
				fallback()
			)
		),
	[set_var(debug_print('turn_initialized'), turn)] +
	initialize_weapon_specials_map(self) +
	create_recruits_map(self)
)

faiend
"
			[/team_formula]
		[/ai]
		[ai]
			villages_per_scout="8"
		[/ai]
		[village]
			x="6"
			y="7"
		[/village]
		[village]
			x="6"
			y="15"
		[/village]
		[village]
			x="7"
			y="2"
		[/village]
		[village]
			x="13"
			y="6"
		[/village]
		[village]
			x="17"
			y="17"
		[/village]
		[village]
			x="19"
			y="7"
		[/village]
		[village]
			x="22"
			y="5"
		[/village]
		[village]
			x="24"
			y="2"
		[/village]
		[village]
			x="24"
			y="7"
		[/village]
		[village]
			x="24"
			y="15"
		[/village]
		[unit]
			advances_to="Dwarvish Dragonguard"
			alignment="neutral"
			allow_changes="yes"
			allow_player="yes"
			alpha="256"
			attacks_left="1"
			canrecruit="yes"
			colour="1"
			controller="human"
			cost="30"
			current_player="KnightKunibert"
			die_sound="dwarf-die-1.ogg,dwarf-die-2.ogg"
			experience="0"
			facing="sw"
			flag_rgb="magenta"
			flying="no"
			fog="yes"
			gender="male"
			gold="100"
			goto_x="-999"
			goto_y="-999"
			hitpoints="42"
			id="KnightKunibert1"
			image="units/dwarves/thunderguard.png"
			income="0"
#textdomain wesnoth-units
			language_name=_ "Dwarvish Thunderguard"
			leader="Dwarvish Steelclad,Dwarvish Thunderguard,Dwarvish Stalwart,Rogue,Trapper"
			level="2"
			max_attacks="1"
			max_experience="67"
			max_hitpoints="42"
			max_moves="5"
			movement="4"
			movement_type="dwarvishfoot"
			moves="0"
			mp_countdown="yes"
			mp_countdown_action_bonus="20"
			mp_countdown_init_time="270"
			mp_countdown_reservoir_time="270"
			mp_countdown_turn_bonus="200"
			name="KnightKunibert"
			profile="portraits/dwarves/thunderer.png"
			race="dwarf"
			random_leader="Dwarvish Steelclad,Dwarvish Thunderguard,Rogue,Trapper"
			random_traits="no"
			recruit="Dwarvish Guardsman,Dwarvish Fighter,Dwarvish Ulfserker,Dwarvish Thunderer,Thief,Poacher,Footpad,Gryphon Rider"
			resting="yes"
			save_id="KnightKunibert1"
			share_maps="no"
			share_view="yes"
			shroud="no"
			side="1"
			team_name="north"
			terrain_liked="Hh, Ha, Mm"
			type="Dwarvish Thunderguard"
			undead_variation="dwarf"
			underlying_id="1"
			unrenamable="no"
			upkeep="full"
			usage="mixed fighter"
			user_team_name="wesnoth-multiplayerteamname^North"
			village_gold="2"
			x="11"
			y="6"
			zoc="yes"
			[portrait]
				image="portraits/dwarves/transparent/thunderer.png"
				mirror="false"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/dwarves/transparent/thunderer.png"
				mirror="true"
				side="right"
				size="400"
			[/portrait]
			[defense]
				castle="40"
				cave="50"
				deep_water="80"
				flat="70"
				forest="70"
				frozen="70"
				fungus="60"
				hills="40"
				impassable="50"
				mountains="30"
				reef="70"
				sand="70"
				shallow_water="80"
				swamp_water="80"
				unwalkable="80"
				village="50"
			[/defense]
			[movement_costs]
				castle="1"
				cave="1"
				deep_water="99"
				flat="1"
				forest="1"
				frozen="2"
				fungus="1"
				hills="1"
				impassable="99"
				mountains="1"
				reef="2"
				sand="1"
				shallow_water="3"
				swamp_water="3"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="90"
				blade="80"
				cold="90"
				fire="90"
				impact="80"
				pierce="80"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="6"
				description=_ "dagger"
				icon="attacks/dagger-human.png"
				name="dagger"
				number="3"
				range="melee"
				type="blade"
			[/attack]
			[attack]
				damage="28"
				description=_ "thunderstick"
				icon="attacks/thunderstick.png"
				name="thunderstick"
				number="1"
				range="ranged"
				type="pierce"
			[/attack]
			[modifications]
				[trait]
#textdomain wesnoth
					female_name=_ "female^quick"
					id="quick"
					male_name=_ "quick"
					name=_ "quick"
					[effect]
						apply_to="movement"
						increase="1"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="-5%"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Rogue"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="13"
			die_sound="human-die-1.ogg,human-die-2.ogg,human-die-3.ogg"
			ellipse="misc/ellipse"
			experience="18"
			facing="s"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="21"
			id="Thief-4"
			image="units/human-outlaws/thief.png"
#textdomain wesnoth-units
			language_name=_ "Thief"
			level="1"
			max_attacks="1"
			max_experience="20"
			max_hitpoints="28"
			max_moves="7"
			movement="6"
			movement_type="elusivefoot"
			moves="7"
			name="Aethonvan"
			profile="portraits/humans/thief.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="1"
			type="Thief"
			underlying_id="4"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			x="24"
			y="14"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					name="dagger"
				[/filter_attack]
				[frame]
					begin="-150"
					end="-100"
					image="units/human-outlaws/thief.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/thief-attack.png"
						sound="dagger-swish.wav"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/thief-attack.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="150"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/attack_anim]
			[death]
				start_time="0"
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-5.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-6.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-7.png"
				[/frame]
			[/death]
			[defend]
				hits="miss"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="-42"
					image="units/human-outlaws/thief-defend-1-1.png"
				[/frame]
				[frame]
					begin="-42"
					end="41"
					image="units/human-outlaws/thief-defend-1-2.png"
				[/frame]
				[frame]
					begin="41"
					end="125"
					image="units/human-outlaws/thief-defend-1-1.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[defend]
				hits="miss"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="-42"
					image="units/human-outlaws/thief-defend-2-1.png"
				[/frame]
				[frame]
					begin="-42"
					end="41"
					image="units/human-outlaws/thief-defend-2-2.png"
				[/frame]
				[frame]
					begin="41"
					end="125"
					image="units/human-outlaws/thief-defend-2-1.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[defend]
				hits="miss"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="-42"
					image="units/human-outlaws/thief-defend-3-1.png"
				[/frame]
				[frame]
					begin="-42"
					end="41"
					image="units/human-outlaws/thief-defend-3-2.png"
				[/frame]
				[frame]
					begin="41"
					end="125"
					image="units/human-outlaws/thief-defend-3-1.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[defend]
				hits="kill"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="125"
					image="units/human-outlaws/thief-defend.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[defend]
				hits="hit"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="125"
					image="units/human-outlaws/thief-defend.png"
					sound="human-hit-1.ogg,human-hit-2.ogg,human-hit-3.ogg,human-hit-4.ogg,human-hit-5.ogg"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[idle_anim]
				start_time="0"
				[filter]
					[not]
						[filter_wml]
							[status]
								poisoned="yes"
							[/status]
						[/filter_wml]
					[/not]
				[/filter]
				[filter]
					[filter_adjacent]
						count="0"
						is_enemy="yes"
					[/filter_adjacent]
				[/filter]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-4.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/thief-idle-5.png"
				[/frame]
				[frame]
					duration="150"
					image="units/human-outlaws/thief-idle-6.png"
				[/frame]
				[frame]
					duration="500"
					image="units/human-outlaws/thief-idle-7.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-8.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-12.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-8.png"
				[/frame]
				[frame]
					duration="300"
					image="units/human-outlaws/thief-idle-7.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-8.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-12.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-8.png"
				[/frame]
				[frame]
					duration="500"
					image="units/human-outlaws/thief-idle-7.png"
				[/frame]
				[frame]
					duration="150"
					image="units/human-outlaws/thief-idle-6.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/thief-idle-5.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-1.png"
				[/frame]
			[/idle_anim]
			[portrait]
				image="portraits/humans/transparent/thief.png"
				mirror="false"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/humans/transparent/thief.png"
				mirror="true"
				side="right"
				size="400"
			[/portrait]
			[defense]
				castle="30"
				cave="50"
				deep_water="70"
				flat="40"
				forest="30"
				frozen="60"
				fungus="30"
				hills="30"
				impassable="50"
				mountains="30"
				reef="50"
				sand="60"
				shallow_water="60"
				swamp_water="60"
				unwalkable="80"
				village="30"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="2"
				fungus="2"
				hills="2"
				impassable="99"
				mountains="3"
				reef="2"
				sand="2"
				shallow_water="2"
				swamp_water="2"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="130"
				cold="100"
				fire="100"
				impact="120"
				pierce="120"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="4"
				description=_ "dagger"
				icon="attacks/dagger-human.png"
				name="dagger"
				number="3"
				range="melee"
				type="blade"
				[specials]
					[damage]
						active_on="offense"
						backstab="yes"
#textdomain wesnoth
						description=_ "Backstab:
When used offensively, this attack deals double damage if there is an enemy of the target on the opposite side of the target, and that unit is not incapacitated (turned to stone or otherwise paralyzed)."
						id="backstab"
						multiply="2"
						name=_ "backstab"
					[/damage]
				[/specials]
			[/attack]
			[modifications]
				[trait]
					female_name=_ "female^quick"
					id="quick"
					male_name=_ "quick"
					name=_ "quick"
					[effect]
						apply_to="movement"
						increase="1"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="-5%"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^resilient"
					id="resilient"
					male_name=_ "resilient"
					name=_ "resilient"
					[effect]
						apply_to="hitpoints"
						increase_total="4"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
						times="per level"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Outlaw"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="14"
			die_sound="human-die-1.ogg,human-die-2.ogg,human-die-3.ogg"
			ellipse="misc/ellipse"
			experience="16"
			facing="n"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="9"
			id="Footpad-6"
			image="units/human-outlaws/footpad.png"
#textdomain wesnoth-units
			language_name=_ "Footpad"
			level="1"
			max_attacks="1"
			max_experience="25"
			max_hitpoints="33"
			max_moves="8"
			movement="7"
			movement_type="elusivefoot"
			moves="0"
			name="Meonyn"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="1"
			type="Footpad"
			underlying_id="6"
			unrenamable="no"
			upkeep="full"
			usage="scout"
			x="7"
			y="8"
			zoc="yes"
			[attack_anim]
				offset="0.0"
				[filter_attack]
					name="sling"
				[/filter_attack]
				[if]
					hits="yes"
					[sling_stone_frame]
						begin="-201"
						end="-200"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="-200"
						end="0"
						halo="projectiles/stone.png"
						halo_x="20~0"
						halo_y="-6~0"
						offset="0.0~1.0"
						y="0~-5,-5~-8,-8~-9,-9~-10,-10~-9,-9~-8,-8~-5,-5~0"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="0"
						end="1"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[frame]
						begin="-400"
						end="-150"
						image="units/human-outlaws/footpad-attack1.png"
						sound="sling.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[sling_stone_frame]
						begin="-201"
						end="-200"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="-200"
						end="100"
						halo="projectiles/stone.png"
						halo_x="20~0"
						halo_y="-6~0"
						offset="0.0~1.5"
						y="0~-5,-5~-8,-8~-9,-9~-10,-10~-9,-9~-8,-8~-5,-5~0"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="100"
						end="101"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[frame]
						begin="-400"
						end="-150"
						image="units/human-outlaws/footpad-attack1.png"
						sound="sling-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="-150"
					end="50"
					image="units/human-outlaws/footpad-attack2.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				[filter_attack]
					name="club"
				[/filter_attack]
				[frame]
					begin="-250"
					end="-200"
					image="units/human-outlaws/footpad.png"
				[/frame]
				[frame]
					begin="-200"
					end="-100"
					image="units/human-outlaws/footpad-melee-1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/footpad-melee-2.png"
						sound="staff.wav"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/footpad-melee-2.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="200"
					image="units/human-outlaws/footpad-melee-3.png"
				[/frame]
				[frame]
					begin="200"
					end="300"
					image="units/human-outlaws/footpad-melee-4.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/human-outlaws/footpad.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/human-outlaws/footpad-defend.png"
						sound="human-hit-1.ogg,human-hit-2.ogg,human-hit-3.ogg,human-hit-4.ogg,human-hit-5.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/human-outlaws/footpad-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/human-outlaws/footpad.png"
				[/frame]
			[/defend]
			[idle_anim]
				start_time="0"
				[filter]
					[not]
						[filter_wml]
							[status]
								poisoned="yes"
							[/status]
						[/filter_wml]
					[/not]
				[/filter]
				[filter]
					[filter_adjacent]
						count="0"
						is_enemy="yes"
					[/filter_adjacent]
				[/filter]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/footpad-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/footpad-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-1.png"
				[/frame]
			[/idle_anim]
			[defense]
				castle="30"
				cave="50"
				deep_water="70"
				flat="40"
				forest="30"
				frozen="60"
				fungus="30"
				hills="30"
				impassable="50"
				mountains="30"
				reef="50"
				sand="60"
				shallow_water="60"
				swamp_water="60"
				unwalkable="80"
				village="30"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="2"
				fungus="2"
				hills="2"
				impassable="99"
				mountains="3"
				reef="2"
				sand="2"
				shallow_water="2"
				swamp_water="2"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="130"
				cold="100"
				fire="100"
				impact="120"
				pierce="120"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="5"
				description=_ "club"
				icon="attacks/club-small.png"
				name="club"
				number="2"
				range="melee"
				type="impact"
			[/attack]
			[attack]
				damage="5"
				description=_ "sling"
				name="sling"
				number="2"
				range="ranged"
				type="impact"
			[/attack]
			[modifications]
				[trait]
#textdomain wesnoth
					female_name=_ "female^resilient"
					id="resilient"
					male_name=_ "resilient"
					name=_ "resilient"
					[effect]
						apply_to="hitpoints"
						increase_total="4"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
						times="per level"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^quick"
					id="quick"
					male_name=_ "quick"
					name=_ "quick"
					[effect]
						apply_to="movement"
						increase="1"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="-5%"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Rogue"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="13"
			die_sound="human-die-1.ogg,human-die-2.ogg,human-die-3.ogg"
			ellipse="misc/ellipse"
			experience="19"
			facing="s"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="30"
			id="Thief-18"
			image="units/human-outlaws/thief.png"
#textdomain wesnoth-units
			language_name=_ "Thief"
			level="1"
			max_attacks="1"
			max_experience="20"
			max_hitpoints="30"
			max_moves="6"
			movement="6"
			movement_type="elusivefoot"
			moves="6"
			name="Cunry"
			profile="portraits/humans/thief.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="1"
			type="Thief"
			underlying_id="18"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			x="24"
			y="12"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					name="dagger"
				[/filter_attack]
				[frame]
					begin="-150"
					end="-100"
					image="units/human-outlaws/thief.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/thief-attack.png"
						sound="dagger-swish.wav"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/thief-attack.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="150"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/attack_anim]
			[death]
				start_time="0"
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-5.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-6.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-7.png"
				[/frame]
			[/death]
			[defend]
				hits="miss"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="-42"
					image="units/human-outlaws/thief-defend-1-1.png"
				[/frame]
				[frame]
					begin="-42"
					end="41"
					image="units/human-outlaws/thief-defend-1-2.png"
				[/frame]
				[frame]
					begin="41"
					end="125"
					image="units/human-outlaws/thief-defend-1-1.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[defend]
				hits="miss"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="-42"
					image="units/human-outlaws/thief-defend-2-1.png"
				[/frame]
				[frame]
					begin="-42"
					end="41"
					image="units/human-outlaws/thief-defend-2-2.png"
				[/frame]
				[frame]
					begin="41"
					end="125"
					image="units/human-outlaws/thief-defend-2-1.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[defend]
				hits="miss"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="-42"
					image="units/human-outlaws/thief-defend-3-1.png"
				[/frame]
				[frame]
					begin="-42"
					end="41"
					image="units/human-outlaws/thief-defend-3-2.png"
				[/frame]
				[frame]
					begin="41"
					end="125"
					image="units/human-outlaws/thief-defend-3-1.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[defend]
				hits="kill"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="125"
					image="units/human-outlaws/thief-defend.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[defend]
				hits="hit"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="125"
					image="units/human-outlaws/thief-defend.png"
					sound="human-hit-1.ogg,human-hit-2.ogg,human-hit-3.ogg,human-hit-4.ogg,human-hit-5.ogg"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[idle_anim]
				start_time="0"
				[filter]
					[not]
						[filter_wml]
							[status]
								poisoned="yes"
							[/status]
						[/filter_wml]
					[/not]
				[/filter]
				[filter]
					[filter_adjacent]
						count="0"
						is_enemy="yes"
					[/filter_adjacent]
				[/filter]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-4.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/thief-idle-5.png"
				[/frame]
				[frame]
					duration="150"
					image="units/human-outlaws/thief-idle-6.png"
				[/frame]
				[frame]
					duration="500"
					image="units/human-outlaws/thief-idle-7.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-8.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-12.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-8.png"
				[/frame]
				[frame]
					duration="300"
					image="units/human-outlaws/thief-idle-7.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-8.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-12.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-8.png"
				[/frame]
				[frame]
					duration="500"
					image="units/human-outlaws/thief-idle-7.png"
				[/frame]
				[frame]
					duration="150"
					image="units/human-outlaws/thief-idle-6.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/thief-idle-5.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-1.png"
				[/frame]
			[/idle_anim]
			[portrait]
				image="portraits/humans/transparent/thief.png"
				mirror="false"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/humans/transparent/thief.png"
				mirror="true"
				side="right"
				size="400"
			[/portrait]
			[defense]
				castle="30"
				cave="50"
				deep_water="70"
				flat="40"
				forest="30"
				frozen="60"
				fungus="30"
				hills="30"
				impassable="50"
				mountains="30"
				reef="50"
				sand="60"
				shallow_water="60"
				swamp_water="60"
				unwalkable="80"
				village="30"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="2"
				fungus="2"
				hills="2"
				impassable="99"
				mountains="3"
				reef="2"
				sand="2"
				shallow_water="2"
				swamp_water="2"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="130"
				cold="100"
				fire="100"
				impact="120"
				pierce="120"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="5"
				description=_ "dagger"
				icon="attacks/dagger-human.png"
				name="dagger"
				number="3"
				range="melee"
				type="blade"
				[specials]
					[damage]
						active_on="offense"
						backstab="yes"
#textdomain wesnoth
						description=_ "Backstab:
When used offensively, this attack deals double damage if there is an enemy of the target on the opposite side of the target, and that unit is not incapacitated (turned to stone or otherwise paralyzed)."
						id="backstab"
						multiply="2"
						name=_ "backstab"
					[/damage]
				[/specials]
			[/attack]
			[modifications]
				[trait]
					female_name=_ "female^resilient"
					id="resilient"
					male_name=_ "resilient"
					name=_ "resilient"
					[effect]
						apply_to="hitpoints"
						increase_total="4"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
						times="per level"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^strong"
					id="strong"
					male_name=_ "strong"
					name=_ "strong"
					[effect]
						apply_to="attack"
						increase_damage="1"
						range="melee"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Rogue"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="13"
			die_sound="human-die-1.ogg,human-die-2.ogg,human-die-3.ogg"
			ellipse="misc/ellipse"
			experience="3"
			facing="n"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="5"
			id="Thief-21"
			image="units/human-outlaws/thief.png"
#textdomain wesnoth-units
			language_name=_ "Thief"
			level="1"
			max_attacks="1"
			max_experience="15"
			max_hitpoints="23"
			max_moves="7"
			movement="6"
			movement_type="elusivefoot"
			moves="0"
			name="Bledreollydd"
			profile="portraits/humans/thief.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="1"
			type="Thief"
			underlying_id="21"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			x="23"
			y="9"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					name="dagger"
				[/filter_attack]
				[frame]
					begin="-150"
					end="-100"
					image="units/human-outlaws/thief.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/thief-attack.png"
						sound="dagger-swish.wav"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/thief-attack.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="150"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/attack_anim]
			[death]
				start_time="0"
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-5.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-6.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-7.png"
				[/frame]
			[/death]
			[defend]
				hits="miss"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="-42"
					image="units/human-outlaws/thief-defend-1-1.png"
				[/frame]
				[frame]
					begin="-42"
					end="41"
					image="units/human-outlaws/thief-defend-1-2.png"
				[/frame]
				[frame]
					begin="41"
					end="125"
					image="units/human-outlaws/thief-defend-1-1.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[defend]
				hits="miss"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="-42"
					image="units/human-outlaws/thief-defend-2-1.png"
				[/frame]
				[frame]
					begin="-42"
					end="41"
					image="units/human-outlaws/thief-defend-2-2.png"
				[/frame]
				[frame]
					begin="41"
					end="125"
					image="units/human-outlaws/thief-defend-2-1.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[defend]
				hits="miss"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="-42"
					image="units/human-outlaws/thief-defend-3-1.png"
				[/frame]
				[frame]
					begin="-42"
					end="41"
					image="units/human-outlaws/thief-defend-3-2.png"
				[/frame]
				[frame]
					begin="41"
					end="125"
					image="units/human-outlaws/thief-defend-3-1.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[defend]
				hits="kill"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="125"
					image="units/human-outlaws/thief-defend.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[defend]
				hits="hit"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="125"
					image="units/human-outlaws/thief-defend.png"
					sound="human-hit-1.ogg,human-hit-2.ogg,human-hit-3.ogg,human-hit-4.ogg,human-hit-5.ogg"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[idle_anim]
				start_time="0"
				[filter]
					[not]
						[filter_wml]
							[status]
								poisoned="yes"
							[/status]
						[/filter_wml]
					[/not]
				[/filter]
				[filter]
					[filter_adjacent]
						count="0"
						is_enemy="yes"
					[/filter_adjacent]
				[/filter]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-4.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/thief-idle-5.png"
				[/frame]
				[frame]
					duration="150"
					image="units/human-outlaws/thief-idle-6.png"
				[/frame]
				[frame]
					duration="500"
					image="units/human-outlaws/thief-idle-7.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-8.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-12.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-8.png"
				[/frame]
				[frame]
					duration="300"
					image="units/human-outlaws/thief-idle-7.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-8.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-12.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-8.png"
				[/frame]
				[frame]
					duration="500"
					image="units/human-outlaws/thief-idle-7.png"
				[/frame]
				[frame]
					duration="150"
					image="units/human-outlaws/thief-idle-6.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/thief-idle-5.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-1.png"
				[/frame]
			[/idle_anim]
			[portrait]
				image="portraits/humans/transparent/thief.png"
				mirror="false"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/humans/transparent/thief.png"
				mirror="true"
				side="right"
				size="400"
			[/portrait]
			[defense]
				castle="30"
				cave="50"
				deep_water="70"
				flat="40"
				forest="30"
				frozen="60"
				fungus="30"
				hills="30"
				impassable="50"
				mountains="30"
				reef="50"
				sand="60"
				shallow_water="60"
				swamp_water="60"
				unwalkable="80"
				village="30"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="2"
				fungus="2"
				hills="2"
				impassable="99"
				mountains="3"
				reef="2"
				sand="2"
				shallow_water="2"
				swamp_water="2"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="130"
				cold="100"
				fire="100"
				impact="120"
				pierce="120"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="4"
				description=_ "dagger"
				icon="attacks/dagger-human.png"
				name="dagger"
				number="3"
				range="melee"
				type="blade"
				[specials]
					[damage]
						active_on="offense"
						backstab="yes"
#textdomain wesnoth
						description=_ "Backstab:
When used offensively, this attack deals double damage if there is an enemy of the target on the opposite side of the target, and that unit is not incapacitated (turned to stone or otherwise paralyzed)."
						id="backstab"
						multiply="2"
						name=_ "backstab"
					[/damage]
				[/specials]
			[/attack]
			[modifications]
				[trait]
					female_name=_ "female^intelligent"
					id="intelligent"
					male_name=_ "intelligent"
					name=_ "intelligent"
					[effect]
						apply_to="max_experience"
						increase="-20%"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^quick"
					id="quick"
					male_name=_ "quick"
					name=_ "quick"
					[effect]
						apply_to="movement"
						increase="1"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="-5%"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Rogue"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="13"
			die_sound="human-die-1.ogg,human-die-2.ogg,human-die-3.ogg"
			ellipse="misc/ellipse"
			experience="4"
			facing="se"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="17"
			id="Thief-23"
			image="units/human-outlaws/thief.png"
#textdomain wesnoth-units
			language_name=_ "Thief"
			level="1"
			max_attacks="1"
			max_experience="20"
			max_hitpoints="30"
			max_moves="6"
			movement="6"
			movement_type="elusivefoot"
			moves="6"
			name="Glon"
			profile="portraits/humans/thief.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="1"
			type="Thief"
			underlying_id="23"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			x="23"
			y="16"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					name="dagger"
				[/filter_attack]
				[frame]
					begin="-150"
					end="-100"
					image="units/human-outlaws/thief.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/thief-attack.png"
						sound="dagger-swish.wav"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/thief-attack.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="150"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/attack_anim]
			[death]
				start_time="0"
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-5.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-6.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-7.png"
				[/frame]
			[/death]
			[defend]
				hits="miss"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="-42"
					image="units/human-outlaws/thief-defend-1-1.png"
				[/frame]
				[frame]
					begin="-42"
					end="41"
					image="units/human-outlaws/thief-defend-1-2.png"
				[/frame]
				[frame]
					begin="41"
					end="125"
					image="units/human-outlaws/thief-defend-1-1.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[defend]
				hits="miss"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="-42"
					image="units/human-outlaws/thief-defend-2-1.png"
				[/frame]
				[frame]
					begin="-42"
					end="41"
					image="units/human-outlaws/thief-defend-2-2.png"
				[/frame]
				[frame]
					begin="41"
					end="125"
					image="units/human-outlaws/thief-defend-2-1.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[defend]
				hits="miss"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="-42"
					image="units/human-outlaws/thief-defend-3-1.png"
				[/frame]
				[frame]
					begin="-42"
					end="41"
					image="units/human-outlaws/thief-defend-3-2.png"
				[/frame]
				[frame]
					begin="41"
					end="125"
					image="units/human-outlaws/thief-defend-3-1.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[defend]
				hits="kill"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="125"
					image="units/human-outlaws/thief-defend.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[defend]
				hits="hit"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="125"
					image="units/human-outlaws/thief-defend.png"
					sound="human-hit-1.ogg,human-hit-2.ogg,human-hit-3.ogg,human-hit-4.ogg,human-hit-5.ogg"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[idle_anim]
				start_time="0"
				[filter]
					[not]
						[filter_wml]
							[status]
								poisoned="yes"
							[/status]
						[/filter_wml]
					[/not]
				[/filter]
				[filter]
					[filter_adjacent]
						count="0"
						is_enemy="yes"
					[/filter_adjacent]
				[/filter]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-4.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/thief-idle-5.png"
				[/frame]
				[frame]
					duration="150"
					image="units/human-outlaws/thief-idle-6.png"
				[/frame]
				[frame]
					duration="500"
					image="units/human-outlaws/thief-idle-7.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-8.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-12.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-8.png"
				[/frame]
				[frame]
					duration="300"
					image="units/human-outlaws/thief-idle-7.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-8.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-12.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-8.png"
				[/frame]
				[frame]
					duration="500"
					image="units/human-outlaws/thief-idle-7.png"
				[/frame]
				[frame]
					duration="150"
					image="units/human-outlaws/thief-idle-6.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/thief-idle-5.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-1.png"
				[/frame]
			[/idle_anim]
			[portrait]
				image="portraits/humans/transparent/thief.png"
				mirror="false"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/humans/transparent/thief.png"
				mirror="true"
				side="right"
				size="400"
			[/portrait]
			[defense]
				castle="30"
				cave="50"
				deep_water="70"
				flat="40"
				forest="30"
				frozen="60"
				fungus="30"
				hills="30"
				impassable="50"
				mountains="30"
				reef="50"
				sand="60"
				shallow_water="60"
				swamp_water="60"
				unwalkable="80"
				village="30"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="2"
				fungus="2"
				hills="2"
				impassable="99"
				mountains="3"
				reef="2"
				sand="2"
				shallow_water="2"
				swamp_water="2"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="130"
				cold="100"
				fire="100"
				impact="120"
				pierce="120"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="5"
				description=_ "dagger"
				icon="attacks/dagger-human.png"
				name="dagger"
				number="3"
				range="melee"
				type="blade"
				[specials]
					[damage]
						active_on="offense"
						backstab="yes"
#textdomain wesnoth
						description=_ "Backstab:
When used offensively, this attack deals double damage if there is an enemy of the target on the opposite side of the target, and that unit is not incapacitated (turned to stone or otherwise paralyzed)."
						id="backstab"
						multiply="2"
						name=_ "backstab"
					[/damage]
				[/specials]
			[/attack]
			[modifications]
				[trait]
					female_name=_ "female^resilient"
					id="resilient"
					male_name=_ "resilient"
					name=_ "resilient"
					[effect]
						apply_to="hitpoints"
						increase_total="4"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
						times="per level"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^strong"
					id="strong"
					male_name=_ "strong"
					name=_ "strong"
					[effect]
						apply_to="attack"
						increase_damage="1"
						range="melee"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Rogue"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="13"
			die_sound="human-female-die-1.ogg,human-female-die-2.ogg,human-female-die-3.ogg"
			ellipse="misc/ellipse"
			experience="1"
			facing="s"
			flag_rgb="magenta"
			flying="no"
			gender="female"
			goto_x="-999"
			goto_y="-999"
			hitpoints="29"
			id="Thief-25"
			image="units/human-outlaws/thief+female.png"
#textdomain wesnoth-units
			language_name=_ "female^Thief"
			level="1"
			max_attacks="1"
			max_experience="15"
			max_hitpoints="29"
			max_moves="6"
			movement="6"
			movement_type="elusivefoot"
			moves="6"
			name="Saera"
			profile="portraits/humans/thief+female.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="1"
			type="Thief"
			underlying_id="25"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			x="24"
			y="15"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					name="dagger"
				[/filter_attack]
				[frame]
					begin="-150"
					end="-100"
					image="units/human-outlaws/thief+female.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/thief+female-attack.png"
						sound="dagger-swish.wav"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/thief+female-attack.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="150"
					image="units/human-outlaws/thief+female.png"
				[/frame]
			[/attack_anim]
			[death]
				start_time="0"
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-die-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-die-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-die-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-die-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-die-5.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-die-6.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-die-7.png"
				[/frame]
			[/death]
			[defend]
				hits="miss"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief+female.png"
				[/frame]
				[frame]
					begin="-125"
					end="-42"
					image="units/human-outlaws/thief+female-defend-1-1.png"
				[/frame]
				[frame]
					begin="-42"
					end="41"
					image="units/human-outlaws/thief+female-defend-1-2.png"
				[/frame]
				[frame]
					begin="41"
					end="125"
					image="units/human-outlaws/thief+female-defend-1-1.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief+female.png"
				[/frame]
			[/defend]
			[defend]
				hits="miss"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief+female.png"
				[/frame]
				[frame]
					begin="-125"
					end="-42"
					image="units/human-outlaws/thief+female-defend-2-1.png"
				[/frame]
				[frame]
					begin="-42"
					end="41"
					image="units/human-outlaws/thief+female-defend-2-2.png"
				[/frame]
				[frame]
					begin="41"
					end="125"
					image="units/human-outlaws/thief+female-defend-2-1.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief+female.png"
				[/frame]
			[/defend]
			[defend]
				hits="miss"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief+female.png"
				[/frame]
				[frame]
					begin="-125"
					end="-42"
					image="units/human-outlaws/thief+female-defend-3-1.png"
				[/frame]
				[frame]
					begin="-42"
					end="41"
					image="units/human-outlaws/thief+female-defend-3-2.png"
				[/frame]
				[frame]
					begin="41"
					end="125"
					image="units/human-outlaws/thief+female-defend-3-1.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief+female.png"
				[/frame]
			[/defend]
			[defend]
				hits="kill"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief+female.png"
				[/frame]
				[frame]
					begin="-125"
					end="125"
					image="units/human-outlaws/thief+female-defend.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief+female.png"
				[/frame]
			[/defend]
			[defend]
				hits="hit"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief+female.png"
				[/frame]
				[frame]
					begin="-125"
					end="125"
					image="units/human-outlaws/thief+female-defend.png"
					sound="human-female-hit-1.ogg,human-female-hit-2.ogg,human-female-hit-3.ogg"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief+female.png"
				[/frame]
			[/defend]
			[idle_anim]
				start_time="0"
				[filter]
					[not]
						[filter_wml]
							[status]
								poisoned="yes"
							[/status]
						[/filter_wml]
					[/not]
				[/filter]
				[filter]
					[filter_adjacent]
						count="0"
						is_enemy="yes"
					[/filter_adjacent]
				[/filter]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-4.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/thief+female-idle-5.png"
				[/frame]
				[frame]
					duration="150"
					image="units/human-outlaws/thief+female-idle-6.png"
				[/frame]
				[frame]
					duration="500"
					image="units/human-outlaws/thief+female-idle-7.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-8.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-12.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-8.png"
				[/frame]
				[frame]
					duration="300"
					image="units/human-outlaws/thief+female-idle-7.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-8.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-12.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-8.png"
				[/frame]
				[frame]
					duration="500"
					image="units/human-outlaws/thief+female-idle-7.png"
				[/frame]
				[frame]
					duration="150"
					image="units/human-outlaws/thief+female-idle-6.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/thief+female-idle-5.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-1.png"
				[/frame]
			[/idle_anim]
			[portrait]
				image="portraits/humans/transparent/thief+female.png"
				mirror="false"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/humans/transparent/thief+female.png"
				mirror="true"
				side="right"
				size="400"
			[/portrait]
			[defense]
				castle="30"
				cave="50"
				deep_water="70"
				flat="40"
				forest="30"
				frozen="60"
				fungus="30"
				hills="30"
				impassable="50"
				mountains="30"
				reef="50"
				sand="60"
				shallow_water="60"
				swamp_water="60"
				unwalkable="80"
				village="30"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="2"
				fungus="2"
				hills="2"
				impassable="99"
				mountains="3"
				reef="2"
				sand="2"
				shallow_water="2"
				swamp_water="2"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="130"
				cold="100"
				fire="100"
				impact="120"
				pierce="120"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="4"
				description=_ "dagger"
				icon="attacks/dagger-human.png"
				name="dagger"
				number="3"
				range="melee"
				type="blade"
				[specials]
					[damage]
						active_on="offense"
						backstab="yes"
#textdomain wesnoth
						description=_ "Backstab:
When used offensively, this attack deals double damage if there is an enemy of the target on the opposite side of the target, and that unit is not incapacitated (turned to stone or otherwise paralyzed)."
						id="backstab"
						multiply="2"
						name=_ "backstab"
					[/damage]
				[/specials]
			[/attack]
			[modifications]
				[trait]
					female_name=_ "female^intelligent"
					id="intelligent"
					male_name=_ "intelligent"
					name=_ "female^intelligent"
					[effect]
						apply_to="max_experience"
						increase="-20%"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^resilient"
					id="resilient"
					male_name=_ "resilient"
					name=_ "female^resilient"
					[effect]
						apply_to="hitpoints"
						increase_total="4"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
						times="per level"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Outlaw"
			alignment="chaotic"
			alpha="256"
			attacks_left="0"
			cost="14"
			die_sound="human-female-die-1.ogg,human-female-die-2.ogg,human-female-die-3.ogg"
			ellipse="misc/ellipse"
			experience="6"
			facing="n"
			flag_rgb="magenta"
			flying="no"
			gender="female"
			goto_x="-999"
			goto_y="-999"
			hitpoints="27"
			id="Footpad-28"
			image="units/human-outlaws/footpad+female.png"
#textdomain wesnoth-units
			language_name=_ "female^Footpad"
			level="1"
			max_attacks="1"
			max_experience="20"
			max_hitpoints="35"
			max_moves="7"
			movement="7"
			movement_type="elusivefoot"
			moves="0"
			name="Lyllyra"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="1"
			type="Footpad"
			underlying_id="28"
			unrenamable="no"
			upkeep="full"
			usage="scout"
			x="17"
			y="17"
			zoc="yes"
			[attack_anim]
				offset="0.0"
				[filter_attack]
					name="sling"
				[/filter_attack]
				[if]
					hits="yes"
					[sling_stone_frame]
						begin="-201"
						end="-200"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="-200"
						end="0"
						halo="projectiles/stone.png"
						halo_x="20~0"
						halo_y="-6~0"
						offset="0.0~1.0"
						y="0~-5,-5~-8,-8~-9,-9~-10,-10~-9,-9~-8,-8~-5,-5~0"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="0"
						end="1"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[frame]
						begin="-400"
						end="-150"
						image="units/human-outlaws/footpad+female-attack1.png"
						sound="sling.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[sling_stone_frame]
						begin="-201"
						end="-200"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="-200"
						end="100"
						halo="projectiles/stone.png"
						halo_x="20~0"
						halo_y="-6~0"
						offset="0.0~1.5"
						y="0~-5,-5~-8,-8~-9,-9~-10,-10~-9,-9~-8,-8~-5,-5~0"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="100"
						end="101"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[frame]
						begin="-400"
						end="-150"
						image="units/human-outlaws/footpad+female-attack1.png"
						sound="sling-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="-150"
					end="50"
					image="units/human-outlaws/footpad+female-attack2.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				[filter_attack]
					name="club"
				[/filter_attack]
				[frame]
					begin="-250"
					end="-200"
					image="units/human-outlaws/footpad+female.png"
				[/frame]
				[frame]
					begin="-200"
					end="-100"
					image="units/human-outlaws/footpad+female-melee-1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/footpad+female-melee-2.png"
						sound="staff.wav"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/footpad+female-melee-2.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="200"
					image="units/human-outlaws/footpad+female-melee-3.png"
				[/frame]
				[frame]
					begin="200"
					end="300"
					image="units/human-outlaws/footpad+female-melee-4.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/human-outlaws/footpad+female.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad+female-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/human-outlaws/footpad+female-defend.png"
						sound="human-female-hit-1.ogg,human-female-hit-2.ogg,human-female-hit-3.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/human-outlaws/footpad+female-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/human-outlaws/footpad+female.png"
				[/frame]
			[/defend]
			[idle_anim]
				start_time="0"
				[filter]
					[not]
						[filter_wml]
							[status]
								poisoned="yes"
							[/status]
						[/filter_wml]
					[/not]
				[/filter]
				[filter]
					[filter_adjacent]
						count="0"
						is_enemy="yes"
					[/filter_adjacent]
				[/filter]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad+female-idle-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad+female-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad+female-idle-3.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/footpad+female-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad+female-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad+female-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad+female-idle-3.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/footpad+female-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad+female-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad+female-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad+female-idle-1.png"
				[/frame]
			[/idle_anim]
			[defense]
				castle="30"
				cave="50"
				deep_water="70"
				flat="40"
				forest="30"
				frozen="60"
				fungus="30"
				hills="30"
				impassable="50"
				mountains="30"
				reef="50"
				sand="60"
				shallow_water="60"
				swamp_water="60"
				unwalkable="80"
				village="30"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="2"
				fungus="2"
				hills="2"
				impassable="99"
				mountains="3"
				reef="2"
				sand="2"
				shallow_water="2"
				swamp_water="2"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="130"
				cold="100"
				fire="100"
				impact="120"
				pierce="120"
			[/resistance]
			[variables]
			[/variables]
			[status]
			[/status]
			[attack]
				damage="5"
				description=_ "club"
				icon="attacks/club-small.png"
				name="club"
				number="2"
				range="melee"
				type="impact"
			[/attack]
			[attack]
				damage="5"
				description=_ "sling"
				name="sling"
				number="2"
				range="ranged"
				type="impact"
			[/attack]
			[modifications]
				[trait]
#textdomain wesnoth
					female_name=_ "female^intelligent"
					id="intelligent"
					male_name=_ "intelligent"
					name=_ "female^intelligent"
					[effect]
						apply_to="max_experience"
						increase="-20%"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^resilient"
					id="resilient"
					male_name=_ "resilient"
					name=_ "female^resilient"
					[effect]
						apply_to="hitpoints"
						increase_total="4"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
						times="per level"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Outlaw"
			alignment="chaotic"
			alpha="256"
			attacks_left="0"
			cost="14"
			die_sound="human-die-1.ogg,human-die-2.ogg,human-die-3.ogg"
			ellipse="misc/ellipse"
			experience="2"
			facing="nw"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="22"
			id="Footpad-29"
			image="units/human-outlaws/footpad.png"
#textdomain wesnoth-units
			language_name=_ "Footpad"
			level="1"
			max_attacks="1"
			max_experience="20"
			max_hitpoints="29"
			max_moves="8"
			movement="7"
			movement_type="elusivefoot"
			moves="0"
			name="Rheoc"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="1"
			type="Footpad"
			underlying_id="29"
			unrenamable="no"
			upkeep="full"
			usage="scout"
			x="8"
			y="15"
			zoc="yes"
			[attack_anim]
				offset="0.0"
				[filter_attack]
					name="sling"
				[/filter_attack]
				[if]
					hits="yes"
					[sling_stone_frame]
						begin="-201"
						end="-200"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="-200"
						end="0"
						halo="projectiles/stone.png"
						halo_x="20~0"
						halo_y="-6~0"
						offset="0.0~1.0"
						y="0~-5,-5~-8,-8~-9,-9~-10,-10~-9,-9~-8,-8~-5,-5~0"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="0"
						end="1"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[frame]
						begin="-400"
						end="-150"
						image="units/human-outlaws/footpad-attack1.png"
						sound="sling.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[sling_stone_frame]
						begin="-201"
						end="-200"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="-200"
						end="100"
						halo="projectiles/stone.png"
						halo_x="20~0"
						halo_y="-6~0"
						offset="0.0~1.5"
						y="0~-5,-5~-8,-8~-9,-9~-10,-10~-9,-9~-8,-8~-5,-5~0"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="100"
						end="101"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[frame]
						begin="-400"
						end="-150"
						image="units/human-outlaws/footpad-attack1.png"
						sound="sling-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="-150"
					end="50"
					image="units/human-outlaws/footpad-attack2.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				[filter_attack]
					name="club"
				[/filter_attack]
				[frame]
					begin="-250"
					end="-200"
					image="units/human-outlaws/footpad.png"
				[/frame]
				[frame]
					begin="-200"
					end="-100"
					image="units/human-outlaws/footpad-melee-1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/footpad-melee-2.png"
						sound="staff.wav"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/footpad-melee-2.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="200"
					image="units/human-outlaws/footpad-melee-3.png"
				[/frame]
				[frame]
					begin="200"
					end="300"
					image="units/human-outlaws/footpad-melee-4.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/human-outlaws/footpad.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/human-outlaws/footpad-defend.png"
						sound="human-hit-1.ogg,human-hit-2.ogg,human-hit-3.ogg,human-hit-4.ogg,human-hit-5.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/human-outlaws/footpad-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/human-outlaws/footpad.png"
				[/frame]
			[/defend]
			[idle_anim]
				start_time="0"
				[filter]
					[not]
						[filter_wml]
							[status]
								poisoned="yes"
							[/status]
						[/filter_wml]
					[/not]
				[/filter]
				[filter]
					[filter_adjacent]
						count="0"
						is_enemy="yes"
					[/filter_adjacent]
				[/filter]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/footpad-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/footpad-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-1.png"
				[/frame]
			[/idle_anim]
			[defense]
				castle="30"
				cave="50"
				deep_water="70"
				flat="40"
				forest="30"
				frozen="60"
				fungus="30"
				hills="30"
				impassable="50"
				mountains="30"
				reef="50"
				sand="60"
				shallow_water="60"
				swamp_water="60"
				unwalkable="80"
				village="30"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="2"
				fungus="2"
				hills="2"
				impassable="99"
				mountains="3"
				reef="2"
				sand="2"
				shallow_water="2"
				swamp_water="2"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="130"
				cold="100"
				fire="100"
				impact="120"
				pierce="120"
			[/resistance]
			[variables]
			[/variables]
			[status]
			[/status]
			[attack]
				damage="5"
				description=_ "club"
				icon="attacks/club-small.png"
				name="club"
				number="2"
				range="melee"
				type="impact"
			[/attack]
			[attack]
				damage="5"
				description=_ "sling"
				name="sling"
				number="2"
				range="ranged"
				type="impact"
			[/attack]
			[modifications]
				[trait]
#textdomain wesnoth
					female_name=_ "female^intelligent"
					id="intelligent"
					male_name=_ "intelligent"
					name=_ "intelligent"
					[effect]
						apply_to="max_experience"
						increase="-20%"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^quick"
					id="quick"
					male_name=_ "quick"
					name=_ "quick"
					[effect]
						apply_to="movement"
						increase="1"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="-5%"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Outlaw"
			alignment="chaotic"
			alpha="256"
			attacks_left="0"
			cost="14"
			die_sound="human-die-1.ogg,human-die-2.ogg,human-die-3.ogg"
			ellipse="misc/ellipse"
			experience="8"
			facing="sw"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="26"
			id="Footpad-35"
			image="units/human-outlaws/footpad.png"
#textdomain wesnoth-units
			language_name=_ "Footpad"
			level="1"
			max_attacks="1"
			max_experience="25"
			max_hitpoints="36"
			max_moves="7"
			movement="7"
			movement_type="elusivefoot"
			moves="0"
			name="Geddyn"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="1"
			type="Footpad"
			underlying_id="35"
			unrenamable="no"
			upkeep="full"
			usage="scout"
			x="8"
			y="14"
			zoc="yes"
			[attack_anim]
				offset="0.0"
				[filter_attack]
					name="sling"
				[/filter_attack]
				[if]
					hits="yes"
					[sling_stone_frame]
						begin="-201"
						end="-200"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="-200"
						end="0"
						halo="projectiles/stone.png"
						halo_x="20~0"
						halo_y="-6~0"
						offset="0.0~1.0"
						y="0~-5,-5~-8,-8~-9,-9~-10,-10~-9,-9~-8,-8~-5,-5~0"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="0"
						end="1"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[frame]
						begin="-400"
						end="-150"
						image="units/human-outlaws/footpad-attack1.png"
						sound="sling.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[sling_stone_frame]
						begin="-201"
						end="-200"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="-200"
						end="100"
						halo="projectiles/stone.png"
						halo_x="20~0"
						halo_y="-6~0"
						offset="0.0~1.5"
						y="0~-5,-5~-8,-8~-9,-9~-10,-10~-9,-9~-8,-8~-5,-5~0"
					[/sling_stone_frame]
					[sling_stone_frame]
						begin="100"
						end="101"
						image="misc/blank-hex.png"
					[/sling_stone_frame]
					[frame]
						begin="-400"
						end="-150"
						image="units/human-outlaws/footpad-attack1.png"
						sound="sling-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="-150"
					end="50"
					image="units/human-outlaws/footpad-attack2.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				[filter_attack]
					name="club"
				[/filter_attack]
				[frame]
					begin="-250"
					end="-200"
					image="units/human-outlaws/footpad.png"
				[/frame]
				[frame]
					begin="-200"
					end="-100"
					image="units/human-outlaws/footpad-melee-1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/footpad-melee-2.png"
						sound="staff.wav"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/footpad-melee-2.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="200"
					image="units/human-outlaws/footpad-melee-3.png"
				[/frame]
				[frame]
					begin="200"
					end="300"
					image="units/human-outlaws/footpad-melee-4.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/human-outlaws/footpad.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/human-outlaws/footpad-defend.png"
						sound="human-hit-1.ogg,human-hit-2.ogg,human-hit-3.ogg,human-hit-4.ogg,human-hit-5.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/human-outlaws/footpad-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/human-outlaws/footpad.png"
				[/frame]
			[/defend]
			[idle_anim]
				start_time="0"
				[filter]
					[not]
						[filter_wml]
							[status]
								poisoned="yes"
							[/status]
						[/filter_wml]
					[/not]
				[/filter]
				[filter]
					[filter_adjacent]
						count="0"
						is_enemy="yes"
					[/filter_adjacent]
				[/filter]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/footpad-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/footpad-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/footpad-idle-1.png"
				[/frame]
			[/idle_anim]
			[defense]
				castle="30"
				cave="50"
				deep_water="70"
				flat="40"
				forest="30"
				frozen="60"
				fungus="30"
				hills="30"
				impassable="50"
				mountains="30"
				reef="50"
				sand="60"
				shallow_water="60"
				swamp_water="60"
				unwalkable="80"
				village="30"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="2"
				fungus="2"
				hills="2"
				impassable="99"
				mountains="3"
				reef="2"
				sand="2"
				shallow_water="2"
				swamp_water="2"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="130"
				cold="100"
				fire="100"
				impact="120"
				pierce="120"
			[/resistance]
			[variables]
			[/variables]
			[status]
			[/status]
			[attack]
				damage="6"
				description=_ "club"
				icon="attacks/club-small.png"
				name="club"
				number="2"
				range="melee"
				type="impact"
			[/attack]
			[attack]
				damage="5"
				description=_ "sling"
				name="sling"
				number="2"
				range="ranged"
				type="impact"
			[/attack]
			[modifications]
				[trait]
#textdomain wesnoth
					female_name=_ "female^resilient"
					id="resilient"
					male_name=_ "resilient"
					name=_ "resilient"
					[effect]
						apply_to="hitpoints"
						increase_total="4"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
						times="per level"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^strong"
					id="strong"
					male_name=_ "strong"
					name=_ "strong"
					[effect]
						apply_to="attack"
						increase_damage="1"
						range="melee"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Rogue"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="13"
			die_sound="human-female-die-1.ogg,human-female-die-2.ogg,human-female-die-3.ogg"
			ellipse="misc/ellipse"
			experience="0"
			facing="s"
			flag_rgb="magenta"
			flying="no"
			gender="female"
			goto_x="-999"
			goto_y="-999"
			hitpoints="30"
			id="Thief-37"
			image="units/human-outlaws/thief+female.png"
#textdomain wesnoth-units
			language_name=_ "female^Thief"
			level="1"
			max_attacks="1"
			max_experience="20"
			max_hitpoints="30"
			max_moves="6"
			movement="6"
			movement_type="elusivefoot"
			moves="0"
			name="Cliverylyan"
			profile="portraits/humans/thief+female.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="1"
			type="Thief"
			underlying_id="37"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			x="8"
			y="7"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					name="dagger"
				[/filter_attack]
				[frame]
					begin="-150"
					end="-100"
					image="units/human-outlaws/thief+female.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/thief+female-attack.png"
						sound="dagger-swish.wav"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/thief+female-attack.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="150"
					image="units/human-outlaws/thief+female.png"
				[/frame]
			[/attack_anim]
			[death]
				start_time="0"
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-die-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-die-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-die-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-die-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-die-5.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-die-6.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-die-7.png"
				[/frame]
			[/death]
			[defend]
				hits="miss"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief+female.png"
				[/frame]
				[frame]
					begin="-125"
					end="-42"
					image="units/human-outlaws/thief+female-defend-1-1.png"
				[/frame]
				[frame]
					begin="-42"
					end="41"
					image="units/human-outlaws/thief+female-defend-1-2.png"
				[/frame]
				[frame]
					begin="41"
					end="125"
					image="units/human-outlaws/thief+female-defend-1-1.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief+female.png"
				[/frame]
			[/defend]
			[defend]
				hits="miss"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief+female.png"
				[/frame]
				[frame]
					begin="-125"
					end="-42"
					image="units/human-outlaws/thief+female-defend-2-1.png"
				[/frame]
				[frame]
					begin="-42"
					end="41"
					image="units/human-outlaws/thief+female-defend-2-2.png"
				[/frame]
				[frame]
					begin="41"
					end="125"
					image="units/human-outlaws/thief+female-defend-2-1.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief+female.png"
				[/frame]
			[/defend]
			[defend]
				hits="miss"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief+female.png"
				[/frame]
				[frame]
					begin="-125"
					end="-42"
					image="units/human-outlaws/thief+female-defend-3-1.png"
				[/frame]
				[frame]
					begin="-42"
					end="41"
					image="units/human-outlaws/thief+female-defend-3-2.png"
				[/frame]
				[frame]
					begin="41"
					end="125"
					image="units/human-outlaws/thief+female-defend-3-1.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief+female.png"
				[/frame]
			[/defend]
			[defend]
				hits="kill"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief+female.png"
				[/frame]
				[frame]
					begin="-125"
					end="125"
					image="units/human-outlaws/thief+female-defend.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief+female.png"
				[/frame]
			[/defend]
			[defend]
				hits="hit"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief+female.png"
				[/frame]
				[frame]
					begin="-125"
					end="125"
					image="units/human-outlaws/thief+female-defend.png"
					sound="human-female-hit-1.ogg,human-female-hit-2.ogg,human-female-hit-3.ogg"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief+female.png"
				[/frame]
			[/defend]
			[idle_anim]
				start_time="0"
				[filter]
					[not]
						[filter_wml]
							[status]
								poisoned="yes"
							[/status]
						[/filter_wml]
					[/not]
				[/filter]
				[filter]
					[filter_adjacent]
						count="0"
						is_enemy="yes"
					[/filter_adjacent]
				[/filter]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-4.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/thief+female-idle-5.png"
				[/frame]
				[frame]
					duration="150"
					image="units/human-outlaws/thief+female-idle-6.png"
				[/frame]
				[frame]
					duration="500"
					image="units/human-outlaws/thief+female-idle-7.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-8.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-12.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-8.png"
				[/frame]
				[frame]
					duration="300"
					image="units/human-outlaws/thief+female-idle-7.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-8.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-12.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-8.png"
				[/frame]
				[frame]
					duration="500"
					image="units/human-outlaws/thief+female-idle-7.png"
				[/frame]
				[frame]
					duration="150"
					image="units/human-outlaws/thief+female-idle-6.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/thief+female-idle-5.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief+female-idle-1.png"
				[/frame]
			[/idle_anim]
			[portrait]
				image="portraits/humans/transparent/thief+female.png"
				mirror="false"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/humans/transparent/thief+female.png"
				mirror="true"
				side="right"
				size="400"
			[/portrait]
			[defense]
				castle="30"
				cave="50"
				deep_water="70"
				flat="40"
				forest="30"
				frozen="60"
				fungus="30"
				hills="30"
				impassable="50"
				mountains="30"
				reef="50"
				sand="60"
				shallow_water="60"
				swamp_water="60"
				unwalkable="80"
				village="30"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="2"
				fungus="2"
				hills="2"
				impassable="99"
				mountains="3"
				reef="2"
				sand="2"
				shallow_water="2"
				swamp_water="2"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="130"
				cold="100"
				fire="100"
				impact="120"
				pierce="120"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="5"
				description=_ "dagger"
				icon="attacks/dagger-human.png"
				name="dagger"
				number="3"
				range="melee"
				type="blade"
				[specials]
					[damage]
						active_on="offense"
						backstab="yes"
#textdomain wesnoth
						description=_ "Backstab:
When used offensively, this attack deals double damage if there is an enemy of the target on the opposite side of the target, and that unit is not incapacitated (turned to stone or otherwise paralyzed)."
						id="backstab"
						multiply="2"
						name=_ "backstab"
					[/damage]
				[/specials]
			[/attack]
			[modifications]
				[trait]
					female_name=_ "female^resilient"
					id="resilient"
					male_name=_ "resilient"
					name=_ "female^resilient"
					[effect]
						apply_to="hitpoints"
						increase_total="4"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
						times="per level"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^strong"
					id="strong"
					male_name=_ "strong"
					name=_ "female^strong"
					[effect]
						apply_to="attack"
						increase_damage="1"
						range="melee"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Rogue"
			alignment="chaotic"
			alpha="256"
			attacks_left="0"
			cost="13"
			die_sound="human-die-1.ogg,human-die-2.ogg,human-die-3.ogg"
			ellipse="misc/ellipse"
			experience="0"
			facing="se"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="24"
			id="Thief-38"
			image="units/human-outlaws/thief.png"
#textdomain wesnoth-units
			language_name=_ "Thief"
			level="1"
			max_attacks="1"
			max_experience="20"
			max_hitpoints="24"
			max_moves="7"
			movement="6"
			movement_type="elusivefoot"
			moves="0"
			name="Tin"
			profile="portraits/humans/thief.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="no"
			side="1"
			type="Thief"
			underlying_id="38"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			x="13"
			y="4"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					name="dagger"
				[/filter_attack]
				[frame]
					begin="-150"
					end="-100"
					image="units/human-outlaws/thief.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/thief-attack.png"
						sound="dagger-swish.wav"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/thief-attack.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="150"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/attack_anim]
			[death]
				start_time="0"
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-5.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-6.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-7.png"
				[/frame]
			[/death]
			[defend]
				hits="miss"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="-42"
					image="units/human-outlaws/thief-defend-1-1.png"
				[/frame]
				[frame]
					begin="-42"
					end="41"
					image="units/human-outlaws/thief-defend-1-2.png"
				[/frame]
				[frame]
					begin="41"
					end="125"
					image="units/human-outlaws/thief-defend-1-1.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[defend]
				hits="miss"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="-42"
					image="units/human-outlaws/thief-defend-2-1.png"
				[/frame]
				[frame]
					begin="-42"
					end="41"
					image="units/human-outlaws/thief-defend-2-2.png"
				[/frame]
				[frame]
					begin="41"
					end="125"
					image="units/human-outlaws/thief-defend-2-1.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[defend]
				hits="miss"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="-42"
					image="units/human-outlaws/thief-defend-3-1.png"
				[/frame]
				[frame]
					begin="-42"
					end="41"
					image="units/human-outlaws/thief-defend-3-2.png"
				[/frame]
				[frame]
					begin="41"
					end="125"
					image="units/human-outlaws/thief-defend-3-1.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[defend]
				hits="kill"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="125"
					image="units/human-outlaws/thief-defend.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[defend]
				hits="hit"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="125"
					image="units/human-outlaws/thief-defend.png"
					sound="human-hit-1.ogg,human-hit-2.ogg,human-hit-3.ogg,human-hit-4.ogg,human-hit-5.ogg"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[idle_anim]
				start_time="0"
				[filter]
					[not]
						[filter_wml]
							[status]
								poisoned="yes"
							[/status]
						[/filter_wml]
					[/not]
				[/filter]
				[filter]
					[filter_adjacent]
						count="0"
						is_enemy="yes"
					[/filter_adjacent]
				[/filter]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-4.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/thief-idle-5.png"
				[/frame]
				[frame]
					duration="150"
					image="units/human-outlaws/thief-idle-6.png"
				[/frame]
				[frame]
					duration="500"
					image="units/human-outlaws/thief-idle-7.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-8.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-12.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-8.png"
				[/frame]
				[frame]
					duration="300"
					image="units/human-outlaws/thief-idle-7.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-8.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-12.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-8.png"
				[/frame]
				[frame]
					duration="500"
					image="units/human-outlaws/thief-idle-7.png"
				[/frame]
				[frame]
					duration="150"
					image="units/human-outlaws/thief-idle-6.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/thief-idle-5.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-1.png"
				[/frame]
			[/idle_anim]
			[portrait]
				image="portraits/humans/transparent/thief.png"
				mirror="false"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/humans/transparent/thief.png"
				mirror="true"
				side="right"
				size="400"
			[/portrait]
			[defense]
				castle="30"
				cave="50"
				deep_water="70"
				flat="40"
				forest="30"
				frozen="60"
				fungus="30"
				hills="30"
				impassable="50"
				mountains="30"
				reef="50"
				sand="60"
				shallow_water="60"
				swamp_water="60"
				unwalkable="80"
				village="30"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="2"
				fungus="2"
				hills="2"
				impassable="99"
				mountains="3"
				reef="2"
				sand="2"
				shallow_water="2"
				swamp_water="2"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="130"
				cold="100"
				fire="100"
				impact="120"
				pierce="120"
			[/resistance]
			[variables]
			[/variables]
			[status]
			[/status]
			[attack]
				damage="5"
				description=_ "dagger"
				icon="attacks/dagger-human.png"
				name="dagger"
				number="3"
				range="melee"
				type="blade"
				[specials]
					[damage]
						active_on="offense"
						backstab="yes"
#textdomain wesnoth
						description=_ "Backstab:
When used offensively, this attack deals double damage if there is an enemy of the target on the opposite side of the target, and that unit is not incapacitated (turned to stone or otherwise paralyzed)."
						id="backstab"
						multiply="2"
						name=_ "backstab"
					[/damage]
				[/specials]
			[/attack]
			[modifications]
				[trait]
					female_name=_ "female^strong"
					id="strong"
					male_name=_ "strong"
					name=_ "strong"
					[effect]
						apply_to="attack"
						increase_damage="1"
						range="melee"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^quick"
					id="quick"
					male_name=_ "quick"
					name=_ "quick"
					[effect]
						apply_to="movement"
						increase="1"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="-5%"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Rogue"
			alignment="chaotic"
			alpha="256"
			attacks_left="0"
			cost="13"
			die_sound="human-die-1.ogg,human-die-2.ogg,human-die-3.ogg"
			ellipse="misc/ellipse"
			experience="0"
			facing="n"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="23"
			id="Thief-39"
			image="units/human-outlaws/thief.png"
#textdomain wesnoth-units
			language_name=_ "Thief"
			level="1"
			max_attacks="1"
			max_experience="15"
			max_hitpoints="23"
			max_moves="7"
			movement="6"
			movement_type="elusivefoot"
			moves="0"
			name="Carraedry"
			profile="portraits/humans/thief.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="no"
			side="1"
			type="Thief"
			underlying_id="39"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			x="14"
			y="3"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					name="dagger"
				[/filter_attack]
				[frame]
					begin="-150"
					end="-100"
					image="units/human-outlaws/thief.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/thief-attack.png"
						sound="dagger-swish.wav"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/human-outlaws/thief-attack.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="150"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/attack_anim]
			[death]
				start_time="0"
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-5.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-6.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-die-7.png"
				[/frame]
			[/death]
			[defend]
				hits="miss"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="-42"
					image="units/human-outlaws/thief-defend-1-1.png"
				[/frame]
				[frame]
					begin="-42"
					end="41"
					image="units/human-outlaws/thief-defend-1-2.png"
				[/frame]
				[frame]
					begin="41"
					end="125"
					image="units/human-outlaws/thief-defend-1-1.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[defend]
				hits="miss"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="-42"
					image="units/human-outlaws/thief-defend-2-1.png"
				[/frame]
				[frame]
					begin="-42"
					end="41"
					image="units/human-outlaws/thief-defend-2-2.png"
				[/frame]
				[frame]
					begin="41"
					end="125"
					image="units/human-outlaws/thief-defend-2-1.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[defend]
				hits="miss"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="-42"
					image="units/human-outlaws/thief-defend-3-1.png"
				[/frame]
				[frame]
					begin="-42"
					end="41"
					image="units/human-outlaws/thief-defend-3-2.png"
				[/frame]
				[frame]
					begin="41"
					end="125"
					image="units/human-outlaws/thief-defend-3-1.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[defend]
				hits="kill"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="125"
					image="units/human-outlaws/thief-defend.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[defend]
				hits="hit"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-outlaws/thief.png"
				[/frame]
				[frame]
					begin="-125"
					end="125"
					image="units/human-outlaws/thief-defend.png"
					sound="human-hit-1.ogg,human-hit-2.ogg,human-hit-3.ogg,human-hit-4.ogg,human-hit-5.ogg"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-outlaws/thief.png"
				[/frame]
			[/defend]
			[idle_anim]
				start_time="0"
				[filter]
					[not]
						[filter_wml]
							[status]
								poisoned="yes"
							[/status]
						[/filter_wml]
					[/not]
				[/filter]
				[filter]
					[filter_adjacent]
						count="0"
						is_enemy="yes"
					[/filter_adjacent]
				[/filter]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-4.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/thief-idle-5.png"
				[/frame]
				[frame]
					duration="150"
					image="units/human-outlaws/thief-idle-6.png"
				[/frame]
				[frame]
					duration="500"
					image="units/human-outlaws/thief-idle-7.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-8.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-12.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-8.png"
				[/frame]
				[frame]
					duration="300"
					image="units/human-outlaws/thief-idle-7.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-8.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-12.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-11.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-10.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-9.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-8.png"
				[/frame]
				[frame]
					duration="500"
					image="units/human-outlaws/thief-idle-7.png"
				[/frame]
				[frame]
					duration="150"
					image="units/human-outlaws/thief-idle-6.png"
				[/frame]
				[frame]
					duration="200"
					image="units/human-outlaws/thief-idle-5.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-outlaws/thief-idle-1.png"
				[/frame]
			[/idle_anim]
			[portrait]
				image="portraits/humans/transparent/thief.png"
				mirror="false"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/humans/transparent/thief.png"
				mirror="true"
				side="right"
				size="400"
			[/portrait]
			[defense]
				castle="30"
				cave="50"
				deep_water="70"
				flat="40"
				forest="30"
				frozen="60"
				fungus="30"
				hills="30"
				impassable="50"
				mountains="30"
				reef="50"
				sand="60"
				shallow_water="60"
				swamp_water="60"
				unwalkable="80"
				village="30"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="2"
				fungus="2"
				hills="2"
				impassable="99"
				mountains="3"
				reef="2"
				sand="2"
				shallow_water="2"
				swamp_water="2"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="130"
				cold="100"
				fire="100"
				impact="120"
				pierce="120"
			[/resistance]
			[variables]
			[/variables]
			[status]
			[/status]
			[attack]
				damage="4"
				description=_ "dagger"
				icon="attacks/dagger-human.png"
				name="dagger"
				number="3"
				range="melee"
				type="blade"
				[specials]
					[damage]
						active_on="offense"
						backstab="yes"
#textdomain wesnoth
						description=_ "Backstab:
When used offensively, this attack deals double damage if there is an enemy of the target on the opposite side of the target, and that unit is not incapacitated (turned to stone or otherwise paralyzed)."
						id="backstab"
						multiply="2"
						name=_ "backstab"
					[/damage]
				[/specials]
			[/attack]
			[modifications]
				[trait]
					female_name=_ "female^quick"
					id="quick"
					male_name=_ "quick"
					name=_ "quick"
					[effect]
						apply_to="movement"
						increase="1"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="-5%"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^intelligent"
					id="intelligent"
					male_name=_ "intelligent"
					name=_ "intelligent"
					[effect]
						apply_to="max_experience"
						increase="-20%"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
	[/side]
	[side]
		action_bonus_count="9"
		aggression="0.5"
		allow_player="yes"
		caution="0.25"
		colour="2"
		controller="network"
		countdown_time="270000"
		current_player="Coriolan_"
		disallow_observers="no"
		fog="yes"
		global_recruitment_pattern="fighter,fighter,fighter,archer,mixed fighter,scout"
		gold="8"
		hidden="no"
		id="Almogaver2"
		income="0"
		leader_value="3"
		name="Almogaver"
		no_leader="yes"
		number_of_possible_recruits_to_force_recruit="3.1"
		objectives=_ "Victory:
@Defeat enemy leader(s)"
		objectives_changed="yes"
		recruit="Bowman,Cavalryman,Fencer,Heavy Infantryman,Horseman,Mage,Merman Fighter,Spearman"
		recruitment_pattern="fighter,fighter,fighter,archer,mixed fighter,scout"
		save_id="Almogaver2"
		share_maps="no"
		share_view="yes"
		shroud="no"
		side="2"
		start_gold="100"
		team_name="south"
#textdomain wesnoth-multiplayer
		user_team_name=_ "teamname^South"
		village_gold="2"
		village_value="1"
		villages_per_scout="8"
		[ai]
			recruitment_pattern="fighter,fighter,fighter,archer,mixed fighter,scout"
			villages_per_scout="8"
			[team_formula]
				rulebase="fai 'recruitment.fai'
		# ===== Some general functions used later ==== #

def sumarize_values( input_map )
	sum(
		values(input_map)
	);

def lowest_value( input_map )
	choose( input_map, -value ).value;

def highest_value( input_map )
	choose( input_map, value ).value;

def change_numbers_to_percents( input_map )
	map( input_map, 
		(value*100) / highest_value(input_map) 
	);

def add_number_to_values( input_map, number )
	map( input_map, 
		value + number 
	);

#make sure we have only positive values in a map #

def make_positive_only( input_map )
	if( lowest_value( input_map ) < 0, 
		add_number_to_values( 
			input_map, 
			abs(lowest_value(input_map))
		), 
		input_map 
	);

def sumarize_maps_values( map_A, map_B )
	map( map_A + map_B, 
		value + map_A[key]
	);

		#===== Evaluation how good unit is on a map ===== #

# ==1==  evaluate average defense #
#gives map where key is id of terrain, and value is number of hexes of that terrain on a gamemap#

def locations_map(ai*) 
	tomap( 
		map( 
			map.terrain, 
			id 
		) 
	);

#filters terrain map, min_percent it minimal % of map that terrain has to occupy to be considered in later evaluations# 

def filtered_locations_map(ai*, min_percent)
	filter( 
		locations_map(ai) , 
		value >  (map.w * map.h) / ( 100 / min_percent ) 
	);

#returns average defense of the unit #

def unit_average_defense(ai*, unit, terrain_min_percent )
	sum( 
		values( 
			map(
				filtered_locations_map(ai,terrain_min_percent), 
				defense_on( 
					unit, 
					find(map.terrain,id=key).loc
				) *
				value
			) 
		) 
	) / 
	sum(
		values(
			filtered_locations_map(
				ai,
				terrain_min_percent
			)
		)
	);

#returns map of units from units_list and their average defense (more -> better) #

def map_units_average_defense(ai*, units_list, terrain_min_percent) 
	tomap(
		map( 
			units_list, 
			id 
		), 
		map( 
			units_list, 'unit', 
			unit_average_defense(
				ai, 
				unit, 
				terrain_min_percent 
			) 
		) 
	);

def units_average_defense(ai*, units_list, terrain_min_percent)
	sum(
		map( 
			units_list, 'unit', 
			unit_average_defense(
				ai, 
				unit, 
				terrain_min_percent 
			) 
		) 
	) /
	size(
		units_list
	);


# ==2== TODO: evaluate unit effectivness based on movement points and movement cost#


		#===== Evaluation of game state - how good is ai doing ===== #

# ==1== based on unit cost and current amount of gold #
# returns number between 0 and 100 where: 0 we are losing, 100 we are winning #

def units_cost_gold_eval(ai*)
	min(
		[
			(
				(
					sum(
						map(
							allies, 'team', 
							sum(
								map(
									units_of_side[team], 
									cost
								)
							) + 
							teams[team].gold 
						)
					) * 
					100
				) / 
				sum(
					map(
						enemies, 'team', 
						sum(
							map(
								units_of_side[team], 
								cost
							)
						) + 
						max(
							[teams[team].gold, 0]
						) 
					)
				)
			) / 2,
			100
		]
	);

# ==2== based on village possession #

def count_allied_villages(ai*)
	sum(
		map(
			allies, 'side', 
			size(
				villages_of_side[side]
			)
		)
	);

def count_enemy_villages(ai*)
	sum(
		map(
			enemies, 'side', 
			size(
				villages_of_side[side]
			)
		)
	);

# multipled by 1000 to increase precision #

def village_evaluation(ai*)
	(
		50000 + 
		(
			count_allied_villages(ai) - 
			count_enemy_villages(ai)
		) * 
		(
			50000 /
			size(
				villages
			)
		)
	) /
	1000;

# ==3== combined 2 of the above #

def eval(ai*)
	( 
		units_cost_gold_eval(ai) + 
		village_evaluation(ai)
	) / 
	2;

		#===== Evaluation how effective my units are against the enemy ===== #

#==1==  basic evaluation #

# evaluate how much damage unit can inflict - how much damage unit can get#

def evaluate_attacker_against_opponents(ai*, unit, enemy_units)
	sum( 
		map( 
			enemy_units, 'enemy_unit', 
			sum(
				map(
					[
						max_possible_damage_with_retaliation( unit, enemy_unit )
					],
					max(
						[
							self[0] - self[2],
							self[1] - self[3]
						]
					)
				) 
			)
		)
	);

def evaluate_defender_against_opponents(ai*, unit, enemy_units)
	-sum( 
		map( 
			enemy_units, 'enemy_unit', 
			sum(
				map(
					[
						max_possible_damage_with_retaliation( enemy_unit, unit )
					],
					max(
						[
							self[0] - self[2],
							self[1] - self[3]
						]
					)
				)
			)
		)
	);

def units_hp_map(ai*, units)
	tomap( 
		map(
			units, 
			id
		), 
		map( 
			units, 
			hitpoints
		)
	);

#in case side's gold is more than 50, add units that side can recruit to the side's unit list#

def create_side_unit_list(ai*, side)
	if( 
		teams[side].gold > 50, 
		recruits_of_side[side], 
		[]
	) + 
	units_of_side[side];

def evaluate_my_recruits_as_attackers(ai*)
	tomap( 
		map(
			my_recruits, 
			id
		), 
		map(
			my_recruits, 'my_unit',
			sum(
				map(
					enemies, 'enemy_side',
					evaluate_attacker_against_opponents(
						ai,
						my_unit,
						create_side_unit_list(
							ai, 
							enemy_side
						)
					)
				)
			)
		)
	);

def evaluate_my_recruits_as_defenders(ai*)
	tomap(
		map(
			my_recruits, 
			id
		),
		map( 
			my_recruits, 'my_unit',
			sum(
				map(
					enemies, 'enemy_side',
					evaluate_defender_against_opponents(
						ai,
						my_unit,
						create_side_unit_list(
							ai,
							enemy_side
						)
					)
				)
			)
		)
	);


# === 2 ===  now consider abilities and weapon specials  #

def abilities_weights()
	['skirmisher' -> 15, 'ambush' -> 10, 'nightstalk' -> 20, 'regenerates' -> 20, 'healing' -> 15, 'curing' -> 10, 'leadership' -> 20, 'illumination' -> 15, 'teleport' -> 10, 'steadfast' -> 15 ];

def weapon_specials_weights()
	[ 'backstab' -> 20 ,'slow' -> 10 ,'berserk' -> 20 ,'stones' -> 60 ,'plague' -> 10 ,'marksman' -> 30 ,'magical' -> 40 ,'charge' -> 30 ,'drains' -> 30,  'firststrike' -> 10, 'poison' -> 25 ];

def apply_abilities_weights( units_map )
	map( 
		units_map, 
		value +
		(
			value * 
			max(
				map(
					get_unit_type( key ).abilities, 'ability',
					abilities_weights()[ability]
				)
			)
		) / 100
	);

def apply_weapon_specials_weights( units_map )
	map(
		units_map, 
		value +
		(
			value *
			max(
				map(
					get_unit_type( key ).attacks, 'attack',
					vars.weapon_specials[attack.special]
				)
			)
		) / 100
	);

# since undead units don't get random traits and are balanced with that, we need to lower their evaluation a bit to match fairly the living units #

def undead_malus( units_map )
	map( 
		units_map, 
		if(
			get_unit_type(key).undead,
			( value * 90 ) / 100,
			value 
		)
	);

# === 3 ===  pit 1 and 2 together  #

def evaluate_attackers(ai*)
	change_numbers_to_percents(
		apply_abilities_weights(
			apply_weapon_specials_weights(
				undead_malus( 
					make_positive_only(
						evaluate_my_recruits_as_attackers( ai )	
					)
				)
			)
		)
	);

def evaluate_defenders(ai*)
	map(
		map(
			change_numbers_to_percents(
				apply_abilities_weights(
					apply_weapon_specials_weights(
						undead_malus( 
							make_positive_only(
								evaluate_my_recruits_as_defenders( ai )	
							)
						)
					)
				)
			),
			value / 3
		), 
		value +
		map(
			change_numbers_to_percents(
				units_hp_map(
					ai,
					my_recruits
				)
			),
		value * 2 / 3
		)[key]
	);

	#=========== we have evaluation of game state and units, time to combine them: ==========#
		#=========	recruitment_list_builder	=========#

def rlb_apply_eval(eval, attackers_map, defenders_map, offset)
	map(
		sumarize_maps_values(
			map(
				attackers_map, 
				value * (eval+offset)
			),
			map(
				defenders_map,
				value * ( (100 - eval) - offset )
			)
		),
		value / 100
	);

def rlb_remove_lowest( input_map, percent)
	filter(
		input_map, 
		value > 
		(
			(
				percent * sumarize_values(input_map)
			) / 100
		)
	);

def rlb_first_step(eval, attackers_map, defenders_map, offset)
	rlb_remove_lowest(
		rlb_apply_eval(
			eval,
			attackers_map,
			defenders_map,
			offset
		),
		10
	);

def recruitment_list_builder(eval, attackers_map, defenders_map)
	map(
		rlb_first_step(
			eval,
			attackers_map,
			defenders_map,
			40
		),
		(
			(
				value * 100
			) / 
			sumarize_values(
				rlb_first_step(
					eval,
					attackers_map,
					defenders_map,
					40
				)
			)
		)
	);

		# ========== choose the unit to recruit now ========= #

def unit_chooser(ai*,unit_map) 
	choose(
		keys(unit_map), 'unit_type',
		unit_map[unit_type] - 
		(
			(
				100 * 
				size(
					filter(
						my_units, 
						type = unit_type
					)
				)
			) / 
			size(my_units)
		)
	);

def unit_map_cost_filter(ai*, unit_map)
	filter( unit_map,
		get_unit_type(key).cost < my_side.gold
	);

		# ==========	Main formula section 	========== #

def initialize_weapon_specials_map(ai*)
	if(vars.weapon_specials_init != turn,
		[
			set_var('weapon_specials_init', turn),
			set_var('weapon_specials',
				map(
					weapon_specials_weights(),
					if( key = 'magical',
						units_average_defense(ai, enemy_units, 10),
						if( key = 'marksman',
							units_average_defense(ai, enemy_units, 10) - 10,
							value
						)
					)
				)
			)
		],
		[]
	);

def create_recruits_map(ai*)
	if(vars.recruits_map_creator != turn,
		[
			set_var('recruits_map_creator', turn ),
			set_var('recruits_map',
				debug_print('final unit evaluation: ', recruitment_list_builder(
					debug_print('current AI evaluation (0-100): ', eval(ai)),
					debug_print('attackers evaluation: ',evaluate_attackers(ai)),
					debug_print('defenders evaluation: ',evaluate_defenders(ai))
				))
			)
		],
		[]
	);

def castle_space(ai*)
	filter( map( castle_locs( my_leader.loc ), 'location', if( unit_at( location ), 1, 0 ) ), self = 0  ).size;

if(vars.turn_initialized = turn,
		if( my_leader.loc = nearest_keep( my_leader.loc ),
			if( 
				get_unit_type(
					choose(
						vars.recruits_map,
						-get_unit_type(key).cost
					).key
				).cost <
				my_side.gold,
				if( castle_space(self),
					recruit(debug_print(
						unit_chooser(
							self,
							unit_map_cost_filter(
								self,
								vars.recruits_map
							)
						)
					)),
					fallback()
				),
				fallback() 
			),
			if( my_leader.movement_left > 0,
				move( my_leader.loc, nearest_keep( my_leader.loc ) ),
				fallback()
			)
		),
	[set_var(debug_print('turn_initialized'), turn)] +
	initialize_weapon_specials_map(self) +
	create_recruits_map(self)
)

faiend
"
			[/team_formula]
		[/ai]
		[ai]
			villages_per_scout="8"
		[/ai]
		[village]
			x="6"
			y="20"
		[/village]
		[village]
			x="8"
			y="17"
		[/village]
		[village]
			x="11"
			y="16"
		[/village]
		[village]
			x="21"
			y="20"
		[/village]
		[unit]
			advances_to="Halberdier"
			alignment="lawful"
			allow_changes="yes"
			allow_player="yes"
			alpha="256"
			attacks_left="0"
			canrecruit="yes"
			colour="2"
			controller="network"
			cost="25"
			current_player="Almogaver"
			die_sound="human-die-1.ogg,human-die-2.ogg,human-die-3.ogg"
			experience="18"
			facing="n"
			flag_rgb="magenta"
			flying="no"
			fog="yes"
			gender="male"
			gold="100"
			goto_x="-999"
			goto_y="-999"
			hitpoints="43"
			id="Almogaver2"
			image="units/human-loyalists/pikeman.png"
			income="0"
#textdomain wesnoth-units
			language_name=_ "Pikeman"
			leader="Lieutenant,Swordsman,Pikeman,Javelineer,Shock Trooper,Longbowman,White Mage,Red Mage"
			level="2"
			max_attacks="1"
			max_experience="46"
			max_hitpoints="55"
			max_moves="5"
			movement="5"
			movement_type="smallfoot"
			moves="0"
			mp_countdown="yes"
			mp_countdown_action_bonus="20"
			mp_countdown_init_time="270"
			mp_countdown_reservoir_time="270"
			mp_countdown_turn_bonus="200"
			name="Coriolan_"
			profile="portraits/humans/pikeman.png"
			race="human"
			random_leader="Lieutenant,Swordsman,Pikeman,Javelineer,Longbowman,Red Mage"
			random_traits="no"
			recruit="Cavalryman,Horseman,Spearman,Fencer,Heavy Infantryman,Bowman,Mage,Merman Fighter"
			resting="no"
			save_id="Almogaver2"
			share_maps="no"
			share_view="yes"
			shroud="no"
			side="2"
			team_name="south"
			terrain_liked="Gg, Ww, Wo"
			type="Pikeman"
			underlying_id="2"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			user_team_name="wesnoth-multiplayerteamname^South"
			village_gold="2"
			x="17"
			y="18"
			zoc="yes"
			[defense]
				castle="40"
				cave="60"
				deep_water="80"
				flat="60"
				forest="50"
				frozen="80"
				fungus="50"
				hills="50"
				impassable="60"
				mountains="40"
				reef="70"
				sand="70"
				shallow_water="80"
				swamp_water="80"
				unwalkable="80"
				village="40"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="3"
				fungus="2"
				hills="2"
				impassable="99"
				mountains="3"
				reef="2"
				sand="2"
				shallow_water="3"
				swamp_water="3"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="100"
				cold="100"
				fire="100"
				impact="100"
				pierce="60"
			[/resistance]
			[portrait]
				image="portraits/humans/transparent/pikeman.png"
				mirror="false"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/humans/transparent/pikeman.png"
				mirror="true"
				side="right"
				size="400"
			[/portrait]
			[variables]
			[/variables]
			[status]
			[/status]
			[attack]
				damage="10"
				description=_ "pike"
				name="pike"
				number="3"
				range="melee"
				type="pierce"
				[specials]
					[firststrike]
#textdomain wesnoth
						description=_ "First Strike:
This unit always strikes first with this attack, even if they are defending."
						id="firststrike"
						name=_ "firststrike"
					[/firststrike]
				[/specials]
			[/attack]
			[modifications]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Swordsman,Pikeman,Javelineer"
			alignment="lawful"
			alpha="256"
			attacks_left="0"
			cost="14"
			die_sound="human-die-1.ogg,human-die-2.ogg,human-die-3.ogg"
			ellipse="misc/ellipse"
			experience="1"
			facing="ne"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="31"
			id="Spearman-30"
			image="units/human-loyalists/spearman.png"
#textdomain wesnoth-units
			language_name=_ "Spearman"
			level="1"
			max_attacks="1"
			max_experience="24"
			max_hitpoints="37"
			max_moves="5"
			movement="5"
			movement_type="smallfoot"
			moves="0"
			name="Rheodraent"
			profile="portraits/humans/spearman.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="no"
			side="2"
			type="Spearman"
			underlying_id="30"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			x="5"
			y="16"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					name="javelin"
				[/filter_attack]
				[missile_frame]
					begin="-150"
					end="0"
					image="projectiles/spear-n.png"
					image_diagonal="projectiles/spear-ne.png"
				[/missile_frame]
				[frame]
					begin="-250"
					end="-150"
					image="units/human-loyalists/spearman-death1.png"
					sound="throw-1.wav,throw-2.wav,throw-3.wav,throw-4.wav"
				[/frame]
				[frame]
					begin="-150"
					end="-100"
					image="units/human-loyalists/spearman-attack-ranged.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="-50"
						image="units/human-loyalists/spearman-attack-ranged.png"
						sound="spear.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="-50"
						image="units/human-loyalists/spearman-attack-ranged.png"
					[/frame]
				[/else]
				[frame]
					begin="-50"
					end="50"
					image="units/human-loyalists/spearman-attack-ranged2.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				direction="s"
				[filter_attack]
					name="spear"
				[/filter_attack]
				[frame]
					begin="-200"
					end="-150"
					image="units/human-loyalists/spearman.png"
				[/frame]
				[frame]
					begin="-150"
					end="-50"
					image="units/human-loyalists/spearman-attack-s-1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-50"
						end="100"
						image="units/human-loyalists/spearman-attack-s-2.png"
						sound="spear.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-50"
						end="100"
						image="units/human-loyalists/spearman-attack-s-2.png"
						sound="spear-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="150"
					image="units/human-loyalists/spearman-attack-s-1.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				direction="n"
				[filter_attack]
					name="spear"
				[/filter_attack]
				[frame]
					begin="-200"
					end="-100"
					image="units/human-loyalists/spearman.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/human-loyalists/spearman-attack-n.png"
						sound="spear.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/human-loyalists/spearman-attack-n.png"
						sound="spear-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="150"
					image="units/human-loyalists/spearman.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				direction="ne,nw"
				[filter_attack]
					name="spear"
				[/filter_attack]
				[frame]
					begin="-200"
					end="-100"
					image="units/human-loyalists/spearman.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/human-loyalists/spearman-attack-ne.png"
						sound="spear.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/human-loyalists/spearman-attack-ne.png"
						sound="spear-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="150"
					image="units/human-loyalists/spearman.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				direction="se,sw"
				[filter_attack]
					name="spear"
				[/filter_attack]
				[frame]
					begin="-200"
					end="-100"
					image="units/human-loyalists/spearman.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/human-loyalists/spearman-attack.png"
						sound="spear.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/human-loyalists/spearman-attack.png"
						sound="spear-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="150"
					image="units/human-loyalists/spearman.png"
				[/frame]
			[/attack_anim]
			[death]
				[frame]
					begin="0"
					end="125"
					image="units/human-loyalists/spearman-death1.png"
				[/frame]
				[frame]
					begin="125"
					end="250"
					image="units/human-loyalists/spearman-death2.png"
				[/frame]
				[frame]
					begin="250"
					end="375"
					image="units/human-loyalists/spearman-death3.png"
				[/frame]
				[frame]
					begin="375"
					end="500"
					image="units/human-loyalists/spearman-death4.png"
				[/frame]
			[/death]
			[defend]
				[frame]
					begin="-100"
					end="-90"
					image="units/human-loyalists/spearman-defend-2.png"
				[/frame]
				[frame]
					begin="-90"
					end="90"
					image="units/human-loyalists/spearman-defend.png"
				[/frame]
				[frame]
					begin="90"
					end="100"
					image="units/human-loyalists/spearman-defend-2.png"
				[/frame]
			[/defend]
			[portrait]
				image="portraits/humans/transparent/spearman.png"
				mirror="false"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/humans/transparent/spearman.png"
				mirror="true"
				side="right"
				size="400"
			[/portrait]
			[defense]
				castle="40"
				cave="60"
				deep_water="80"
				flat="60"
				forest="50"
				frozen="80"
				fungus="50"
				hills="50"
				impassable="60"
				mountains="40"
				reef="70"
				sand="70"
				shallow_water="80"
				swamp_water="80"
				unwalkable="80"
				village="40"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="3"
				fungus="2"
				hills="2"
				impassable="99"
				mountains="3"
				reef="2"
				sand="2"
				shallow_water="3"
				swamp_water="3"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="100"
				cold="100"
				fire="100"
				impact="100"
				pierce="100"
			[/resistance]
			[variables]
			[/variables]
			[status]
			[/status]
			[attack]
				damage="8"
				description=_ "spear"
				icon="attacks/spear.png"
				name="spear"
				number="3"
				range="melee"
				type="pierce"
				[specials]
					[firststrike]
#textdomain wesnoth
						description=_ "First Strike:
This unit always strikes first with this attack, even if they are defending."
						id="firststrike"
						name=_ "firststrike"
					[/firststrike]
				[/specials]
			[/attack]
			[attack]
				damage="6"
#textdomain wesnoth-units
				description=_ "javelin"
				icon="attacks/javelin-human.png"
				name="javelin"
				number="1"
				range="ranged"
				type="pierce"
			[/attack]
			[modifications]
				[trait]
#textdomain wesnoth
					female_name=_ "female^strong"
					id="strong"
					male_name=_ "strong"
					name=_ "strong"
					[effect]
						apply_to="attack"
						increase_damage="1"
						range="melee"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^intelligent"
					id="intelligent"
					male_name=_ "intelligent"
					name=_ "intelligent"
					[effect]
						apply_to="max_experience"
						increase="-20%"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Shock Trooper"
			alignment="lawful"
			alpha="256"
			attacks_left="0"
			cost="19"
			die_sound="human-die-1.ogg,human-die-2.ogg,human-die-3.ogg"
			ellipse="misc/ellipse"
			experience="1"
			facing="nw"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="33"
			id="Heavy Infantryman-31"
			image="units/human-loyalists/heavyinfantry.png"
#textdomain wesnoth-units
			language_name=_ "Heavy Infantryman"
			level="1"
			max_attacks="1"
			max_experience="22"
			max_hitpoints="36"
			max_moves="5"
			movement="4"
			movement_type="armoredfoot"
			moves="0"
			name="Rudry"
			profile="portraits/humans/heavy-infantry.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="no"
			side="2"
			type="Heavy Infantryman"
			underlying_id="31"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			x="24"
			y="16"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					name="mace"
				[/filter_attack]
				[frame]
					begin="-230"
					end="-100"
					image="units/human-loyalists/heavyinfantry-attack-1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/human-loyalists/heavyinfantry-attack-2.png"
						sound="mace.wav"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/human-loyalists/heavyinfantry-attack-2.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="200"
					image="units/human-loyalists/heavyinfantry.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/human-loyalists/heavyinfantry-defend-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavyinfantry-defend-2.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/human-loyalists/heavyinfantry-defend-2.png"
						sound="human-hit-1.ogg,human-hit-2.ogg,human-hit-3.ogg,human-hit-4.ogg,human-hit-5.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/human-loyalists/heavyinfantry-defend-2.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/human-loyalists/heavyinfantry-defend-1.png"
				[/frame]
			[/defend]
			[idle_anim]
				start_time="0"
				[filter]
					[not]
						[filter_wml]
							[status]
								poisoned="yes"
							[/status]
						[/filter_wml]
					[/not]
				[/filter]
				[filter]
					[filter_adjacent]
						count="0"
						is_enemy="yes"
					[/filter_adjacent]
				[/filter]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-3.png"
				[/frame]
				[frame]
					duration="300"
					image="units/human-loyalists/heavy-infantry-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-5.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-6.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-7.png"
				[/frame]
				[frame]
					duration="1000"
					image="units/human-loyalists/heavy-infantry-idle-8.png"
				[/frame]
				[frame]
					duration="1000"
					image="units/human-loyalists/heavy-infantry-idle-9.png"
				[/frame]
				[frame]
					duration="1000"
					image="units/human-loyalists/heavy-infantry-idle-8.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-7.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-6.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-5.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-1.png"
				[/frame]
			[/idle_anim]
			[portrait]
				image="portraits/humans/transparent/heavy-infantry.png"
				mirror="false"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/humans/transparent/heavy-infantry.png"
				mirror="true"
				side="right"
				size="400"
			[/portrait]
			[trait]
#textdomain wesnoth
				description=_ "Fights normally during unfavorable times of day/night"
				female_name=_ "female^fearless"
				id="fearless"
				male_name=_ "fearless"
			[/trait]
			[defense]
				castle="50"
				cave="60"
				deep_water="80"
				flat="70"
				forest="60"
				frozen="80"
				fungus="60"
				hills="60"
				impassable="60"
				mountains="80"
				reef="80"
				sand="80"
				shallow_water="90"
				swamp_water="90"
				unwalkable="80"
				village="60"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="4"
				fungus="2"
				hills="3"
				impassable="99"
				mountains="99"
				reef="3"
				sand="2"
				shallow_water="4"
				swamp_water="4"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="50"
				cold="110"
				fire="110"
				impact="90"
				pierce="60"
			[/resistance]
			[variables]
			[/variables]
			[status]
			[/status]
			[attack]
				damage="11"
#textdomain wesnoth-units
				description=_ "mace"
				name="mace"
				number="2"
				range="melee"
				type="impact"
			[/attack]
			[modifications]
				[trait]
#textdomain wesnoth
					female_name=_ "female^quick"
					id="quick"
					male_name=_ "quick"
					name=_ "quick"
					[effect]
						apply_to="movement"
						increase="1"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="-5%"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^intelligent"
					id="intelligent"
					male_name=_ "intelligent"
					name=_ "intelligent"
					[effect]
						apply_to="max_experience"
						increase="-20%"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Shock Trooper"
			alignment="lawful"
			alpha="256"
			attacks_left="0"
			cost="19"
			die_sound="human-die-1.ogg,human-die-2.ogg,human-die-3.ogg"
			ellipse="misc/ellipse"
			experience="1"
			facing="se"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="27"
			id="Heavy Infantryman-32"
			image="units/human-loyalists/heavyinfantry.png"
#textdomain wesnoth-units
			language_name=_ "Heavy Infantryman"
			level="1"
			max_attacks="1"
			max_experience="28"
			max_hitpoints="36"
			max_moves="5"
			movement="4"
			movement_type="armoredfoot"
			moves="0"
			name="Owodd"
			profile="portraits/humans/heavy-infantry.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="no"
			side="2"
			type="Heavy Infantryman"
			underlying_id="32"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			x="22"
			y="15"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					name="mace"
				[/filter_attack]
				[frame]
					begin="-230"
					end="-100"
					image="units/human-loyalists/heavyinfantry-attack-1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/human-loyalists/heavyinfantry-attack-2.png"
						sound="mace.wav"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/human-loyalists/heavyinfantry-attack-2.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="200"
					image="units/human-loyalists/heavyinfantry.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/human-loyalists/heavyinfantry-defend-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavyinfantry-defend-2.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/human-loyalists/heavyinfantry-defend-2.png"
						sound="human-hit-1.ogg,human-hit-2.ogg,human-hit-3.ogg,human-hit-4.ogg,human-hit-5.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/human-loyalists/heavyinfantry-defend-2.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/human-loyalists/heavyinfantry-defend-1.png"
				[/frame]
			[/defend]
			[idle_anim]
				start_time="0"
				[filter]
					[not]
						[filter_wml]
							[status]
								poisoned="yes"
							[/status]
						[/filter_wml]
					[/not]
				[/filter]
				[filter]
					[filter_adjacent]
						count="0"
						is_enemy="yes"
					[/filter_adjacent]
				[/filter]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-3.png"
				[/frame]
				[frame]
					duration="300"
					image="units/human-loyalists/heavy-infantry-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-5.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-6.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-7.png"
				[/frame]
				[frame]
					duration="1000"
					image="units/human-loyalists/heavy-infantry-idle-8.png"
				[/frame]
				[frame]
					duration="1000"
					image="units/human-loyalists/heavy-infantry-idle-9.png"
				[/frame]
				[frame]
					duration="1000"
					image="units/human-loyalists/heavy-infantry-idle-8.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-7.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-6.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-5.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/heavy-infantry-idle-1.png"
				[/frame]
			[/idle_anim]
			[portrait]
				image="portraits/humans/transparent/heavy-infantry.png"
				mirror="false"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/humans/transparent/heavy-infantry.png"
				mirror="true"
				side="right"
				size="400"
			[/portrait]
			[trait]
#textdomain wesnoth
				description=_ "Fights normally during unfavorable times of day/night"
				female_name=_ "female^fearless"
				id="fearless"
				male_name=_ "fearless"
			[/trait]
			[defense]
				castle="50"
				cave="60"
				deep_water="80"
				flat="70"
				forest="60"
				frozen="80"
				fungus="60"
				hills="60"
				impassable="60"
				mountains="80"
				reef="80"
				sand="80"
				shallow_water="90"
				swamp_water="90"
				unwalkable="80"
				village="60"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="4"
				fungus="2"
				hills="3"
				impassable="99"
				mountains="99"
				reef="3"
				sand="2"
				shallow_water="4"
				swamp_water="4"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="50"
				cold="110"
				fire="110"
				impact="90"
				pierce="60"
			[/resistance]
			[variables]
			[/variables]
			[status]
			[/status]
			[attack]
				damage="11"
#textdomain wesnoth-units
				description=_ "mace"
				name="mace"
				number="2"
				range="melee"
				type="impact"
			[/attack]
			[modifications]
				[trait]
#textdomain wesnoth
					female_name=_ "female^quick"
					id="quick"
					male_name=_ "quick"
					name=_ "quick"
					[effect]
						apply_to="movement"
						increase="1"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="-5%"
					[/effect]
				[/trait]
				[trait]
					description=_ "Fights normally during unfavorable times of day/night"
					female_name=_ "female^fearless"
					id="fearless"
					male_name=_ "fearless"
					name=_ "fearless"
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Swordsman,Pikeman,Javelineer"
			alignment="lawful"
			alpha="256"
			attacks_left="0"
			cost="14"
			die_sound="human-die-1.ogg,human-die-2.ogg,human-die-3.ogg"
			ellipse="misc/ellipse"
			experience="1"
			facing="sw"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="42"
			id="Spearman-33"
			image="units/human-loyalists/spearman.png"
#textdomain wesnoth-units
			language_name=_ "Spearman"
			level="1"
			max_attacks="1"
			max_experience="29"
			max_hitpoints="42"
			max_moves="5"
			movement="5"
			movement_type="smallfoot"
			moves="0"
			name="Ladoc"
			profile="portraits/humans/spearman.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="no"
			side="2"
			type="Spearman"
			underlying_id="33"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			x="18"
			y="16"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					name="javelin"
				[/filter_attack]
				[missile_frame]
					begin="-150"
					end="0"
					image="projectiles/spear-n.png"
					image_diagonal="projectiles/spear-ne.png"
				[/missile_frame]
				[frame]
					begin="-250"
					end="-150"
					image="units/human-loyalists/spearman-death1.png"
					sound="throw-1.wav,throw-2.wav,throw-3.wav,throw-4.wav"
				[/frame]
				[frame]
					begin="-150"
					end="-100"
					image="units/human-loyalists/spearman-attack-ranged.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="-50"
						image="units/human-loyalists/spearman-attack-ranged.png"
						sound="spear.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="-50"
						image="units/human-loyalists/spearman-attack-ranged.png"
					[/frame]
				[/else]
				[frame]
					begin="-50"
					end="50"
					image="units/human-loyalists/spearman-attack-ranged2.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				direction="s"
				[filter_attack]
					name="spear"
				[/filter_attack]
				[frame]
					begin="-200"
					end="-150"
					image="units/human-loyalists/spearman.png"
				[/frame]
				[frame]
					begin="-150"
					end="-50"
					image="units/human-loyalists/spearman-attack-s-1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-50"
						end="100"
						image="units/human-loyalists/spearman-attack-s-2.png"
						sound="spear.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-50"
						end="100"
						image="units/human-loyalists/spearman-attack-s-2.png"
						sound="spear-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="150"
					image="units/human-loyalists/spearman-attack-s-1.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				direction="n"
				[filter_attack]
					name="spear"
				[/filter_attack]
				[frame]
					begin="-200"
					end="-100"
					image="units/human-loyalists/spearman.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/human-loyalists/spearman-attack-n.png"
						sound="spear.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/human-loyalists/spearman-attack-n.png"
						sound="spear-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="150"
					image="units/human-loyalists/spearman.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				direction="ne,nw"
				[filter_attack]
					name="spear"
				[/filter_attack]
				[frame]
					begin="-200"
					end="-100"
					image="units/human-loyalists/spearman.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/human-loyalists/spearman-attack-ne.png"
						sound="spear.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/human-loyalists/spearman-attack-ne.png"
						sound="spear-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="150"
					image="units/human-loyalists/spearman.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				direction="se,sw"
				[filter_attack]
					name="spear"
				[/filter_attack]
				[frame]
					begin="-200"
					end="-100"
					image="units/human-loyalists/spearman.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="100"
						image="units/human-loyalists/spearman-attack.png"
						sound="spear.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="100"
						image="units/human-loyalists/spearman-attack.png"
						sound="spear-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="100"
					end="150"
					image="units/human-loyalists/spearman.png"
				[/frame]
			[/attack_anim]
			[death]
				[frame]
					begin="0"
					end="125"
					image="units/human-loyalists/spearman-death1.png"
				[/frame]
				[frame]
					begin="125"
					end="250"
					image="units/human-loyalists/spearman-death2.png"
				[/frame]
				[frame]
					begin="250"
					end="375"
					image="units/human-loyalists/spearman-death3.png"
				[/frame]
				[frame]
					begin="375"
					end="500"
					image="units/human-loyalists/spearman-death4.png"
				[/frame]
			[/death]
			[defend]
				[frame]
					begin="-100"
					end="-90"
					image="units/human-loyalists/spearman-defend-2.png"
				[/frame]
				[frame]
					begin="-90"
					end="90"
					image="units/human-loyalists/spearman-defend.png"
				[/frame]
				[frame]
					begin="90"
					end="100"
					image="units/human-loyalists/spearman-defend-2.png"
				[/frame]
			[/defend]
			[portrait]
				image="portraits/humans/transparent/spearman.png"
				mirror="false"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/humans/transparent/spearman.png"
				mirror="true"
				side="right"
				size="400"
			[/portrait]
			[defense]
				castle="40"
				cave="60"
				deep_water="80"
				flat="60"
				forest="50"
				frozen="80"
				fungus="50"
				hills="50"
				impassable="60"
				mountains="40"
				reef="70"
				sand="70"
				shallow_water="80"
				swamp_water="80"
				unwalkable="80"
				village="40"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="3"
				fungus="2"
				hills="2"
				impassable="99"
				mountains="3"
				reef="2"
				sand="2"
				shallow_water="3"
				swamp_water="3"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="100"
				cold="100"
				fire="100"
				impact="100"
				pierce="100"
			[/resistance]
			[variables]
			[/variables]
			[status]
			[/status]
			[attack]
				damage="8"
				description=_ "spear"
				icon="attacks/spear.png"
				name="spear"
				number="3"
				range="melee"
				type="pierce"
				[specials]
					[firststrike]
#textdomain wesnoth
						description=_ "First Strike:
This unit always strikes first with this attack, even if they are defending."
						id="firststrike"
						name=_ "firststrike"
					[/firststrike]
				[/specials]
			[/attack]
			[attack]
				damage="6"
#textdomain wesnoth-units
				description=_ "javelin"
				icon="attacks/javelin-human.png"
				name="javelin"
				number="1"
				range="ranged"
				type="pierce"
			[/attack]
			[modifications]
				[trait]
#textdomain wesnoth
					female_name=_ "female^resilient"
					id="resilient"
					male_name=_ "resilient"
					name=_ "resilient"
					[effect]
						apply_to="hitpoints"
						increase_total="4"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
						times="per level"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^strong"
					id="strong"
					male_name=_ "strong"
					name=_ "strong"
					[effect]
						apply_to="attack"
						increase_damage="1"
						range="melee"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Longbowman"
			alignment="lawful"
			alpha="256"
			attacks_left="0"
			cost="14"
			die_sound="human-die-1.ogg,human-die-2.ogg,human-die-3.ogg"
			ellipse="misc/ellipse"
			experience="1"
			facing="n"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="30"
			id="Bowman-34"
			image="units/human-loyalists/bowman.png"
#textdomain wesnoth-units
			language_name=_ "Bowman"
			level="1"
			max_attacks="1"
			max_experience="27"
			max_hitpoints="36"
			max_moves="6"
			movement="5"
			movement_type="smallfoot"
			moves="0"
			name="Aethaent"
			profile="portraits/humans/bowman.png"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="no"
			side="2"
			type="Bowman"
			undead_variation="archer"
			underlying_id="34"
			unrenamable="no"
			upkeep="full"
			usage="archer"
			x="6"
			y="16"
			zoc="yes"
			[attack_anim]
				start_time="-445"
				[filter_attack]
					name="bow"
				[/filter_attack]
				[missile_frame]
					begin="-150"
					end="0"
					image="projectiles/missile-n.png"
					image_diagonal="projectiles/missile-ne.png"
				[/missile_frame]
				[frame]
					duration="65"
					image="units/human-loyalists/bowman-bow.png"
				[/frame]
				[frame]
					duration="75"
					image="units/human-loyalists/bowman-bow-attack-1.png"
				[/frame]
				[frame]
					duration="75"
					image="units/human-loyalists/bowman-bow-attack-2.png"
				[/frame]
				[if]
					hits="no"
					[frame]
						duration="100"
						image="units/human-loyalists/bowman-bow-attack-3.png"
						sound="bow-miss.ogg"
					[/frame]
				[/if]
				[else]
					hits="yes"
					[frame]
						duration="100"
						image="units/human-loyalists/bowman-bow-attack-3.png"
						sound="bow.ogg"
					[/frame]
				[/else]
				[frame]
					duration="130"
					image="units/human-loyalists/bowman-bow-attack-4.png"
				[/frame]
				[frame]
					duration="65"
					image="units/human-loyalists/bowman-bow-attack-1.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				start_time="-275"
				[filter_attack]
					name="short sword"
				[/filter_attack]
				[frame]
					duration="50"
					image="units/human-loyalists/bowman-melee-defend-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/bowman-melee-attack-1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						duration="100"
						image="units/human-loyalists/bowman-melee-attack-2.png"
						sound="sword-1.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						duration="100"
						image="units/human-loyalists/bowman-melee-attack-2.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					duration="100"
					image="units/human-loyalists/bowman-melee-attack-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/bowman-melee-attack-4.png"
				[/frame]
				[frame]
					duration="50"
					image="units/human-loyalists/bowman-melee-defend-1.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[filter_attack]
					range="melee"
				[/filter_attack]
				[frame]
					duration="1"
					image="units/human-loyalists/bowman-melee-defend-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/bowman-melee-defend-2.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/human-loyalists/bowman-melee-defend-2.png"
						sound="human-hit-1.ogg,human-hit-2.ogg,human-hit-3.ogg,human-hit-4.ogg,human-hit-5.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/human-loyalists/bowman-melee-defend-2.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/human-loyalists/bowman-melee-defend-1.png"
				[/frame]
			[/defend]
			[defend]
				start_time="-126"
				[filter_attack]
					range="ranged"
				[/filter_attack]
				[frame]
					duration="1"
					image="units/human-loyalists/bowman-bow.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/bowman-bow-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/human-loyalists/bowman-bow-defend.png"
						sound="human-hit-1.ogg,human-hit-2.ogg,human-hit-3.ogg,human-hit-4.ogg,human-hit-5.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/human-loyalists/bowman-bow-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/human-loyalists/bowman-bow.png"
				[/frame]
			[/defend]
			[portrait]
				image="portraits/humans/transparent/bowman.png"
				mirror="false"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/humans/transparent/bowman.png"
				mirror="true"
				side="right"
				size="400"
			[/portrait]
			[defense]
				castle="40"
				cave="60"
				deep_water="80"
				flat="60"
				forest="50"
				frozen="80"
				fungus="50"
				hills="50"
				impassable="60"
				mountains="40"
				reef="70"
				sand="70"
				shallow_water="80"
				swamp_water="80"
				unwalkable="80"
				village="40"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="3"
				fungus="2"
				hills="2"
				impassable="99"
				mountains="3"
				reef="2"
				sand="2"
				shallow_water="3"
				swamp_water="3"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="100"
				cold="100"
				fire="100"
				impact="100"
				pierce="100"
			[/resistance]
			[variables]
			[/variables]
			[status]
			[/status]
			[attack]
				damage="4"
				description=_ "short sword"
				icon="attacks/sword-human-short.png"
				name="short sword"
				number="2"
				range="melee"
				type="blade"
			[/attack]
			[attack]
				damage="6"
				description=_ "bow"
				name="bow"
				number="3"
				range="ranged"
				type="pierce"
			[/attack]
			[modifications]
				[trait]
#textdomain wesnoth
					female_name=_ "female^resilient"
					id="resilient"
					male_name=_ "resilient"
					name=_ "resilient"
					[effect]
						apply_to="hitpoints"
						increase_total="4"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
						times="per level"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^quick"
					id="quick"
					male_name=_ "quick"
					name=_ "quick"
					[effect]
						apply_to="movement"
						increase="1"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="-5%"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Duelist"
			alignment="lawful"
			alpha="256"
			attacks_left="0"
			cost="16"
			die_sound="human-die-1.ogg,human-die-2.ogg,human-die-3.ogg"
			ellipse="misc/ellipse"
			experience="2"
			facing="s"
			flag_rgb="magenta"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="33"
			id="Fencer-36"
			image="units/human-loyalists/fencer.png"
#textdomain wesnoth-units
			language_name=_ "Fencer"
			level="1"
			max_attacks="1"
			max_experience="24"
			max_hitpoints="33"
			max_moves="6"
			movement="6"
			movement_type="elusivefoot"
			moves="0"
			name="Vaennyn"
			race="human"
			random_gender="no"
			random_traits="no"
			resting="no"
			side="2"
			type="Fencer"
			underlying_id="36"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			x="17"
			y="16"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					name="saber"
				[/filter_attack]
				[frame]
					begin="-300"
					end="-250"
					image="units/human-loyalists/fencer-attack-1.png"
					offset="0.0~-0.07"
				[/frame]
				[frame]
					begin="-250"
					end="-200"
					image="units/human-loyalists/fencer-attack-2.png"
					offset="-0.07~-0.15"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-200"
						end="-150"
						image="units/human-loyalists/fencer-attack-3.png"
						offset="-0.15~-0.25"
						sound="sword-1.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-200"
						end="-150"
						image="units/human-loyalists/fencer-attack-3.png"
						offset="-0.15~-0.25"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="-150"
					end="-100"
					image="units/human-loyalists/fencer-attack-4.png"
					offset="-0.25~-0.2"
				[/frame]
				[frame]
					begin="-100"
					end="-50"
					image="units/human-loyalists/fencer-attack-5.png"
					offset="-0.2~-0.1"
				[/frame]
				[frame]
					begin="-50"
					end="0"
					image="units/human-loyalists/fencer-attack-6.png"
					offset="-0.1~0.25"
				[/frame]
				[frame]
					begin="0"
					end="50"
					image="units/human-loyalists/fencer-attack-7.png"
					offset="0.25~0.55"
				[/frame]
				[frame]
					begin="50"
					end="100"
					image="units/human-loyalists/fencer-attack-8.png"
					offset="0.55~0.25"
				[/frame]
				[frame]
					begin="100"
					end="150"
					image="units/human-loyalists/fencer-attack-9.png"
					offset="0.25~0.1"
				[/frame]
				[frame]
					begin="150"
					end="200"
					image="units/human-loyalists/fencer-attack-1.png"
					offset="0.1~0.0"
				[/frame]
			[/attack_anim]
			[death]
				[frame]
					begin="0"
					end="100"
					image="units/human-loyalists/fencer-die1.png"
				[/frame]
				[frame]
					begin="100"
					end="200"
					image="units/human-loyalists/fencer-die2.png"
				[/frame]
				[frame]
					begin="200"
					end="300"
					image="units/human-loyalists/fencer-die3.png"
				[/frame]
				[frame]
					begin="300"
					end="400"
					image="units/human-loyalists/fencer-die4.png"
				[/frame]
				[frame]
					begin="400"
					end="500"
					image="units/human-loyalists/fencer-die5.png"
				[/frame]
			[/death]
			[defend]
				hits="miss"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-loyalists/fencer.png"
				[/frame]
				[frame]
					begin="-125"
					end="-42"
					image="units/human-loyalists/fencer-defend-1-1.png"
				[/frame]
				[frame]
					begin="-42"
					end="41"
					image="units/human-loyalists/fencer-defend-1-2.png"
				[/frame]
				[frame]
					begin="41"
					end="125"
					image="units/human-loyalists/fencer-defend-1-1.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-loyalists/fencer-defend-1-1.png"
				[/frame]
			[/defend]
			[defend]
				hits="hit"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-loyalists/fencer.png"
				[/frame]
				[frame]
					begin="-125"
					end="-25"
					image="units/human-loyalists/fencer-defend.png"
				[/frame]
				[frame]
					begin="-25"
					end="125"
					image="units/human-loyalists/fencer-defend.png"
					sound="human-hit-1.ogg,human-hit-2.ogg,human-hit-3.ogg,human-hit-4.ogg,human-hit-5.ogg"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-loyalists/fencer.png"
				[/frame]
			[/defend]
			[defend]
				hits="kill"
				[frame]
					begin="-126"
					end="-125"
					image="units/human-loyalists/fencer.png"
				[/frame]
				[frame]
					begin="-125"
					end="125"
					image="units/human-loyalists/fencer-defend.png"
				[/frame]
				[frame]
					begin="125"
					end="126"
					image="units/human-loyalists/fencer.png"
				[/frame]
			[/defend]
			[idle_anim]
				start_time="0"
				[filter]
					[not]
						[filter_wml]
							[status]
								poisoned="yes"
							[/status]
						[/filter_wml]
					[/not]
				[/filter]
				[filter]
					[filter_adjacent]
						count="0"
						is_enemy="yes"
					[/filter_adjacent]
				[/filter]
				[frame]
					duration="100"
					image="units/human-loyalists/fencer-idle-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/fencer-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/fencer-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/fencer-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/fencer-idle-5.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/fencer-idle-6.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/fencer-idle-7.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/fencer-idle-6.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/fencer-idle-5.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/fencer-idle-4.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/fencer-idle-3.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/fencer-idle-2.png"
				[/frame]
				[frame]
					duration="100"
					image="units/human-loyalists/fencer-idle-1.png"
				[/frame]
			[/idle_anim]
			[defense]
				castle="30"
				cave="50"
				deep_water="70"
				flat="40"
				forest="30"
				frozen="60"
				fungus="30"
				hills="30"
				impassable="50"
				mountains="30"
				reef="50"
				sand="60"
				shallow_water="60"
				swamp_water="60"
				unwalkable="80"
				village="30"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="2"
				fungus="2"
				hills="2"
				impassable="99"
				mountains="3"
				reef="2"
				sand="2"
				shallow_water="2"
				swamp_water="2"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="130"
				cold="90"
				fire="100"
				impact="120"
				pierce="120"
			[/resistance]
			[abilities]
				[skirmisher]
					affect_self="yes"
#textdomain wesnoth
					description=_ "Skirmisher:
This unit is skilled in moving past enemies quickly, and ignores all enemy Zones of Control."
					female_name=_ "female^skirmisher"
					id="skirmisher"
					name=_ "skirmisher"
				[/skirmisher]
			[/abilities]
			[variables]
			[/variables]
			[status]
			[/status]
			[attack]
				damage="4"
#textdomain wesnoth-units
				description=_ "saber"
				icon="attacks/saber-human.png"
				name="saber"
				number="4"
				range="melee"
				type="blade"
			[/attack]
			[modifications]
				[trait]
#textdomain wesnoth
					female_name=_ "female^resilient"
					id="resilient"
					male_name=_ "resilient"
					name=_ "resilient"
					[effect]
						apply_to="hitpoints"
						increase_total="4"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
						times="per level"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^intelligent"
					id="intelligent"
					male_name=_ "intelligent"
					name=_ "intelligent"
					[effect]
						apply_to="max_experience"
						increase="-20%"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
	[/side]
	[time]
		blue="0"
		green="-20"
		id="dawn"
		image="misc/schedule-dawn.png"
		lawful_bonus="0"
		name=_ "Dawn"
		red="-20"
	[/time]
	[time]
		blue="0"
		green="0"
		id="morning"
		image="misc/schedule-morning.png"
		lawful_bonus="25"
		name=_ "Morning"
		red="0"
	[/time]
	[time]
		blue="0"
		green="0"
		id="afternoon"
		image="misc/schedule-afternoon.png"
		lawful_bonus="25"
		name=_ "Afternoon"
		red="0"
	[/time]
	[time]
		blue="-20"
		green="-20"
		id="dusk"
		image="misc/schedule-dusk.png"
		lawful_bonus="0"
		name=_ "Dusk"
		red="0"
	[/time]
	[time]
		blue="-10"
		green="-40"
		id="first_watch"
		image="misc/schedule-firstwatch.png"
		lawful_bonus="-25"
		name=_ "First Watch"
		red="-40"
	[/time]
	[time]
		blue="-10"
		green="-40"
		id="second_watch"
		image="misc/schedule-secondwatch.png"
		lawful_bonus="-25"
		name=_ "Second Watch"
		red="-40"
	[/time]
	[music]
		ms_after="0"
		ms_before="12000"
		name="knolls.ogg"
	[/music]
	[music]
		append="yes"
		ms_after="0"
		ms_before="12000"
		name="wanderer.ogg"
	[/music]
	[music]
		append="yes"
		ms_after="0"
		ms_before="12000"
		name="battle.ogg"
	[/music]
	[music]
		append="yes"
		ms_after="0"
		ms_before="12000"
		name="transience.ogg"
	[/music]
	[music]
		append="yes"
		ms_after="0"
		ms_before="12000"
		name="revelation.ogg"
	[/music]
	[music]
		append="yes"
		ms_after="0"
		ms_before="12000"
		name="loyalists.ogg"
	[/music]
	[music]
		append="yes"
		ms_after="0"
		ms_before="12000"
		name="the_king_is_dead.ogg"
	[/music]
	[music]
		append="yes"
		ms_after="0"
		ms_before="12000"
		name="knalgan_theme.ogg"
	[/music]
	[music]
		append="yes"
		ms_after="0"
		ms_before="12000"
		name="the_city_falls.ogg"
	[/music]
	[music]
		append="yes"
		ms_after="0"
		ms_before="12000"
		name="nunc_dimittis.ogg"
	[/music]
	[music]
		append="yes"
		ms_after="0"
		ms_before="12000"
		name="breaking_the_chains.ogg"
	[/music]
	[music]
		append="yes"
		ms_after="0"
		ms_before="12000"
		name="elvish-theme.ogg"
	[/music]
	[music]
		append="yes"
		ms_after="0"
		ms_before="12000"
		name="legends_of_the_north.ogg"
	[/music]
	[music]
		append="yes"
		ms_after="0"
		ms_before="12000"
		name="traveling_minstrels.ogg"
	[/music]
	[music]
		append="yes"
		ms_after="0"
		ms_before="12000"
		name="underground.ogg"
	[/music]
	[music]
		append="yes"
		ms_after="0"
		ms_before="12000"
		name="vengeful.ogg"
	[/music]
	[music]
		append="yes"
		ms_after="0"
		ms_before="12000"
		name="frantic.ogg"
	[/music]
	[music]
		append="yes"
		ms_after="0"
		ms_before="12000"
		name="the_dangerous_symphony.ogg"
	[/music]
	[music]
		append="yes"
		ms_after="0"
		ms_before="12000"
		name="heroes_rite.ogg"
	[/music]
	[music]
		append="yes"
		ms_after="0"
		ms_before="12000"
		name="suspense.ogg"
	[/music]
	[music]
		append="yes"
		ms_after="0"
		ms_before="12000"
		name="the_deep_path.ogg"
	[/music]
	[music]
		append="yes"
		ms_after="0"
		ms_before="12000"
		name="siege_of_laurelmor.ogg"
	[/music]
	[variables]
		damage_inflicted="6"
		side_number="1"
		turn_number="13"
	[/variables]
	[player]
		can_recruit="Bowman,Cavalryman,Fencer,Heavy Infantryman,Horseman,Mage,Merman Fighter,Spearman"
		gold="-1"
		gold_add="no"
		save_id="Almogaver2"
	[/player]
	[player]
		can_recruit="Dwarvish Fighter,Dwarvish Guardsman,Dwarvish Thunderer,Dwarvish Ulfserker,Footpad,Gryphon Rider,Poacher,Thief"
		gold="-1"
		gold_add="no"
		save_id="KnightKunibert1"
	[/player]
[/snapshot]
[replay_start]
	current_tod="0"
#textdomain wesnoth-multiplayer
	description=_ "This vital supply route has played a key role in many of Wesnoth's greatest battles."
	experience_modifier="70"
	hash="ni><w8>Ksy9E6lpej<-R7zqNgF0HH1GU14mLcPs+Y0>x<lui3JMr96tqaCJ+gLs7vdDsR,OV+p41UARdwDMp8w8hABAeHRqXh0zHL5LEGp<BJU2ovj4yzohfX.yffdE0"
	id="multiplayer_Weldyn_Channel"
	map_data="border_size=1
usage=map

Ss          , Hh          , Rp          , Ss          , Gs^Fp       , Hh          , Rp          , Rp          , Hh          , Ss          , Ss          , Gg          , Hh          , Hh          , Gs^Fms      , Ss          , Gg          , Hh          , Ww          , Ww          , Wo          , Wo          , Ww          , Wwf         , Hh          , Hh          , Hh          , Hh          , Ss          , Hh          , Hh          
Gg          , Gg^Fet      , Rp          , Mm          , Gs^Fp       , Ss          , Rp          , Gs^Fp       , Gg^Fet      , Gs^Fms      , Mm          , Gs^Fp       , Gg          , Gs^Fds      , Hh          , Gs^Fp       , Hh          , Gg          , Ww          , Wo          , Wo          , Ww          , Gs^Fp       , Gg^Fet      , Gs^Fms      , Mm          , Ss          , Mm          , Hh          , Gs^Fp       , Ss          
Gg          , Gg          , Gg          , Rp          , Rp          , Rp          , Gg          , Gg^Ve       , Gg          , Hh          , Gg          , Gg          , Re          , Gg          , Re          , Ch          , Mm          , Ww          , Wo          , Wo          , Ww          , Ww          , Mm          , Ss          , Ss^Vhs      , Hh          , Gs^Fp       , Hh          , Gs^Fms      , Gg^Fet      , Gg          
Gs^Fms      , Gg          , Gg          , Gg          , Rp          , Gg          , Gg          , Gg          , Re          , Mm          , Re          , Re          , Re          , Re          , Ch          , 1 Kh        , Ch          , Ww          , Ww          , Ww          , Gs^Fp       , Hh          , Hh          , Gs^Fp       , Gg          , Gg          , Gg          , Gg          , Gg          , Hh          , Gg          
Hh          , Gs^Fp       , Rp          , Rp          , Re^Uf       , Gs^Fds      , Re          , Re          , Gg          , Re          , Gg          , Gg          , Gg          , Kh          , Gg          , Ch          , Wwf         , Kh          , Ww^Bw\      , Gg          , Gg          , Gg          , Gg          , Gg          , Re          , Re^Uf       , Mm          , Gg          , Gg          , Gg          , Gg          
Hh          , Hh          , Rp          , Mm          , Gs^Fp       , Re          , Re          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Ww          , Ww          , Wwf         , Gg          , Gg          , Gg          , Gg          , Gg^Vh       , Gg          , Re          , Ss          , Hh          , Gs^Fp       , Re          , Gg          , Gg          
Gs^Fp       , Rp          , Mm          , Hh          , Re          , Re          , Gg          , Gg          , Gg          , Gg          , Gg^Uf       , Hh          , Hh          , Gg^Ve       , Ww          , Ww          , Ww          , Gg          , Ss          , Gs^Fp       , Gg          , Gg          , Gg          , Gg          , Gg          , Re          , Re          , Re^Uf       , Re          , Gg          , Gg          
Rp          , Rp          , Re          , Re          , Gg          , Gg          , Gg^Vh       , Gg          , Gg          , Gs^Fds      , Hh          , Mm          , Gg          , Gs^Fp       , Ww          , Wo          , Ww          , Gg          , Gs^Fp       , Ss^Vhs      , Ww          , Mm          , Hh          , Gg          , Gg^Ve       , Gs^Fms      , Gg          , Re          , Gg          , Gg          , Gg          
Gs^Fp       , Re          , Re          , Gg          , Gs^Fp       , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Ww          , Ww          , Wo          , Wo          , Wo          , Ww          , Ww          , Ww          , Ww          , Wwf         , Rp          , Gg          , Gg          , Gg          , Gg          , Gg          , Mm          , Gg^Uf       , Hh          
Gg          , Re          , Re          , Hh          , Ss          , Ggf^Uf      , Gg          , Gg          , Gs^Fms      , Ggf         , Gg          , Gg          , Ww          , Ww          , Wo          , Wo          , Mm^Xm       , Wo          , Wo          , Wo          , Ww          , Wwf         , Wwf         , Rp          , Rp          , Gg          , Gs^Fp       , Hh          , Gg^Fet      , Hh          , Gg          
Wwf         , Gg          , Gg          , Gs^Fms      , Mm          , Hh          , Hh          , Gg          , Gg          , Mm          , Hh          , Ww          , Ww          , Wo          , Wo          , Hh          , Mm^Xm       , Wo          , Wo          , Wo          , Ww          , Gs^Fp       , Rp          , Wwf         , Wwf         , Gg          , Rp          , Rp          , Rp          , Gg          , Gg          
Rp          , Wwf         , Wwf         , Gg          , Wwf         , Wwf         , Wwf         , Rp          , Gg          , Hh          , Ww          , Ww          , Wo          , Ww          , Wwr         , Mm^Xm       , Wwr         , Wo          , Wo          , Ww          , Ww          , Gg          , Gg          , Rp          , Wwf         , Rp          , Wwf         , Wwf         , Wwf         , Rp          , Rp          
Gg          , Rp          , Rp          , Wwf         , Rp          , Rp          , Wwf         , Rp          , Rp          , Gg          , Ww          , Ww          , Wo          , Wo          , Mm^Xm       , Mm^Xm       , Wo          , Ww          , Ww          , Ww          , Hh          , Hh          , Gg          , Rp          , Hh          , Wwf         , Mm          , Gg          , Gg          , Wwf         , Wwf         
Gs^Fds      , Gg          , Gg^Fet      , Rp          , Gs^Fms      , Gg          , Rp          , Wwf         , Wwf         , Gs^Fp       , Ww          , Wo          , Wo          , Wo          , Mm^Xm       , Hh          , Wo          , Wo          , Ww          , Ww          , Gg          , Mm          , Gs^Fms      , Gg          , Gg          , Hh          , Ss          , Gs^Fp       , Re          , Gg          , Gg          
Hh          , Hh          , Mm          , Hh          , Gg          , Gg          , Gg          , Rp          , Rp          , Wwf         , Ww          , Wo          , Ww          , Wo          , Wo          , Wo          , Wo          , Ww          , Ww          , Gg          , Gg          , Ggf         , Gg          , Gg          , Gg          , Ggf^Uf      , Gg^Fet      , Hh          , Re          , Re          , Gs^Fp       
Gs^Fds      , Ggf^Uf      , Gg          , Gg          , Gg          , Gg          , Gg^Ve       , Gg          , Hh          , Wwf         , Ww          , Ww          , Gs^Fp       , Ww          , Ww          , Wo          , Ww          , Ww          , Gg          , Gg          , Hh          , Gg          , Gg          , Gg          , Gg^Vh       , Gg          , Gg          , Gg          , Re          , Re          , Rp          
Gg          , Gg          , Re          , Re          , Re          , Gs^Fms      , Gg          , Gg          , Gg          , Mm          , Gg          , Ss^Vhs      , Ss          , Gg          , Ww          , Wo          , Ww          , Gs^Fp       , Hh          , Mm          , Ggf^Uf      , Gs^Fp       , Gg          , Gg          , Gg          , Gg          , Re          , Re          , Mm          , Rp          , Gs^Fp       
Gg          , Gg          , Re          , Re^Uf       , Hh          , Re          , Re          , Gg          , Gg^Vh       , Gg          , Gg          , Gs^Fp       , Gg          , Gg          , Ww          , Ww          , Gg          , Gg^Ve       , Gg          , Hh          , Gg          , Gg          , Gg          , Gg          , Ggf         , Re          , Gs^Fds      , Hh          , Rp          , Rp          , Hh          
Gg          , Gg          , Gg          , Gs^Fp       , Mm          , Ss          , Re          , Gg          , Gg          , Gg          , Gg          , Gg          , Ww^Bw\      , Wwf         , Wwf         , Ww          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Re          , Re          , Re^Uf       , Mm          , Rp          , Hh          , Hh          
Gg          , Gg          , Gg          , Gg          , Gg          , Re^Uf       , Gg          , Gg          , Hh          , Gg          , Gs^Fp       , Gg          , Ww          , Kh          , Ch          , Ch          , Ch          , Kh          , Gg          , Gg          , Re          , Re          , Re          , Re          , Gg          , Gs^Fp       , Rp          , Rp          , Gg          , Gs^Fms      , Gg          
Gs^Fds      , Gg          , Gs^Fp       , Gg          , Gs^Fp       , Gg          , Ss^Vhs      , Gs^Fp       , Mm          , Hh          , Ww          , Ww          , Wo          , Ww          , Mm          , 2 Kh        , Re          , Re          , Re          , Re          , Gg          , Gg^Ve       , Gg          , Gg          , Gg          , Gg          , Rp          , Gg          , Gg          , Gg          , Gg          
Ss          , Gg^Fet      , Ss          , Hh          , Mm          , Hh          , Gs^Fms      , Ss          , Gs^Fp       , Ww          , Wo          , Wo          , Ww          , Ww          , Hh          , Ch          , Gs^Fds      , Gg          , Gs^Fms      , Mm          , Gg^Fet      , Hh          , Mm          , Hh          , Rp          , Rp          , Gs^Fp       , Rp          , Rp          , Gg          , Gg          
Hh          , Hh          , Gs^Fms      , Gs^Fp       , Hh          , Ss          , Mm          , Gg^Fet      , Ww          , Ww          , Wo          , Wo          , Ww          , Hh          , Gs^Fp       , Gg^Fet      , Gs^Fms      , Hh          , Mm          , Hh          , Gs^Fp       , Ss          , Hh          , Gs^Fp       , Rp          , Ss          , Ss          , Hh          , Mm          , Rp          , Gg          
Hh          , Gs^Fms      , Hh          , Ss          , Hh          , Hh          , Wwf         , Ww          , Wo          , Wo          , Ww          , Ww          , Hh          , Gg          , Hh          , Hh          , Ss          , Hh          , Hh          , Gs^Fms      , Ss          , Hh          , Rp          , Rp          , Gg          , Hh          , Hh          , Gs^Fp       , Ss          , Rp          , Hh          
"
	mp_countdown="yes"
	mp_countdown_action_bonus="20"
	mp_countdown_init_time="270"
	mp_countdown_reservoir_time="270"
	mp_countdown_turn_bonus="200"
	mp_fog="yes"
	mp_shroud="no"
	mp_use_map_settings="yes"
	mp_village_gold="2"
	name=_ "2p - Weldyn Channel"
	next_underlying_unit_id="0"
#textdomain wesnoth
	objectives=_ "Victory:
@Defeat enemy leader(s)"
	observer="yes"
	random_seed="2003138879"
	random_start_time="no"
	scenario="Ladder KnightKunibert"
	turns="-1"
	version="1.6"
	[time]
		green="-20"
		id="dawn"
		image="misc/schedule-dawn.png"
		name=_ "Dawn"
		red="-20"
		sound="ambient/morning.ogg"
	[/time]
	[time]
		id="morning"
		image="misc/schedule-morning.png"
		lawful_bonus="25"
		name=_ "Morning"
	[/time]
	[time]
		id="afternoon"
		image="misc/schedule-afternoon.png"
		lawful_bonus="25"
		name=_ "Afternoon"
	[/time]
	[time]
		blue="-20"
		green="-20"
		id="dusk"
		image="misc/schedule-dusk.png"
		name=_ "Dusk"
		sound="ambient/night.ogg"
	[/time]
	[time]
		blue="-10"
		green="-40"
		id="first_watch"
		image="misc/schedule-firstwatch.png"
		lawful_bonus="-25"
		name=_ "First Watch"
		red="-40"
	[/time]
	[time]
		blue="-10"
		green="-40"
		id="second_watch"
		image="misc/schedule-secondwatch.png"
		lawful_bonus="-25"
		name=_ "Second Watch"
		red="-40"
	[/time]
	[music]
		ms_before="12000"
		name="knolls.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="wanderer.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="battle.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="transience.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="the_king_is_dead.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="knalgan_theme.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="the_city_falls.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="nunc_dimittis.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="revelation.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="loyalists.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="breaking_the_chains.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="elvish-theme.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="legends_of_the_north.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="traveling_minstrels.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="underground.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="vengeful.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="frantic.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="the_dangerous_symphony.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="heroes_rite.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="suspense.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="the_deep_path.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="siege_of_laurelmor.ogg"
	[/music]
	[event]
		name="prestart"
		[music]
			ms_before="12000"
			name="knolls.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="wanderer.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="battle.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="transience.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="revelation.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="loyalists.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="the_king_is_dead.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="knalgan_theme.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="the_city_falls.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="nunc_dimittis.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="breaking_the_chains.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="elvish-theme.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="legends_of_the_north.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="traveling_minstrels.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="underground.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="vengeful.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="frantic.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="the_dangerous_symphony.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="heroes_rite.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="suspense.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="the_deep_path.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="siege_of_laurelmor.ogg"
		[/music]
	[/event]
	[era]
		id="era_default"
#textdomain wesnoth-multiplayer
		name=_ "Default"
		[multiplayer_side]
			flag_rgb="magenta"
			id="Random"
			image="units/random-dice.png"
			name=_ "Random"
			random_faction="yes"
		[/multiplayer_side]
		[multiplayer_side]
			flag_rgb="magenta"
			id="Loyalists"
			image="units/human-loyalists/lieutenant.png"
			leader="Lieutenant,Swordsman,Pikeman,Javelineer,Shock Trooper,Longbowman,White Mage,Red Mage"
			name=_ "Loyalists"
			random_leader="Lieutenant,Swordsman,Pikeman,Javelineer,Longbowman,Red Mage"
			recruit="Cavalryman,Horseman,Spearman,Fencer,Heavy Infantryman,Bowman,Mage,Merman Fighter"
			terrain_liked="Gg, Ww, Wo"
			type="Lieutenant"
			[ai]
				recruitment_pattern="fighter,fighter,fighter,archer,mixed fighter,scout"
				[team_formula]
					rulebase="fai 'recruitment.fai'
		# ===== Some general functions used later ==== #

def sumarize_values( input_map )
	sum(
		values(input_map)
	);

def lowest_value( input_map )
	choose( input_map, -value ).value;

def highest_value( input_map )
	choose( input_map, value ).value;

def change_numbers_to_percents( input_map )
	map( input_map, 
		(value*100) / highest_value(input_map) 
	);

def add_number_to_values( input_map, number )
	map( input_map, 
		value + number 
	);

#make sure we have only positive values in a map #

def make_positive_only( input_map )
	if( lowest_value( input_map ) < 0, 
		add_number_to_values( 
			input_map, 
			abs(lowest_value(input_map))
		), 
		input_map 
	);

def sumarize_maps_values( map_A, map_B )
	map( map_A + map_B, 
		value + map_A[key]
	);

		#===== Evaluation how good unit is on a map ===== #

# ==1==  evaluate average defense #
#gives map where key is id of terrain, and value is number of hexes of that terrain on a gamemap#

def locations_map(ai*) 
	tomap( 
		map( 
			map.terrain, 
			id 
		) 
	);

#filters terrain map, min_percent it minimal % of map that terrain has to occupy to be considered in later evaluations# 

def filtered_locations_map(ai*, min_percent)
	filter( 
		locations_map(ai) , 
		value >  (map.w * map.h) / ( 100 / min_percent ) 
	);

#returns average defense of the unit #

def unit_average_defense(ai*, unit, terrain_min_percent )
	sum( 
		values( 
			map(
				filtered_locations_map(ai,terrain_min_percent), 
				defense_on( 
					unit, 
					find(map.terrain,id=key).loc
				) *
				value
			) 
		) 
	) / 
	sum(
		values(
			filtered_locations_map(
				ai,
				terrain_min_percent
			)
		)
	);

#returns map of units from units_list and their average defense (more -> better) #

def map_units_average_defense(ai*, units_list, terrain_min_percent) 
	tomap(
		map( 
			units_list, 
			id 
		), 
		map( 
			units_list, 'unit', 
			unit_average_defense(
				ai, 
				unit, 
				terrain_min_percent 
			) 
		) 
	);

def units_average_defense(ai*, units_list, terrain_min_percent)
	sum(
		map( 
			units_list, 'unit', 
			unit_average_defense(
				ai, 
				unit, 
				terrain_min_percent 
			) 
		) 
	) /
	size(
		units_list
	);


# ==2== TODO: evaluate unit effectivness based on movement points and movement cost#


		#===== Evaluation of game state - how good is ai doing ===== #

# ==1== based on unit cost and current amount of gold #
# returns number between 0 and 100 where: 0 we are losing, 100 we are winning #

def units_cost_gold_eval(ai*)
	min(
		[
			(
				(
					sum(
						map(
							allies, 'team', 
							sum(
								map(
									units_of_side[team], 
									cost
								)
							) + 
							teams[team].gold 
						)
					) * 
					100
				) / 
				sum(
					map(
						enemies, 'team', 
						sum(
							map(
								units_of_side[team], 
								cost
							)
						) + 
						max(
							[teams[team].gold, 0]
						) 
					)
				)
			) / 2,
			100
		]
	);

# ==2== based on village possession #

def count_allied_villages(ai*)
	sum(
		map(
			allies, 'side', 
			size(
				villages_of_side[side]
			)
		)
	);

def count_enemy_villages(ai*)
	sum(
		map(
			enemies, 'side', 
			size(
				villages_of_side[side]
			)
		)
	);

# multipled by 1000 to increase precision #

def village_evaluation(ai*)
	(
		50000 + 
		(
			count_allied_villages(ai) - 
			count_enemy_villages(ai)
		) * 
		(
			50000 /
			size(
				villages
			)
		)
	) /
	1000;

# ==3== combined 2 of the above #

def eval(ai*)
	( 
		units_cost_gold_eval(ai) + 
		village_evaluation(ai)
	) / 
	2;

		#===== Evaluation how effective my units are against the enemy ===== #

#==1==  basic evaluation #

# evaluate how much damage unit can inflict - how much damage unit can get#

def evaluate_attacker_against_opponents(ai*, unit, enemy_units)
	sum( 
		map( 
			enemy_units, 'enemy_unit', 
			sum(
				map(
					[
						max_possible_damage_with_retaliation( unit, enemy_unit )
					],
					max(
						[
							self[0] - self[2],
							self[1] - self[3]
						]
					)
				) 
			)
		)
	);

def evaluate_defender_against_opponents(ai*, unit, enemy_units)
	-sum( 
		map( 
			enemy_units, 'enemy_unit', 
			sum(
				map(
					[
						max_possible_damage_with_retaliation( enemy_unit, unit )
					],
					max(
						[
							self[0] - self[2],
							self[1] - self[3]
						]
					)
				)
			)
		)
	);

def units_hp_map(ai*, units)
	tomap( 
		map(
			units, 
			id
		), 
		map( 
			units, 
			hitpoints
		)
	);

#in case side's gold is more than 50, add units that side can recruit to the side's unit list#

def create_side_unit_list(ai*, side)
	if( 
		teams[side].gold > 50, 
		recruits_of_side[side], 
		[]
	) + 
	units_of_side[side];

def evaluate_my_recruits_as_attackers(ai*)
	tomap( 
		map(
			my_recruits, 
			id
		), 
		map(
			my_recruits, 'my_unit',
			sum(
				map(
					enemies, 'enemy_side',
					evaluate_attacker_against_opponents(
						ai,
						my_unit,
						create_side_unit_list(
							ai, 
							enemy_side
						)
					)
				)
			)
		)
	);

def evaluate_my_recruits_as_defenders(ai*)
	tomap(
		map(
			my_recruits, 
			id
		),
		map( 
			my_recruits, 'my_unit',
			sum(
				map(
					enemies, 'enemy_side',
					evaluate_defender_against_opponents(
						ai,
						my_unit,
						create_side_unit_list(
							ai,
							enemy_side
						)
					)
				)
			)
		)
	);


# === 2 ===  now consider abilities and weapon specials  #

def abilities_weights()
	['skirmisher' -> 15, 'ambush' -> 10, 'nightstalk' -> 20, 'regenerates' -> 20, 'healing' -> 15, 'curing' -> 10, 'leadership' -> 20, 'illumination' -> 15, 'teleport' -> 10, 'steadfast' -> 15 ];

def weapon_specials_weights()
	[ 'backstab' -> 20 ,'slow' -> 10 ,'berserk' -> 20 ,'stones' -> 60 ,'plague' -> 10 ,'marksman' -> 30 ,'magical' -> 40 ,'charge' -> 30 ,'drains' -> 30,  'firststrike' -> 10, 'poison' -> 25 ];

def apply_abilities_weights( units_map )
	map( 
		units_map, 
		value +
		(
			value * 
			max(
				map(
					get_unit_type( key ).abilities, 'ability',
					abilities_weights()[ability]
				)
			)
		) / 100
	);

def apply_weapon_specials_weights( units_map )
	map(
		units_map, 
		value +
		(
			value *
			max(
				map(
					get_unit_type( key ).attacks, 'attack',
					vars.weapon_specials[attack.special]
				)
			)
		) / 100
	);

# since undead units don't get random traits and are balanced with that, we need to lower their evaluation a bit to match fairly the living units #

def undead_malus( units_map )
	map( 
		units_map, 
		if(
			get_unit_type(key).undead,
			( value * 90 ) / 100,
			value 
		)
	);

# === 3 ===  pit 1 and 2 together  #

def evaluate_attackers(ai*)
	change_numbers_to_percents(
		apply_abilities_weights(
			apply_weapon_specials_weights(
				undead_malus( 
					make_positive_only(
						evaluate_my_recruits_as_attackers( ai )	
					)
				)
			)
		)
	);

def evaluate_defenders(ai*)
	map(
		map(
			change_numbers_to_percents(
				apply_abilities_weights(
					apply_weapon_specials_weights(
						undead_malus( 
							make_positive_only(
								evaluate_my_recruits_as_defenders( ai )	
							)
						)
					)
				)
			),
			value / 3
		), 
		value +
		map(
			change_numbers_to_percents(
				units_hp_map(
					ai,
					my_recruits
				)
			),
		value * 2 / 3
		)[key]
	);

	#=========== we have evaluation of game state and units, time to combine them: ==========#
		#=========	recruitment_list_builder	=========#

def rlb_apply_eval(eval, attackers_map, defenders_map, offset)
	map(
		sumarize_maps_values(
			map(
				attackers_map, 
				value * (eval+offset)
			),
			map(
				defenders_map,
				value * ( (100 - eval) - offset )
			)
		),
		value / 100
	);

def rlb_remove_lowest( input_map, percent)
	filter(
		input_map, 
		value > 
		(
			(
				percent * sumarize_values(input_map)
			) / 100
		)
	);

def rlb_first_step(eval, attackers_map, defenders_map, offset)
	rlb_remove_lowest(
		rlb_apply_eval(
			eval,
			attackers_map,
			defenders_map,
			offset
		),
		10
	);

def recruitment_list_builder(eval, attackers_map, defenders_map)
	map(
		rlb_first_step(
			eval,
			attackers_map,
			defenders_map,
			40
		),
		(
			(
				value * 100
			) / 
			sumarize_values(
				rlb_first_step(
					eval,
					attackers_map,
					defenders_map,
					40
				)
			)
		)
	);

		# ========== choose the unit to recruit now ========= #

def unit_chooser(ai*,unit_map) 
	choose(
		keys(unit_map), 'unit_type',
		unit_map[unit_type] - 
		(
			(
				100 * 
				size(
					filter(
						my_units, 
						type = unit_type
					)
				)
			) / 
			size(my_units)
		)
	);

def unit_map_cost_filter(ai*, unit_map)
	filter( unit_map,
		get_unit_type(key).cost < my_side.gold
	);

		# ==========	Main formula section 	========== #

def initialize_weapon_specials_map(ai*)
	if(vars.weapon_specials_init != turn,
		[
			set_var('weapon_specials_init', turn),
			set_var('weapon_specials',
				map(
					weapon_specials_weights(),
					if( key = 'magical',
						units_average_defense(ai, enemy_units, 10),
						if( key = 'marksman',
							units_average_defense(ai, enemy_units, 10) - 10,
							value
						)
					)
				)
			)
		],
		[]
	);

def create_recruits_map(ai*)
	if(vars.recruits_map_creator != turn,
		[
			set_var('recruits_map_creator', turn ),
			set_var('recruits_map',
				debug_print('final unit evaluation: ', recruitment_list_builder(
					debug_print('current AI evaluation (0-100): ', eval(ai)),
					debug_print('attackers evaluation: ',evaluate_attackers(ai)),
					debug_print('defenders evaluation: ',evaluate_defenders(ai))
				))
			)
		],
		[]
	);

def castle_space(ai*)
	filter( map( castle_locs( my_leader.loc ), 'location', if( unit_at( location ), 1, 0 ) ), self = 0  ).size;

if(vars.turn_initialized = turn,
		if( my_leader.loc = nearest_keep( my_leader.loc ),
			if( 
				get_unit_type(
					choose(
						vars.recruits_map,
						-get_unit_type(key).cost
					).key
				).cost <
				my_side.gold,
				if( castle_space(self),
					recruit(debug_print(
						unit_chooser(
							self,
							unit_map_cost_filter(
								self,
								vars.recruits_map
							)
						)
					)),
					fallback()
				),
				fallback() 
			),
			if( my_leader.movement_left > 0,
				move( my_leader.loc, nearest_keep( my_leader.loc ) ),
				fallback()
			)
		),
	[set_var(debug_print('turn_initialized'), turn)] +
	initialize_weapon_specials_map(self) +
	create_recruits_map(self)
)

faiend
"
				[/team_formula]
			[/ai]
		[/multiplayer_side]
		[multiplayer_side]
			flag_rgb="magenta"
			id="Rebels"
			image="units/elves-wood/captain.png"
			leader="Elvish Captain,Elvish Hero,Elvish Ranger,Elvish Marksman,Elvish Druid,Elvish Sorceress,White Mage,Red Mage,Elder Wose"
			name=_ "Rebels"
			random_leader="Elvish Captain,Elvish Hero,Elvish Ranger,Elvish Marksman,Elvish Druid,Elvish Sorceress,Red Mage"
			recruit="Elvish Fighter,Elvish Archer,Mage,Elvish Shaman,Elvish Scout,Wose,Merman Hunter"
			terrain_liked="Ff, Fa, Ss, Ww"
			type="Elvish Captain"
			[ai]
				recruitment_pattern="fighter,fighter,archer,archer,mixed fighter,healer,scout"
				[team_formula]
					rulebase="fai 'recruitment.fai'
		# ===== Some general functions used later ==== #

def sumarize_values( input_map )
	sum(
		values(input_map)
	);

def lowest_value( input_map )
	choose( input_map, -value ).value;

def highest_value( input_map )
	choose( input_map, value ).value;

def change_numbers_to_percents( input_map )
	map( input_map, 
		(value*100) / highest_value(input_map) 
	);

def add_number_to_values( input_map, number )
	map( input_map, 
		value + number 
	);

#make sure we have only positive values in a map #

def make_positive_only( input_map )
	if( lowest_value( input_map ) < 0, 
		add_number_to_values( 
			input_map, 
			abs(lowest_value(input_map))
		), 
		input_map 
	);

def sumarize_maps_values( map_A, map_B )
	map( map_A + map_B, 
		value + map_A[key]
	);

		#===== Evaluation how good unit is on a map ===== #

# ==1==  evaluate average defense #
#gives map where key is id of terrain, and value is number of hexes of that terrain on a gamemap#

def locations_map(ai*) 
	tomap( 
		map( 
			map.terrain, 
			id 
		) 
	);

#filters terrain map, min_percent it minimal % of map that terrain has to occupy to be considered in later evaluations# 

def filtered_locations_map(ai*, min_percent)
	filter( 
		locations_map(ai) , 
		value >  (map.w * map.h) / ( 100 / min_percent ) 
	);

#returns average defense of the unit #

def unit_average_defense(ai*, unit, terrain_min_percent )
	sum( 
		values( 
			map(
				filtered_locations_map(ai,terrain_min_percent), 
				defense_on( 
					unit, 
					find(map.terrain,id=key).loc
				) *
				value
			) 
		) 
	) / 
	sum(
		values(
			filtered_locations_map(
				ai,
				terrain_min_percent
			)
		)
	);

#returns map of units from units_list and their average defense (more -> better) #

def map_units_average_defense(ai*, units_list, terrain_min_percent) 
	tomap(
		map( 
			units_list, 
			id 
		), 
		map( 
			units_list, 'unit', 
			unit_average_defense(
				ai, 
				unit, 
				terrain_min_percent 
			) 
		) 
	);

def units_average_defense(ai*, units_list, terrain_min_percent)
	sum(
		map( 
			units_list, 'unit', 
			unit_average_defense(
				ai, 
				unit, 
				terrain_min_percent 
			) 
		) 
	) /
	size(
		units_list
	);


# ==2== TODO: evaluate unit effectivness based on movement points and movement cost#


		#===== Evaluation of game state - how good is ai doing ===== #

# ==1== based on unit cost and current amount of gold #
# returns number between 0 and 100 where: 0 we are losing, 100 we are winning #

def units_cost_gold_eval(ai*)
	min(
		[
			(
				(
					sum(
						map(
							allies, 'team', 
							sum(
								map(
									units_of_side[team], 
									cost
								)
							) + 
							teams[team].gold 
						)
					) * 
					100
				) / 
				sum(
					map(
						enemies, 'team', 
						sum(
							map(
								units_of_side[team], 
								cost
							)
						) + 
						max(
							[teams[team].gold, 0]
						) 
					)
				)
			) / 2,
			100
		]
	);

# ==2== based on village possession #

def count_allied_villages(ai*)
	sum(
		map(
			allies, 'side', 
			size(
				villages_of_side[side]
			)
		)
	);

def count_enemy_villages(ai*)
	sum(
		map(
			enemies, 'side', 
			size(
				villages_of_side[side]
			)
		)
	);

# multipled by 1000 to increase precision #

def village_evaluation(ai*)
	(
		50000 + 
		(
			count_allied_villages(ai) - 
			count_enemy_villages(ai)
		) * 
		(
			50000 /
			size(
				villages
			)
		)
	) /
	1000;

# ==3== combined 2 of the above #

def eval(ai*)
	( 
		units_cost_gold_eval(ai) + 
		village_evaluation(ai)
	) / 
	2;

		#===== Evaluation how effective my units are against the enemy ===== #

#==1==  basic evaluation #

# evaluate how much damage unit can inflict - how much damage unit can get#

def evaluate_attacker_against_opponents(ai*, unit, enemy_units)
	sum( 
		map( 
			enemy_units, 'enemy_unit', 
			sum(
				map(
					[
						max_possible_damage_with_retaliation( unit, enemy_unit )
					],
					max(
						[
							self[0] - self[2],
							self[1] - self[3]
						]
					)
				) 
			)
		)
	);

def evaluate_defender_against_opponents(ai*, unit, enemy_units)
	-sum( 
		map( 
			enemy_units, 'enemy_unit', 
			sum(
				map(
					[
						max_possible_damage_with_retaliation( enemy_unit, unit )
					],
					max(
						[
							self[0] - self[2],
							self[1] - self[3]
						]
					)
				)
			)
		)
	);

def units_hp_map(ai*, units)
	tomap( 
		map(
			units, 
			id
		), 
		map( 
			units, 
			hitpoints
		)
	);

#in case side's gold is more than 50, add units that side can recruit to the side's unit list#

def create_side_unit_list(ai*, side)
	if( 
		teams[side].gold > 50, 
		recruits_of_side[side], 
		[]
	) + 
	units_of_side[side];

def evaluate_my_recruits_as_attackers(ai*)
	tomap( 
		map(
			my_recruits, 
			id
		), 
		map(
			my_recruits, 'my_unit',
			sum(
				map(
					enemies, 'enemy_side',
					evaluate_attacker_against_opponents(
						ai,
						my_unit,
						create_side_unit_list(
							ai, 
							enemy_side
						)
					)
				)
			)
		)
	);

def evaluate_my_recruits_as_defenders(ai*)
	tomap(
		map(
			my_recruits, 
			id
		),
		map( 
			my_recruits, 'my_unit',
			sum(
				map(
					enemies, 'enemy_side',
					evaluate_defender_against_opponents(
						ai,
						my_unit,
						create_side_unit_list(
							ai,
							enemy_side
						)
					)
				)
			)
		)
	);


# === 2 ===  now consider abilities and weapon specials  #

def abilities_weights()
	['skirmisher' -> 15, 'ambush' -> 10, 'nightstalk' -> 20, 'regenerates' -> 20, 'healing' -> 15, 'curing' -> 10, 'leadership' -> 20, 'illumination' -> 15, 'teleport' -> 10, 'steadfast' -> 15 ];

def weapon_specials_weights()
	[ 'backstab' -> 20 ,'slow' -> 10 ,'berserk' -> 20 ,'stones' -> 60 ,'plague' -> 10 ,'marksman' -> 30 ,'magical' -> 40 ,'charge' -> 30 ,'drains' -> 30,  'firststrike' -> 10, 'poison' -> 25 ];

def apply_abilities_weights( units_map )
	map( 
		units_map, 
		value +
		(
			value * 
			max(
				map(
					get_unit_type( key ).abilities, 'ability',
					abilities_weights()[ability]
				)
			)
		) / 100
	);

def apply_weapon_specials_weights( units_map )
	map(
		units_map, 
		value +
		(
			value *
			max(
				map(
					get_unit_type( key ).attacks, 'attack',
					vars.weapon_specials[attack.special]
				)
			)
		) / 100
	);

# since undead units don't get random traits and are balanced with that, we need to lower their evaluation a bit to match fairly the living units #

def undead_malus( units_map )
	map( 
		units_map, 
		if(
			get_unit_type(key).undead,
			( value * 90 ) / 100,
			value 
		)
	);

# === 3 ===  pit 1 and 2 together  #

def evaluate_attackers(ai*)
	change_numbers_to_percents(
		apply_abilities_weights(
			apply_weapon_specials_weights(
				undead_malus( 
					make_positive_only(
						evaluate_my_recruits_as_attackers( ai )	
					)
				)
			)
		)
	);

def evaluate_defenders(ai*)
	map(
		map(
			change_numbers_to_percents(
				apply_abilities_weights(
					apply_weapon_specials_weights(
						undead_malus( 
							make_positive_only(
								evaluate_my_recruits_as_defenders( ai )	
							)
						)
					)
				)
			),
			value / 3
		), 
		value +
		map(
			change_numbers_to_percents(
				units_hp_map(
					ai,
					my_recruits
				)
			),
		value * 2 / 3
		)[key]
	);

	#=========== we have evaluation of game state and units, time to combine them: ==========#
		#=========	recruitment_list_builder	=========#

def rlb_apply_eval(eval, attackers_map, defenders_map, offset)
	map(
		sumarize_maps_values(
			map(
				attackers_map, 
				value * (eval+offset)
			),
			map(
				defenders_map,
				value * ( (100 - eval) - offset )
			)
		),
		value / 100
	);

def rlb_remove_lowest( input_map, percent)
	filter(
		input_map, 
		value > 
		(
			(
				percent * sumarize_values(input_map)
			) / 100
		)
	);

def rlb_first_step(eval, attackers_map, defenders_map, offset)
	rlb_remove_lowest(
		rlb_apply_eval(
			eval,
			attackers_map,
			defenders_map,
			offset
		),
		10
	);

def recruitment_list_builder(eval, attackers_map, defenders_map)
	map(
		rlb_first_step(
			eval,
			attackers_map,
			defenders_map,
			40
		),
		(
			(
				value * 100
			) / 
			sumarize_values(
				rlb_first_step(
					eval,
					attackers_map,
					defenders_map,
					40
				)
			)
		)
	);

		# ========== choose the unit to recruit now ========= #

def unit_chooser(ai*,unit_map) 
	choose(
		keys(unit_map), 'unit_type',
		unit_map[unit_type] - 
		(
			(
				100 * 
				size(
					filter(
						my_units, 
						type = unit_type
					)
				)
			) / 
			size(my_units)
		)
	);

def unit_map_cost_filter(ai*, unit_map)
	filter( unit_map,
		get_unit_type(key).cost < my_side.gold
	);

		# ==========	Main formula section 	========== #

def initialize_weapon_specials_map(ai*)
	if(vars.weapon_specials_init != turn,
		[
			set_var('weapon_specials_init', turn),
			set_var('weapon_specials',
				map(
					weapon_specials_weights(),
					if( key = 'magical',
						units_average_defense(ai, enemy_units, 10),
						if( key = 'marksman',
							units_average_defense(ai, enemy_units, 10) - 10,
							value
						)
					)
				)
			)
		],
		[]
	);

def create_recruits_map(ai*)
	if(vars.recruits_map_creator != turn,
		[
			set_var('recruits_map_creator', turn ),
			set_var('recruits_map',
				debug_print('final unit evaluation: ', recruitment_list_builder(
					debug_print('current AI evaluation (0-100): ', eval(ai)),
					debug_print('attackers evaluation: ',evaluate_attackers(ai)),
					debug_print('defenders evaluation: ',evaluate_defenders(ai))
				))
			)
		],
		[]
	);

def castle_space(ai*)
	filter( map( castle_locs( my_leader.loc ), 'location', if( unit_at( location ), 1, 0 ) ), self = 0  ).size;

if(vars.turn_initialized = turn,
		if( my_leader.loc = nearest_keep( my_leader.loc ),
			if( 
				get_unit_type(
					choose(
						vars.recruits_map,
						-get_unit_type(key).cost
					).key
				).cost <
				my_side.gold,
				if( castle_space(self),
					recruit(debug_print(
						unit_chooser(
							self,
							unit_map_cost_filter(
								self,
								vars.recruits_map
							)
						)
					)),
					fallback()
				),
				fallback() 
			),
			if( my_leader.movement_left > 0,
				move( my_leader.loc, nearest_keep( my_leader.loc ) ),
				fallback()
			)
		),
	[set_var(debug_print('turn_initialized'), turn)] +
	initialize_weapon_specials_map(self) +
	create_recruits_map(self)
)

faiend
"
				[/team_formula]
			[/ai]
		[/multiplayer_side]
		[multiplayer_side]
			flag_rgb="magenta"
			id="Northerners"
			image="units/orcs/warrior.png"
			leader="Orcish Warrior,Troll,Troll Rocklobber,Orcish Crossbowman,Orcish Slayer"
			name=_ "Northerners"
			recruit="Orcish Grunt,Troll Whelp,Wolf Rider,Orcish Archer,Orcish Assassin,Naga Fighter,Goblin Spearman"
			terrain_liked="Hh, Ha, Mm, Ss"
			type="Orcish Warrior"
			[ai]
				recruitment_pattern="fighter,fighter,fighter,mixed fighter,archer,scout"
				[team_formula]
					rulebase="fai 'recruitment.fai'
		# ===== Some general functions used later ==== #

def sumarize_values( input_map )
	sum(
		values(input_map)
	);

def lowest_value( input_map )
	choose( input_map, -value ).value;

def highest_value( input_map )
	choose( input_map, value ).value;

def change_numbers_to_percents( input_map )
	map( input_map, 
		(value*100) / highest_value(input_map) 
	);

def add_number_to_values( input_map, number )
	map( input_map, 
		value + number 
	);

#make sure we have only positive values in a map #

def make_positive_only( input_map )
	if( lowest_value( input_map ) < 0, 
		add_number_to_values( 
			input_map, 
			abs(lowest_value(input_map))
		), 
		input_map 
	);

def sumarize_maps_values( map_A, map_B )
	map( map_A + map_B, 
		value + map_A[key]
	);

		#===== Evaluation how good unit is on a map ===== #

# ==1==  evaluate average defense #
#gives map where key is id of terrain, and value is number of hexes of that terrain on a gamemap#

def locations_map(ai*) 
	tomap( 
		map( 
			map.terrain, 
			id 
		) 
	);

#filters terrain map, min_percent it minimal % of map that terrain has to occupy to be considered in later evaluations# 

def filtered_locations_map(ai*, min_percent)
	filter( 
		locations_map(ai) , 
		value >  (map.w * map.h) / ( 100 / min_percent ) 
	);

#returns average defense of the unit #

def unit_average_defense(ai*, unit, terrain_min_percent )
	sum( 
		values( 
			map(
				filtered_locations_map(ai,terrain_min_percent), 
				defense_on( 
					unit, 
					find(map.terrain,id=key).loc
				) *
				value
			) 
		) 
	) / 
	sum(
		values(
			filtered_locations_map(
				ai,
				terrain_min_percent
			)
		)
	);

#returns map of units from units_list and their average defense (more -> better) #

def map_units_average_defense(ai*, units_list, terrain_min_percent) 
	tomap(
		map( 
			units_list, 
			id 
		), 
		map( 
			units_list, 'unit', 
			unit_average_defense(
				ai, 
				unit, 
				terrain_min_percent 
			) 
		) 
	);

def units_average_defense(ai*, units_list, terrain_min_percent)
	sum(
		map( 
			units_list, 'unit', 
			unit_average_defense(
				ai, 
				unit, 
				terrain_min_percent 
			) 
		) 
	) /
	size(
		units_list
	);


# ==2== TODO: evaluate unit effectivness based on movement points and movement cost#


		#===== Evaluation of game state - how good is ai doing ===== #

# ==1== based on unit cost and current amount of gold #
# returns number between 0 and 100 where: 0 we are losing, 100 we are winning #

def units_cost_gold_eval(ai*)
	min(
		[
			(
				(
					sum(
						map(
							allies, 'team', 
							sum(
								map(
									units_of_side[team], 
									cost
								)
							) + 
							teams[team].gold 
						)
					) * 
					100
				) / 
				sum(
					map(
						enemies, 'team', 
						sum(
							map(
								units_of_side[team], 
								cost
							)
						) + 
						max(
							[teams[team].gold, 0]
						) 
					)
				)
			) / 2,
			100
		]
	);

# ==2== based on village possession #

def count_allied_villages(ai*)
	sum(
		map(
			allies, 'side', 
			size(
				villages_of_side[side]
			)
		)
	);

def count_enemy_villages(ai*)
	sum(
		map(
			enemies, 'side', 
			size(
				villages_of_side[side]
			)
		)
	);

# multipled by 1000 to increase precision #

def village_evaluation(ai*)
	(
		50000 + 
		(
			count_allied_villages(ai) - 
			count_enemy_villages(ai)
		) * 
		(
			50000 /
			size(
				villages
			)
		)
	) /
	1000;

# ==3== combined 2 of the above #

def eval(ai*)
	( 
		units_cost_gold_eval(ai) + 
		village_evaluation(ai)
	) / 
	2;

		#===== Evaluation how effective my units are against the enemy ===== #

#==1==  basic evaluation #

# evaluate how much damage unit can inflict - how much damage unit can get#

def evaluate_attacker_against_opponents(ai*, unit, enemy_units)
	sum( 
		map( 
			enemy_units, 'enemy_unit', 
			sum(
				map(
					[
						max_possible_damage_with_retaliation( unit, enemy_unit )
					],
					max(
						[
							self[0] - self[2],
							self[1] - self[3]
						]
					)
				) 
			)
		)
	);

def evaluate_defender_against_opponents(ai*, unit, enemy_units)
	-sum( 
		map( 
			enemy_units, 'enemy_unit', 
			sum(
				map(
					[
						max_possible_damage_with_retaliation( enemy_unit, unit )
					],
					max(
						[
							self[0] - self[2],
							self[1] - self[3]
						]
					)
				)
			)
		)
	);

def units_hp_map(ai*, units)
	tomap( 
		map(
			units, 
			id
		), 
		map( 
			units, 
			hitpoints
		)
	);

#in case side's gold is more than 50, add units that side can recruit to the side's unit list#

def create_side_unit_list(ai*, side)
	if( 
		teams[side].gold > 50, 
		recruits_of_side[side], 
		[]
	) + 
	units_of_side[side];

def evaluate_my_recruits_as_attackers(ai*)
	tomap( 
		map(
			my_recruits, 
			id
		), 
		map(
			my_recruits, 'my_unit',
			sum(
				map(
					enemies, 'enemy_side',
					evaluate_attacker_against_opponents(
						ai,
						my_unit,
						create_side_unit_list(
							ai, 
							enemy_side
						)
					)
				)
			)
		)
	);

def evaluate_my_recruits_as_defenders(ai*)
	tomap(
		map(
			my_recruits, 
			id
		),
		map( 
			my_recruits, 'my_unit',
			sum(
				map(
					enemies, 'enemy_side',
					evaluate_defender_against_opponents(
						ai,
						my_unit,
						create_side_unit_list(
							ai,
							enemy_side
						)
					)
				)
			)
		)
	);


# === 2 ===  now consider abilities and weapon specials  #

def abilities_weights()
	['skirmisher' -> 15, 'ambush' -> 10, 'nightstalk' -> 20, 'regenerates' -> 20, 'healing' -> 15, 'curing' -> 10, 'leadership' -> 20, 'illumination' -> 15, 'teleport' -> 10, 'steadfast' -> 15 ];

def weapon_specials_weights()
	[ 'backstab' -> 20 ,'slow' -> 10 ,'berserk' -> 20 ,'stones' -> 60 ,'plague' -> 10 ,'marksman' -> 30 ,'magical' -> 40 ,'charge' -> 30 ,'drains' -> 30,  'firststrike' -> 10, 'poison' -> 25 ];

def apply_abilities_weights( units_map )
	map( 
		units_map, 
		value +
		(
			value * 
			max(
				map(
					get_unit_type( key ).abilities, 'ability',
					abilities_weights()[ability]
				)
			)
		) / 100
	);

def apply_weapon_specials_weights( units_map )
	map(
		units_map, 
		value +
		(
			value *
			max(
				map(
					get_unit_type( key ).attacks, 'attack',
					vars.weapon_specials[attack.special]
				)
			)
		) / 100
	);

# since undead units don't get random traits and are balanced with that, we need to lower their evaluation a bit to match fairly the living units #

def undead_malus( units_map )
	map( 
		units_map, 
		if(
			get_unit_type(key).undead,
			( value * 90 ) / 100,
			value 
		)
	);

# === 3 ===  pit 1 and 2 together  #

def evaluate_attackers(ai*)
	change_numbers_to_percents(
		apply_abilities_weights(
			apply_weapon_specials_weights(
				undead_malus( 
					make_positive_only(
						evaluate_my_recruits_as_attackers( ai )	
					)
				)
			)
		)
	);

def evaluate_defenders(ai*)
	map(
		map(
			change_numbers_to_percents(
				apply_abilities_weights(
					apply_weapon_specials_weights(
						undead_malus( 
							make_positive_only(
								evaluate_my_recruits_as_defenders( ai )	
							)
						)
					)
				)
			),
			value / 3
		), 
		value +
		map(
			change_numbers_to_percents(
				units_hp_map(
					ai,
					my_recruits
				)
			),
		value * 2 / 3
		)[key]
	);

	#=========== we have evaluation of game state and units, time to combine them: ==========#
		#=========	recruitment_list_builder	=========#

def rlb_apply_eval(eval, attackers_map, defenders_map, offset)
	map(
		sumarize_maps_values(
			map(
				attackers_map, 
				value * (eval+offset)
			),
			map(
				defenders_map,
				value * ( (100 - eval) - offset )
			)
		),
		value / 100
	);

def rlb_remove_lowest( input_map, percent)
	filter(
		input_map, 
		value > 
		(
			(
				percent * sumarize_values(input_map)
			) / 100
		)
	);

def rlb_first_step(eval, attackers_map, defenders_map, offset)
	rlb_remove_lowest(
		rlb_apply_eval(
			eval,
			attackers_map,
			defenders_map,
			offset
		),
		10
	);

def recruitment_list_builder(eval, attackers_map, defenders_map)
	map(
		rlb_first_step(
			eval,
			attackers_map,
			defenders_map,
			40
		),
		(
			(
				value * 100
			) / 
			sumarize_values(
				rlb_first_step(
					eval,
					attackers_map,
					defenders_map,
					40
				)
			)
		)
	);

		# ========== choose the unit to recruit now ========= #

def unit_chooser(ai*,unit_map) 
	choose(
		keys(unit_map), 'unit_type',
		unit_map[unit_type] - 
		(
			(
				100 * 
				size(
					filter(
						my_units, 
						type = unit_type
					)
				)
			) / 
			size(my_units)
		)
	);

def unit_map_cost_filter(ai*, unit_map)
	filter( unit_map,
		get_unit_type(key).cost < my_side.gold
	);

		# ==========	Main formula section 	========== #

def initialize_weapon_specials_map(ai*)
	if(vars.weapon_specials_init != turn,
		[
			set_var('weapon_specials_init', turn),
			set_var('weapon_specials',
				map(
					weapon_specials_weights(),
					if( key = 'magical',
						units_average_defense(ai, enemy_units, 10),
						if( key = 'marksman',
							units_average_defense(ai, enemy_units, 10) - 10,
							value
						)
					)
				)
			)
		],
		[]
	);

def create_recruits_map(ai*)
	if(vars.recruits_map_creator != turn,
		[
			set_var('recruits_map_creator', turn ),
			set_var('recruits_map',
				debug_print('final unit evaluation: ', recruitment_list_builder(
					debug_print('current AI evaluation (0-100): ', eval(ai)),
					debug_print('attackers evaluation: ',evaluate_attackers(ai)),
					debug_print('defenders evaluation: ',evaluate_defenders(ai))
				))
			)
		],
		[]
	);

def castle_space(ai*)
	filter( map( castle_locs( my_leader.loc ), 'location', if( unit_at( location ), 1, 0 ) ), self = 0  ).size;

if(vars.turn_initialized = turn,
		if( my_leader.loc = nearest_keep( my_leader.loc ),
			if( 
				get_unit_type(
					choose(
						vars.recruits_map,
						-get_unit_type(key).cost
					).key
				).cost <
				my_side.gold,
				if( castle_space(self),
					recruit(debug_print(
						unit_chooser(
							self,
							unit_map_cost_filter(
								self,
								vars.recruits_map
							)
						)
					)),
					fallback()
				),
				fallback() 
			),
			if( my_leader.movement_left > 0,
				move( my_leader.loc, nearest_keep( my_leader.loc ) ),
				fallback()
			)
		),
	[set_var(debug_print('turn_initialized'), turn)] +
	initialize_weapon_specials_map(self) +
	create_recruits_map(self)
)

faiend
"
				[/team_formula]
			[/ai]
		[/multiplayer_side]
		[multiplayer_side]
			flag_rgb="magenta"
			id="Undead"
			image="units/undead-necromancers/dark-sorcerer.png"
			leader="Dark Sorcerer,Revenant,Deathblade,Bone Shooter,Necrophage"
			name=_ "Undead"
			random_leader="Dark Sorcerer,Revenant,Deathblade,Bone Shooter"
			recruit="Skeleton,Skeleton Archer,Walking Corpse,Ghost,Vampire Bat,Dark Adept,Ghoul"
			terrain_liked="Ss, Hh, Ha, Ww"
			type="Dark Sorcerer"
			[ai]
				recruitment_pattern="fighter,fighter,archer,fighter,scout,archer"
				[team_formula]
					rulebase="fai 'recruitment.fai'
		# ===== Some general functions used later ==== #

def sumarize_values( input_map )
	sum(
		values(input_map)
	);

def lowest_value( input_map )
	choose( input_map, -value ).value;

def highest_value( input_map )
	choose( input_map, value ).value;

def change_numbers_to_percents( input_map )
	map( input_map, 
		(value*100) / highest_value(input_map) 
	);

def add_number_to_values( input_map, number )
	map( input_map, 
		value + number 
	);

#make sure we have only positive values in a map #

def make_positive_only( input_map )
	if( lowest_value( input_map ) < 0, 
		add_number_to_values( 
			input_map, 
			abs(lowest_value(input_map))
		), 
		input_map 
	);

def sumarize_maps_values( map_A, map_B )
	map( map_A + map_B, 
		value + map_A[key]
	);

		#===== Evaluation how good unit is on a map ===== #

# ==1==  evaluate average defense #
#gives map where key is id of terrain, and value is number of hexes of that terrain on a gamemap#

def locations_map(ai*) 
	tomap( 
		map( 
			map.terrain, 
			id 
		) 
	);

#filters terrain map, min_percent it minimal % of map that terrain has to occupy to be considered in later evaluations# 

def filtered_locations_map(ai*, min_percent)
	filter( 
		locations_map(ai) , 
		value >  (map.w * map.h) / ( 100 / min_percent ) 
	);

#returns average defense of the unit #

def unit_average_defense(ai*, unit, terrain_min_percent )
	sum( 
		values( 
			map(
				filtered_locations_map(ai,terrain_min_percent), 
				defense_on( 
					unit, 
					find(map.terrain,id=key).loc
				) *
				value
			) 
		) 
	) / 
	sum(
		values(
			filtered_locations_map(
				ai,
				terrain_min_percent
			)
		)
	);

#returns map of units from units_list and their average defense (more -> better) #

def map_units_average_defense(ai*, units_list, terrain_min_percent) 
	tomap(
		map( 
			units_list, 
			id 
		), 
		map( 
			units_list, 'unit', 
			unit_average_defense(
				ai, 
				unit, 
				terrain_min_percent 
			) 
		) 
	);

def units_average_defense(ai*, units_list, terrain_min_percent)
	sum(
		map( 
			units_list, 'unit', 
			unit_average_defense(
				ai, 
				unit, 
				terrain_min_percent 
			) 
		) 
	) /
	size(
		units_list
	);


# ==2== TODO: evaluate unit effectivness based on movement points and movement cost#


		#===== Evaluation of game state - how good is ai doing ===== #

# ==1== based on unit cost and current amount of gold #
# returns number between 0 and 100 where: 0 we are losing, 100 we are winning #

def units_cost_gold_eval(ai*)
	min(
		[
			(
				(
					sum(
						map(
							allies, 'team', 
							sum(
								map(
									units_of_side[team], 
									cost
								)
							) + 
							teams[team].gold 
						)
					) * 
					100
				) / 
				sum(
					map(
						enemies, 'team', 
						sum(
							map(
								units_of_side[team], 
								cost
							)
						) + 
						max(
							[teams[team].gold, 0]
						) 
					)
				)
			) / 2,
			100
		]
	);

# ==2== based on village possession #

def count_allied_villages(ai*)
	sum(
		map(
			allies, 'side', 
			size(
				villages_of_side[side]
			)
		)
	);

def count_enemy_villages(ai*)
	sum(
		map(
			enemies, 'side', 
			size(
				villages_of_side[side]
			)
		)
	);

# multipled by 1000 to increase precision #

def village_evaluation(ai*)
	(
		50000 + 
		(
			count_allied_villages(ai) - 
			count_enemy_villages(ai)
		) * 
		(
			50000 /
			size(
				villages
			)
		)
	) /
	1000;

# ==3== combined 2 of the above #

def eval(ai*)
	( 
		units_cost_gold_eval(ai) + 
		village_evaluation(ai)
	) / 
	2;

		#===== Evaluation how effective my units are against the enemy ===== #

#==1==  basic evaluation #

# evaluate how much damage unit can inflict - how much damage unit can get#

def evaluate_attacker_against_opponents(ai*, unit, enemy_units)
	sum( 
		map( 
			enemy_units, 'enemy_unit', 
			sum(
				map(
					[
						max_possible_damage_with_retaliation( unit, enemy_unit )
					],
					max(
						[
							self[0] - self[2],
							self[1] - self[3]
						]
					)
				) 
			)
		)
	);

def evaluate_defender_against_opponents(ai*, unit, enemy_units)
	-sum( 
		map( 
			enemy_units, 'enemy_unit', 
			sum(
				map(
					[
						max_possible_damage_with_retaliation( enemy_unit, unit )
					],
					max(
						[
							self[0] - self[2],
							self[1] - self[3]
						]
					)
				)
			)
		)
	);

def units_hp_map(ai*, units)
	tomap( 
		map(
			units, 
			id
		), 
		map( 
			units, 
			hitpoints
		)
	);

#in case side's gold is more than 50, add units that side can recruit to the side's unit list#

def create_side_unit_list(ai*, side)
	if( 
		teams[side].gold > 50, 
		recruits_of_side[side], 
		[]
	) + 
	units_of_side[side];

def evaluate_my_recruits_as_attackers(ai*)
	tomap( 
		map(
			my_recruits, 
			id
		), 
		map(
			my_recruits, 'my_unit',
			sum(
				map(
					enemies, 'enemy_side',
					evaluate_attacker_against_opponents(
						ai,
						my_unit,
						create_side_unit_list(
							ai, 
							enemy_side
						)
					)
				)
			)
		)
	);

def evaluate_my_recruits_as_defenders(ai*)
	tomap(
		map(
			my_recruits, 
			id
		),
		map( 
			my_recruits, 'my_unit',
			sum(
				map(
					enemies, 'enemy_side',
					evaluate_defender_against_opponents(
						ai,
						my_unit,
						create_side_unit_list(
							ai,
							enemy_side
						)
					)
				)
			)
		)
	);


# === 2 ===  now consider abilities and weapon specials  #

def abilities_weights()
	['skirmisher' -> 15, 'ambush' -> 10, 'nightstalk' -> 20, 'regenerates' -> 20, 'healing' -> 15, 'curing' -> 10, 'leadership' -> 20, 'illumination' -> 15, 'teleport' -> 10, 'steadfast' -> 15 ];

def weapon_specials_weights()
	[ 'backstab' -> 20 ,'slow' -> 10 ,'berserk' -> 20 ,'stones' -> 60 ,'plague' -> 10 ,'marksman' -> 30 ,'magical' -> 40 ,'charge' -> 30 ,'drains' -> 30,  'firststrike' -> 10, 'poison' -> 25 ];

def apply_abilities_weights( units_map )
	map( 
		units_map, 
		value +
		(
			value * 
			max(
				map(
					get_unit_type( key ).abilities, 'ability',
					abilities_weights()[ability]
				)
			)
		) / 100
	);

def apply_weapon_specials_weights( units_map )
	map(
		units_map, 
		value +
		(
			value *
			max(
				map(
					get_unit_type( key ).attacks, 'attack',
					vars.weapon_specials[attack.special]
				)
			)
		) / 100
	);

# since undead units don't get random traits and are balanced with that, we need to lower their evaluation a bit to match fairly the living units #

def undead_malus( units_map )
	map( 
		units_map, 
		if(
			get_unit_type(key).undead,
			( value * 90 ) / 100,
			value 
		)
	);

# === 3 ===  pit 1 and 2 together  #

def evaluate_attackers(ai*)
	change_numbers_to_percents(
		apply_abilities_weights(
			apply_weapon_specials_weights(
				undead_malus( 
					make_positive_only(
						evaluate_my_recruits_as_attackers( ai )	
					)
				)
			)
		)
	);

def evaluate_defenders(ai*)
	map(
		map(
			change_numbers_to_percents(
				apply_abilities_weights(
					apply_weapon_specials_weights(
						undead_malus( 
							make_positive_only(
								evaluate_my_recruits_as_defenders( ai )	
							)
						)
					)
				)
			),
			value / 3
		), 
		value +
		map(
			change_numbers_to_percents(
				units_hp_map(
					ai,
					my_recruits
				)
			),
		value * 2 / 3
		)[key]
	);

	#=========== we have evaluation of game state and units, time to combine them: ==========#
		#=========	recruitment_list_builder	=========#

def rlb_apply_eval(eval, attackers_map, defenders_map, offset)
	map(
		sumarize_maps_values(
			map(
				attackers_map, 
				value * (eval+offset)
			),
			map(
				defenders_map,
				value * ( (100 - eval) - offset )
			)
		),
		value / 100
	);

def rlb_remove_lowest( input_map, percent)
	filter(
		input_map, 
		value > 
		(
			(
				percent * sumarize_values(input_map)
			) / 100
		)
	);

def rlb_first_step(eval, attackers_map, defenders_map, offset)
	rlb_remove_lowest(
		rlb_apply_eval(
			eval,
			attackers_map,
			defenders_map,
			offset
		),
		10
	);

def recruitment_list_builder(eval, attackers_map, defenders_map)
	map(
		rlb_first_step(
			eval,
			attackers_map,
			defenders_map,
			40
		),
		(
			(
				value * 100
			) / 
			sumarize_values(
				rlb_first_step(
					eval,
					attackers_map,
					defenders_map,
					40
				)
			)
		)
	);

		# ========== choose the unit to recruit now ========= #

def unit_chooser(ai*,unit_map) 
	choose(
		keys(unit_map), 'unit_type',
		unit_map[unit_type] - 
		(
			(
				100 * 
				size(
					filter(
						my_units, 
						type = unit_type
					)
				)
			) / 
			size(my_units)
		)
	);

def unit_map_cost_filter(ai*, unit_map)
	filter( unit_map,
		get_unit_type(key).cost < my_side.gold
	);

		# ==========	Main formula section 	========== #

def initialize_weapon_specials_map(ai*)
	if(vars.weapon_specials_init != turn,
		[
			set_var('weapon_specials_init', turn),
			set_var('weapon_specials',
				map(
					weapon_specials_weights(),
					if( key = 'magical',
						units_average_defense(ai, enemy_units, 10),
						if( key = 'marksman',
							units_average_defense(ai, enemy_units, 10) - 10,
							value
						)
					)
				)
			)
		],
		[]
	);

def create_recruits_map(ai*)
	if(vars.recruits_map_creator != turn,
		[
			set_var('recruits_map_creator', turn ),
			set_var('recruits_map',
				debug_print('final unit evaluation: ', recruitment_list_builder(
					debug_print('current AI evaluation (0-100): ', eval(ai)),
					debug_print('attackers evaluation: ',evaluate_attackers(ai)),
					debug_print('defenders evaluation: ',evaluate_defenders(ai))
				))
			)
		],
		[]
	);

def castle_space(ai*)
	filter( map( castle_locs( my_leader.loc ), 'location', if( unit_at( location ), 1, 0 ) ), self = 0  ).size;

if(vars.turn_initialized = turn,
		if( my_leader.loc = nearest_keep( my_leader.loc ),
			if( 
				get_unit_type(
					choose(
						vars.recruits_map,
						-get_unit_type(key).cost
					).key
				).cost <
				my_side.gold,
				if( castle_space(self),
					recruit(debug_print(
						unit_chooser(
							self,
							unit_map_cost_filter(
								self,
								vars.recruits_map
							)
						)
					)),
					fallback()
				),
				fallback() 
			),
			if( my_leader.movement_left > 0,
				move( my_leader.loc, nearest_keep( my_leader.loc ) ),
				fallback()
			)
		),
	[set_var(debug_print('turn_initialized'), turn)] +
	initialize_weapon_specials_map(self) +
	create_recruits_map(self)
)

faiend
"
				[/team_formula]
			[/ai]
		[/multiplayer_side]
		[multiplayer_side]
			flag_rgb="magenta"
			id="Knalgan Alliance"
			image="units/dwarves/steelclad.png"
			leader="Dwarvish Steelclad,Dwarvish Thunderguard,Dwarvish Stalwart,Rogue,Trapper"
			name=_ "Knalgan Alliance"
			random_leader="Dwarvish Steelclad,Dwarvish Thunderguard,Rogue,Trapper"
			recruit="Dwarvish Guardsman,Dwarvish Fighter,Dwarvish Ulfserker,Dwarvish Thunderer,Thief,Poacher,Footpad,Gryphon Rider"
			terrain_liked="Hh, Ha, Mm"
			type="Dwarvish Steelclad"
			[ai]
				recruitment_pattern="fighter,fighter,fighter,mixed fighter,archer,scout"
				[team_formula]
					rulebase="fai 'recruitment.fai'
		# ===== Some general functions used later ==== #

def sumarize_values( input_map )
	sum(
		values(input_map)
	);

def lowest_value( input_map )
	choose( input_map, -value ).value;

def highest_value( input_map )
	choose( input_map, value ).value;

def change_numbers_to_percents( input_map )
	map( input_map, 
		(value*100) / highest_value(input_map) 
	);

def add_number_to_values( input_map, number )
	map( input_map, 
		value + number 
	);

#make sure we have only positive values in a map #

def make_positive_only( input_map )
	if( lowest_value( input_map ) < 0, 
		add_number_to_values( 
			input_map, 
			abs(lowest_value(input_map))
		), 
		input_map 
	);

def sumarize_maps_values( map_A, map_B )
	map( map_A + map_B, 
		value + map_A[key]
	);

		#===== Evaluation how good unit is on a map ===== #

# ==1==  evaluate average defense #
#gives map where key is id of terrain, and value is number of hexes of that terrain on a gamemap#

def locations_map(ai*) 
	tomap( 
		map( 
			map.terrain, 
			id 
		) 
	);

#filters terrain map, min_percent it minimal % of map that terrain has to occupy to be considered in later evaluations# 

def filtered_locations_map(ai*, min_percent)
	filter( 
		locations_map(ai) , 
		value >  (map.w * map.h) / ( 100 / min_percent ) 
	);

#returns average defense of the unit #

def unit_average_defense(ai*, unit, terrain_min_percent )
	sum( 
		values( 
			map(
				filtered_locations_map(ai,terrain_min_percent), 
				defense_on( 
					unit, 
					find(map.terrain,id=key).loc
				) *
				value
			) 
		) 
	) / 
	sum(
		values(
			filtered_locations_map(
				ai,
				terrain_min_percent
			)
		)
	);

#returns map of units from units_list and their average defense (more -> better) #

def map_units_average_defense(ai*, units_list, terrain_min_percent) 
	tomap(
		map( 
			units_list, 
			id 
		), 
		map( 
			units_list, 'unit', 
			unit_average_defense(
				ai, 
				unit, 
				terrain_min_percent 
			) 
		) 
	);

def units_average_defense(ai*, units_list, terrain_min_percent)
	sum(
		map( 
			units_list, 'unit', 
			unit_average_defense(
				ai, 
				unit, 
				terrain_min_percent 
			) 
		) 
	) /
	size(
		units_list
	);


# ==2== TODO: evaluate unit effectivness based on movement points and movement cost#


		#===== Evaluation of game state - how good is ai doing ===== #

# ==1== based on unit cost and current amount of gold #
# returns number between 0 and 100 where: 0 we are losing, 100 we are winning #

def units_cost_gold_eval(ai*)
	min(
		[
			(
				(
					sum(
						map(
							allies, 'team', 
							sum(
								map(
									units_of_side[team], 
									cost
								)
							) + 
							teams[team].gold 
						)
					) * 
					100
				) / 
				sum(
					map(
						enemies, 'team', 
						sum(
							map(
								units_of_side[team], 
								cost
							)
						) + 
						max(
							[teams[team].gold, 0]
						) 
					)
				)
			) / 2,
			100
		]
	);

# ==2== based on village possession #

def count_allied_villages(ai*)
	sum(
		map(
			allies, 'side', 
			size(
				villages_of_side[side]
			)
		)
	);

def count_enemy_villages(ai*)
	sum(
		map(
			enemies, 'side', 
			size(
				villages_of_side[side]
			)
		)
	);

# multipled by 1000 to increase precision #

def village_evaluation(ai*)
	(
		50000 + 
		(
			count_allied_villages(ai) - 
			count_enemy_villages(ai)
		) * 
		(
			50000 /
			size(
				villages
			)
		)
	) /
	1000;

# ==3== combined 2 of the above #

def eval(ai*)
	( 
		units_cost_gold_eval(ai) + 
		village_evaluation(ai)
	) / 
	2;

		#===== Evaluation how effective my units are against the enemy ===== #

#==1==  basic evaluation #

# evaluate how much damage unit can inflict - how much damage unit can get#

def evaluate_attacker_against_opponents(ai*, unit, enemy_units)
	sum( 
		map( 
			enemy_units, 'enemy_unit', 
			sum(
				map(
					[
						max_possible_damage_with_retaliation( unit, enemy_unit )
					],
					max(
						[
							self[0] - self[2],
							self[1] - self[3]
						]
					)
				) 
			)
		)
	);

def evaluate_defender_against_opponents(ai*, unit, enemy_units)
	-sum( 
		map( 
			enemy_units, 'enemy_unit', 
			sum(
				map(
					[
						max_possible_damage_with_retaliation( enemy_unit, unit )
					],
					max(
						[
							self[0] - self[2],
							self[1] - self[3]
						]
					)
				)
			)
		)
	);

def units_hp_map(ai*, units)
	tomap( 
		map(
			units, 
			id
		), 
		map( 
			units, 
			hitpoints
		)
	);

#in case side's gold is more than 50, add units that side can recruit to the side's unit list#

def create_side_unit_list(ai*, side)
	if( 
		teams[side].gold > 50, 
		recruits_of_side[side], 
		[]
	) + 
	units_of_side[side];

def evaluate_my_recruits_as_attackers(ai*)
	tomap( 
		map(
			my_recruits, 
			id
		), 
		map(
			my_recruits, 'my_unit',
			sum(
				map(
					enemies, 'enemy_side',
					evaluate_attacker_against_opponents(
						ai,
						my_unit,
						create_side_unit_list(
							ai, 
							enemy_side
						)
					)
				)
			)
		)
	);

def evaluate_my_recruits_as_defenders(ai*)
	tomap(
		map(
			my_recruits, 
			id
		),
		map( 
			my_recruits, 'my_unit',
			sum(
				map(
					enemies, 'enemy_side',
					evaluate_defender_against_opponents(
						ai,
						my_unit,
						create_side_unit_list(
							ai,
							enemy_side
						)
					)
				)
			)
		)
	);


# === 2 ===  now consider abilities and weapon specials  #

def abilities_weights()
	['skirmisher' -> 15, 'ambush' -> 10, 'nightstalk' -> 20, 'regenerates' -> 20, 'healing' -> 15, 'curing' -> 10, 'leadership' -> 20, 'illumination' -> 15, 'teleport' -> 10, 'steadfast' -> 15 ];

def weapon_specials_weights()
	[ 'backstab' -> 20 ,'slow' -> 10 ,'berserk' -> 20 ,'stones' -> 60 ,'plague' -> 10 ,'marksman' -> 30 ,'magical' -> 40 ,'charge' -> 30 ,'drains' -> 30,  'firststrike' -> 10, 'poison' -> 25 ];

def apply_abilities_weights( units_map )
	map( 
		units_map, 
		value +
		(
			value * 
			max(
				map(
					get_unit_type( key ).abilities, 'ability',
					abilities_weights()[ability]
				)
			)
		) / 100
	);

def apply_weapon_specials_weights( units_map )
	map(
		units_map, 
		value +
		(
			value *
			max(
				map(
					get_unit_type( key ).attacks, 'attack',
					vars.weapon_specials[attack.special]
				)
			)
		) / 100
	);

# since undead units don't get random traits and are balanced with that, we need to lower their evaluation a bit to match fairly the living units #

def undead_malus( units_map )
	map( 
		units_map, 
		if(
			get_unit_type(key).undead,
			( value * 90 ) / 100,
			value 
		)
	);

# === 3 ===  pit 1 and 2 together  #

def evaluate_attackers(ai*)
	change_numbers_to_percents(
		apply_abilities_weights(
			apply_weapon_specials_weights(
				undead_malus( 
					make_positive_only(
						evaluate_my_recruits_as_attackers( ai )	
					)
				)
			)
		)
	);

def evaluate_defenders(ai*)
	map(
		map(
			change_numbers_to_percents(
				apply_abilities_weights(
					apply_weapon_specials_weights(
						undead_malus( 
							make_positive_only(
								evaluate_my_recruits_as_defenders( ai )	
							)
						)
					)
				)
			),
			value / 3
		), 
		value +
		map(
			change_numbers_to_percents(
				units_hp_map(
					ai,
					my_recruits
				)
			),
		value * 2 / 3
		)[key]
	);

	#=========== we have evaluation of game state and units, time to combine them: ==========#
		#=========	recruitment_list_builder	=========#

def rlb_apply_eval(eval, attackers_map, defenders_map, offset)
	map(
		sumarize_maps_values(
			map(
				attackers_map, 
				value * (eval+offset)
			),
			map(
				defenders_map,
				value * ( (100 - eval) - offset )
			)
		),
		value / 100
	);

def rlb_remove_lowest( input_map, percent)
	filter(
		input_map, 
		value > 
		(
			(
				percent * sumarize_values(input_map)
			) / 100
		)
	);

def rlb_first_step(eval, attackers_map, defenders_map, offset)
	rlb_remove_lowest(
		rlb_apply_eval(
			eval,
			attackers_map,
			defenders_map,
			offset
		),
		10
	);

def recruitment_list_builder(eval, attackers_map, defenders_map)
	map(
		rlb_first_step(
			eval,
			attackers_map,
			defenders_map,
			40
		),
		(
			(
				value * 100
			) / 
			sumarize_values(
				rlb_first_step(
					eval,
					attackers_map,
					defenders_map,
					40
				)
			)
		)
	);

		# ========== choose the unit to recruit now ========= #

def unit_chooser(ai*,unit_map) 
	choose(
		keys(unit_map), 'unit_type',
		unit_map[unit_type] - 
		(
			(
				100 * 
				size(
					filter(
						my_units, 
						type = unit_type
					)
				)
			) / 
			size(my_units)
		)
	);

def unit_map_cost_filter(ai*, unit_map)
	filter( unit_map,
		get_unit_type(key).cost < my_side.gold
	);

		# ==========	Main formula section 	========== #

def initialize_weapon_specials_map(ai*)
	if(vars.weapon_specials_init != turn,
		[
			set_var('weapon_specials_init', turn),
			set_var('weapon_specials',
				map(
					weapon_specials_weights(),
					if( key = 'magical',
						units_average_defense(ai, enemy_units, 10),
						if( key = 'marksman',
							units_average_defense(ai, enemy_units, 10) - 10,
							value
						)
					)
				)
			)
		],
		[]
	);

def create_recruits_map(ai*)
	if(vars.recruits_map_creator != turn,
		[
			set_var('recruits_map_creator', turn ),
			set_var('recruits_map',
				debug_print('final unit evaluation: ', recruitment_list_builder(
					debug_print('current AI evaluation (0-100): ', eval(ai)),
					debug_print('attackers evaluation: ',evaluate_attackers(ai)),
					debug_print('defenders evaluation: ',evaluate_defenders(ai))
				))
			)
		],
		[]
	);

def castle_space(ai*)
	filter( map( castle_locs( my_leader.loc ), 'location', if( unit_at( location ), 1, 0 ) ), self = 0  ).size;

if(vars.turn_initialized = turn,
		if( my_leader.loc = nearest_keep( my_leader.loc ),
			if( 
				get_unit_type(
					choose(
						vars.recruits_map,
						-get_unit_type(key).cost
					).key
				).cost <
				my_side.gold,
				if( castle_space(self),
					recruit(debug_print(
						unit_chooser(
							self,
							unit_map_cost_filter(
								self,
								vars.recruits_map
							)
						)
					)),
					fallback()
				),
				fallback() 
			),
			if( my_leader.movement_left > 0,
				move( my_leader.loc, nearest_keep( my_leader.loc ) ),
				fallback()
			)
		),
	[set_var(debug_print('turn_initialized'), turn)] +
	initialize_weapon_specials_map(self) +
	create_recruits_map(self)
)

faiend
"
				[/team_formula]
			[/ai]
		[/multiplayer_side]
		[multiplayer_side]
			flag_rgb="magenta"
			id="Drakes"
			image="units/drakes/flare.png"
			leader="Drake Flare,Fire Drake,Drake Slasher,Drake Gladiator,Drake Warrior,Saurian Oracle,Saurian Soothsayer"
			name=_ "Drakes"
			random_leader="Drake Flare,Fire Drake,Drake Slasher,Drake Gladiator,Drake Warrior"
			recruit="Drake Burner,Drake Clasher,Drake Glider,Drake Fighter,Saurian Skirmisher,Saurian Augur"
			terrain_liked="Hh, Ha, Ds, Ss"
			type="Drake Flare"
			[ai]
				recruitment_pattern="fighter,fighter,archer,healer,scout,scout"
				[team_formula]
					rulebase="fai 'recruitment.fai'
		# ===== Some general functions used later ==== #

def sumarize_values( input_map )
	sum(
		values(input_map)
	);

def lowest_value( input_map )
	choose( input_map, -value ).value;

def highest_value( input_map )
	choose( input_map, value ).value;

def change_numbers_to_percents( input_map )
	map( input_map, 
		(value*100) / highest_value(input_map) 
	);

def add_number_to_values( input_map, number )
	map( input_map, 
		value + number 
	);

#make sure we have only positive values in a map #

def make_positive_only( input_map )
	if( lowest_value( input_map ) < 0, 
		add_number_to_values( 
			input_map, 
			abs(lowest_value(input_map))
		), 
		input_map 
	);

def sumarize_maps_values( map_A, map_B )
	map( map_A + map_B, 
		value + map_A[key]
	);

		#===== Evaluation how good unit is on a map ===== #

# ==1==  evaluate average defense #
#gives map where key is id of terrain, and value is number of hexes of that terrain on a gamemap#

def locations_map(ai*) 
	tomap( 
		map( 
			map.terrain, 
			id 
		) 
	);

#filters terrain map, min_percent it minimal % of map that terrain has to occupy to be considered in later evaluations# 

def filtered_locations_map(ai*, min_percent)
	filter( 
		locations_map(ai) , 
		value >  (map.w * map.h) / ( 100 / min_percent ) 
	);

#returns average defense of the unit #

def unit_average_defense(ai*, unit, terrain_min_percent )
	sum( 
		values( 
			map(
				filtered_locations_map(ai,terrain_min_percent), 
				defense_on( 
					unit, 
					find(map.terrain,id=key).loc
				) *
				value
			) 
		) 
	) / 
	sum(
		values(
			filtered_locations_map(
				ai,
				terrain_min_percent
			)
		)
	);

#returns map of units from units_list and their average defense (more -> better) #

def map_units_average_defense(ai*, units_list, terrain_min_percent) 
	tomap(
		map( 
			units_list, 
			id 
		), 
		map( 
			units_list, 'unit', 
			unit_average_defense(
				ai, 
				unit, 
				terrain_min_percent 
			) 
		) 
	);

def units_average_defense(ai*, units_list, terrain_min_percent)
	sum(
		map( 
			units_list, 'unit', 
			unit_average_defense(
				ai, 
				unit, 
				terrain_min_percent 
			) 
		) 
	) /
	size(
		units_list
	);


# ==2== TODO: evaluate unit effectivness based on movement points and movement cost#


		#===== Evaluation of game state - how good is ai doing ===== #

# ==1== based on unit cost and current amount of gold #
# returns number between 0 and 100 where: 0 we are losing, 100 we are winning #

def units_cost_gold_eval(ai*)
	min(
		[
			(
				(
					sum(
						map(
							allies, 'team', 
							sum(
								map(
									units_of_side[team], 
									cost
								)
							) + 
							teams[team].gold 
						)
					) * 
					100
				) / 
				sum(
					map(
						enemies, 'team', 
						sum(
							map(
								units_of_side[team], 
								cost
							)
						) + 
						max(
							[teams[team].gold, 0]
						) 
					)
				)
			) / 2,
			100
		]
	);

# ==2== based on village possession #

def count_allied_villages(ai*)
	sum(
		map(
			allies, 'side', 
			size(
				villages_of_side[side]
			)
		)
	);

def count_enemy_villages(ai*)
	sum(
		map(
			enemies, 'side', 
			size(
				villages_of_side[side]
			)
		)
	);

# multipled by 1000 to increase precision #

def village_evaluation(ai*)
	(
		50000 + 
		(
			count_allied_villages(ai) - 
			count_enemy_villages(ai)
		) * 
		(
			50000 /
			size(
				villages
			)
		)
	) /
	1000;

# ==3== combined 2 of the above #

def eval(ai*)
	( 
		units_cost_gold_eval(ai) + 
		village_evaluation(ai)
	) / 
	2;

		#===== Evaluation how effective my units are against the enemy ===== #

#==1==  basic evaluation #

# evaluate how much damage unit can inflict - how much damage unit can get#

def evaluate_attacker_against_opponents(ai*, unit, enemy_units)
	sum( 
		map( 
			enemy_units, 'enemy_unit', 
			sum(
				map(
					[
						max_possible_damage_with_retaliation( unit, enemy_unit )
					],
					max(
						[
							self[0] - self[2],
							self[1] - self[3]
						]
					)
				) 
			)
		)
	);

def evaluate_defender_against_opponents(ai*, unit, enemy_units)
	-sum( 
		map( 
			enemy_units, 'enemy_unit', 
			sum(
				map(
					[
						max_possible_damage_with_retaliation( enemy_unit, unit )
					],
					max(
						[
							self[0] - self[2],
							self[1] - self[3]
						]
					)
				)
			)
		)
	);

def units_hp_map(ai*, units)
	tomap( 
		map(
			units, 
			id
		), 
		map( 
			units, 
			hitpoints
		)
	);

#in case side's gold is more than 50, add units that side can recruit to the side's unit list#

def create_side_unit_list(ai*, side)
	if( 
		teams[side].gold > 50, 
		recruits_of_side[side], 
		[]
	) + 
	units_of_side[side];

def evaluate_my_recruits_as_attackers(ai*)
	tomap( 
		map(
			my_recruits, 
			id
		), 
		map(
			my_recruits, 'my_unit',
			sum(
				map(
					enemies, 'enemy_side',
					evaluate_attacker_against_opponents(
						ai,
						my_unit,
						create_side_unit_list(
							ai, 
							enemy_side
						)
					)
				)
			)
		)
	);

def evaluate_my_recruits_as_defenders(ai*)
	tomap(
		map(
			my_recruits, 
			id
		),
		map( 
			my_recruits, 'my_unit',
			sum(
				map(
					enemies, 'enemy_side',
					evaluate_defender_against_opponents(
						ai,
						my_unit,
						create_side_unit_list(
							ai,
							enemy_side
						)
					)
				)
			)
		)
	);


# === 2 ===  now consider abilities and weapon specials  #

def abilities_weights()
	['skirmisher' -> 15, 'ambush' -> 10, 'nightstalk' -> 20, 'regenerates' -> 20, 'healing' -> 15, 'curing' -> 10, 'leadership' -> 20, 'illumination' -> 15, 'teleport' -> 10, 'steadfast' -> 15 ];

def weapon_specials_weights()
	[ 'backstab' -> 20 ,'slow' -> 10 ,'berserk' -> 20 ,'stones' -> 60 ,'plague' -> 10 ,'marksman' -> 30 ,'magical' -> 40 ,'charge' -> 30 ,'drains' -> 30,  'firststrike' -> 10, 'poison' -> 25 ];

def apply_abilities_weights( units_map )
	map( 
		units_map, 
		value +
		(
			value * 
			max(
				map(
					get_unit_type( key ).abilities, 'ability',
					abilities_weights()[ability]
				)
			)
		) / 100
	);

def apply_weapon_specials_weights( units_map )
	map(
		units_map, 
		value +
		(
			value *
			max(
				map(
					get_unit_type( key ).attacks, 'attack',
					vars.weapon_specials[attack.special]
				)
			)
		) / 100
	);

# since undead units don't get random traits and are balanced with that, we need to lower their evaluation a bit to match fairly the living units #

def undead_malus( units_map )
	map( 
		units_map, 
		if(
			get_unit_type(key).undead,
			( value * 90 ) / 100,
			value 
		)
	);

# === 3 ===  pit 1 and 2 together  #

def evaluate_attackers(ai*)
	change_numbers_to_percents(
		apply_abilities_weights(
			apply_weapon_specials_weights(
				undead_malus( 
					make_positive_only(
						evaluate_my_recruits_as_attackers( ai )	
					)
				)
			)
		)
	);

def evaluate_defenders(ai*)
	map(
		map(
			change_numbers_to_percents(
				apply_abilities_weights(
					apply_weapon_specials_weights(
						undead_malus( 
							make_positive_only(
								evaluate_my_recruits_as_defenders( ai )	
							)
						)
					)
				)
			),
			value / 3
		), 
		value +
		map(
			change_numbers_to_percents(
				units_hp_map(
					ai,
					my_recruits
				)
			),
		value * 2 / 3
		)[key]
	);

	#=========== we have evaluation of game state and units, time to combine them: ==========#
		#=========	recruitment_list_builder	=========#

def rlb_apply_eval(eval, attackers_map, defenders_map, offset)
	map(
		sumarize_maps_values(
			map(
				attackers_map, 
				value * (eval+offset)
			),
			map(
				defenders_map,
				value * ( (100 - eval) - offset )
			)
		),
		value / 100
	);

def rlb_remove_lowest( input_map, percent)
	filter(
		input_map, 
		value > 
		(
			(
				percent * sumarize_values(input_map)
			) / 100
		)
	);

def rlb_first_step(eval, attackers_map, defenders_map, offset)
	rlb_remove_lowest(
		rlb_apply_eval(
			eval,
			attackers_map,
			defenders_map,
			offset
		),
		10
	);

def recruitment_list_builder(eval, attackers_map, defenders_map)
	map(
		rlb_first_step(
			eval,
			attackers_map,
			defenders_map,
			40
		),
		(
			(
				value * 100
			) / 
			sumarize_values(
				rlb_first_step(
					eval,
					attackers_map,
					defenders_map,
					40
				)
			)
		)
	);

		# ========== choose the unit to recruit now ========= #

def unit_chooser(ai*,unit_map) 
	choose(
		keys(unit_map), 'unit_type',
		unit_map[unit_type] - 
		(
			(
				100 * 
				size(
					filter(
						my_units, 
						type = unit_type
					)
				)
			) / 
			size(my_units)
		)
	);

def unit_map_cost_filter(ai*, unit_map)
	filter( unit_map,
		get_unit_type(key).cost < my_side.gold
	);

		# ==========	Main formula section 	========== #

def initialize_weapon_specials_map(ai*)
	if(vars.weapon_specials_init != turn,
		[
			set_var('weapon_specials_init', turn),
			set_var('weapon_specials',
				map(
					weapon_specials_weights(),
					if( key = 'magical',
						units_average_defense(ai, enemy_units, 10),
						if( key = 'marksman',
							units_average_defense(ai, enemy_units, 10) - 10,
							value
						)
					)
				)
			)
		],
		[]
	);

def create_recruits_map(ai*)
	if(vars.recruits_map_creator != turn,
		[
			set_var('recruits_map_creator', turn ),
			set_var('recruits_map',
				debug_print('final unit evaluation: ', recruitment_list_builder(
					debug_print('current AI evaluation (0-100): ', eval(ai)),
					debug_print('attackers evaluation: ',evaluate_attackers(ai)),
					debug_print('defenders evaluation: ',evaluate_defenders(ai))
				))
			)
		],
		[]
	);

def castle_space(ai*)
	filter( map( castle_locs( my_leader.loc ), 'location', if( unit_at( location ), 1, 0 ) ), self = 0  ).size;

if(vars.turn_initialized = turn,
		if( my_leader.loc = nearest_keep( my_leader.loc ),
			if( 
				get_unit_type(
					choose(
						vars.recruits_map,
						-get_unit_type(key).cost
					).key
				).cost <
				my_side.gold,
				if( castle_space(self),
					recruit(debug_print(
						unit_chooser(
							self,
							unit_map_cost_filter(
								self,
								vars.recruits_map
							)
						)
					)),
					fallback()
				),
				fallback() 
			),
			if( my_leader.movement_left > 0,
				move( my_leader.loc, nearest_keep( my_leader.loc ) ),
				fallback()
			)
		),
	[set_var(debug_print('turn_initialized'), turn)] +
	initialize_weapon_specials_map(self) +
	create_recruits_map(self)
)

faiend
"
				[/team_formula]
			[/ai]
		[/multiplayer_side]
		[event]
			name="prestart"
			[store_unit]
				kill="yes"
				variable="leaders_to_make_quick"
				[filter]
					canrecruit="yes"
					[filter_wml]
						max_moves="4"
					[/filter_wml]
				[/filter]
			[/store_unit]
			[set_variable]
				name="i"
				value="0"
			[/set_variable]
			[while]
				[variable]
					less_than="$leaders_to_make_quick.length"
					name="i"
				[/variable]
				[do]
					[set_variables]
						mode="merge"
						name="leaders_to_make_quick[$i].modifications"
						[literal]
							[trait]
#textdomain wesnoth
								female_name=_ "female^quick"
								id="quick"
								male_name=_ "quick"
								[effect]
									apply_to="movement"
									increase="1"
								[/effect]
								[effect]
									apply_to="hitpoints"
									increase_total="-5%"
								[/effect]
							[/trait]
						[/literal]
					[/set_variables]
					[clear_variable]
						name="leaders_to_make_quick[$i].max_moves,leaders_to_make_quick[$i].moves,leaders_to_make_quick[$i].max_hitpoints,leaders_to_make_quick[$i].hitpoints"
					[/clear_variable]
					[unstore_unit]
						variable="leaders_to_make_quick[$i]"
					[/unstore_unit]
					[set_variable]
						add="1"
						name="i"
					[/set_variable]
				[/do]
			[/while]
			[clear_variable]
				name="i"
			[/clear_variable]
			[clear_variable]
				name="leaders_to_make_quick"
			[/clear_variable]
		[/event]
	[/era]
	[side]
		allow_changes="yes"
		allow_player="yes"
		canrecruit="yes"
		colour="1"
		controller="human"
		current_player="KnightKunibert"
		flag_rgb="magenta"
		fog="yes"
		gender="male"
		gold="100"
		id="KnightKunibert1"
		image="units/dwarves/steelclad.png"
		income="0"
		leader="Dwarvish Steelclad,Dwarvish Thunderguard,Dwarvish Stalwart,Rogue,Trapper"
		mp_countdown="yes"
		mp_countdown_action_bonus="20"
		mp_countdown_init_time="270"
		mp_countdown_reservoir_time="270"
		mp_countdown_turn_bonus="200"
		name="KnightKunibert"
		random_leader="Dwarvish Steelclad,Dwarvish Thunderguard,Rogue,Trapper"
		recruit="Dwarvish Guardsman,Dwarvish Fighter,Dwarvish Ulfserker,Dwarvish Thunderer,Thief,Poacher,Footpad,Gryphon Rider"
		save_id="KnightKunibert1"
		share_maps="no"
		share_view="yes"
		shroud="no"
		side="1"
		team_name="north"
		terrain_liked="Hh, Ha, Mm"
		type="Dwarvish Thunderguard"
		user_team_name="wesnoth-multiplayerteamname^North"
		village_gold="2"
		[ai]
			recruitment_pattern="fighter,fighter,fighter,mixed fighter,archer,scout"
			villages_per_scout="8"
			[team_formula]
				rulebase="fai 'recruitment.fai'
		# ===== Some general functions used later ==== #

def sumarize_values( input_map )
	sum(
		values(input_map)
	);

def lowest_value( input_map )
	choose( input_map, -value ).value;

def highest_value( input_map )
	choose( input_map, value ).value;

def change_numbers_to_percents( input_map )
	map( input_map, 
		(value*100) / highest_value(input_map) 
	);

def add_number_to_values( input_map, number )
	map( input_map, 
		value + number 
	);

#make sure we have only positive values in a map #

def make_positive_only( input_map )
	if( lowest_value( input_map ) < 0, 
		add_number_to_values( 
			input_map, 
			abs(lowest_value(input_map))
		), 
		input_map 
	);

def sumarize_maps_values( map_A, map_B )
	map( map_A + map_B, 
		value + map_A[key]
	);

		#===== Evaluation how good unit is on a map ===== #

# ==1==  evaluate average defense #
#gives map where key is id of terrain, and value is number of hexes of that terrain on a gamemap#

def locations_map(ai*) 
	tomap( 
		map( 
			map.terrain, 
			id 
		) 
	);

#filters terrain map, min_percent it minimal % of map that terrain has to occupy to be considered in later evaluations# 

def filtered_locations_map(ai*, min_percent)
	filter( 
		locations_map(ai) , 
		value >  (map.w * map.h) / ( 100 / min_percent ) 
	);

#returns average defense of the unit #

def unit_average_defense(ai*, unit, terrain_min_percent )
	sum( 
		values( 
			map(
				filtered_locations_map(ai,terrain_min_percent), 
				defense_on( 
					unit, 
					find(map.terrain,id=key).loc
				) *
				value
			) 
		) 
	) / 
	sum(
		values(
			filtered_locations_map(
				ai,
				terrain_min_percent
			)
		)
	);

#returns map of units from units_list and their average defense (more -> better) #

def map_units_average_defense(ai*, units_list, terrain_min_percent) 
	tomap(
		map( 
			units_list, 
			id 
		), 
		map( 
			units_list, 'unit', 
			unit_average_defense(
				ai, 
				unit, 
				terrain_min_percent 
			) 
		) 
	);

def units_average_defense(ai*, units_list, terrain_min_percent)
	sum(
		map( 
			units_list, 'unit', 
			unit_average_defense(
				ai, 
				unit, 
				terrain_min_percent 
			) 
		) 
	) /
	size(
		units_list
	);


# ==2== TODO: evaluate unit effectivness based on movement points and movement cost#


		#===== Evaluation of game state - how good is ai doing ===== #

# ==1== based on unit cost and current amount of gold #
# returns number between 0 and 100 where: 0 we are losing, 100 we are winning #

def units_cost_gold_eval(ai*)
	min(
		[
			(
				(
					sum(
						map(
							allies, 'team', 
							sum(
								map(
									units_of_side[team], 
									cost
								)
							) + 
							teams[team].gold 
						)
					) * 
					100
				) / 
				sum(
					map(
						enemies, 'team', 
						sum(
							map(
								units_of_side[team], 
								cost
							)
						) + 
						max(
							[teams[team].gold, 0]
						) 
					)
				)
			) / 2,
			100
		]
	);

# ==2== based on village possession #

def count_allied_villages(ai*)
	sum(
		map(
			allies, 'side', 
			size(
				villages_of_side[side]
			)
		)
	);

def count_enemy_villages(ai*)
	sum(
		map(
			enemies, 'side', 
			size(
				villages_of_side[side]
			)
		)
	);

# multipled by 1000 to increase precision #

def village_evaluation(ai*)
	(
		50000 + 
		(
			count_allied_villages(ai) - 
			count_enemy_villages(ai)
		) * 
		(
			50000 /
			size(
				villages
			)
		)
	) /
	1000;

# ==3== combined 2 of the above #

def eval(ai*)
	( 
		units_cost_gold_eval(ai) + 
		village_evaluation(ai)
	) / 
	2;

		#===== Evaluation how effective my units are against the enemy ===== #

#==1==  basic evaluation #

# evaluate how much damage unit can inflict - how much damage unit can get#

def evaluate_attacker_against_opponents(ai*, unit, enemy_units)
	sum( 
		map( 
			enemy_units, 'enemy_unit', 
			sum(
				map(
					[
						max_possible_damage_with_retaliation( unit, enemy_unit )
					],
					max(
						[
							self[0] - self[2],
							self[1] - self[3]
						]
					)
				) 
			)
		)
	);

def evaluate_defender_against_opponents(ai*, unit, enemy_units)
	-sum( 
		map( 
			enemy_units, 'enemy_unit', 
			sum(
				map(
					[
						max_possible_damage_with_retaliation( enemy_unit, unit )
					],
					max(
						[
							self[0] - self[2],
							self[1] - self[3]
						]
					)
				)
			)
		)
	);

def units_hp_map(ai*, units)
	tomap( 
		map(
			units, 
			id
		), 
		map( 
			units, 
			hitpoints
		)
	);

#in case side's gold is more than 50, add units that side can recruit to the side's unit list#

def create_side_unit_list(ai*, side)
	if( 
		teams[side].gold > 50, 
		recruits_of_side[side], 
		[]
	) + 
	units_of_side[side];

def evaluate_my_recruits_as_attackers(ai*)
	tomap( 
		map(
			my_recruits, 
			id
		), 
		map(
			my_recruits, 'my_unit',
			sum(
				map(
					enemies, 'enemy_side',
					evaluate_attacker_against_opponents(
						ai,
						my_unit,
						create_side_unit_list(
							ai, 
							enemy_side
						)
					)
				)
			)
		)
	);

def evaluate_my_recruits_as_defenders(ai*)
	tomap(
		map(
			my_recruits, 
			id
		),
		map( 
			my_recruits, 'my_unit',
			sum(
				map(
					enemies, 'enemy_side',
					evaluate_defender_against_opponents(
						ai,
						my_unit,
						create_side_unit_list(
							ai,
							enemy_side
						)
					)
				)
			)
		)
	);


# === 2 ===  now consider abilities and weapon specials  #

def abilities_weights()
	['skirmisher' -> 15, 'ambush' -> 10, 'nightstalk' -> 20, 'regenerates' -> 20, 'healing' -> 15, 'curing' -> 10, 'leadership' -> 20, 'illumination' -> 15, 'teleport' -> 10, 'steadfast' -> 15 ];

def weapon_specials_weights()
	[ 'backstab' -> 20 ,'slow' -> 10 ,'berserk' -> 20 ,'stones' -> 60 ,'plague' -> 10 ,'marksman' -> 30 ,'magical' -> 40 ,'charge' -> 30 ,'drains' -> 30,  'firststrike' -> 10, 'poison' -> 25 ];

def apply_abilities_weights( units_map )
	map( 
		units_map, 
		value +
		(
			value * 
			max(
				map(
					get_unit_type( key ).abilities, 'ability',
					abilities_weights()[ability]
				)
			)
		) / 100
	);

def apply_weapon_specials_weights( units_map )
	map(
		units_map, 
		value +
		(
			value *
			max(
				map(
					get_unit_type( key ).attacks, 'attack',
					vars.weapon_specials[attack.special]
				)
			)
		) / 100
	);

# since undead units don't get random traits and are balanced with that, we need to lower their evaluation a bit to match fairly the living units #

def undead_malus( units_map )
	map( 
		units_map, 
		if(
			get_unit_type(key).undead,
			( value * 90 ) / 100,
			value 
		)
	);

# === 3 ===  pit 1 and 2 together  #

def evaluate_attackers(ai*)
	change_numbers_to_percents(
		apply_abilities_weights(
			apply_weapon_specials_weights(
				undead_malus( 
					make_positive_only(
						evaluate_my_recruits_as_attackers( ai )	
					)
				)
			)
		)
	);

def evaluate_defenders(ai*)
	map(
		map(
			change_numbers_to_percents(
				apply_abilities_weights(
					apply_weapon_specials_weights(
						undead_malus( 
							make_positive_only(
								evaluate_my_recruits_as_defenders( ai )	
							)
						)
					)
				)
			),
			value / 3
		), 
		value +
		map(
			change_numbers_to_percents(
				units_hp_map(
					ai,
					my_recruits
				)
			),
		value * 2 / 3
		)[key]
	);

	#=========== we have evaluation of game state and units, time to combine them: ==========#
		#=========	recruitment_list_builder	=========#

def rlb_apply_eval(eval, attackers_map, defenders_map, offset)
	map(
		sumarize_maps_values(
			map(
				attackers_map, 
				value * (eval+offset)
			),
			map(
				defenders_map,
				value * ( (100 - eval) - offset )
			)
		),
		value / 100
	);

def rlb_remove_lowest( input_map, percent)
	filter(
		input_map, 
		value > 
		(
			(
				percent * sumarize_values(input_map)
			) / 100
		)
	);

def rlb_first_step(eval, attackers_map, defenders_map, offset)
	rlb_remove_lowest(
		rlb_apply_eval(
			eval,
			attackers_map,
			defenders_map,
			offset
		),
		10
	);

def recruitment_list_builder(eval, attackers_map, defenders_map)
	map(
		rlb_first_step(
			eval,
			attackers_map,
			defenders_map,
			40
		),
		(
			(
				value * 100
			) / 
			sumarize_values(
				rlb_first_step(
					eval,
					attackers_map,
					defenders_map,
					40
				)
			)
		)
	);

		# ========== choose the unit to recruit now ========= #

def unit_chooser(ai*,unit_map) 
	choose(
		keys(unit_map), 'unit_type',
		unit_map[unit_type] - 
		(
			(
				100 * 
				size(
					filter(
						my_units, 
						type = unit_type
					)
				)
			) / 
			size(my_units)
		)
	);

def unit_map_cost_filter(ai*, unit_map)
	filter( unit_map,
		get_unit_type(key).cost < my_side.gold
	);

		# ==========	Main formula section 	========== #

def initialize_weapon_specials_map(ai*)
	if(vars.weapon_specials_init != turn,
		[
			set_var('weapon_specials_init', turn),
			set_var('weapon_specials',
				map(
					weapon_specials_weights(),
					if( key = 'magical',
						units_average_defense(ai, enemy_units, 10),
						if( key = 'marksman',
							units_average_defense(ai, enemy_units, 10) - 10,
							value
						)
					)
				)
			)
		],
		[]
	);

def create_recruits_map(ai*)
	if(vars.recruits_map_creator != turn,
		[
			set_var('recruits_map_creator', turn ),
			set_var('recruits_map',
				debug_print('final unit evaluation: ', recruitment_list_builder(
					debug_print('current AI evaluation (0-100): ', eval(ai)),
					debug_print('attackers evaluation: ',evaluate_attackers(ai)),
					debug_print('defenders evaluation: ',evaluate_defenders(ai))
				))
			)
		],
		[]
	);

def castle_space(ai*)
	filter( map( castle_locs( my_leader.loc ), 'location', if( unit_at( location ), 1, 0 ) ), self = 0  ).size;

if(vars.turn_initialized = turn,
		if( my_leader.loc = nearest_keep( my_leader.loc ),
			if( 
				get_unit_type(
					choose(
						vars.recruits_map,
						-get_unit_type(key).cost
					).key
				).cost <
				my_side.gold,
				if( castle_space(self),
					recruit(debug_print(
						unit_chooser(
							self,
							unit_map_cost_filter(
								self,
								vars.recruits_map
							)
						)
					)),
					fallback()
				),
				fallback() 
			),
			if( my_leader.movement_left > 0,
				move( my_leader.loc, nearest_keep( my_leader.loc ) ),
				fallback()
			)
		),
	[set_var(debug_print('turn_initialized'), turn)] +
	initialize_weapon_specials_map(self) +
	create_recruits_map(self)
)

faiend
"
			[/team_formula]
		[/ai]
		[ai]
			villages_per_scout="8"
		[/ai]
	[/side]
	[side]
		allow_changes="yes"
		allow_player="yes"
		canrecruit="yes"
		colour="2"
		controller="network"
		current_player="Almogaver"
		flag_rgb="magenta"
		fog="yes"
		gender="male"
		gold="100"
		id="Almogaver2"
		image="units/human-loyalists/lieutenant.png"
		income="0"
		leader="Lieutenant,Swordsman,Pikeman,Javelineer,Shock Trooper,Longbowman,White Mage,Red Mage"
		mp_countdown="yes"
		mp_countdown_action_bonus="20"
		mp_countdown_init_time="270"
		mp_countdown_reservoir_time="270"
		mp_countdown_turn_bonus="200"
		name="Almogaver"
		random_leader="Lieutenant,Swordsman,Pikeman,Javelineer,Longbowman,Red Mage"
		recruit="Cavalryman,Horseman,Spearman,Fencer,Heavy Infantryman,Bowman,Mage,Merman Fighter"
		save_id="Almogaver2"
		share_maps="no"
		share_view="yes"
		shroud="no"
		side="2"
		team_name="south"
		terrain_liked="Gg, Ww, Wo"
		type="Pikeman"
		user_team_name="wesnoth-multiplayerteamname^South"
		village_gold="2"
		[ai]
			recruitment_pattern="fighter,fighter,fighter,archer,mixed fighter,scout"
			villages_per_scout="8"
			[team_formula]
				rulebase="fai 'recruitment.fai'
		# ===== Some general functions used later ==== #

def sumarize_values( input_map )
	sum(
		values(input_map)
	);

def lowest_value( input_map )
	choose( input_map, -value ).value;

def highest_value( input_map )
	choose( input_map, value ).value;

def change_numbers_to_percents( input_map )
	map( input_map, 
		(value*100) / highest_value(input_map) 
	);

def add_number_to_values( input_map, number )
	map( input_map, 
		value + number 
	);

#make sure we have only positive values in a map #

def make_positive_only( input_map )
	if( lowest_value( input_map ) < 0, 
		add_number_to_values( 
			input_map, 
			abs(lowest_value(input_map))
		), 
		input_map 
	);

def sumarize_maps_values( map_A, map_B )
	map( map_A + map_B, 
		value + map_A[key]
	);

		#===== Evaluation how good unit is on a map ===== #

# ==1==  evaluate average defense #
#gives map where key is id of terrain, and value is number of hexes of that terrain on a gamemap#

def locations_map(ai*) 
	tomap( 
		map( 
			map.terrain, 
			id 
		) 
	);

#filters terrain map, min_percent it minimal % of map that terrain has to occupy to be considered in later evaluations# 

def filtered_locations_map(ai*, min_percent)
	filter( 
		locations_map(ai) , 
		value >  (map.w * map.h) / ( 100 / min_percent ) 
	);

#returns average defense of the unit #

def unit_average_defense(ai*, unit, terrain_min_percent )
	sum( 
		values( 
			map(
				filtered_locations_map(ai,terrain_min_percent), 
				defense_on( 
					unit, 
					find(map.terrain,id=key).loc
				) *
				value
			) 
		) 
	) / 
	sum(
		values(
			filtered_locations_map(
				ai,
				terrain_min_percent
			)
		)
	);

#returns map of units from units_list and their average defense (more -> better) #

def map_units_average_defense(ai*, units_list, terrain_min_percent) 
	tomap(
		map( 
			units_list, 
			id 
		), 
		map( 
			units_list, 'unit', 
			unit_average_defense(
				ai, 
				unit, 
				terrain_min_percent 
			) 
		) 
	);

def units_average_defense(ai*, units_list, terrain_min_percent)
	sum(
		map( 
			units_list, 'unit', 
			unit_average_defense(
				ai, 
				unit, 
				terrain_min_percent 
			) 
		) 
	) /
	size(
		units_list
	);


# ==2== TODO: evaluate unit effectivness based on movement points and movement cost#


		#===== Evaluation of game state - how good is ai doing ===== #

# ==1== based on unit cost and current amount of gold #
# returns number between 0 and 100 where: 0 we are losing, 100 we are winning #

def units_cost_gold_eval(ai*)
	min(
		[
			(
				(
					sum(
						map(
							allies, 'team', 
							sum(
								map(
									units_of_side[team], 
									cost
								)
							) + 
							teams[team].gold 
						)
					) * 
					100
				) / 
				sum(
					map(
						enemies, 'team', 
						sum(
							map(
								units_of_side[team], 
								cost
							)
						) + 
						max(
							[teams[team].gold, 0]
						) 
					)
				)
			) / 2,
			100
		]
	);

# ==2== based on village possession #

def count_allied_villages(ai*)
	sum(
		map(
			allies, 'side', 
			size(
				villages_of_side[side]
			)
		)
	);

def count_enemy_villages(ai*)
	sum(
		map(
			enemies, 'side', 
			size(
				villages_of_side[side]
			)
		)
	);

# multipled by 1000 to increase precision #

def village_evaluation(ai*)
	(
		50000 + 
		(
			count_allied_villages(ai) - 
			count_enemy_villages(ai)
		) * 
		(
			50000 /
			size(
				villages
			)
		)
	) /
	1000;

# ==3== combined 2 of the above #

def eval(ai*)
	( 
		units_cost_gold_eval(ai) + 
		village_evaluation(ai)
	) / 
	2;

		#===== Evaluation how effective my units are against the enemy ===== #

#==1==  basic evaluation #

# evaluate how much damage unit can inflict - how much damage unit can get#

def evaluate_attacker_against_opponents(ai*, unit, enemy_units)
	sum( 
		map( 
			enemy_units, 'enemy_unit', 
			sum(
				map(
					[
						max_possible_damage_with_retaliation( unit, enemy_unit )
					],
					max(
						[
							self[0] - self[2],
							self[1] - self[3]
						]
					)
				) 
			)
		)
	);

def evaluate_defender_against_opponents(ai*, unit, enemy_units)
	-sum( 
		map( 
			enemy_units, 'enemy_unit', 
			sum(
				map(
					[
						max_possible_damage_with_retaliation( enemy_unit, unit )
					],
					max(
						[
							self[0] - self[2],
							self[1] - self[3]
						]
					)
				)
			)
		)
	);

def units_hp_map(ai*, units)
	tomap( 
		map(
			units, 
			id
		), 
		map( 
			units, 
			hitpoints
		)
	);

#in case side's gold is more than 50, add units that side can recruit to the side's unit list#

def create_side_unit_list(ai*, side)
	if( 
		teams[side].gold > 50, 
		recruits_of_side[side], 
		[]
	) + 
	units_of_side[side];

def evaluate_my_recruits_as_attackers(ai*)
	tomap( 
		map(
			my_recruits, 
			id
		), 
		map(
			my_recruits, 'my_unit',
			sum(
				map(
					enemies, 'enemy_side',
					evaluate_attacker_against_opponents(
						ai,
						my_unit,
						create_side_unit_list(
							ai, 
							enemy_side
						)
					)
				)
			)
		)
	);

def evaluate_my_recruits_as_defenders(ai*)
	tomap(
		map(
			my_recruits, 
			id
		),
		map( 
			my_recruits, 'my_unit',
			sum(
				map(
					enemies, 'enemy_side',
					evaluate_defender_against_opponents(
						ai,
						my_unit,
						create_side_unit_list(
							ai,
							enemy_side
						)
					)
				)
			)
		)
	);


# === 2 ===  now consider abilities and weapon specials  #

def abilities_weights()
	['skirmisher' -> 15, 'ambush' -> 10, 'nightstalk' -> 20, 'regenerates' -> 20, 'healing' -> 15, 'curing' -> 10, 'leadership' -> 20, 'illumination' -> 15, 'teleport' -> 10, 'steadfast' -> 15 ];

def weapon_specials_weights()
	[ 'backstab' -> 20 ,'slow' -> 10 ,'berserk' -> 20 ,'stones' -> 60 ,'plague' -> 10 ,'marksman' -> 30 ,'magical' -> 40 ,'charge' -> 30 ,'drains' -> 30,  'firststrike' -> 10, 'poison' -> 25 ];

def apply_abilities_weights( units_map )
	map( 
		units_map, 
		value +
		(
			value * 
			max(
				map(
					get_unit_type( key ).abilities, 'ability',
					abilities_weights()[ability]
				)
			)
		) / 100
	);

def apply_weapon_specials_weights( units_map )
	map(
		units_map, 
		value +
		(
			value *
			max(
				map(
					get_unit_type( key ).attacks, 'attack',
					vars.weapon_specials[attack.special]
				)
			)
		) / 100
	);

# since undead units don't get random traits and are balanced with that, we need to lower their evaluation a bit to match fairly the living units #

def undead_malus( units_map )
	map( 
		units_map, 
		if(
			get_unit_type(key).undead,
			( value * 90 ) / 100,
			value 
		)
	);

# === 3 ===  pit 1 and 2 together  #

def evaluate_attackers(ai*)
	change_numbers_to_percents(
		apply_abilities_weights(
			apply_weapon_specials_weights(
				undead_malus( 
					make_positive_only(
						evaluate_my_recruits_as_attackers( ai )	
					)
				)
			)
		)
	);

def evaluate_defenders(ai*)
	map(
		map(
			change_numbers_to_percents(
				apply_abilities_weights(
					apply_weapon_specials_weights(
						undead_malus( 
							make_positive_only(
								evaluate_my_recruits_as_defenders( ai )	
							)
						)
					)
				)
			),
			value / 3
		), 
		value +
		map(
			change_numbers_to_percents(
				units_hp_map(
					ai,
					my_recruits
				)
			),
		value * 2 / 3
		)[key]
	);

	#=========== we have evaluation of game state and units, time to combine them: ==========#
		#=========	recruitment_list_builder	=========#

def rlb_apply_eval(eval, attackers_map, defenders_map, offset)
	map(
		sumarize_maps_values(
			map(
				attackers_map, 
				value * (eval+offset)
			),
			map(
				defenders_map,
				value * ( (100 - eval) - offset )
			)
		),
		value / 100
	);

def rlb_remove_lowest( input_map, percent)
	filter(
		input_map, 
		value > 
		(
			(
				percent * sumarize_values(input_map)
			) / 100
		)
	);

def rlb_first_step(eval, attackers_map, defenders_map, offset)
	rlb_remove_lowest(
		rlb_apply_eval(
			eval,
			attackers_map,
			defenders_map,
			offset
		),
		10
	);

def recruitment_list_builder(eval, attackers_map, defenders_map)
	map(
		rlb_first_step(
			eval,
			attackers_map,
			defenders_map,
			40
		),
		(
			(
				value * 100
			) / 
			sumarize_values(
				rlb_first_step(
					eval,
					attackers_map,
					defenders_map,
					40
				)
			)
		)
	);

		# ========== choose the unit to recruit now ========= #

def unit_chooser(ai*,unit_map) 
	choose(
		keys(unit_map), 'unit_type',
		unit_map[unit_type] - 
		(
			(
				100 * 
				size(
					filter(
						my_units, 
						type = unit_type
					)
				)
			) / 
			size(my_units)
		)
	);

def unit_map_cost_filter(ai*, unit_map)
	filter( unit_map,
		get_unit_type(key).cost < my_side.gold
	);

		# ==========	Main formula section 	========== #

def initialize_weapon_specials_map(ai*)
	if(vars.weapon_specials_init != turn,
		[
			set_var('weapon_specials_init', turn),
			set_var('weapon_specials',
				map(
					weapon_specials_weights(),
					if( key = 'magical',
						units_average_defense(ai, enemy_units, 10),
						if( key = 'marksman',
							units_average_defense(ai, enemy_units, 10) - 10,
							value
						)
					)
				)
			)
		],
		[]
	);

def create_recruits_map(ai*)
	if(vars.recruits_map_creator != turn,
		[
			set_var('recruits_map_creator', turn ),
			set_var('recruits_map',
				debug_print('final unit evaluation: ', recruitment_list_builder(
					debug_print('current AI evaluation (0-100): ', eval(ai)),
					debug_print('attackers evaluation: ',evaluate_attackers(ai)),
					debug_print('defenders evaluation: ',evaluate_defenders(ai))
				))
			)
		],
		[]
	);

def castle_space(ai*)
	filter( map( castle_locs( my_leader.loc ), 'location', if( unit_at( location ), 1, 0 ) ), self = 0  ).size;

if(vars.turn_initialized = turn,
		if( my_leader.loc = nearest_keep( my_leader.loc ),
			if( 
				get_unit_type(
					choose(
						vars.recruits_map,
						-get_unit_type(key).cost
					).key
				).cost <
				my_side.gold,
				if( castle_space(self),
					recruit(debug_print(
						unit_chooser(
							self,
							unit_map_cost_filter(
								self,
								vars.recruits_map
							)
						)
					)),
					fallback()
				),
				fallback() 
			),
			if( my_leader.movement_left > 0,
				move( my_leader.loc, nearest_keep( my_leader.loc ) ),
				fallback()
			)
		),
	[set_var(debug_print('turn_initialized'), turn)] +
	initialize_weapon_specials_map(self) +
	create_recruits_map(self)
)

faiend
"
			[/team_formula]
		[/ai]
		[ai]
			villages_per_scout="8"
		[/ai]
	[/side]
[/replay_start]
[statistics]
	mid_scenario="yes"
	[scenario]
		scenario="2p - Weldyn Channel"
		[team]
			[recruits]
				Bowman="3"
				Fencer="1"
				Heavy Infantryman="3"
				Mage="1"
				Merman Fighter="1"
				Spearman="6"
			[/recruits]
			[recalls]
			[/recalls]
			[advances]
			[/advances]
			[deaths]
				Bowman="2"
				Heavy Infantryman="1"
				Mage="1"
				Merman Fighter="1"
				Spearman="4"
			[/deaths]
			[killed]
				Footpad="3"
				Gryphon Rider="1"
				Thief="3"
			[/killed]
			[attacks]
				[sequence]
					s00="1"
					s000="3"
					s0000="1"
					s001="2"
					s010="2"
					s011="1"
					s1="2"
					s100="1"
					s101="1"
					_num="30"
				[/sequence]
				[sequence]
					s00="3"
					s000="2"
					s001="1"
					s010="1"
					s011="1"
					s1="1"
					s10="1"
					s101="1"
					s11="2"
					s110="1"
					_num="40"
				[/sequence]
				[sequence]
					s1="1"
					_num="50"
				[/sequence]
				[sequence]
					s101="1"
					s111="1"
					_num="70"
				[/sequence]
			[/attacks]
			[defends]
				[sequence]
					s="2"
					_num="0"
				[/sequence]
				[sequence]
					s000="1"
					s001="1"
					s1="3"
					_num="30"
				[/sequence]
				[sequence]
					s="1"
					s0="5"
					s00="2"
					s001="2"
					s01="2"
					s011="1"
					s1="3"
					s10="1"
					s100="1"
					s110="1"
					s111="1"
					_num="40"
				[/sequence]
				[sequence]
					s001="1"
					s011="1"
					_num="50"
				[/sequence]
			[/defends]
			recruit_cost="233"
			recall_cost="0"
			damage_inflicted="398"
			damage_taken="384"
			expected_damage_inflicted="380578"
			expected_damage_taken="392671"
			turn_damage_inflicted="59"
			turn_damage_taken="53"
			turn_expected_damage_inflicted="59581"
			turn_expected_damage_taken="63372"
			save_id="Almogaver2"
		[/team]
		[team]
			[recruits]
				Footpad="7"
				Gryphon Rider="1"
				Thief="11"
			[/recruits]
			[recalls]
			[/recalls]
			[advances]
			[/advances]
			[deaths]
				Footpad="3"
				Gryphon Rider="1"
				Thief="3"
			[/deaths]
			[killed]
				Bowman="2"
				Heavy Infantryman="1"
				Mage="1"
				Merman Fighter="1"
				Spearman="4"
			[/killed]
			[attacks]
				[sequence]
					s00="1"
					_num="30"
				[/sequence]
				[sequence]
					s00="3"
					s000="1"
					s01="4"
					s011="2"
					s1="1"
					s100="3"
					s11="1"
					s111="1"
					_num="40"
				[/sequence]
				[sequence]
					s00="1"
					_num="50"
				[/sequence]
				[sequence]
					s01="1"
					s1="2"
					s10="1"
					s11="2"
					s110="1"
					s111="1"
					_num="60"
				[/sequence]
				[sequence]
					s011="1"
					s11="2"
					_num="70"
				[/sequence]
			[/attacks]
			[defends]
				[sequence]
					s="2"
					_num="0"
				[/sequence]
				[sequence]
					s00="1"
					_num="30"
				[/sequence]
				[sequence]
					s0="1"
					s000="1"
					_num="40"
				[/sequence]
				[sequence]
					s00="1"
					s10="1"
					s111="1"
					_num="50"
				[/sequence]
				[sequence]
					s="3"
					s00="3"
					s01="5"
					s010="1"
					s11="6"
					_num="60"
				[/sequence]
				[sequence]
					s100="2"
					s110="1"
					s111="2"
					_num="70"
				[/sequence]
			[/defends]
			recruit_cost="265"
			recall_cost="0"
			damage_inflicted="384"
			damage_taken="398"
			expected_damage_inflicted="392671"
			expected_damage_taken="380578"
			turn_damage_inflicted="11"
			turn_damage_taken="17"
			turn_expected_damage_inflicted="14640"
			turn_expected_damage_taken="8340"
			save_id="KnightKunibert1"
		[/team]
	[/scenario]
[/statistics]
