label="zilo vs Odol 18.04.2009"
version="1.6"
completion="victory"
campaign_type="multiplayer"
difficulty="NORMAL"
random_seed="931179095"
random_calls="0"
next_underlying_unit_id="31"
end_text_duration="0"
[variables]
[/variables]
[replay]
	[command]
		[start]
		[/start]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Plaz has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="2"
			x="6"
			y="14"
		[/recruit]
		[random]
			value="1958203665"
		[/random]
		[random]
			value="1825959263"
		[/random]
		[random]
			value="1073730171"
		[/random]
		[random]
			value="1944082793"
		[/random]
		[random]
			value="1364453035"
		[/random]
		[random]
			value="1833928420"
		[/random]
		[random]
			value="1955128402"
		[/random]
		[random]
			value="2027278747"
		[/random]
		[random]
			value="885699732"
		[/random]
		[random]
			value="1409562875"
		[/random]
		[random]
			value="384113159"
		[/random]
		[random]
			value="1524804178"
		[/random]
		[random]
			value="753911062"
		[/random]
		[random]
			value="1258429869"
		[/random]
		[random]
			value="1174386992"
			[results]
				checksum="9CIQwCrz6RyeTTICy,HrVEsv8xKMwFuxzJDqOwQmKzmtMTEzPv,zPSmuOMoJAyLuJqKyRzLtHrjzLNtqqmLt5eGFJBAwBICTrpKGHCIsunwtfEIWcgGAO<cOO98<30k3"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="inferno has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="4"
			x="5"
			y="14"
		[/recruit]
		[random]
			value="2017342976"
		[/random]
		[random]
			value="984213479"
		[/random]
		[random]
			value="245599221"
		[/random]
		[random]
			value="216999920"
		[/random]
		[random]
			value="265592083"
		[/random]
		[random]
			value="1412674066"
		[/random]
		[random]
			value="1618284024"
		[/random]
		[random]
			value="1895946735"
		[/random]
		[random]
			value="2071327926"
		[/random]
		[random]
			value="1429004041"
		[/random]
		[random]
			value="1574422351"
		[/random]
		[random]
			value="997574450"
		[/random]
		[random]
			value="1225603186"
		[/random]
		[random]
			value="791391738"
		[/random]
		[random]
			value="684019222"
			[results]
				checksum="ixp,4nc1oNO<LLyKmJLIEhoF>vyBA6mszOAMDTywuzyODCrTtRLwFwmIsr1QENmxPFHFw.RFKFnqypNKqM8mwoFomIhFlq1.CL-<<ddBfkHDONNHvMSO1I9LGCHpACmL"
			[/results]
		[/random]
	[/command]
	[command]
		undo="no"
		[speak]
			id="Odol"
			message="GL&HF"
			side="2"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="0"
			x="5"
			y="13"
		[/recruit]
		[random]
			value="2121426477"
		[/random]
		[random]
			value="2114074691"
		[/random]
		[random]
			value="208371535"
		[/random]
		[random]
			value="1831973105"
		[/random]
		[random]
			value="782920642"
		[/random]
		[random]
			value="139971127"
		[/random]
		[random]
			value="1805386773"
		[/random]
		[random]
			value="1555343277"
		[/random]
		[random]
			value="9830455"
		[/random]
		[random]
			value="642116604"
		[/random]
		[random]
			value="1800942498"
		[/random]
		[random]
			value="226830375"
		[/random]
		[random]
			value="907708687"
		[/random]
		[random]
			value="1066132916"
		[/random]
		[random]
			value="1845114399"
			[results]
				checksum="DB6s-,zQn1M2yKQrtl,yvEJs-TqLAH7qSCNCNSvmIJ>KNGxwmIQwSVVvQLyBGFwuCzBR9PMVRCroPzMEKTmSKvvPnFtw-InBRSqBwbD3xFMMEJCCHO+YDPPnPywBn8FA"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="1"
			x="4"
			y="13"
		[/recruit]
		[random]
			value="1238002272"
		[/random]
		[random]
			value="1545689054"
		[/random]
		[random]
			value="2093806174"
		[/random]
		[random]
			value="1533329440"
		[/random]
		[random]
			value="453505403"
		[/random]
		[random]
			value="893362011"
		[/random]
		[random]
			value="435084022"
		[/random]
		[random]
			value="619751622"
		[/random]
		[random]
			value="867304840"
		[/random]
		[random]
			value="401675066"
		[/random]
		[random]
			value="828123157"
		[/random]
		[random]
			value="551794297"
		[/random]
		[random]
			value="1184595708"
		[/random]
		[random]
			value="968094284"
		[/random]
		[random]
			value="209697422"
			[results]
				checksum="ACIByNSVYtLXPemyRXKFwqFrLmVQqEv0TwtBGgNMvJHtOMFtHrtKmNzMnuxEPDq6BPSLFIOJqR+ProSyETFwFyA9EumVnpCouMKPBb5tJGPbmz3o>.fjcflW4p97m5p7"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Jarn has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="3"
			x="4"
			y="12"
		[/recruit]
		[random]
			value="902385867"
		[/random]
		[random]
			value="268210840"
		[/random]
		[random]
			value="154540649"
		[/random]
		[random]
			value="2029020659"
		[/random]
		[random]
			value="351321317"
		[/random]
		[random]
			value="2142092294"
		[/random]
		[random]
			value="86291342"
		[/random]
		[random]
			value="1225823533"
		[/random]
		[random]
			value="518695865"
		[/random]
		[random]
			value="1324293614"
		[/random]
		[random]
			value="624028939"
		[/random]
		[random]
			value="465018391"
		[/random]
		[random]
			value="710139406"
		[/random]
		[random]
			value="1077534343"
		[/random]
		[random]
			value="1358380402"
			[results]
				checksum="rQV6GBwD,UJ+7ePAQJ+xOoaC5U6DfS5lmb>+9w26zYBFaluj9yjnQ1omih>hik67n,e0IoZ07o9kcp0Ad568,m9n<X,+nY08797o60sxBFgnWEzrk-i.-tciji+H>s4C"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="luersa has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="1"
			x="5"
			y="12"
		[/recruit]
		[random]
			value="1346019758"
		[/random]
		[random]
			value="839693314"
		[/random]
		[random]
			value="1176465892"
		[/random]
		[random]
			value="176460850"
		[/random]
		[random]
			value="1691507341"
		[/random]
		[random]
			value="1422380079"
		[/random]
		[random]
			value="1381215966"
		[/random]
		[random]
			value="1303546406"
		[/random]
		[random]
			value="586943534"
		[/random]
		[random]
			value="136118185"
		[/random]
		[random]
			value="1571757246"
		[/random]
		[random]
			value="741484183"
		[/random]
		[random]
			value="17655196"
		[/random]
		[random]
			value="1923078564"
		[/random]
		[random]
			value="736092829"
			[results]
				checksum="ACIByNSVYrLXPemyRXKCwqFrLmVQqEv0TwtBGgNMvJHtOMFtHrtKmNzMnuxEPDq6BPSLFIOJqR+ProSyETFwFyA9CumVnpCouMKPBb5tJGPbmz3o>.fjcflW4pf7m5p7"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="4,4,4,5,5"
			y="11,10,9,9,8"
		[/move]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Rafik has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="zilo"
			message="u2"
			side="1"
		[/speak]
	[/command]
	[command]
		[recruit]
			value="6"
			x="22"
			y="17"
		[/recruit]
		[random]
			value="31820"
		[/random]
		[random]
			value="29958"
		[/random]
		[random]
			value="28115"
		[/random]
		[random]
			value="5676"
		[/random]
		[random]
			value="29140"
		[/random]
		[random]
			value="31216"
		[/random]
		[random]
			value="1237"
		[/random]
		[random]
			value="23850"
		[/random]
		[random]
			value="269"
		[/random]
		[random]
			value="1778"
		[/random]
		[random]
			value="30727"
		[/random]
		[random]
			value="22064"
		[/random]
		[random]
			value="14956"
		[/random]
		[random]
			value="6336"
		[/random]
		[random]
			value="1821"
			[results]
				checksum="J59kLNwuL-Q+<062sP>0636mC5373eQ6,a5n2j.dTe2hl89<fZ.a.g-4+XcWi.Xef>.1Xyja86>c+>fg4o.2cih1iXak6r,8m4,Z.v3Dnk4Yd84dfCd5sga,Y<,09k7r"
			[/results]
		[/random]
	[/command]
	[command]
		[recruit]
			value="4"
			x="23"
			y="17"
		[/recruit]
		[random]
			value="21610"
		[/random]
		[random]
			value="21375"
		[/random]
		[random]
			value="17425"
		[/random]
		[random]
			value="19485"
		[/random]
		[random]
			value="32034"
		[/random]
		[random]
			value="19276"
		[/random]
		[random]
			value="18192"
		[/random]
		[random]
			value="17195"
		[/random]
		[random]
			value="23059"
		[/random]
		[random]
			value="10081"
		[/random]
		[random]
			value="11865"
		[/random]
		[random]
			value="7675"
		[/random]
		[random]
			value="3563"
		[/random]
		[random]
			value="23620"
		[/random]
		[random]
			value="18087"
			[results]
				checksum="jfC5opl9mneud6314Hg106a+elObfd5dh>d-kgk5j40fd5c,laoh2>q4W68<jj1,,Bh1+4l10mji-+Ug681h64jGjKk7ELYl9YI95gAxGxnvPuSIVEH>yBMtLAwyHUER"
			[/results]
		[/random]
	[/command]
	[command]
		[recruit]
			value="4"
			x="23"
			y="16"
		[/recruit]
		[random]
			value="24254"
		[/random]
		[random]
			value="24724"
		[/random]
		[random]
			value="7971"
		[/random]
		[random]
			value="8308"
		[/random]
		[random]
			value="2550"
		[/random]
		[random]
			value="22466"
		[/random]
		[random]
			value="5977"
		[/random]
		[random]
			value="17872"
		[/random]
		[random]
			value="31272"
		[/random]
		[random]
			value="18325"
		[/random]
		[random]
			value="25314"
		[/random]
		[random]
			value="32110"
		[/random]
		[random]
			value="17120"
		[/random]
		[random]
			value="25597"
		[/random]
		[random]
			value="23101"
			[results]
				checksum="6hs5opl9mneud6314Hg106a+elObfd5dh>d-kgk5j40fd5c,laoh2>q4W68<jj1,,Bh1+4l10mji--Ug681h64jGjKk7ELbfXlO69>IPFNIDBGnoCSO3srDyLKztBCMx"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="22,22,22,22,22"
			y="14,13,12,11,10"
		[/move]
	[/command]
	[command]
		[recruit]
			value="4"
			x="20"
			y="8"
		[/recruit]
		[random]
			value="27881"
		[/random]
		[random]
			value="25825"
		[/random]
		[random]
			value="24501"
		[/random]
		[random]
			value="26803"
		[/random]
		[random]
			value="15417"
		[/random]
		[random]
			value="9554"
		[/random]
		[random]
			value="29051"
		[/random]
		[random]
			value="8025"
		[/random]
		[random]
			value="9380"
		[/random]
		[random]
			value="22080"
		[/random]
		[random]
			value="29282"
		[/random]
		[random]
			value="27344"
		[/random]
		[random]
			value="15355"
		[/random]
		[random]
			value="30281"
		[/random]
		[random]
			value="26208"
			[results]
				checksum="jfC5opl9mneud6314Hg106a+elObfd5dh>d-kgk5j40fd5c,laoh2>q4W68<jj1,,Bh1+4l10mji-+Ug681h64jGjKk7ELYl9YI95gAxGxnvPuSIVEH>yBMtLAwyHUER"
			[/results]
		[/random]
	[/command]
	[command]
		[recruit]
			value="1"
			x="21"
			y="9"
		[/recruit]
		[random]
			value="5407"
		[/random]
		[random]
			value="19261"
		[/random]
		[random]
			value="12703"
		[/random]
		[random]
			value="32250"
		[/random]
		[random]
			value="3416"
		[/random]
		[random]
			value="26910"
		[/random]
		[random]
			value="17052"
		[/random]
		[random]
			value="4194"
		[/random]
		[random]
			value="30276"
		[/random]
		[random]
			value="32049"
		[/random]
		[random]
			value="3100"
		[/random]
		[random]
			value="19445"
		[/random]
		[random]
			value="32655"
		[/random]
		[random]
			value="8326"
		[/random]
		[random]
			value="2752"
			[results]
				checksum="00J7>Z06rXgrZjiwa9d7cad.emOn+5f,-+.9cf<<+W1-4egW6m2jahna90i9fa3b.ld3k,h+bA1+Z4..>9<ImYcB->dd8+XYVckKYca0dYfE>bqAh-anyQoXDDBuuCLO"
			[/results]
		[/random]
	[/command]
	[command]
		[recruit]
			value="3"
			x="22"
			y="9"
		[/recruit]
		[random]
			value="12741"
		[/random]
		[random]
			value="13197"
		[/random]
		[random]
			value="24558"
		[/random]
		[random]
			value="22353"
		[/random]
		[random]
			value="1670"
		[/random]
		[random]
			value="22523"
		[/random]
		[random]
			value="10443"
		[/random]
		[random]
			value="32640"
		[/random]
		[random]
			value="5605"
		[/random]
		[random]
			value="24928"
		[/random]
		[random]
			value="30814"
		[/random]
		[random]
			value="5828"
		[/random]
		[random]
			value="25188"
		[/random]
		[random]
			value="22589"
		[/random]
		[random]
			value="17649"
			[results]
				checksum="H-Q.4kSV1kP6gOQR,wHJxusL-.Ekr06z8QM,E>N>OoNiAM-x,w+es6q9HO5BeFhCwtP2J9TQGVxuTw8SMUFUUA1FGHuc9g0x6zCvNjoC,6pf72FoLfpj9>yBpy8oZxof"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Nath has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[countdown_update]
			team="2"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[move]
			x="5,5,6,7,8,9"
			y="8,7,6,6,5,5"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="5,6,7,8,9,10"
			y="12,11,11,10,11,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="6,7,8,9,10,11"
			y="14,15,15,16,16,16"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="5,5,5,5,6,6,7"
			y="14,15,16,17,17,18,19"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="4,5,6,6,6,6"
			y="13,14,14,15,16,17"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="5,5,6,6,6,6,6,6"
			y="13,14,14,15,16,17,18,19"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="4,4,5,5,5,5"
			y="12,13,14,15,16,17"
		[/move]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		[move]
			x="21,20,19,18"
			y="9,9,10,10"
		[/move]
	[/command]
	[command]
		[move]
			x="18,17"
			y="10,11"
		[/move]
	[/command]
	[command]
		[move]
			x="17,17"
			y="11,12"
		[/move]
	[/command]
	[command]
		[move]
			x="23,22,21,20,19"
			y="16,16,17,16,17"
		[/move]
	[/command]
	[command]
		[move]
			x="23,23,23,23,24"
			y="17,18,19,20,20"
		[/move]
	[/command]
	[command]
		[move]
			x="22,21,21,20,19,18"
			y="17,18,19,19,20,20"
		[/move]
	[/command]
	[command]
		[move]
			x="20,20,20,20,20,21"
			y="8,7,6,5,4,4"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Lega_Nord has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="22,21,20,19"
			y="9,9,8,8"
		[/move]
	[/command]
	[command]
		[move]
			x="22,22,22,22,23"
			y="10,9,8,7,7"
		[/move]
	[/command]
	[command]
		[countdown_update]
			team="2"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="SI has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="knightheaven has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="BlackHero has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="9,9"
			y="5,4"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="6,7,7,7,8,8,9"
			y="19,20,21,22,22,23,24"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="6,6,7,8,9,10"
			y="17,18,19,19,20,20"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="5,6,6,7,8,9"
			y="17,17,18,19,19,20"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="7,7,6,5"
			y="19,20,20,21"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="10,10,10,10,11,12"
			y="10,11,12,13,14,14"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="11,11,12"
			y="16,17,17"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="MoaB has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="12,13,13,13"
			y="17,18,19,20"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Shikyo has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="13,13"
			y="20,21"
		[/move]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		[move]
			x="21,20,19,18"
			y="4,3,3,2"
		[/move]
	[/command]
	[command]
		[move]
			x="24,23,22,22,21,20,19"
			y="20,21,21,22,23,23,24"
		[/move]
	[/command]
	[command]
		[move]
			x="19,18,17,16"
			y="8,7,8,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Zeaux has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="ZeusTheTrueGod has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Rrr has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="23,22,21,20"
			y="7,7,8,8"
		[/move]
	[/command]
	[command]
		[recruit]
			value="5"
			x="21"
			y="9"
		[/recruit]
		[random]
			value="18173"
		[/random]
		[random]
			value="28726"
		[/random]
		[random]
			value="5930"
		[/random]
		[random]
			value="871"
		[/random]
		[random]
			value="152"
		[/random]
		[random]
			value="21432"
		[/random]
		[random]
			value="2285"
		[/random]
		[random]
			value="29057"
		[/random]
		[random]
			value="9050"
		[/random]
		[random]
			value="32381"
		[/random]
		[random]
			value="16573"
		[/random]
		[random]
			value="19960"
		[/random]
		[random]
			value="32132"
		[/random]
		[random]
			value="12180"
		[/random]
		[random]
			value="17402"
			[results]
				checksum="SU39RsGPnopbtoBBs5yPBdjCxIoyMyJsCAbPtOQpxQRNpnMsQGGGqEpPQwrEETo0BNqQDyBuEICFSQFuTGrqGKJbRBzNpHETGFOwJPvMPJFf8IBNyQOKRJUZDRgOWmID"
			[/results]
		[/random]
	[/command]
	[command]
		[recruit]
			value="4"
			x="22"
			y="9"
		[/recruit]
		[random]
			value="21375"
		[/random]
		[random]
			value="25857"
		[/random]
		[random]
			value="17374"
		[/random]
		[random]
			value="19980"
		[/random]
		[random]
			value="22624"
		[/random]
		[random]
			value="10039"
		[/random]
		[random]
			value="30700"
		[/random]
		[random]
			value="31247"
		[/random]
		[random]
			value="21265"
		[/random]
		[random]
			value="13623"
		[/random]
		[random]
			value="25844"
		[/random]
		[random]
			value="14886"
		[/random]
		[random]
			value="6277"
		[/random]
		[random]
			value="504"
		[/random]
		[random]
			value="7321"
			[results]
				checksum="jfC5opl9pneud6314Hg106a+elObfd5dh>d-kgk5j40fd5c,laoh2>q4W68<jj1,,Bh1+4l10mji-0Ug681h64jGjKk7ELYl9YI95gAxGxnvPuSVVEH>yBMtLAwyHUqR"
			[/results]
		[/random]
	[/command]
	[command]
		[countdown_update]
			team="2"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Anni has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="9,9,9,8"
			y="4,5,6,6"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="AD_42 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="1"
			x="9"
			y="6"
		[/recruit]
		[random]
			value="679223503"
		[/random]
		[random]
			value="930718351"
		[/random]
		[random]
			value="1887714887"
		[/random]
		[random]
			value="949570491"
		[/random]
		[random]
			value="1738933931"
		[/random]
		[random]
			value="922327518"
		[/random]
		[random]
			value="879175235"
		[/random]
		[random]
			value="1083630982"
		[/random]
		[random]
			value="58781945"
		[/random]
		[random]
			value="83643117"
		[/random]
		[random]
			value="762940610"
		[/random]
		[random]
			value="642655796"
		[/random]
		[random]
			value="98282836"
		[/random]
		[random]
			value="102680785"
		[/random]
		[random]
			value="1390945275"
			[results]
				checksum="ACIByNSVYmLXPemyRXKFwqFrLmVQqEv0TwtBGgNMvJHtOMFtHrtKmNzMnuxEPDq6BPSLFIOJqR+ProSyETFwFyA9zumVnpCouMKPBb5oJGPbmz3o>.fjcflW4pf7m5p7"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="13,13,14,14"
			y="21,22,22,23"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="mathieu has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Xaoc has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Lucifer_Sam has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Athrun has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="14,13,12,11,10"
			y="23,24,23,24,23"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="10,10,10,11,12"
			y="20,21,22,23,23"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="9,10,10,10,11"
			y="20,20,21,22,23"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="9,10,11"
			y="24,24,24"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="5,6,7,8,9,9,10"
			y="21,21,22,22,23,24,24"
		[/move]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="1"
			value="243000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		[move]
			x="16,15"
			y="7,7"
		[/move]
	[/command]
	[command]
		[move]
			x="15,16"
			y="7,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Forget has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="18,17,16,15,14"
			y="2,3,3,3,2"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Benn has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Anni has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="17,16,15,14,13"
			y="12,12,12,12,13"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="VULVOR_FEVER has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="19,18,18,18,17,16"
			y="17,16,15,14,14,13"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="syc has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="22,22,21,20,19,18"
			y="9,10,11,11,12,12"
		[/move]
	[/command]
	[command]
		[move]
			x="21,20,19,18"
			y="9,9,10,10"
		[/move]
	[/command]
	[command]
		[move]
			x="20,19,19,18,18"
			y="8,9,10,10,11"
		[/move]
	[/command]
	[command]
		[recruit]
			value="4"
			x="17"
			y="13"
		[/recruit]
		[random]
			value="23985"
		[/random]
		[random]
			value="11569"
		[/random]
		[random]
			value="30292"
		[/random]
		[random]
			value="22390"
		[/random]
		[random]
			value="5153"
		[/random]
		[random]
			value="15575"
		[/random]
		[random]
			value="27074"
		[/random]
		[random]
			value="25679"
		[/random]
		[random]
			value="19817"
		[/random]
		[random]
			value="12743"
		[/random]
		[random]
			value="26588"
		[/random]
		[random]
			value="5504"
		[/random]
		[random]
			value="28832"
		[/random]
		[random]
			value="30731"
		[/random]
		[random]
			value="2201"
			[results]
				checksum="6hs5opl9pneud6314Hg106a+elObfd5dh>d-kgk5j40fd5c,laoh2>q4W68<jj1,,Bh1+4l10mji0WUg681h64jGjKk7ELbfXlO69>IPFNIDBGnoCSO3srDyLKztBBJx"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="EvilMaster has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[countdown_update]
			team="2"
			value="255000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[move]
			x="9,10,11"
			y="6,6,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="0"
			x="9"
			y="6"
		[/recruit]
		[random]
			value="763348261"
		[/random]
		[random]
			value="1323891272"
		[/random]
		[random]
			value="827433112"
		[/random]
		[random]
			value="2097842334"
		[/random]
		[random]
			value="1165101889"
		[/random]
		[random]
			value="1308951704"
		[/random]
		[random]
			value="284526219"
		[/random]
		[random]
			value="47389650"
		[/random]
		[random]
			value="215647772"
		[/random]
		[random]
			value="158410764"
		[/random]
		[random]
			value="1949960938"
		[/random]
		[random]
			value="1997779882"
		[/random]
		[random]
			value="531316980"
		[/random]
		[random]
			value="903496154"
		[/random]
		[random]
			value="1704661622"
			[results]
				checksum="DB6s-,zQn1M2yKRrtl,yvEJs+TqLAH7qSCNCNSvmIJ>KNGxwmIQwSVVvQLyBGFwuCzBR9PMVRCroPzMEKTmSKvvPnFtw-JnBRSqBwbD3xFMMEJCCHO+YDPPnPywBn8EE"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="tetta has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="8,8,8"
			y="6,7,8"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="12,11,10"
			y="14,15,15"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="DeadKing has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="10,10,10"
			y="15,14,13"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="10,11,12,13,14"
			y="23,24,24,24,24"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="12,13,14,15"
			y="23,24,24,25"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="14,14"
			y="24,25"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="14,13"
			y="25,26"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="10,11,12,13"
			y="24,25,24,25"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="11,11,11,12"
			y="24,25,26,26"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="11,11,11,12"
			y="23,24,25,25"
		[/move]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="1"
			value="257000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Gollum has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="18,18,19,19,19,19"
			y="12,13,14,15,16,17"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Balint831 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="13,13,12,12,11"
			y="13,14,14,15,16"
		[/move]
	[/command]
	[command]
		[move]
			x="16,15,14,13,12,11,10"
			y="13,14,14,15,14,15,14"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="10"
				y="14"
			[/source]
			[destination]
				x="10"
				y="13"
			[/destination]
		[/attack]
		[random]
			value="31287"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="29523"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="14625"
			[results]
				chance="50"
				damage="11"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="8976"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="426"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="30326"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="18,17,16,15,14,13,12"
			y="11,12,12,13,13,14,14"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="raccoon337 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="18,18,17,17,16"
			y="10,11,12,13,13"
		[/move]
	[/command]
	[command]
		[move]
			x="17,18,19,19,20"
			y="13,13,14,15,15"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Ronin has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[countdown_update]
			team="2"
			value="261000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[move]
			x="8,7,6,6,5,4"
			y="8,9,9,10,11,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="1"
			x="6"
			y="14"
		[/recruit]
		[random]
			value="1458173158"
		[/random]
		[random]
			value="2000678761"
		[/random]
		[random]
			value="321153553"
		[/random]
		[random]
			value="1125921294"
		[/random]
		[random]
			value="311896937"
		[/random]
		[random]
			value="441846085"
		[/random]
		[random]
			value="2095548501"
		[/random]
		[random]
			value="94410346"
		[/random]
		[random]
			value="1300975967"
		[/random]
		[random]
			value="534827383"
		[/random]
		[random]
			value="760986170"
		[/random]
		[random]
			value="206326995"
		[/random]
		[random]
			value="1192126811"
		[/random]
		[random]
			value="1971428197"
		[/random]
		[random]
			value="1926815821"
			[results]
				checksum="ACIByNSVYrLXPemyRXKCwqFrLmVQqEv0TwtBGgNMvJHtOMFtHrtKmNzMnuxEPDq6BPSLFIOJqR+ProSyETFwFyA9CumVnpCouMKPBb5TJGPbmz3o>.fjcflW4p97m5p7"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="elvenbane has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="10,10,10,10"
			y="13,12,11,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="9,9,9"
			y="6,5,4"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Horatiu has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="7tenz has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="kkk has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Jequ has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="KafkaTamura has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="15,15"
			y="25,24"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="13,14,15"
			y="26,25,25"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="12,13,14,15,16,17"
			y="26,26,25,26,26,27"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="12,13,14"
			y="25,26,25"
		[/move]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="1"
			value="207000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		[move]
			x="12,11,10"
			y="14,15,15"
		[/move]
	[/command]
	[command]
		[recruit]
			value="4"
			x="10"
			y="16"
		[/recruit]
		[random]
			value="20706"
		[/random]
		[random]
			value="7484"
		[/random]
		[random]
			value="16717"
		[/random]
		[random]
			value="32114"
		[/random]
		[random]
			value="17640"
		[/random]
		[random]
			value="23557"
		[/random]
		[random]
			value="27304"
		[/random]
		[random]
			value="11644"
		[/random]
		[random]
			value="6323"
		[/random]
		[random]
			value="31784"
		[/random]
		[random]
			value="25071"
		[/random]
		[random]
			value="16859"
		[/random]
		[random]
			value="26943"
		[/random]
		[random]
			value="27846"
		[/random]
		[random]
			value="18316"
			[results]
				checksum="6hs5opl9mneud6314Hg106a+elObfd5dh>d-kgk5j40fd5c,laoh2>q4W68<jj1,,Bh1+4l10mji--Ug681h64jGjKk7ELbfXlO69>IPFNIDBGnoCSO3srDyLKztBCMx"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Leon has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[recruit]
			value="4"
			x="11"
			y="15"
		[/recruit]
		[random]
			value="31989"
		[/random]
		[random]
			value="9065"
		[/random]
		[random]
			value="5417"
		[/random]
		[random]
			value="32258"
		[/random]
		[random]
			value="218"
		[/random]
		[random]
			value="6430"
		[/random]
		[random]
			value="8990"
		[/random]
		[random]
			value="11556"
		[/random]
		[random]
			value="30123"
		[/random]
		[random]
			value="3135"
		[/random]
		[random]
			value="19517"
		[/random]
		[random]
			value="17541"
		[/random]
		[random]
			value="10392"
		[/random]
		[random]
			value="29837"
		[/random]
		[random]
			value="19280"
			[results]
				checksum="6hs5opl9mneud6314Hg106a+elObfd5dh>d-kgk5j40fd5c,laoh2>q4W68<jj1,,Bh1+4l10mji0YUg681h64jGjKk7ELbfXlO69>IPFNIDBGnBCSO3srDyLKztBBHx"
			[/results]
		[/random]
	[/command]
	[command]
		[recruit]
			value="4"
			x="12"
			y="14"
		[/recruit]
		[random]
			value="25730"
		[/random]
		[random]
			value="7536"
		[/random]
		[random]
			value="20421"
		[/random]
		[random]
			value="9180"
		[/random]
		[random]
			value="7939"
		[/random]
		[random]
			value="23863"
		[/random]
		[random]
			value="4559"
		[/random]
		[random]
			value="27615"
		[/random]
		[random]
			value="26069"
		[/random]
		[random]
			value="20589"
		[/random]
		[random]
			value="29801"
		[/random]
		[random]
			value="21916"
		[/random]
		[random]
			value="8511"
		[/random]
		[random]
			value="11405"
		[/random]
		[random]
			value="19508"
			[results]
				checksum="6hs5opl9mneud6314Hg106a+elObfd5dh>d-kgk5j40fd5c,laoh2>q4W68<jj1,,Bh1+4l10mji0YUg681h64jGjKk7ELbfXlO69>IPFNIDBGnBCSO3srDyLKztBBHx"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="16,15,15,14"
			y="13,14,15,15"
		[/move]
	[/command]
	[command]
		[move]
			x="10,10,10,9,9"
			y="14,13,12,12,11"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="9"
				y="11"
			[/source]
			[destination]
				x="10"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="21157"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="31567"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="13862"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="11381"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="19697"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="15709"
			[results]
				chance="50"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Hercon has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="16,15,14,13,12,11"
			y="7,8,8,9,9,10"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="11"
				y="10"
			[/source]
			[destination]
				x="10"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="21134"
			[results]
				chance="60"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="26743"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="12922"
			[results]
				chance="60"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="5143"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="29664"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="30367"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="hisoka has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="qop has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="19,20,21,21,21"
			y="17,17,18,19,20"
		[/move]
	[/command]
	[command]
		[move]
			x="20,20,21,22,22,22"
			y="15,16,17,17,18,19"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="hisoka has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[countdown_update]
			team="2"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="q has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="1"
			x="5"
			y="12"
		[/recruit]
		[random]
			value="1170762166"
		[/random]
		[random]
			value="189357306"
		[/random]
		[random]
			value="560566814"
		[/random]
		[random]
			value="451718303"
		[/random]
		[random]
			value="42723692"
		[/random]
		[random]
			value="835353183"
		[/random]
		[random]
			value="1113683877"
		[/random]
		[random]
			value="1716583056"
		[/random]
		[random]
			value="1546384723"
		[/random]
		[random]
			value="956623882"
		[/random]
		[random]
			value="1642589990"
		[/random]
		[random]
			value="584923936"
		[/random]
		[random]
			value="157293307"
		[/random]
		[random]
			value="597824152"
		[/random]
		[random]
			value="1934486048"
			[results]
				checksum="ACIByNSVYmLXPemyRXKFwqFrLmVQqEv0TwtBGgNMvJHtOMFtHrtKmNzMnuxEPDq6BPSLFIOJqR+ProSyETFwFyA9zumVnpCouMKPBb5OJGPbmz3o>.fjcflW4p97m5p7"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="shan has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Mamut has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="9,10,11,12,13"
			y="4,3,3,3,3"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="13"
				y="3"
			[/source]
			[destination]
				x="14"
				y="2"
			[/destination]
		[/attack]
		[random]
			value="1426859974"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="2004981507"
			[results]
				chance="50"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="921116184"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1783031599"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="MagicRabbit has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Nordmann has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="11,12,13,14"
			y="7,6,7,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="14,15"
			y="7,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="kit has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="4,5,6,7,8"
			y="11,12,11,11,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="8"
				y="10"
			[/source]
			[destination]
				x="9"
				y="11"
			[/destination]
		[/attack]
		[random]
			value="184962313"
			[results]
				chance="70"
				damage="8"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1176931202"
			[results]
				chance="70"
				damage="8"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Balanceguardian has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="6,6,7"
			y="14,13,13"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="7,7,8"
			y="13,12,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="10"
				y="10"
			[/source]
			[destination]
				x="11"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="459609303"
			[results]
				chance="40"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="300067650"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="607498134"
			[results]
				chance="40"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="899071146"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1574974778"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="13,14,15,16,17,18,19"
			y="25,25,26,26,26,25,25"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="19"
				y="25"
			[/source]
			[destination]
				x="19"
				y="24"
			[/destination]
		[/attack]
		[random]
			value="582257088"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="221050355"
			[results]
				chance="70"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="474511394"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="15,16,17,18"
			y="25,24,24,23"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="18"
				y="23"
			[/source]
			[destination]
				x="19"
				y="24"
			[/destination]
		[/attack]
		[random]
			value="1330401590"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="489781095"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="14,15,16,17,18"
			y="25,26,25,25,24"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="18"
				y="24"
			[/source]
			[destination]
				x="19"
				y="24"
			[/destination]
		[/attack]
		[random]
			value="1295080755"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="898243378"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="15,16,17,18,19"
			y="24,23,23,22,23"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="19"
				y="23"
			[/source]
			[destination]
				x="19"
				y="24"
			[/destination]
		[/attack]
		[random]
			value="1004237963"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="480587364"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1017124449"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="17,17,17,16,15"
			y="27,26,25,24,24"
		[/move]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="1"
			value="229000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="EvilMaster has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="22,22,22,22,21,20"
			y="19,20,21,22,23,23"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="20"
				y="23"
			[/source]
			[destination]
				x="19"
				y="23"
			[/destination]
		[/attack]
		[random]
			value="7914"
			[results]
				chance="60"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1549"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="23980"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="9555"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="7311"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="25568"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="21,21,21,20"
			y="20,21,22,22"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="20"
				y="22"
			[/source]
			[destination]
				x="19"
				y="23"
			[/destination]
		[/attack]
		[random]
			value="336"
			[results]
				chance="60"
				damage="10"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="17813"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="13444"
			[results]
				chance="60"
				damage="10"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="6562"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="12374"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="2921"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Msc_2 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="18,18,18"
			y="20,21,22"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="18"
				y="22"
			[/source]
			[destination]
				x="19"
				y="23"
			[/destination]
		[/attack]
		[random]
			value="22070"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="3219"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="28030"
			[results]
				chance="60"
				damage="6"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="19"
				y="24"
			[/source]
			[destination]
				x="19"
				y="25"
			[/destination]
		[/attack]
		[random]
			value="1859"
			[results]
				chance="60"
				damage="10"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="17842"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="22799"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="inferno has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="niu has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="11,12,13,13,12,11"
			y="10,9,9,8,7,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Ilmrik has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="xxx has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="14"
				y="2"
			[/source]
			[destination]
				x="13"
				y="3"
			[/destination]
		[/attack]
		[random]
			value="31317"
			[results]
				chance="50"
				damage="10"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="9106"
			[results]
				chance="50"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="8137"
			[results]
				chance="50"
				damage="10"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="5685"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Black has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Pulsative has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="10,10,9,8,8,9,10"
			y="16,17,18,18,19,20,20"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Undertaker has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="12,12,12,12,11"
			y="14,13,12,11,11"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="11"
				y="11"
			[/source]
			[destination]
				x="10"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="32108"
			[results]
				chance="40"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1414"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="4811"
			[results]
				chance="40"
				damage="9"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="11,11,10,10,10,10"
			y="15,14,13,12,11,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="zilo"
			message="you lucker"
			side="1"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="BoS_Garol has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="10,9,8,7,6"
			y="15,15,14,15,14"
		[/move]
	[/command]
	[command]
		[recruit]
			value="4"
			x="5"
			y="13"
		[/recruit]
		[random]
			value="5663"
		[/random]
		[random]
			value="13890"
		[/random]
		[random]
			value="21316"
		[/random]
		[random]
			value="27312"
		[/random]
		[random]
			value="25861"
		[/random]
		[random]
			value="20584"
		[/random]
		[random]
			value="27267"
		[/random]
		[random]
			value="1304"
		[/random]
		[random]
			value="16794"
		[/random]
		[random]
			value="21122"
		[/random]
		[random]
			value="19187"
		[/random]
		[random]
			value="9427"
		[/random]
		[random]
			value="16265"
		[/random]
		[random]
			value="24728"
		[/random]
		[random]
			value="11077"
			[results]
				checksum="jfC5opl9pneud6314Hg106a+elObfd5dh>d-kgk5j40fd5c,laoh2>q4W68<jj1,,Bh1+4l10mji-0Ug681h64jGjKk7ELYl9YI95gAxGxnvPuSVVEH>yBMtLAwyHUqR"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Darkweaver has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[recruit]
			value="4"
			x="5"
			y="14"
		[/recruit]
		[random]
			value="27292"
		[/random]
		[random]
			value="30982"
		[/random]
		[random]
			value="23603"
		[/random]
		[random]
			value="26205"
		[/random]
		[random]
			value="20480"
		[/random]
		[random]
			value="20766"
		[/random]
		[random]
			value="20574"
		[/random]
		[random]
			value="21698"
		[/random]
		[random]
			value="25438"
		[/random]
		[random]
			value="15778"
		[/random]
		[random]
			value="20539"
		[/random]
		[random]
			value="22834"
		[/random]
		[random]
			value="19767"
		[/random]
		[random]
			value="4319"
		[/random]
		[random]
			value="16753"
			[results]
				checksum="6hs5opl9mneud6314Hg106a+elObfd5dh>d-kgk5j40fd5c,laoh2>q4W68<jj1,,Bh1+4l10mji0YUg681h64jGjKk7ELbfXlO69>IPFNIDBGnBCSO3srDyLKztBBHx"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="6,5,4"
			y="14,15,15"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="inioch has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="TDW_Pom has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="giorgos has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="11,10,9,8,7"
			y="16,15,15,14,15"
		[/move]
	[/command]
	[command]
		[move]
			x="14,13,12,11"
			y="15,15,15,16"
		[/move]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="Odol"
			message="Sorry :P"
			side="2"
		[/speak]
	[/command]
	[command]
		[countdown_update]
			team="2"
			value="265000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[move]
			x="19,20"
			y="25,24"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="20"
				y="24"
			[/source]
			[destination]
				x="19"
				y="24"
			[/destination]
		[/attack]
		[random]
			value="242258313"
			[results]
				chance="70"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1661421475"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="827960537"
			[results]
				chance="70"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="15,16,17"
			y="24,23,23"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="17"
				y="23"
			[/source]
			[destination]
				x="18"
				y="22"
			[/destination]
		[/attack]
		[random]
			value="1914531289"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1938525833"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1979611581"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1352388675"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="bluey has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="18,19"
			y="23,23"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="19"
				y="23"
			[/source]
			[destination]
				x="18"
				y="22"
			[/destination]
		[/attack]
		[random]
			value="2039247171"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="2121832965"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Morpf has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="18,18"
			y="24,23"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="18"
				y="23"
			[/source]
			[destination]
				x="18"
				y="22"
			[/destination]
		[/attack]
		[random]
			value="471727146"
			[results]
				chance="60"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1570081250"
			[results]
				chance="60"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="zilo"
			message="..."
			side="1"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Masqurin has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="15,14,13,12"
			y="7,7,7,6"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="12"
				y="6"
			[/source]
			[destination]
				x="11"
				y="7"
			[/destination]
		[/attack]
		[random]
			value="1141905853"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1476672912"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="830132604"
			[results]
				chance="30"
				damage="8"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="229976903"
			[results]
				chance="30"
				damage="8"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="13,13,13,12,11,11"
			y="3,4,5,5,6,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="8,7,6,5,4"
			y="10,11,11,11,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="1"
			x="6"
			y="14"
		[/recruit]
		[random]
			value="1069486472"
		[/random]
		[random]
			value="550438738"
		[/random]
		[random]
			value="834620323"
		[/random]
		[random]
			value="1894340034"
		[/random]
		[random]
			value="119496816"
		[/random]
		[random]
			value="557781091"
		[/random]
		[random]
			value="1452649"
		[/random]
		[random]
			value="658453835"
		[/random]
		[random]
			value="1370422942"
		[/random]
		[random]
			value="125043225"
		[/random]
		[random]
			value="1126424999"
		[/random]
		[random]
			value="37808491"
		[/random]
		[random]
			value="1666048234"
		[/random]
		[random]
			value="536734957"
		[/random]
		[random]
			value="1812463185"
			[results]
				checksum="ACIByNSVYrLXPemyRXKCwqFrLmVQqEv0TwtBGgNMvJHtOMFtHrtKmNzMnuxEPDq6BPSLFIOJqR+ProSyETFwFyA9CumVnpCouMKPBb5TJGPbmz3o>.fjcflW4p97m5p7"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="4,4"
			y="11,12"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="4"
				y="12"
			[/source]
			[destination]
				x="5"
				y="13"
			[/destination]
		[/attack]
		[random]
			value="723562638"
			[results]
				chance="70"
				damage="8"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="532790327"
			[results]
				chance="70"
				damage="8"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="73255905"
			[results]
				chance="70"
				damage="8"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="198879230"
			[results]
				chance="70"
				damage="8"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="5,4,3,3,3,3"
			y="12,11,12,13,14,15"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="3"
				y="15"
			[/source]
			[destination]
				x="4"
				y="15"
			[/destination]
		[/attack]
		[random]
			value="2141710885"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="218106375"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1336973276"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1905181290"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1171269014"
			[results]
				chance="40"
				damage="8"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="19745133"
			[results]
				chance="40"
				damage="8"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="8,7,6,5"
			y="11,12,11,12"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="5"
				y="12"
			[/source]
			[destination]
				x="5"
				y="13"
			[/destination]
		[/attack]
		[random]
			value="1656514228"
			[results]
				chance="40"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1171079070"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="279257079"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1656587126"
			[results]
				chance="40"
				damage="8"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="2064500828"
			[results]
				chance="40"
				damage="5"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Ceoden_de_Rohan has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="14,13,12,11,10,9"
			y="2,3,3,4,3,4"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Mezriss has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="oneK has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="10,10,10,10,9"
			y="20,21,22,23,24"
		[/move]
	[/command]
	[command]
		[move]
			x="4,5,5,6,6,7,8"
			y="15,16,17,17,18,19,19"
		[/move]
	[/command]
	[command]
		[recruit]
			value="4"
			x="6"
			y="18"
		[/recruit]
		[random]
			value="20596"
		[/random]
		[random]
			value="658"
		[/random]
		[random]
			value="15432"
		[/random]
		[random]
			value="1572"
		[/random]
		[random]
			value="19969"
		[/random]
		[random]
			value="9930"
		[/random]
		[random]
			value="26948"
		[/random]
		[random]
			value="24971"
		[/random]
		[random]
			value="1799"
		[/random]
		[random]
			value="17227"
		[/random]
		[random]
			value="16707"
		[/random]
		[random]
			value="17473"
		[/random]
		[random]
			value="17672"
		[/random]
		[random]
			value="25635"
		[/random]
		[random]
			value="9839"
			[results]
				checksum="6hs5opl9pneud6314Hg106a+elObfd5dh>d-kgk5j40fd5c,laoh2>q4W68<jj1,,Bh1+4l10mji0WUg681h64jGjKk7ELbfXlO69>IPFNIDBGnoCSO3srDyLKztBBJx"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Soliton has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[recruit]
			value="4"
			x="7"
			y="19"
		[/recruit]
		[random]
			value="21965"
		[/random]
		[random]
			value="20240"
		[/random]
		[random]
			value="22213"
		[/random]
		[random]
			value="13848"
		[/random]
		[random]
			value="507"
		[/random]
		[random]
			value="14639"
		[/random]
		[random]
			value="31146"
		[/random]
		[random]
			value="8678"
		[/random]
		[random]
			value="22618"
		[/random]
		[random]
			value="8950"
		[/random]
		[random]
			value="18155"
		[/random]
		[random]
			value="9889"
		[/random]
		[random]
			value="24559"
		[/random]
		[random]
			value="14627"
		[/random]
		[random]
			value="13024"
			[results]
				checksum="6hs5opl9mneud6314Hg106a+elObfd5dh>d-kgk5j40fd5c,laoh2>q4W68<jj1,,Bh1+4l10mji0YUg681h64jGjKk7ELbfXlO69>IPFNIDBGnBCSO3srDyLKztBBHx"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="5,4"
			y="14,13"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="4"
				y="13"
			[/source]
			[destination]
				x="4"
				y="12"
			[/destination]
		[/attack]
		[random]
			value="16982"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="21657"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="4022"
			[results]
				chance="40"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="28808"
			[results]
				chance="40"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="7,8,8,8,8"
			y="15,15,16,17,18"
		[/move]
	[/command]
	[command]
		[move]
			x="10,9,8,7,6,6,5"
			y="10,10,10,10,9,8,8"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="exz has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Jarn has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="11,10"
			y="11,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="R has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="19"
				y="24"
			[/source]
			[destination]
				x="20"
				y="24"
			[/destination]
		[/attack]
		[random]
			value="29160"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="23065"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="24269"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="20"
				y="23"
			[/source]
			[destination]
				x="20"
				y="24"
			[/destination]
		[/attack]
		[random]
			value="19751"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="15772"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="6568"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="20,21,21"
			y="22,23,24"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="21"
				y="24"
			[/source]
			[destination]
				x="20"
				y="24"
			[/destination]
		[/attack]
		[random]
			value="26068"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="15993"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="29505"
			[results]
				chance="50"
				damage="8"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="18,18,18"
			y="22,21,20"
		[/move]
	[/command]
	[command]
		[countdown_update]
			team="2"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="mayu has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Pulsative has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="20,19"
			y="24,25"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="19"
				y="25"
			[/source]
			[destination]
				x="19"
				y="24"
			[/destination]
		[/attack]
		[random]
			value="2092588752"
			[results]
				chance="70"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1126448652"
			[results]
				chance="70"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="184471232"
			[results]
				chance="70"
				damage="9"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="18,18,19,20"
			y="23,24,25,24"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="20"
				y="24"
			[/source]
			[destination]
				x="20"
				y="23"
			[/destination]
		[/attack]
		[random]
			value="532968074"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="905281853"
			[results]
				chance="60"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="17,16,16,17"
			y="23,22,21,21"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="17"
				y="21"
			[/source]
			[destination]
				x="18"
				y="20"
			[/destination]
		[/attack]
		[random]
			value="877664395"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="2002807192"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="2101847722"
			[results]
				chance="50"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1207676476"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="gran has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="gerardryan has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="19,19"
			y="23,24"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="19"
				y="24"
			[/source]
			[destination]
				x="20"
				y="23"
			[/destination]
		[/attack]
		[random]
			value="1592211384"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="789877247"
			[results]
				chance="60"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="2030322345"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1044543084"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="2066480522"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="11,12,13,14,15,16"
			y="7,6,7,7,7,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="12,12,13,14,15,16"
			y="6,5,5,4,5,4"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="bigbug has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="zhoubug has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="4,5,6,7,8,9"
			y="12,12,11,11,10,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="9"
				y="10"
			[/source]
			[destination]
				x="10"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="1845306959"
			[results]
				chance="70"
				damage="8"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="613424326"
			[results]
				chance="70"
				damage="8"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="93538493"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="48255150"
			[results]
				chance="70"
				damage="8"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Moonie has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="6,7,7,8,9,9"
			y="14,14,13,12,12,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="9"
				y="11"
			[/source]
			[destination]
				x="10"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="1583014059"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="206107693"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="263749883"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="381173628"
			[results]
				chance="40"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="2110057625"
			[results]
				chance="40"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1504602041"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="EvilMaster has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="3,4,5,6,6,5"
			y="15,15,15,14,13,13"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="5"
				y="13"
			[/source]
			[destination]
				x="4"
				y="13"
			[/destination]
		[/attack]
		[random]
			value="1549693193"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1740382781"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1006679055"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1904039152"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1323206279"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1849365183"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="R has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="5,6,7,8,9,10"
			y="12,11,12,12,12,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="10"
				y="11"
			[/source]
			[destination]
				x="10"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="1275686934"
			[results]
				chance="40"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1420535345"
			[results]
				chance="60"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="267724473"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1336476694"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="617117651"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="631128958"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="10"
				y="10"
			[/source]
			[destination]
				x="9"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="20628"
			[results]
				chance="60"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="9434"
			[results]
				chance="40"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="28129"
			[results]
				chance="60"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="13159"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Shawer has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="5,6,7,7,8"
			y="8,8,9,10,10"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="8"
				y="10"
			[/source]
			[destination]
				x="9"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="7345"
			[results]
				chance="60"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="4425"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="11768"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="3376"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="9,9,9,10,11"
			y="4,5,6,6,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="er has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="MiErcale has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Shawer has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="6,6,5,5,5,5"
			y="18,17,17,16,15,14"
		[/move]
	[/command]
	[command]
		[move]
			x="7,6,6,6,6,6"
			y="19,18,17,16,15,14"
		[/move]
	[/command]
	[command]
		[move]
			x="11,11,11,10"
			y="16,15,14,13"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="darael has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="8,9,10,11,11,11,11,11,12"
			y="18,18,17,17,16,15,14,13,12"
		[/move]
	[/command]
	[command]
		[recruit]
			value="6"
			x="6"
			y="18"
		[/recruit]
		[random]
			value="29513"
		[/random]
		[random]
			value="20583"
		[/random]
		[random]
			value="20039"
		[/random]
		[random]
			value="556"
		[/random]
		[random]
			value="22115"
		[/random]
		[random]
			value="24764"
		[/random]
		[random]
			value="26788"
		[/random]
		[random]
			value="26685"
		[/random]
		[random]
			value="16116"
		[/random]
		[random]
			value="10239"
		[/random]
		[random]
			value="7226"
		[/random]
		[random]
			value="3233"
		[/random]
		[random]
			value="658"
		[/random]
		[random]
			value="32767"
		[/random]
		[random]
			value="3049"
			[results]
				checksum="J59kONwuL-Q+2062sP>0636mC5373eQ6,a5n2j.dTe2hl89<fZ.a.g-4+XcWi.Xef>.1Xyja86>c+>fg4o.2cih1iXao6r,8m4,Z.v3Dnk4Yd84dfCd5sga,Y<,09k7r"
			[/results]
		[/random]
	[/command]
	[command]
		[recruit]
			value="4"
			x="7"
			y="19"
		[/recruit]
		[random]
			value="29712"
		[/random]
		[random]
			value="30160"
		[/random]
		[random]
			value="7515"
		[/random]
		[random]
			value="13191"
		[/random]
		[random]
			value="20744"
		[/random]
		[random]
			value="1322"
		[/random]
		[random]
			value="31938"
		[/random]
		[random]
			value="27695"
		[/random]
		[random]
			value="9404"
		[/random]
		[random]
			value="2630"
		[/random]
		[random]
			value="262"
		[/random]
		[random]
			value="26587"
		[/random]
		[random]
			value="20110"
		[/random]
		[random]
			value="5006"
		[/random]
		[random]
			value="14649"
			[results]
				checksum="jfC5opl9pneud6314Hg106a+elObfd5dh>d-kgk5j40fd5c,laoh2>q4W68<jj1,,Bh1+4l10mji-0Ug681h64jGjKk7ELYl9YI95gAxGxnvPuSVVEH>yBMtLAwyHUqR"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="8,7,6,5"
			y="19,20,20,21"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="lina has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="20,21,22"
			y="23,23,22"
		[/move]
	[/command]
	[command]
		[move]
			x="21,21"
			y="24,23"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="18"
				y="20"
			[/source]
			[destination]
				x="17"
				y="21"
			[/destination]
		[/attack]
		[random]
			value="28445"
			[results]
				chance="50"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="24695"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1401"
			[results]
				chance="50"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="19907"
			[results]
				chance="50"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="31568"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Umberto has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Kajchi has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[countdown_update]
			team="2"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="17"
				y="21"
			[/source]
			[destination]
				x="18"
				y="20"
			[/destination]
		[/attack]
		[random]
			value="58878638"
			[results]
				chance="50"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1423326705"
			[results]
				chance="50"
				damage="6"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="19,19,20"
			y="25,24,23"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="20"
				y="23"
			[/source]
			[destination]
				x="21"
				y="23"
			[/destination]
		[/attack]
		[random]
			value="1142296361"
			[results]
				chance="70"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="408881780"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1526346079"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="20,19,19,18,18,18"
			y="24,24,23,22,21,20"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="19,19,18,18,19,20,21,22,23,24"
			y="24,23,22,21,21,20,20,20,20,20"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="exz has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="9"
				y="11"
			[/source]
			[destination]
				x="10"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="896646650"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="832857016"
			[results]
				chance="40"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="187538158"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="65263296"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="660996329"
			[results]
				chance="40"
				damage="5"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="CookieBite has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Dynasti has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="5,6,7,8"
			y="13,12,12,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="8"
				y="11"
			[/source]
			[destination]
				x="8"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="63211253"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1736631256"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1246732456"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="2080862494"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1363786807"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="340300702"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="inioch has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="9"
				y="10"
			[/source]
			[destination]
				x="8"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="264992849"
			[results]
				chance="70"
				damage="8"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="480806426"
			[results]
				chance="70"
				damage="8"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="10,10"
			y="11,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="16,17,18,19"
			y="7,8,7,8"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="16,17,18,19,20,21"
			y="4,4,4,4,4,4"
		[/move]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		[move]
			x="11,10,9,8,7,7,8"
			y="7,7,8,8,9,10,10"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="8"
				y="10"
			[/source]
			[destination]
				x="9"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="10290"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="13507"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="13956"
			[results]
				chance="60"
				damage="10"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="25333"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Neves has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="10,10,9"
			y="13,12,12"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="9"
				y="12"
			[/source]
			[destination]
				x="9"
				y="11"
			[/destination]
		[/attack]
		[random]
			value="4510"
			[results]
				chance="40"
				damage="8"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="25341"
			[results]
				chance="50"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="27580"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="26899"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="14143"
			[results]
				chance="50"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="5484"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="6,7,8,9,10,10"
			y="14,14,13,13,12,11"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="10"
				y="11"
			[/source]
			[destination]
				x="9"
				y="11"
			[/destination]
		[/attack]
		[random]
			value="25022"
			[results]
				chance="40"
				damage="9"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="R has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="21"
				y="23"
			[/source]
			[destination]
				x="20"
				y="23"
			[/destination]
		[/attack]
		[random]
			value="688"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="13596"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="2903"
			[results]
				chance="60"
				damage="10"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="22,21,20"
			y="22,22,22"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="20"
				y="22"
			[/source]
			[destination]
				x="20"
				y="23"
			[/destination]
		[/attack]
		[random]
			value="5094"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="20234"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="11277"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="7,7,7,7"
			y="19,18,17,16"
		[/move]
	[/command]
	[command]
		[move]
			x="6,7,8,9,10,10,10,10"
			y="18,18,17,17,16,15,14,13"
		[/move]
	[/command]
	[command]
		[move]
			x="5,6,7,8"
			y="14,13,13,12"
		[/move]
	[/command]
	[command]
		[move]
			x="4,5,5,6,7"
			y="13,13,12,11,11"
		[/move]
	[/command]
	[command]
		[countdown_update]
			team="2"
			value="261000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="a4 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Spectre has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="24,23,22,21,20,19,18,18,19"
			y="20,21,21,21,20,21,21,22,23"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="19"
				y="23"
			[/source]
			[destination]
				x="20"
				y="22"
			[/destination]
		[/attack]
		[random]
			value="1608020098"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1033990780"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1107171334"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1706579191"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1301364215"
			[results]
				chance="60"
				damage="5"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="20,21"
			y="23,24"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="21"
				y="24"
			[/source]
			[destination]
				x="21"
				y="23"
			[/destination]
		[/attack]
		[random]
			value="977268031"
			[results]
				chance="70"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1811308947"
			[results]
				chance="70"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="518266690"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="17,18,19,20,21,22,22"
			y="21,20,21,20,21,21,22"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="22"
				y="22"
			[/source]
			[destination]
				x="21"
				y="23"
			[/destination]
		[/attack]
		[random]
			value="931855739"
			[results]
				chance="40"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1364012531"
			[results]
				chance="40"
				damage="6"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="computerkranker has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="18,19,20,21,21,21"
			y="20,21,20,21,22,23"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="21,20,20,19,19,18"
			y="4,4,5,6,7,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="YouOnAStick has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="8,9"
			y="11,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="10,11,12"
			y="10,10,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="19,18,18,17,16,15,14"
			y="8,8,9,10,9,9,8"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="12,12"
			y="10,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="12"
				y="11"
			[/source]
			[destination]
				x="12"
				y="12"
			[/destination]
		[/attack]
		[random]
			value="48903273"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1861756701"
			[results]
				chance="40"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="572064720"
			[results]
				chance="40"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="9"
				y="11"
			[/source]
			[destination]
				x="10"
				y="11"
			[/destination]
		[/attack]
		[random]
			value="587894577"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="163748143"
			[results]
				chance="60"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="412637566"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="KnightK has logged into the lobby"
		[/speak]
	[/command]
	[command]
		undo="no"
		[speak]
			id="Odol"
			message="Nowhere to run :/"
			side="2"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="9,10,11,12"
			y="10,9,10,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="12,13"
			y="9,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="1"
			value="248000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Rainman has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="12,13,14,14,14,13"
			y="12,13,12,11,10,10"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="13"
				y="10"
			[/source]
			[destination]
				x="13"
				y="9"
			[/destination]
		[/attack]
		[random]
			value="31451"
			[results]
				chance="60"
				damage="4"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="zilo"
			message="if i could run i would win sure"
			side="1"
		[/speak]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="zilo"
			message="gg\"
			side="1"
		[/speak]
	[/command]
	[command]
		undo="no"
		[speak]
			id="Odol"
			message="GG"
			side="1"
		[/speak]
	[/command]
[/replay]
[snapshot]
[/snapshot]
[replay_start]
	current_tod="0"
	description="Players must traverse all manner of terrain in pursuit of victory on this multi-fronted duel map."
	experience_modifier="70"
	hash="cy9,5.FpN3rBcL.L4e+O18wLdEdI4Tz0IvgfbwAuK9N2059<42Xr0yhIQSuhssS,4T<A9.6ab>JpBPvMvrcHSQVHi2E+1XTwfH7D.FR+I29N,oCK6dipd3xe.OJ>Piko"
	id="multiplayer_Silverhead_Crossing"
	map_data="border_size=1
usage=map

Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Ww          , Ww          , Wo          , Ww          , Ww          , Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Wo          
Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Ww          , Wo          , Ww          , Ww          , Ww          , Ww          , Uh          , Xu          , Xu          , Ww          , Hh          , Wo          , Ww          , Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Wo          
Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Ww          , Ww          , Ww          , Gs^Fp       , Ww          , Xu          , Xu          , Gs^Fp       , Uu^Uf       , Uh          , Gs^Fp       , Mm          , Gg^Fet      , Ww          , Ww          , Ww          , Ww          , Ww          , Wo          , Ww          , Wo          , Wo          
Wo          , Wo          , Wo          , Wo          , Wo          , Wo          , Ww          , Ww          , Hh          , Gg          , Gg          , Gg          , Gg          , Uh          , Gg          , Gg          , Gg          , Ggf         , Gg          , Gg          , Gg          , Gs^Fp       , Hh          , Mm          , Gs^Fms      , Ww          , Ww          , Wo          , Wo          
Wo          , Wo          , Wo          , Wo          , Ww          , Wo          , Ww          , Mm          , Gs^Fms      , Gg^Ve       , Gg          , Gg          , Wwf         , Wwf         , Wwf         , Wo          , Wwf         , Gg          , Gg          , Gg          , Rr          , Gg^Vc       , Gg          , Wwf         , Chw         , Hh          , Gs^Fp       , Ww          , Wo          
Wo          , Wo          , Wo          , Wo          , Ww          , Ww          , Gg          , Wwf         , Wwf         , Wwf         , Wwf         , Wwf         , Gg          , Gs^Fp       , Xu          , Wwf         , Xu          , Wwf         , Wwf         , Gg          , Wwf         , Wwf         , Wwf         , Chw         , Rr          , Rr          , Wwf         , Ww          , Wo          
Wo          , Wo          , Wo          , Ww          , Ww          , Gs^Fp       , Rd          , Chw         , Kh          , Ch          , Gg          , Gg          , Rd          , Rd^Uf       , Uh          , Xu          , Xu          , Rd^Uf       , Xu          , Wwf         , Wwf         , Gg          , Gg          , Hh          , Hh          , Wwf         , Ww          , Ww          , Xu          
Wo          , Wo          , Wo          , Wo          , Gg          , Ggf         , Hh          , Mm          , Wwf         , Chw         , Rd          , Uu^Vud      , Uu          , Ur          , Uu^Uf       , Ur          , Gs^Fp       , Xu          , Rd          , Gg          , Wwf         , Gg          , Gg          , Gg^Ve       , Gg^Fet      , Wwf         , Gs^Fp       , Ww          , Xu          
Wo          , Wo          , Ww          , Ww          , Ww          , Gg^Ve       , Wwf         , Gg^Fet      , Wwf         , Ggf         , Xu          , Uu          , Xu          , Uu^Uf       , Wwf         , Uh          , Xu          , Rd          , Gg          , Gg^Ve       , Kh          , Wwf         , Gg          , Gg          , Xu          , Wwf         , Wwf         , Xu          , Xu          
Wo          , Wo          , Ww          , Ww          , Gg          , Wwf         , Gg          , Wwf         , Xu          , Xu          , Gg          , Xu          , Gg          , Gg          , Ww          , Gg          , Gg          , Xu          , Gg          , Gg          , Ww          , Chw         , Ch          , Gg          , Xu          , Xu          , Uh          , Xu          , Xu          
Ww          , Ww          , Ww          , Gg          , Gg          , Gs^Fds      , Gg          , Rd          , Gg          , Gg          , Gg^Vc       , Gg          , Gs^Fms      , Ww          , Wo          , Ww          , Ww          , Gg          , Wwf         , Wwf         , Gg          , Ww          , Kh          , Gg          , Rd          , Gs^Fp       , Rd          , Xu          , Xu          
Ww          , Ww          , Gg          , Gg          , 1 Kh        , Gg          , Rd          , Rd          , Mm          , Gs^Fp       , Gg          , Gg          , Gg          , Ww          , Wo          , Wo          , Ww          , Wwf         , Kh          , Gs^Fms      , Ggf         , Gg          , Gg          , Gg          , Hh          , Rd          , Gg          , Xu          , Xu          
Ww          , Ww          , Ggf         , Gg          , Ch          , Ch          , Ggf         , Gg          , Gg          , Hh          , Gg          , Gs^Fp       , Ww          , Ww          , Ww          , Ww          , Wwf         , Ss^Vhs      , Kh          , Gg          , Hh          , Gs^Fds      , Gg          , Mm          , Gg          , Gg          , Ww          , Gg          , Gg          
Ww          , Gg          , Gg          , Rd          , Ch          , Ch          , Gg          , Gg          , Gg          , Gg          , Hh          , Ww          , Wwf         , Wwf         , Rr          , Rr          , Chw         , Chw         , Wwf         , Gg          , Gg          , Gg          , Wwf         , Gg          , Wwf         , Gs^Fp       , Ww          , Ww          , Ww          
Ww          , Wwf         , Wwf         , Wwf         , Wwf         , Ch          , Kh          , Wwf         , Wwf         , Gg          , Wwf         , Wwf         , Chw         , Wwf         , Rr          , Wwf         , Wwf         , Wwf         , Gs^Fp       , Wwf         , Wwf         , Wwf         , 2 Kud       , Wwf         , Gg          , Wwf         , Ww          , Wo          , Wo          
Gs^Fds      , Gs^Fms      , Hh          , Gg          , Gg          , Wwf         , Wwf         , Wwf         , Gg          , Wwf         , Kh          , Chw         , Wwf         , Rr          , Mm          , Wwf         , Ww          , Ww          , Gg          , Gg          , Hh          , Gg          , Gg          , Cud         , Cud         , Gg          , Gg          , Ww          , Xu          
Rd          , Rd          , Rd          , Gg          , Rd          , Gg          , Gs^Fp       , Mm          , Hh          , Gg          , Kh          , Ss^Vhs      , Ww          , Ww          , Wo          , Ww          , Ww          , Ww          , Gg          , Gg          , Gg          , Mm          , Gg          , Kud         , Cud         , Rd          , Gg          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Rd          , Rd          , Rd          , Rd          , Gg          , Gg          , Wwf         , Wwf         , Ww          , Ww          , Ww          , Ww          , Ww          , Gs^Fms      , Ggf         , Gg^Ve       , Gs^Fds      , Gg          , Cud         , Cud         , Gg          , Rd          , Xu          , Xu          , Xu          
Xu          , Xu          , Uu^Uf       , Uu^Uf       , Uh          , Gg          , Kud         , Gg          , Wwf         , Wwf         , Xu          , Ww          , Hh          , Gs^Fp       , Gs^Fp       , Hh          , Ww          , Gg          , Hh          , Hh          , Xu          , Rd          , Rd          , Gg          , Rd          , Rd          , Gg          , Uu^Uf       , Uu^Uf       
Xu          , Xu          , Cud         , Wwf         , Xu          , Xu          , Wwf         , Cud         , Kud         , Xu          , Xu          , Xu          , Xu          , Cud         , Xu          , Cud         , Xu          , Xu          , Xu          , Xu          , Gs^Fp       , Gg          , Rd          , Rd          , Gg          , Gg          , Gs^Fp       , Xu          , Xu          
Xu          , Xu          , Cud         , Wwf         , Wwf         , Ww          , Gg          , Cud         , Rd          , Rd          , Uu^Vu       , Ur          , Uu^Uf       , Wwf^Uf      , Xu          , Wwf^Uf      , Uu^Uf       , Ur          , Uu^Vu       , Rd          , Rd          , Gg          , Rd          , Gg          , Uu^Vud      , Uu^Uf       , Cud         , Xu          , Xu          
Wwf         , Wwf         , Wwf         , Wwf         , Gs^Fp       , Gg^Vc       , Rd          , Rd          , Xu          , Ur          , Ur          , Uh          , Uh          , Wwf         , Wwf         , Wwf         , Uh          , Uh          , Ur          , Ur          , Xu          , Rd          , Gg          , Gg          , Gg          , Ur          , Cud         , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Gg          , Ggf         , Mm          , Rd          , Rd          , Xu          , Rd          , Xu          , Wwf         , Wwf         , Ggf         , Wwf         , Wwf         , Xu          , Rd          , Xu          , Rd          , Rd          , Kud         , Gg          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Hh          , Gs^Fp       , Gg          , Gg          , Rd          , Gg          , Gg          , Wwf         , Mm          , Gs^Fp       , Hh          , Gg          , Wwf         , Gg          , Rd          , Gg          , Cud         , Cud         , Cud         , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Rd^Uf       , Gg          , Gs^Fms      , Gg^Ve       , Gg          , Wwf         , Gg          , Gg          , Gg          , Gs^Fms      , Gg          , Wwf         , Gg          , Gg^Ve       , Gs^Fds      , Rd          , Rd^Uf       , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Ur          , Xu          , Xu          , Ggf         , Gg          , Wwf         , Gg          , Hh          , Gg          , Mm          , Hh          , Wwf         , Wwf         , Ggf         , Xu          , Xu          , Ur          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Ur          , Xu          , Rr          , Xu          , Wwf         , Wwf         , Gs^Fp       , Gg          , Xu          , Gg          , Gg          , Gg          , Wwf         , Xu          , Xu          , Ur          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Rr          , Wwf         , Chw         , Wwf         , Rr          , Ur          , Xu          , Uu^Uf       , Xu          , Ur          , Gs^Fp       , Rr          , Wwf         , Wwf         , Chw         , Wwf         , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Wwf         , Xu          , Xu          , Rr          , Rr          , Wwf         , Uh          , Wwf         , Uu^Uf       , Wwf         , Rr          , Rr          , Rr          , Rr          , Wwf         , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Wo          , Wwf         , Ur          , Wwf         , Wo          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Uh          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
"
	mp_countdown="yes"
	mp_countdown_action_bonus="13"
	mp_countdown_init_time="270"
	mp_countdown_reservoir_time="270"
	mp_countdown_turn_bonus="60"
	mp_fog="yes"
	mp_shroud="no"
	mp_use_map_settings="yes"
	mp_village_gold="2"
	name="2p - Silverhead Crossing"
	next_underlying_unit_id="0"
	objectives="Victory:
@Defeat enemy leader(s)"
	observer="yes"
	random_seed="931179095"
	random_start_time="no"
	scenario="ladder zilo's game"
	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="zilo"
		flag_rgb="magenta"
		fog="yes"
		gender="male"
		gold="100"
		id="zilo1"
		image="units/elves-wood/captain.png"
		income="0"
		leader="Elvish Captain,Elvish Hero,Elvish Ranger,Elvish Marksman,Elvish Druid,Elvish Sorceress,White Mage,Red Mage,Elder Wose"
		mp_countdown="yes"
		mp_countdown_action_bonus="13"
		mp_countdown_init_time="270"
		mp_countdown_reservoir_time="270"
		mp_countdown_turn_bonus="60"
		name="zilo"
		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"
		save_id="zilo1"
		share_maps="no"
		share_view="yes"
		shroud="no"
		side="1"
		team_name="west"
		terrain_liked="Ff, Fa, Ss, Ww"
		type="Red Mage"
		user_team_name="wesnoth-multiplayerteamname^West"
		village_gold="2"
		[ai]
			recruitment_pattern="fighter,fighter,archer,archer,mixed fighter,healer,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="Odol"
		flag_rgb="magenta"
		fog="yes"
		gender="male"
		gold="100"
		id="Odol2"
		image="units/orcs/warrior.png"
		income="0"
		leader="Orcish Warrior,Troll,Troll Rocklobber,Orcish Crossbowman,Orcish Slayer"
		mp_countdown="yes"
		mp_countdown_action_bonus="13"
		mp_countdown_init_time="270"
		mp_countdown_reservoir_time="270"
		mp_countdown_turn_bonus="60"
		name="Odol"
		recruit="Orcish Grunt,Troll Whelp,Wolf Rider,Orcish Archer,Orcish Assassin,Naga Fighter,Goblin Spearman"
		save_id="Odol2"
		share_maps="no"
		share_view="yes"
		shroud="no"
		side="2"
		team_name="east"
		terrain_liked="Hh, Ha, Mm, Ss"
		type="Orcish Slayer"
		user_team_name="wesnoth-multiplayerteamname^East"
		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]
[/replay_start]
[statistics]
	mid_scenario="yes"
	[scenario]
		scenario="2p - Silverhead Crossing"
		[team]
			[recruits]
				Naga Fighter="1"
				Orcish Assassin="1"
				Orcish Grunt="13"
				Troll Whelp="1"
				Wolf Rider="2"
			[/recruits]
			[recalls]
			[/recalls]
			[advances]
			[/advances]
			[deaths]
				Orcish Assassin="1"
				Orcish Grunt="7"
				Wolf Rider="1"
			[/deaths]
			[killed]
				Elvish Fighter="3"
				Red Mage="1"
			[/killed]
			[attacks]
				[sequence]
					s00="1"
					s01="1"
					s1="1"
					s10="1"
					s11="1"
					_num="40"
				[/sequence]
				[sequence]
					s00="2"
					s01="2"
					s11="1"
					s110="1"
					_num="50"
				[/sequence]
				[sequence]
					s00="1"
					s01="3"
					s1="1"
					s10="3"
					s11="2"
					s110="1"
					_num="60"
				[/sequence]
			[/attacks]
			[defends]
				[sequence]
					s="22"
					_num="0"
				[/sequence]
				[sequence]
					s0="1"
					s00="2"
					s01="2"
					s10="1"
					_num="40"
				[/sequence]
				[sequence]
					s00="2"
					s1="1"
					s10="2"
					_num="60"
				[/sequence]
			[/defends]
			recruit_cost="234"
			recall_cost="0"
			damage_inflicted="219"
			damage_taken="426"
			expected_damage_inflicted="235918"
			expected_damage_taken="457200"
			turn_damage_inflicted="4"
			turn_damage_taken="0"
			turn_expected_damage_inflicted="3898"
			turn_expected_damage_taken="1344"
			save_id="Odol2"
		[/team]
		[team]
			[recruits]
				Elvish Archer="2"
				Elvish Fighter="6"
				Elvish Scout="1"
				Elvish Shaman="1"
				Mage="1"
			[/recruits]
			[recalls]
			[/recalls]
			[advances]
			[/advances]
			[deaths]
				Elvish Fighter="3"
				Red Mage="1"
			[/deaths]
			[killed]
				Orcish Assassin="1"
				Orcish Grunt="7"
				Wolf Rider="1"
			[/killed]
			[attacks]
				[sequence]
					s011="1"
					_num="30"
				[/sequence]
				[sequence]
					s00="2"
					s000="1"
					s0000="1"
					s001="1"
					s0010="1"
					s0011="1"
					s011="1"
					s1000="1"
					s101="1"
					s11="1"
					s1100="1"
					_num="40"
				[/sequence]
				[sequence]
					s0010="1"
					s0100="1"
					s11="1"
					_num="50"
				[/sequence]
				[sequence]
					s00="1"
					s01="1"
					s010="1"
					s0100="1"
					s011="2"
					s11="1"
					s1111="1"
					_num="60"
				[/sequence]
				[sequence]
					s010="1"
					s100="1"
					s101="1"
					s11="2"
					s110="1"
					s1101="1"
					s111="1"
					s1111="1"
					_num="70"
				[/sequence]
			[/attacks]
			[defends]
				[sequence]
					s="1"
					s0="3"
					s000="1"
					s01="1"
					s10="1"
					_num="40"
				[/sequence]
				[sequence]
					s0001="1"
					s01="1"
					s10="1"
					s1010="1"
					_num="50"
				[/sequence]
				[sequence]
					s="1"
					s0="2"
					s1="3"
					s10="1"
					s1001="1"
					s1011="1"
					s11="1"
					s1110="1"
					_num="60"
				[/sequence]
			[/defends]
			recruit_cost="171"
			recall_cost="0"
			damage_inflicted="426"
			damage_taken="219"
			expected_damage_inflicted="457200"
			expected_damage_taken="235918"
			turn_damage_inflicted="41"
			turn_damage_taken="4"
			turn_expected_damage_inflicted="37135"
			turn_expected_damage_taken="14722"
			save_id="zilo1"
		[/team]
	[/scenario]
[/statistics]
