label="2p - Weldyn Channel Turn 11_Gauteamus"
version="1.6"
completion="victory"
campaign_type="multiplayer"
difficulty="NORMAL"
random_seed="69878872"
random_calls="0"
next_underlying_unit_id="24"
end_text_duration="0"
[variables]
[/variables]
[replay]
	[command]
		[start]
		[/start]
	[/command]
	[command]
		[recruit]
			value="3"
			x="17"
			y="4"
		[/recruit]
		[random]
			value="2047889528"
		[/random]
		[random]
			value="1133947586"
		[/random]
		[random]
			value="45088867"
		[/random]
		[random]
			value="871558871"
		[/random]
		[random]
			value="1181268658"
		[/random]
		[random]
			value="1608135847"
		[/random]
		[random]
			value="1957162501"
		[/random]
		[random]
			value="1852568520"
		[/random]
		[random]
			value="741625790"
		[/random]
		[random]
			value="1133125656"
		[/random]
		[random]
			value="283668701"
		[/random]
		[random]
			value="370991374"
		[/random]
		[random]
			value="1432246357"
		[/random]
		[random]
			value="2020855883"
		[/random]
		[random]
			value="1122762436"
			[results]
				checksum="80M696kdt17Q-aGPQ75eF4RIQSHu+GNvRCnIqFywJTCHmxqx1EwQVOxDmGODNOzCNSPAGPJpfzEDPJCs,8AqDwqDqPxMAuFRQxPzFwD4s97wU,890qvi7pTKIPwx3xSB"
			[/results]
		[/random]
	[/command]
	[command]
		[recruit]
			value="1"
			x="16"
			y="3"
		[/recruit]
		[random]
			value="774086923"
		[/random]
		[random]
			value="2039204552"
		[/random]
		[random]
			value="280803174"
		[/random]
		[random]
			value="547566408"
		[/random]
		[random]
			value="1022780988"
		[/random]
		[random]
			value="8693994"
		[/random]
		[random]
			value="395893824"
		[/random]
		[random]
			value="563290976"
		[/random]
		[random]
			value="1620914826"
		[/random]
		[random]
			value="296299704"
		[/random]
		[random]
			value="1697238563"
		[/random]
		[random]
			value="1666003693"
		[/random]
		[random]
			value="1167858576"
		[/random]
		[random]
			value="731023573"
		[/random]
		[random]
			value="1126655892"
			[results]
				checksum="KFLvyin74-,rpeaEvE02ij,1f-H<ltHpHl.4.Zv+KOuxJJEBpQwGOLzIDBBrtvLGpNIMjJxOsDGJKEAIFmsFKnyPOyvu3tJHxVzEnyVqOuyLwrBF>8AJxGsqutBis5-V"
			[/results]
		[/random]
	[/command]
	[command]
		[recruit]
			value="2"
			x="15"
			y="4"
		[/recruit]
		[random]
			value="593149382"
		[/random]
		[random]
			value="1214551845"
		[/random]
		[random]
			value="1784916391"
		[/random]
		[random]
			value="261859941"
		[/random]
		[random]
			value="259709506"
		[/random]
		[random]
			value="1608081138"
		[/random]
		[random]
			value="1412918871"
		[/random]
		[random]
			value="240115950"
		[/random]
		[random]
			value="787668747"
		[/random]
		[random]
			value="39522146"
		[/random]
		[random]
			value="131836855"
		[/random]
		[random]
			value="1068471921"
		[/random]
		[random]
			value="587088554"
		[/random]
		[random]
			value="1154617843"
		[/random]
		[random]
			value="1077165915"
			[results]
				checksum="dyxuTOJUoJO8HNrG4rKqKKyCcwwqoNtRxBzMHwQmPyQBpPAuOCIG6zNHsCQFqzuGzwKqqyuyKqqQ5RBJTuEm3frBwnBwBICTrpKGHCIsunwtfvIWc<MGO<7LH5>f.208"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Lucky has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[recruit]
			value="1"
			x="13"
			y="4"
		[/recruit]
		[random]
			value="287312105"
		[/random]
		[random]
			value="916571066"
		[/random]
		[random]
			value="1240373878"
		[/random]
		[random]
			value="1007089252"
		[/random]
		[random]
			value="1008360475"
		[/random]
		[random]
			value="488316025"
		[/random]
		[random]
			value="1600238634"
		[/random]
		[random]
			value="75428673"
		[/random]
		[random]
			value="125748768"
		[/random]
		[random]
			value="1862098575"
		[/random]
		[random]
			value="335138179"
		[/random]
		[random]
			value="1733829907"
		[/random]
		[random]
			value="1127533798"
		[/random]
		[random]
			value="575254129"
		[/random]
		[random]
			value="374015006"
			[results]
				checksum="KzLvyin74-,vpeaEvE02ij,1f-H<ltHpHl.4.Zv+KOuxJJEBpQwGOLzIDBBrtvLGpNIMjJxOsDGJKEAIFmsFKnyPOyzu3tJHxVzEnyVqOuyLwrBF>8AJxGsqutBis5-V"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="AdoA1 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[recruit]
			value="4"
			x="15"
			y="2"
		[/recruit]
		[random]
			value="552314085"
		[/random]
		[random]
			value="991883426"
		[/random]
		[random]
			value="21098675"
		[/random]
		[random]
			value="403517745"
		[/random]
		[random]
			value="40172810"
		[/random]
		[random]
			value="1298293116"
		[/random]
		[random]
			value="690829851"
		[/random]
		[random]
			value="956743876"
		[/random]
		[random]
			value="391183346"
		[/random]
		[random]
			value="1697919103"
		[/random]
		[random]
			value="1965104352"
		[/random]
		[random]
			value="879499372"
		[/random]
		[random]
			value="1150674090"
		[/random]
		[random]
			value="2040533025"
		[/random]
		[random]
			value="1005248140"
			[results]
				checksum="4zf1OSw,C7F>rbJjIs8AZ92.m<KzFBEHnuR73QRpoMa2r4.k-cpOaw87,.Y8Z.5ndaB-kwWvSlbAfbufC3iaj7hobd->Zhenk<>2fa5>ai01-b1+6Z+40CN5c8b.>X,4"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="15,14,13,13,13"
			y="3,3,4,5,6"
		[/move]
	[/command]
	[command]
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="d has logged into the lobby"
		[/speak]
	[/command]
	[command]
		undo="no"
		[speak]
			id="KnightKunibert"
			message="hf :-)"
			side="1"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="AdoA1 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Fredrik has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="fUmD1g has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="LaDCreator has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="2"
			x="17"
			y="19"
		[/recruit]
		[random]
			value="6942"
		[/random]
		[random]
			value="4752"
		[/random]
		[random]
			value="25427"
		[/random]
		[random]
			value="5871"
		[/random]
		[random]
			value="26846"
		[/random]
		[random]
			value="20861"
		[/random]
		[random]
			value="20044"
		[/random]
		[random]
			value="32265"
		[/random]
		[random]
			value="24005"
		[/random]
		[random]
			value="3431"
		[/random]
		[random]
			value="32495"
		[/random]
		[random]
			value="8767"
		[/random]
		[random]
			value="9473"
		[/random]
		[random]
			value="6489"
		[/random]
		[random]
			value="15977"
			[results]
				checksum="dyxuTOIUoJO8HNrG4rKqKKyCcwwqoNtRxBzMHwQmPyQBpPAuOCIG6zNHsCQFqzuGzwKqqyuyKqqT5RBJTuEm3frBwnBwBICTrpKGHCIsunwtfvIWc-MGO<7LH5>f<208"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="1"
			x="16"
			y="19"
		[/recruit]
		[random]
			value="5612"
		[/random]
		[random]
			value="6192"
		[/random]
		[random]
			value="20264"
		[/random]
		[random]
			value="230"
		[/random]
		[random]
			value="30697"
		[/random]
		[random]
			value="32155"
		[/random]
		[random]
			value="15882"
		[/random]
		[random]
			value="4891"
		[/random]
		[random]
			value="28670"
		[/random]
		[random]
			value="10115"
		[/random]
		[random]
			value="12056"
		[/random]
		[random]
			value="988"
		[/random]
		[random]
			value="8506"
		[/random]
		[random]
			value="7057"
		[/random]
		[random]
			value="1259"
			[results]
				checksum="KzLvyin74-,vpeaEvE02ij,1f-H<ltHpHl.4.Zv+KOuxJJEBpQwGOLzIDBBrtvLGpNIMjJxOsDGJKEAIFmsFKnyPOyzu3tJHxVzEnyVqOuyLwrBF>8AJxGsqutBis5-V"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Jah-works has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="5"
			x="13"
			y="19"
		[/recruit]
		[random]
			value="8954"
		[/random]
		[random]
			value="27035"
		[/random]
		[random]
			value="23372"
		[/random]
		[random]
			value="7407"
		[/random]
		[random]
			value="7569"
		[/random]
		[random]
			value="28153"
		[/random]
		[random]
			value="23819"
		[/random]
		[random]
			value="10593"
		[/random]
		[random]
			value="2155"
		[/random]
		[random]
			value="11549"
		[/random]
		[random]
			value="4038"
		[/random]
		[random]
			value="29434"
		[/random]
		[random]
			value="28548"
		[/random]
		[random]
			value="28774"
		[/random]
		[random]
			value="3952"
			[results]
				checksum="dfk10b5br.kQp.+wk<Ab-239eel1N5llg71o3Xl17<1,5g7Z-k6kZlaGnZ68p4>gn6n3e1iafnb5+9fo4>73a+>+.57mc,6d1edjnNmi-f,a8gbj.r.awWGe+,PQ3hpQ"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Sys has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="4"
			x="15"
			y="19"
		[/recruit]
		[random]
			value="21331"
		[/random]
		[random]
			value="23607"
		[/random]
		[random]
			value="16974"
		[/random]
		[random]
			value="3571"
		[/random]
		[random]
			value="28857"
		[/random]
		[random]
			value="30967"
		[/random]
		[random]
			value="2423"
		[/random]
		[random]
			value="27513"
		[/random]
		[random]
			value="7517"
		[/random]
		[random]
			value="2211"
		[/random]
		[random]
			value="27120"
		[/random]
		[random]
			value="10976"
		[/random]
		[random]
			value="3835"
		[/random]
		[random]
			value="11671"
		[/random]
		[random]
			value="29168"
			[results]
				checksum="4zf1OSw,C7F>rbJjCs8AZ92.m<LzFBEHnuR73QRpoMa2r4.k-cpOaw87,.Y8Z.5ndaB-kwWvSlbAfbufC3iaj7hobd->Zhetk<>2fa5>ai01-b1+6Z+40CN5c8b.>X,4"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="4"
			x="14"
			y="19"
		[/recruit]
		[random]
			value="5132"
		[/random]
		[random]
			value="13971"
		[/random]
		[random]
			value="30107"
		[/random]
		[random]
			value="9498"
		[/random]
		[random]
			value="28551"
		[/random]
		[random]
			value="26998"
		[/random]
		[random]
			value="1075"
		[/random]
		[random]
			value="7630"
		[/random]
		[random]
			value="18745"
		[/random]
		[random]
			value="32054"
		[/random]
		[random]
			value="8627"
		[/random]
		[random]
			value="2386"
		[/random]
		[random]
			value="20448"
		[/random]
		[random]
			value="19944"
		[/random]
		[random]
			value="16616"
			[results]
				checksum="3Cf1OSv,C7F>rbJjRs8AZ92.m<LzFBEHnuR73QRpoMa2r4.k-cpOaw87,.Y8Z.5ndaB-kwWvSlbAfbufC3iaj7hobd->Zheuk<>2fa5>ai01-b1+6Z+40CN5c8b.>X,4"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="15,16,17,17,17"
			y="20,19,19,18,17"
		[/move]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="2"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		[move]
			x="13,12,11,10,9,8,7"
			y="4,3,3,2,2,2,2"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="ilP has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="16,17,18,19,20,21,22"
			y="3,4,4,5,5,5,5"
		[/move]
	[/command]
	[command]
		[move]
			x="15,16,17,18,19,19"
			y="4,4,5,5,6,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="Gauteamus"
			message="above all; not too much zeal!"
			side="2"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="scram has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="NBA has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="17,18,19,20,21,22,23,24"
			y="4,4,4,3,3,2,3,2"
		[/move]
	[/command]
	[command]
		[move]
			x="15,15,16,17,18,19,20,21"
			y="2,3,3,4,4,5,5,6"
		[/move]
	[/command]
	[command]
		[move]
			x="13,13,13"
			y="6,5,4"
		[/move]
	[/command]
	[command]
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[move]
			x="15,14,13,12,12,11"
			y="19,18,18,17,16,16"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="14,13,12,11,10,9,8"
			y="19,19,18,18,17,18,17"
		[/move]
	[/command]
	[command]
		undo="no"
		[speak]
			id="KnightKunibert"
			message="what ?"
			side="1"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="13,12,11,10,9,8,7,6"
			y="19,18,18,17,17,16,16,15"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="17,18,19,20,21,22,23,24"
			y="19,18,18,17,17,16,16,15"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Katastrosha has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="16,17,18,19,20,21"
			y="19,20,20,21,20,20"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Lokii has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="17,17,18,18,18,18"
			y="17,16,15,14,13,12"
		[/move]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="2"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		[move]
			x="7,7,7,7,7,7,6"
			y="2,3,4,5,6,7,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Bohrlochschlaemme has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Krone has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Soban has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="susbus has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="24,23,23,23,23"
			y="2,3,4,5,6"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Misiek has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="23,23"
			y="6,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="DolaX has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="meganoob has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="Gauteamus"
			message="hehe, that was the ancient family motto of Talleyrand, the french diplomat during the napoleonic wars"
			side="2"
		[/speak]
	[/command]
	[command]
		[move]
			x="23,23"
			y="7,8"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="imiliaan has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="19,20,21,22,23,24"
			y="7,6,7,7,7,7"
		[/move]
	[/command]
	[command]
		[move]
			x="22,22,22,22,23,24"
			y="5,6,7,8,9,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="winiar has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="21,22,22,23,24"
			y="6,6,7,8,8"
		[/move]
	[/command]
	[command]
		[recruit]
			value="4"
			x="17"
			y="4"
		[/recruit]
		[random]
			value="1425310039"
		[/random]
		[random]
			value="2067398350"
		[/random]
		[random]
			value="193001145"
		[/random]
		[random]
			value="1536301462"
		[/random]
		[random]
			value="1462807037"
		[/random]
		[random]
			value="269392965"
		[/random]
		[random]
			value="1881629267"
		[/random]
		[random]
			value="960553942"
		[/random]
		[random]
			value="2076999549"
		[/random]
		[random]
			value="89062206"
		[/random]
		[random]
			value="1823187760"
		[/random]
		[random]
			value="995490686"
		[/random]
		[random]
			value="1459709285"
		[/random]
		[random]
			value="866121459"
		[/random]
		[random]
			value="482179864"
			[results]
				checksum="3Cf1OSw,C7F>rbJjDs8AZ92.m<KzFBEHnuR73QRpoMa2r4.k-cpOaw87,.Y8Z.5ndaB-kwWvSlbAfbufC3iaj7hobd->Zhesk<>2fa5>ai01-b1+6Z+40CN5c8b.>X,4"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="13,14,15,16,17,18"
			y="4,4,5,5,6,6"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="edyta has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[move]
			x="11,12,13,13,14,15,16"
			y="16,16,17,18,18,19,19"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="8,8,7,6,6"
			y="17,18,19,19,20"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="18,18,18,18,18,18"
			y="12,13,14,15,16,17"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="6,6,6,6"
			y="15,14,13,12"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="6,6,6"
			y="12,11,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="6,6,6"
			y="10,11,12"
		[/move]
	[/command]
	[command]
		undo="no"
		[speak]
			id="KnightKunibert"
			message="ok ... :-)"
			side="1"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="21,21,21,21,21,20"
			y="20,19,18,17,16,15"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="24,24,24,24"
			y="15,14,13,12"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="24,24,24,24"
			y="12,13,14,15"
		[/move]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="2"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		[move]
			x="23,23,23"
			y="8,9,10"
		[/move]
	[/command]
	[command]
		[move]
			x="23,23"
			y="10,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="makavel has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Nubie has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="DolaX has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Moskito has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="24,24,24,24,23,22"
			y="9,10,11,12,13,13"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="tishbe has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="23,22,21"
			y="11,11,12"
		[/move]
	[/command]
	[command]
		[move]
			x="21,20"
			y="12,12"
		[/move]
	[/command]
	[command]
		[move]
			x="24,24,23,23,22,21,21"
			y="8,9,10,11,11,12,13"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Velensk has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="24,24,24,24,23,23,22"
			y="7,8,9,10,11,12,12"
		[/move]
	[/command]
	[command]
		[move]
			x="17,18,19,20,21,22,22,22"
			y="4,4,5,5,6,6,7,8"
		[/move]
	[/command]
	[command]
		[move]
			x="18,17,16,15,14,13"
			y="6,6,5,5,4,4"
		[/move]
	[/command]
	[command]
		[recruit]
			value="4"
			x="17"
			y="4"
		[/recruit]
		[random]
			value="2013251428"
		[/random]
		[random]
			value="408044714"
		[/random]
		[random]
			value="787038987"
		[/random]
		[random]
			value="1812575065"
		[/random]
		[random]
			value="1509372179"
		[/random]
		[random]
			value="2135006785"
		[/random]
		[random]
			value="698618192"
		[/random]
		[random]
			value="2053567082"
		[/random]
		[random]
			value="860896973"
		[/random]
		[random]
			value="554855425"
		[/random]
		[random]
			value="1706913181"
		[/random]
		[random]
			value="932001451"
		[/random]
		[random]
			value="456342671"
		[/random]
		[random]
			value="1682570842"
		[/random]
		[random]
			value="2020244666"
			[results]
				checksum="4zf1OSw,C7F>rbJjCs8AZ92.m<LzFBEHnuR73QRpoMa2r4.k-cpOaw87,.Y8Z.5ndaB-kwWvSlbAfbufC3iaj7hobd->Zhetk<>2fa5>ai01-b1+6Z+40CN5c8b.>X,4"
			[/results]
		[/random]
	[/command]
	[command]
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[move]
			x="18,18,17"
			y="17,18,19"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Jah-works has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="16,17,17,17,18,19"
			y="19,19,18,17,16,16"
		[/move]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="4"
			x="15"
			y="19"
		[/recruit]
		[random]
			value="19964"
		[/random]
		[random]
			value="3192"
		[/random]
		[random]
			value="11254"
		[/random]
		[random]
			value="20569"
		[/random]
		[random]
			value="24458"
		[/random]
		[random]
			value="28185"
		[/random]
		[random]
			value="14971"
		[/random]
		[random]
			value="10200"
		[/random]
		[random]
			value="30758"
		[/random]
		[random]
			value="20025"
		[/random]
		[random]
			value="1657"
		[/random]
		[random]
			value="16384"
		[/random]
		[random]
			value="30600"
		[/random]
		[random]
			value="17351"
		[/random]
		[random]
			value="26872"
			[results]
				checksum="3Cf1OSw,C7F>rbJjDs8AZ92.m<KzFBEHnuR73QRpoMa2r4.k-cpOaw87,.Y8Z.5ndaB-kwWvSlbAfbufC3iaj7hobd->Zhesk<>2fa5>ai01-b1+6Z+40CN5c8b.>X,4"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="rosta has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="4"
			x="16"
			y="19"
		[/recruit]
		[random]
			value="9340"
		[/random]
		[random]
			value="17749"
		[/random]
		[random]
			value="19465"
		[/random]
		[random]
			value="4325"
		[/random]
		[random]
			value="14682"
		[/random]
		[random]
			value="5391"
		[/random]
		[random]
			value="5152"
		[/random]
		[random]
			value="27662"
		[/random]
		[random]
			value="461"
		[/random]
		[random]
			value="20774"
		[/random]
		[random]
			value="13768"
		[/random]
		[random]
			value="17036"
		[/random]
		[random]
			value="5173"
		[/random]
		[random]
			value="32655"
		[/random]
		[random]
			value="1015"
			[results]
				checksum="3Cf1OSw,C7F>rbJjDs8AZ92.m<KzFBEHnuR73QRpoMa2r4.k-cpOaw87,.Y8Z.5ndaB-kwWvSlbAfbufC3iaj7hobd->Zhesk<>2fa5>ai01-b1+6Z+40CN5c8b.>X,4"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="5"
			x="15"
			y="20"
		[/recruit]
		[random]
			value="745"
		[/random]
		[random]
			value="11120"
		[/random]
		[random]
			value="20919"
		[/random]
		[random]
			value="9088"
		[/random]
		[random]
			value="13242"
		[/random]
		[random]
			value="14331"
		[/random]
		[random]
			value="31580"
		[/random]
		[random]
			value="13312"
		[/random]
		[random]
			value="26671"
		[/random]
		[random]
			value="15871"
		[/random]
		[random]
			value="32613"
		[/random]
		[random]
			value="25823"
		[/random]
		[random]
			value="8414"
		[/random]
		[random]
			value="11081"
		[/random]
		[random]
			value="1471"
			[results]
				checksum="dfk10b5br.kQp.+wk<Ab-239eel1N5llg71o3Xl17<1,5g7Z-k6kZlaGnZ68p4>gn6n3e1iafnb5+9fo4>73a+>+.57mc,6d1edjnNmi-f,a8gbj.r.awWGe+,PQ3hpQ"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="tishbe has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="6,6,6,6,6,6"
			y="20,19,18,17,16,15"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="6,6,6,7,8"
			y="12,11,10,10,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="17-0 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="8,9"
			y="9,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="9,10"
			y="9,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="6,6"
			y="15,14"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Sparhawk has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Alcapter has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="17,18,19,20"
			y="19,18,18,17"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="20,21"
			y="15,16"
		[/move]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="2"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		[move]
			x="21,22,23,24,25,25"
			y="13,12,13,13,14,15"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="25"
				y="15"
			[/source]
			[destination]
				x="24"
				y="15"
			[/destination]
		[/attack]
		[random]
			value="1261602828"
			[results]
				chance="70"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1379292040"
			[results]
				chance="60"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="184961834"
			[results]
				chance="70"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1859451937"
			[results]
				chance="60"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="554570392"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1203971782"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Sparhawk has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Joep has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="22,22,22,22,23,24,24,24"
			y="8,9,10,11,12,12,13,14"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="24"
				y="14"
			[/source]
			[destination]
				x="24"
				y="15"
			[/destination]
		[/attack]
		[random]
			value="363251597"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1080993997"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1460840802"
			[results]
				chance="70"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="537384142"
			[results]
				chance="60"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1951524066"
			[results]
				chance="70"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1946043350"
			[results]
				chance="60"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="22,22,23"
			y="13,14,15"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="1"
			[source]
				x="23"
				y="15"
			[/source]
			[destination]
				x="24"
				y="15"
			[/destination]
		[/attack]
		[random]
			value="1464362972"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1798393172"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1270944032"
			[results]
				chance="60"
				damage="6"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="22,22,23,23,24"
			y="12,13,14,15,15"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="doubleclicker has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="ME4 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="20,21"
			y="12,13"
		[/move]
	[/command]
	[command]
		[move]
			x="17,18,19,20,21,22,22"
			y="4,4,5,5,6,6,7"
		[/move]
	[/command]
	[command]
		[recruit]
			value="4"
			x="17"
			y="4"
		[/recruit]
		[random]
			value="640815216"
		[/random]
		[random]
			value="1504655489"
		[/random]
		[random]
			value="273625183"
		[/random]
		[random]
			value="2119648368"
		[/random]
		[random]
			value="1368261973"
		[/random]
		[random]
			value="551575474"
		[/random]
		[random]
			value="712522549"
		[/random]
		[random]
			value="1433521458"
		[/random]
		[random]
			value="2050522337"
		[/random]
		[random]
			value="1942148756"
		[/random]
		[random]
			value="366580861"
		[/random]
		[random]
			value="1329867100"
		[/random]
		[random]
			value="1749879022"
		[/random]
		[random]
			value="625936348"
		[/random]
		[random]
			value="1014251182"
			[results]
				checksum="4zf1OSv,C7F>rbJjGs8AZ92.m<LzFBEHnuR73QRpoMa2r4.k-cpOaw87,.Y8Z.5ndaB-kwWvSlbAfbufC3iaj7hobd->Zhepk<>2fa5>ai01-b1+6Z+40CN5c8b.>X,4"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Timbauns has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Sparhawk has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Santiago has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="13,13,13,12,11"
			y="4,5,6,6,7"
		[/move]
	[/command]
	[command]
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[move]
			x="16,17,18,19,20,21,22,23"
			y="19,19,18,18,17,17,16,16"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="23"
				y="16"
			[/source]
			[destination]
				x="23"
				y="15"
			[/destination]
		[/attack]
		[random]
			value="22459"
			[results]
				chance="70"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="20288"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="21239"
			[results]
				chance="70"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="19,20,21,22"
			y="16,15,15,14"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="22"
				y="14"
			[/source]
			[destination]
				x="23"
				y="15"
			[/destination]
		[/attack]
		[random]
			value="12265"
			[results]
				chance="70"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="8759"
			[results]
				chance="70"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="26542"
			[results]
				chance="70"
				damage="9"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="BazBaz has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="oblak has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="21,21,22,22"
			y="16,15,14,13"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="1"
			[source]
				x="22"
				y="13"
			[/source]
			[destination]
				x="21"
				y="13"
			[/destination]
		[/attack]
		[random]
			value="7532"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="13399"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="8435"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="6614"
			[results]
				chance="60"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="6516"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="29390"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="dethtoll has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="15,16,16,17,18,18,19,19"
			y="19,18,17,17,16,15,15,14"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="apocalipserocks has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="15,16,17,18,19,20,21,22"
			y="20,19,19,18,18,17,17,16"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="20,20,20,20,20"
			y="17,16,15,14,13"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="20"
				y="13"
			[/source]
			[destination]
				x="21"
				y="13"
			[/destination]
		[/attack]
		[random]
			value="3946"
			[results]
				chance="60"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="24644"
			[results]
				chance="70"
				damage="1"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="5698"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="8601"
			[results]
				chance="70"
				damage="1"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="20910"
			[results]
				chance="60"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="14644"
			[results]
				chance="70"
				damage="1"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="15797"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="9958"
			[results]
				chance="60"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Ulrok has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Samuel has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="6,7,8,8,9,10,11"
			y="14,15,15,16,17,17,18"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="10,10,9,9,8,8,8,8"
			y="9,10,11,12,12,13,14,15"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="smoh has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="2"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Jgrobin has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="22,22,22,22,21,21,20"
			y="7,8,9,10,11,12,12"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="20"
				y="12"
			[/source]
			[destination]
				x="20"
				y="13"
			[/destination]
		[/attack]
		[random]
			value="580025423"
			[results]
				chance="70"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1953259271"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="358199973"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1612333929"
			[results]
				chance="40"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1116971476"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1576583867"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1101526169"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1780947664"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Noob_Brasil has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="CAMPEON-WESNOTH has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="21,21,21,21,21,21,21,21,22"
			y="13,12,11,10,9,8,7,6,5"
		[/move]
	[/command]
	[command]
		[move]
			x="24,24,24,23,22,21,21"
			y="14,13,12,12,11,12,13"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="21"
				y="13"
			[/source]
			[destination]
				x="20"
				y="13"
			[/destination]
		[/attack]
		[random]
			value="2112883935"
			[results]
				chance="70"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="545851034"
			[results]
				chance="40"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="739883543"
			[results]
				chance="70"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1018246931"
			[results]
				chance="40"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="816510121"
			[results]
				chance="70"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="596799072"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="2007071554"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="148446738"
			[results]
				chance="40"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="25,25,25,24,23,22,22,21"
			y="15,16,17,17,18,18,19,20"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="24"
				y="15"
			[/source]
			[destination]
				x="23"
				y="16"
			[/destination]
		[/attack]
		[random]
			value="1049767307"
			[results]
				chance="60"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1955623709"
			[results]
				chance="60"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="2033018707"
			[results]
				chance="60"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1167147016"
			[results]
				chance="60"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1022684123"
			[results]
				chance="60"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="17,18,19,20,21,22,22"
			y="4,4,5,5,6,6,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Xaviul has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="11,12,13,13,13"
			y="7,6,6,5,4"
		[/move]
	[/command]
	[command]
		[recruit]
			value="4"
			x="17"
			y="4"
		[/recruit]
		[random]
			value="480812122"
		[/random]
		[random]
			value="114140228"
		[/random]
		[random]
			value="1470327434"
		[/random]
		[random]
			value="783659412"
		[/random]
		[random]
			value="1365827452"
		[/random]
		[random]
			value="1404166710"
		[/random]
		[random]
			value="715703972"
		[/random]
		[random]
			value="588339559"
		[/random]
		[random]
			value="1432544598"
		[/random]
		[random]
			value="626810873"
		[/random]
		[random]
			value="1096307212"
		[/random]
		[random]
			value="517950609"
		[/random]
		[random]
			value="1570025342"
		[/random]
		[random]
			value="1842933638"
		[/random]
		[random]
			value="1337412354"
			[results]
				checksum="4zf1OSv,C7F>rbJjGs8AZ92.m<LzFBEHnuR73QRpoMa2r4.k-cpOaw87,.Y8Z.5ndaB-kwWvSlbAfbufC3iaj7hobd->Zhepk<>2fa5>ai01-b1+6Z+40CN5c8b.>X,4"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Sww26 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[move]
			x="22,23"
			y="13,14"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="22,22"
			y="14,13"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="22"
				y="13"
			[/source]
			[destination]
				x="21"
				y="13"
			[/destination]
		[/attack]
		[random]
			value="20935"
			[results]
				chance="70"
				damage="7"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[choose]
			value="0"
		[/choose]
	[/command]
	[command]
		sent="yes"
		[move]
			x="23,22,22,22,23,24"
			y="14,14,15,16,17,16"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="1"
			[source]
				x="24"
				y="16"
			[/source]
			[destination]
				x="24"
				y="15"
			[/destination]
		[/attack]
		[random]
			value="28501"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="11826"
			[results]
				chance="70"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="11730"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="27830"
			[results]
				chance="70"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="27200"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="10644"
			[results]
				chance="70"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="19878"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="19,20,21,22,23"
			y="14,14,15,14,15"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="23"
				y="15"
			[/source]
			[destination]
				x="24"
				y="15"
			[/destination]
		[/attack]
		[random]
			value="28637"
			[results]
				chance="70"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1567"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="7571"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="11346"
			[results]
				chance="60"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="21951"
			[results]
				chance="70"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="10398"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="ben11 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="23"
				y="16"
			[/source]
			[destination]
				x="24"
				y="15"
			[/destination]
		[/attack]
		[random]
			value="23309"
			[results]
				chance="70"
				damage="9"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="TomygunBzh has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="20,20,20,19,18,17"
			y="13,14,15,16,16,17"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="22,22,22,21,21"
			y="16,15,14,14,13"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="21"
				y="13"
			[/source]
			[destination]
				x="20"
				y="12"
			[/destination]
		[/attack]
		[random]
			value="24461"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="11304"
			[results]
				chance="40"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="7397"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="21351"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="25941"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1567"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="11,12,13,14,15,16,17"
			y="18,18,19,19,19,18,18"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="LoL69 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="8,8"
			y="15,14"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Kronjohn has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="8,8,8,9,10,11,12"
			y="14,15,16,17,17,18,18"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Unit171 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="2"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Robb has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="ilP has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="6,6,6,6"
			y="7,8,9,10"
		[/move]
	[/command]
	[command]
		[move]
			x="6,6,6"
			y="10,11,12"
		[/move]
	[/command]
	[command]
		[move]
			x="6,6"
			y="12,13"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Undertaker has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="22,22,22,22,22,21"
			y="7,8,9,10,11,12"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="21"
				y="12"
			[/source]
			[destination]
				x="21"
				y="13"
			[/destination]
		[/attack]
		[random]
			value="1282924263"
			[results]
				chance="70"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1779130946"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="315384279"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="2103335990"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="154855653"
			[results]
				chance="70"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Killer595 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="20"
				y="12"
			[/source]
			[destination]
				x="21"
				y="13"
			[/destination]
		[/attack]
		[random]
			value="1493469919"
			[results]
				chance="70"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1662858327"
			[results]
				chance="40"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="2044523314"
			[results]
				chance="70"
				damage="6"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Ananta has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="ilP has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="21,21,21,21,21,22"
			y="20,19,18,17,16,15"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="22"
				y="15"
			[/source]
			[destination]
				x="23"
				y="16"
			[/destination]
		[/attack]
		[random]
			value="276730306"
			[results]
				chance="70"
				damage="6"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="17,18,19,20,21,22,22"
			y="4,4,5,5,6,6,7"
		[/move]
	[/command]
	[command]
		[recruit]
			value="2"
			x="17"
			y="4"
		[/recruit]
		[random]
			value="91251774"
		[/random]
		[random]
			value="548713171"
		[/random]
		[random]
			value="508866469"
		[/random]
		[random]
			value="1262955428"
		[/random]
		[random]
			value="1799780545"
		[/random]
		[random]
			value="818590930"
		[/random]
		[random]
			value="875780415"
		[/random]
		[random]
			value="270218322"
		[/random]
		[random]
			value="248836414"
		[/random]
		[random]
			value="765335708"
		[/random]
		[random]
			value="1118103184"
		[/random]
		[random]
			value="2039712814"
		[/random]
		[random]
			value="1620524132"
		[/random]
		[random]
			value="747440393"
		[/random]
		[random]
			value="773692482"
			[results]
				checksum="dyxuTOIUoJO8HNrG4rKqKKyCcwwqoNtRxBzMHwQmPyQBpPAuOCIG6zNHsCQFqzuGzwKqqyuyKqpN5RBJTuEm3frBwnBwBICTrpKGHCIsunwtfvIWc<MGO<7LH5>c8208"
			[/results]
		[/random]
	[/command]
	[command]
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="ME4 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Santiago has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="24,24,24,23,22,21"
			y="16,15,14,14,13,13"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="1"
			[source]
				x="21"
				y="13"
			[/source]
			[destination]
				x="20"
				y="12"
			[/destination]
		[/attack]
		[random]
			value="16547"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="26900"
			[results]
				chance="60"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="6146"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="6289"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="8212"
			[results]
				chance="40"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="20863"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="FruntilMan has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Korven has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="22,21,20"
			y="13,14,13"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="20"
				y="13"
			[/source]
			[destination]
				x="20"
				y="12"
			[/destination]
		[/attack]
		[random]
			value="18263"
			[results]
				chance="70"
				damage="10"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="31730"
			[results]
				chance="70"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="31864"
			[results]
				chance="70"
				damage="10"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Andrean has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Chester has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="17,18,19,20,21"
			y="18,17,17,16,16"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="21"
				y="16"
			[/source]
			[destination]
				x="22"
				y="15"
			[/destination]
		[/attack]
		[random]
			value="14067"
			[results]
				chance="70"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="19255"
			[results]
				chance="70"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="28293"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="12093"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1807"
			[results]
				chance="70"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="29563"
			[results]
				chance="70"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="23"
				y="15"
			[/source]
			[destination]
				x="22"
				y="15"
			[/destination]
		[/attack]
		[random]
			value="748"
			[results]
				chance="70"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1772"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="5972"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="4691"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="20794"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="12680"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="12,11,10,9,8,7,6"
			y="18,18,17,17,16,16,15"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="cntrpnt has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Zeaux has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="17,17,17"
			y="17,18,19"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="StateEagle1300 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="4"
			x="13"
			y="19"
		[/recruit]
		[random]
			value="29260"
		[/random]
		[random]
			value="14641"
		[/random]
		[random]
			value="18899"
		[/random]
		[random]
			value="14253"
		[/random]
		[random]
			value="24527"
		[/random]
		[random]
			value="24454"
		[/random]
		[random]
			value="20605"
		[/random]
		[random]
			value="25583"
		[/random]
		[random]
			value="4743"
		[/random]
		[random]
			value="14376"
		[/random]
		[random]
			value="11900"
		[/random]
		[random]
			value="25481"
		[/random]
		[random]
			value="21304"
		[/random]
		[random]
			value="4828"
		[/random]
		[random]
			value="13900"
			[results]
				checksum="4zf1OSv,C7F>rbJjGs8AZ92.m<LzFBEHnuR73QRpoMa2r4.k-cpOaw87,.Y8Z.5ndaB-kwWvSlbAfbufC3iaj7hobd->Zhepk<>2fa5>ai01-b1+6Z+40CN5c8b.>X,4"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="4"
			x="16"
			y="19"
		[/recruit]
		[random]
			value="7147"
		[/random]
		[random]
			value="29990"
		[/random]
		[random]
			value="2465"
		[/random]
		[random]
			value="17117"
		[/random]
		[random]
			value="28053"
		[/random]
		[random]
			value="31446"
		[/random]
		[random]
			value="14531"
		[/random]
		[random]
			value="25631"
		[/random]
		[random]
			value="12313"
		[/random]
		[random]
			value="10671"
		[/random]
		[random]
			value="3403"
		[/random]
		[random]
			value="30345"
		[/random]
		[random]
			value="12043"
		[/random]
		[random]
			value="22403"
		[/random]
		[random]
			value="7190"
			[results]
				checksum="4zf1OSw,C7F>rbJjCs8AZ92.m<LzFBEHnuR73QRpoMa2r4.k-cpOaw87,.Y8Z.5ndaB-kwWvSlbAfbufC3iaj7hobd->Zhetk<>2fa5>ai01-b1+6Z+40CN5c8b.>X,4"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="17,18,18,19"
			y="19,18,17,17"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="ilP has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="2"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		[move]
			x="21,22"
			y="12,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Grisogonus has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="22,22,22,22,21,21"
			y="7,8,9,10,11,12"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="21"
				y="12"
			[/source]
			[destination]
				x="21"
				y="13"
			[/destination]
		[/attack]
		[random]
			value="1774324197"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1100627926"
			[results]
				chance="70"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1892793328"
			[results]
				chance="70"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Battlesmile has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="TheKing has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="22,23,24,24,24"
			y="11,12,12,13,14"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Gorthaur has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="24"
				y="14"
			[/source]
			[destination]
				x="23"
				y="15"
			[/destination]
		[/attack]
		[random]
			value="1755900913"
			[results]
				chance="70"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="722864391"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1317428855"
			[results]
				chance="70"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1312461646"
			[results]
				chance="70"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="846397958"
			[results]
				chance="70"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1973523133"
			[results]
				chance="70"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="22,22,22,22,22,22,22,23,23,23"
			y="5,6,7,8,9,10,11,12,13,14"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Barbo has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="23"
				y="14"
			[/source]
			[destination]
				x="23"
				y="15"
			[/destination]
		[/attack]
		[random]
			value="1017711530"
			[results]
				chance="60"
				damage="8"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Emmo has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="22,22,22"
			y="15,14,13"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="22"
				y="13"
			[/source]
			[destination]
				x="21"
				y="13"
			[/destination]
		[/attack]
		[random]
			value="1780065645"
			[results]
				chance="70"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1050324251"
			[results]
				chance="70"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="547702005"
			[results]
				chance="70"
				damage="6"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[choose]
			value="0"
		[/choose]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Panda_ has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="6,7,8,8,8,8"
			y="13,14,14,15,16,17"
		[/move]
	[/command]
	[command]
		[move]
			x="17,17,18,19,20,21,21,21"
			y="4,5,5,6,6,7,8,9"
		[/move]
	[/command]
	[command]
		[recruit]
			value="2"
			x="17"
			y="4"
		[/recruit]
		[random]
			value="1036653326"
		[/random]
		[random]
			value="1346758391"
		[/random]
		[random]
			value="1695672959"
		[/random]
		[random]
			value="380047102"
		[/random]
		[random]
			value="814223544"
		[/random]
		[random]
			value="1549239241"
		[/random]
		[random]
			value="649122650"
		[/random]
		[random]
			value="1424104903"
		[/random]
		[random]
			value="1252246942"
		[/random]
		[random]
			value="1422760534"
		[/random]
		[random]
			value="1006796082"
		[/random]
		[random]
			value="1866097179"
		[/random]
		[random]
			value="1220057644"
		[/random]
		[random]
			value="15294040"
		[/random]
		[random]
			value="1586498705"
			[results]
				checksum="dyxuTOJUoJO8HNrG4rKqKKyCcwwqoNtRxBzMHwQmPyQBpPAuOCIG6zNHsCQFqzuGzwKqqyuyKqqQ5RBJTuEm3frBwnBwBICTrpKGHCIsunwtfvIWc<MGO<7LH5>f.208"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="yamakasi has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[recruit]
			value="4"
			x="16"
			y="3"
		[/recruit]
		[random]
			value="294169380"
		[/random]
		[random]
			value="737658995"
		[/random]
		[random]
			value="444428254"
		[/random]
		[random]
			value="674216483"
		[/random]
		[random]
			value="1551882539"
		[/random]
		[random]
			value="1993667495"
		[/random]
		[random]
			value="1323339133"
		[/random]
		[random]
			value="828503794"
		[/random]
		[random]
			value="1098430789"
		[/random]
		[random]
			value="598616020"
		[/random]
		[random]
			value="1835299876"
		[/random]
		[random]
			value="817044320"
		[/random]
		[random]
			value="1818673664"
		[/random]
		[random]
			value="1850593916"
		[/random]
		[random]
			value="256059378"
			[results]
				checksum="3Cf1OSv,C7F>rbJjHs8AZ92.m<KzFBEHnuR73QRpoMa2r4.k-cpOaw87,.Y8Z.5ndaB-kwWvSlbAfbufC3iaj7hobd->Zheok<>2fa5>ai01-b1+6Z+40CN5c8b.>X,4"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="13,12,11,10,9,9"
			y="4,4,5,5,6,7"
		[/move]
	[/command]
	[command]
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="NoraxsNight has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Rydl has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="DalaiLama has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Saph has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="20,20,21,22,23,24"
			y="13,14,15,15,16,15"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="24"
				y="15"
			[/source]
			[destination]
				x="24"
				y="14"
			[/destination]
		[/attack]
		[random]
			value="5423"
			[results]
				chance="70"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="25926"
			[results]
				chance="70"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="24252"
			[results]
				chance="70"
				damage="7"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="21,22,23"
			y="16,15,15"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="23"
				y="15"
			[/source]
			[destination]
				x="23"
				y="14"
			[/destination]
		[/attack]
		[random]
			value="24642"
			[results]
				chance="70"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="28982"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="19251"
			[results]
				chance="70"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="29848"
			[results]
				chance="60"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="32289"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="23771"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="16,17,17,17,18,19"
			y="19,19,18,17,16,16"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="chorri- has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="19,19,20,20,21"
			y="17,18,18,19,20"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="13,12,11,10,9"
			y="19,18,18,18,18"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="9"
				y="18"
			[/source]
			[destination]
				x="8"
				y="17"
			[/destination]
		[/attack]
		[random]
			value="19794"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="19295"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="32407"
			[results]
				chance="70"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="6,6,7"
			y="15,16,17"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="7"
				y="17"
			[/source]
			[destination]
				x="8"
				y="17"
			[/destination]
		[/attack]
		[random]
			value="15379"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="5084"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="2"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="MrYoung has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="8"
				y="17"
			[/source]
			[destination]
				x="9"
				y="18"
			[/destination]
		[/attack]
		[random]
			value="1966584853"
			[results]
				chance="60"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1883852551"
			[results]
				chance="60"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="277474421"
			[results]
				chance="60"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="755394953"
			[results]
				chance="60"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="202832873"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="379698720"
			[results]
				chance="60"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="9,9,9,9,9,8"
			y="7,8,9,10,11,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="noname has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Jazz has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="Gauteamus"
			message="meh, your leveled oracle turned the table"
			side="2"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="DeathMetal has logged into the lobby"
		[/speak]
	[/command]
	[command]
		undo="no"
		[speak]
			id="KnightKunibert"
			message="yep :-)"
			side="1"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Nickname has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="llhAnny has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="21,21,21,21,21,21,21,22"
			y="9,10,11,12,13,14,15,15"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Bowflan89 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="goku94 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="22"
				y="15"
			[/source]
			[destination]
				x="23"
				y="15"
			[/destination]
		[/attack]
		[random]
			value="1396658758"
			[results]
				chance="60"
				damage="11"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1777792951"
			[results]
				chance="70"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="475126003"
			[results]
				chance="60"
				damage="11"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="mnewton1 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="22,22,22,23"
			y="13,14,15,16"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="23"
				y="16"
			[/source]
			[destination]
				x="24"
				y="15"
			[/destination]
		[/attack]
		[random]
			value="262260462"
			[results]
				chance="70"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="523034710"
			[results]
				chance="70"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="66962513"
			[results]
				chance="70"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="958333657"
			[results]
				chance="70"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1754897721"
			[results]
				chance="70"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1087071395"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="23,24,25,25"
			y="14,13,14,15"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="25"
				y="15"
			[/source]
			[destination]
				x="24"
				y="15"
			[/destination]
		[/attack]
		[random]
			value="270095793"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1054509808"
			[results]
				chance="70"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="572634065"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="135842918"
			[results]
				chance="70"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="43602543"
			[results]
				chance="60"
				damage="4"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[choose]
			value="0"
		[/choose]
	[/command]
	[command]
		[move]
			x="21,22,23,23,23,24"
			y="12,12,13,14,15,15"
		[/move]
	[/command]
	[command]
		[move]
			x="17,18,19,19,20,21,22"
			y="4,4,5,6,6,7,7"
		[/move]
	[/command]
	[command]
		[move]
			x="16,17,18,19,20,21,22,23"
			y="3,4,4,5,5,6,6,7"
		[/move]
	[/command]
	[command]
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="9"
				y="18"
			[/source]
			[destination]
				x="8"
				y="17"
			[/destination]
		[/attack]
		[random]
			value="9355"
			[results]
				chance="70"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="6609"
			[results]
				chance="70"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="3310"
			[results]
				chance="70"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="7"
				y="17"
			[/source]
			[destination]
				x="8"
				y="17"
			[/destination]
		[/attack]
		[random]
			value="14436"
			[results]
				chance="60"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="2867"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="CV has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="19,20,21,22"
			y="16,16,17,16"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="22"
				y="16"
			[/source]
			[destination]
				x="23"
				y="16"
			[/destination]
		[/attack]
		[random]
			value="6184"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="15553"
			[results]
				chance="70"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="6352"
			[results]
				chance="70"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="29611"
			[results]
				chance="70"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="5633"
			[results]
				chance="70"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="28209"
			[results]
				chance="70"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="21,21,22,22,23"
			y="20,19,18,17,17"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="23"
				y="17"
			[/source]
			[destination]
				x="23"
				y="16"
			[/destination]
		[/attack]
		[random]
			value="32408"
			[results]
				chance="60"
				damage="10"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="Gauteamus"
			message="gg"
			side="2"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="2"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="8"
				y="17"
			[/source]
			[destination]
				x="9"
				y="18"
			[/destination]
		[/attack]
		[random]
			value="1428494842"
			[results]
				chance="60"
				damage="5"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="8,8,8,7,7,6"
			y="11,12,13,14,15,15"
		[/move]
	[/command]
	[command]
		[move]
			x="22,21"
			y="15,16"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="21"
				y="16"
			[/source]
			[destination]
				x="22"
				y="16"
			[/destination]
		[/attack]
		[random]
			value="738422032"
			[results]
				chance="60"
				damage="9"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="24,25,25,25,24,23"
			y="15,16,17,18,18,18"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="23"
				y="18"
			[/source]
			[destination]
				x="23"
				y="17"
			[/destination]
		[/attack]
		[random]
			value="245193702"
			[results]
				chance="70"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="2067215989"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1319127419"
			[results]
				chance="70"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1695064293"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="448365528"
			[results]
				chance="70"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1297854621"
			[results]
				chance="60"
				damage="8"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="111457064"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="290508593"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="25,24,23"
			y="15,15,16"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="23"
				y="16"
			[/source]
			[destination]
				x="23"
				y="17"
			[/destination]
		[/attack]
		[random]
			value="521259518"
			[results]
				chance="70"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1339673124"
			[results]
				chance="50"
				damage="8"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="683700500"
			[results]
				chance="70"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1331335527"
			[results]
				chance="50"
				damage="8"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="258194286"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="22,22,22,22,22,22,22"
			y="7,8,9,10,11,12,13"
		[/move]
	[/command]
	[command]
		[move]
			x="23,23,23,23,23,23,23,23"
			y="7,8,9,10,11,12,13,14"
		[/move]
	[/command]
	[command]
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Blind_Wanderer has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Sagnuay has logged into the lobby"
		[/speak]
	[/command]
	[command]
		undo="no"
		[speak]
			id="KnightKunibert"
			message="gg :-)"
			side="1"
		[/speak]
	[/command]
	[command]
		undo="no"
		[speak]
			id="KnightKunibert"
			message="thx "
			side="1"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="23"
				y="17"
			[/source]
			[destination]
				x="23"
				y="18"
			[/destination]
		[/attack]
		[random]
			value="27800"
			[results]
				chance="60"
				damage="10"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="7284"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="25669"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="31305"
			[results]
				chance="70"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="2"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="The_Ambassador has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="8"
				y="17"
			[/source]
			[destination]
				x="7"
				y="17"
			[/destination]
		[/attack]
		[random]
			value="27982474"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1676110687"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1236581597"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="259217656"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1291798451"
			[results]
				chance="60"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="923498506"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="2096825"
			[results]
				chance="60"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1014108495"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Shmoe has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="6,6"
			y="15,16"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="6"
				y="16"
			[/source]
			[destination]
				x="7"
				y="17"
			[/destination]
		[/attack]
		[random]
			value="1569185056"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="634640005"
			[results]
				chance="70"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1970130953"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1401924153"
			[results]
				chance="70"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="158856287"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="2052531589"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="364712388"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="23,23,24,25,25,24"
			y="14,15,15,16,17,17"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="24"
				y="17"
			[/source]
			[destination]
				x="23"
				y="17"
			[/destination]
		[/attack]
		[random]
			value="776819478"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="320365907"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="14197146"
			[results]
				chance="70"
				damage="9"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Sparhawk has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="kingace has logged into the lobby"
		[/speak]
	[/command]
[/replay]
[snapshot]
	campaign_type="multiplayer"
	completion="running"
	current_tod="4"
#textdomain wesnoth-multiplayer
	description=_ "This vital supply route has played a key role in many of Wesnoth's greatest battles."
	difficulty="NORMAL"
	end_text_duration="0"
	experience_modifier="70"
	hash="ni><w8>Ksy9E6lpej<-R7zqNgF0HH1GU14mLcPs+Y0>x<lui3JMr96tqaCJ+gLs7vdDsR,OV+p41UARdwDMp8w8hABAeHRqXh0zHL5LEGp<BJU2ovj4yzohfX.yffdE0"
	id="multiplayer_Weldyn_Channel"
	label="2p - Weldyn Channel"
	map_data="border_size=1
usage=map

Ss          , Hh          , Rp          , Ss          , Gs^Fp       , Hh          , Rp          , Rp          , Hh          , Ss          , Ss          , Gg          , Hh          , Hh          , Gs^Fms      , Ss          , Gg          , Hh          , Ww          , Ww          , Wo          , Wo          , Ww          , Wwf         , Hh          , Hh          , Hh          , Hh          , Ss          , Hh          , Hh          
Gg          , Gg^Fet      , Rp          , Mm          , Gs^Fp       , Ss          , Rp          , Gs^Fp       , Gg^Fet      , Gs^Fms      , Mm          , Gs^Fp       , Gg          , Gs^Fds      , Hh          , Gs^Fp       , Hh          , Gg          , Ww          , Wo          , Wo          , Ww          , Gs^Fp       , Gg^Fet      , Gs^Fms      , Mm          , Ss          , Mm          , Hh          , Gs^Fp       , Ss          
Gg          , Gg          , Gg          , Rp          , Rp          , Rp          , Gg          , Gg^Ve       , Gg          , Hh          , Gg          , Gg          , Re          , Gg          , Re          , Ch          , Mm          , Ww          , Wo          , Wo          , Ww          , Ww          , Mm          , Ss          , Ss^Vhs      , Hh          , Gs^Fp       , Hh          , Gs^Fms      , Gg^Fet      , Gg          
Gs^Fms      , Gg          , Gg          , Gg          , Rp          , Gg          , Gg          , Gg          , Re          , Mm          , Re          , Re          , Re          , Re          , Ch          , 1 Kh        , Ch          , Ww          , Ww          , Ww          , Gs^Fp       , Hh          , Hh          , Gs^Fp       , Gg          , Gg          , Gg          , Gg          , Gg          , Hh          , Gg          
Hh          , Gs^Fp       , Rp          , Rp          , Re^Uf       , Gs^Fds      , Re          , Re          , Gg          , Re          , Gg          , Gg          , Gg          , Kh          , Gg          , Ch          , Wwf         , Kh          , Ww^Bw\      , Gg          , Gg          , Gg          , Gg          , Gg          , Re          , Re^Uf       , Mm          , Gg          , Gg          , Gg          , Gg          
Hh          , Hh          , Rp          , Mm          , Gs^Fp       , Re          , Re          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Ww          , Ww          , Wwf         , Gg          , Gg          , Gg          , Gg          , Gg^Vh       , Gg          , Re          , Ss          , Hh          , Gs^Fp       , Re          , Gg          , Gg          
Gs^Fp       , Rp          , Mm          , Hh          , Re          , Re          , Gg          , Gg          , Gg          , Gg          , Gg^Uf       , Hh          , Hh          , Gg^Ve       , Ww          , Ww          , Ww          , Gg          , Ss          , Gs^Fp       , Gg          , Gg          , Gg          , Gg          , Gg          , Re          , Re          , Re^Uf       , Re          , Gg          , Gg          
Rp          , Rp          , Re          , Re          , Gg          , Gg          , Gg^Vh       , Gg          , Gg          , Gs^Fds      , Hh          , Mm          , Gg          , Gs^Fp       , Ww          , Wo          , Ww          , Gg          , Gs^Fp       , Ss^Vhs      , Ww          , Mm          , Hh          , Gg          , Gg^Ve       , Gs^Fms      , Gg          , Re          , Gg          , Gg          , Gg          
Gs^Fp       , Re          , Re          , Gg          , Gs^Fp       , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Ww          , Ww          , Wo          , Wo          , Wo          , Ww          , Ww          , Ww          , Ww          , Wwf         , Rp          , Gg          , Gg          , Gg          , Gg          , Gg          , Mm          , Gg^Uf       , Hh          
Gg          , Re          , Re          , Hh          , Ss          , Ggf^Uf      , Gg          , Gg          , Gs^Fms      , Ggf         , Gg          , Gg          , Ww          , Ww          , Wo          , Wo          , Mm^Xm       , Wo          , Wo          , Wo          , Ww          , Wwf         , Wwf         , Rp          , Rp          , Gg          , Gs^Fp       , Hh          , Gg^Fet      , Hh          , Gg          
Wwf         , Gg          , Gg          , Gs^Fms      , Mm          , Hh          , Hh          , Gg          , Gg          , Mm          , Hh          , Ww          , Ww          , Wo          , Wo          , Hh          , Mm^Xm       , Wo          , Wo          , Wo          , Ww          , Gs^Fp       , Rp          , Wwf         , Wwf         , Gg          , Rp          , Rp          , Rp          , Gg          , Gg          
Rp          , Wwf         , Wwf         , Gg          , Wwf         , Wwf         , Wwf         , Rp          , Gg          , Hh          , Ww          , Ww          , Wo          , Ww          , Wwr         , Mm^Xm       , Wwr         , Wo          , Wo          , Ww          , Ww          , Gg          , Gg          , Rp          , Wwf         , Rp          , Wwf         , Wwf         , Wwf         , Rp          , Rp          
Gg          , Rp          , Rp          , Wwf         , Rp          , Rp          , Wwf         , Rp          , Rp          , Gg          , Ww          , Ww          , Wo          , Wo          , Mm^Xm       , Mm^Xm       , Wo          , Ww          , Ww          , Ww          , Hh          , Hh          , Gg          , Rp          , Hh          , Wwf         , Mm          , Gg          , Gg          , Wwf         , Wwf         
Gs^Fds      , Gg          , Gg^Fet      , Rp          , Gs^Fms      , Gg          , Rp          , Wwf         , Wwf         , Gs^Fp       , Ww          , Wo          , Wo          , Wo          , Mm^Xm       , Hh          , Wo          , Wo          , Ww          , Ww          , Gg          , Mm          , Gs^Fms      , Gg          , Gg          , Hh          , Ss          , Gs^Fp       , Re          , Gg          , Gg          
Hh          , Hh          , Mm          , Hh          , Gg          , Gg          , Gg          , Rp          , Rp          , Wwf         , Ww          , Wo          , Ww          , Wo          , Wo          , Wo          , Wo          , Ww          , Ww          , Gg          , Gg          , Ggf         , Gg          , Gg          , Gg          , Ggf^Uf      , Gg^Fet      , Hh          , Re          , Re          , Gs^Fp       
Gs^Fds      , Ggf^Uf      , Gg          , Gg          , Gg          , Gg          , Gg^Ve       , Gg          , Hh          , Wwf         , Ww          , Ww          , Gs^Fp       , Ww          , Ww          , Wo          , Ww          , Ww          , Gg          , Gg          , Hh          , Gg          , Gg          , Gg          , Gg^Vh       , Gg          , Gg          , Gg          , Re          , Re          , Rp          
Gg          , Gg          , Re          , Re          , Re          , Gs^Fms      , Gg          , Gg          , Gg          , Mm          , Gg          , Ss^Vhs      , Ss          , Gg          , Ww          , Wo          , Ww          , Gs^Fp       , Hh          , Mm          , Ggf^Uf      , Gs^Fp       , Gg          , Gg          , Gg          , Gg          , Re          , Re          , Mm          , Rp          , Gs^Fp       
Gg          , Gg          , Re          , Re^Uf       , Hh          , Re          , Re          , Gg          , Gg^Vh       , Gg          , Gg          , Gs^Fp       , Gg          , Gg          , Ww          , Ww          , Gg          , Gg^Ve       , Gg          , Hh          , Gg          , Gg          , Gg          , Gg          , Ggf         , Re          , Gs^Fds      , Hh          , Rp          , Rp          , Hh          
Gg          , Gg          , Gg          , Gs^Fp       , Mm          , Ss          , Re          , Gg          , Gg          , Gg          , Gg          , Gg          , Ww^Bw\      , Wwf         , Wwf         , Ww          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Gg          , Re          , Re          , Re^Uf       , Mm          , Rp          , Hh          , Hh          
Gg          , Gg          , Gg          , Gg          , Gg          , Re^Uf       , Gg          , Gg          , Hh          , Gg          , Gs^Fp       , Gg          , Ww          , Kh          , Ch          , Ch          , Ch          , Kh          , Gg          , Gg          , Re          , Re          , Re          , Re          , Gg          , Gs^Fp       , Rp          , Rp          , Gg          , Gs^Fms      , Gg          
Gs^Fds      , Gg          , Gs^Fp       , Gg          , Gs^Fp       , Gg          , Ss^Vhs      , Gs^Fp       , Mm          , Hh          , Ww          , Ww          , Wo          , Ww          , Mm          , 2 Kh        , Re          , Re          , Re          , Re          , Gg          , Gg^Ve       , Gg          , Gg          , Gg          , Gg          , Rp          , Gg          , Gg          , Gg          , Gg          
Ss          , Gg^Fet      , Ss          , Hh          , Mm          , Hh          , Gs^Fms      , Ss          , Gs^Fp       , Ww          , Wo          , Wo          , Ww          , Ww          , Hh          , Ch          , Gs^Fds      , Gg          , Gs^Fms      , Mm          , Gg^Fet      , Hh          , Mm          , Hh          , Rp          , Rp          , Gs^Fp       , Rp          , Rp          , Gg          , Gg          
Hh          , Hh          , Gs^Fms      , Gs^Fp       , Hh          , Ss          , Mm          , Gg^Fet      , Ww          , Ww          , Wo          , Wo          , Ww          , Hh          , Gs^Fp       , Gg^Fet      , Gs^Fms      , Hh          , Mm          , Hh          , Gs^Fp       , Ss          , Hh          , Gs^Fp       , Rp          , Ss          , Ss          , Hh          , Mm          , Rp          , Gg          
Hh          , Gs^Fms      , Hh          , Ss          , Hh          , Hh          , Wwf         , Ww          , Wo          , Wo          , Ww          , Ww          , Hh          , Gg          , Hh          , Hh          , Ss          , Hh          , Hh          , Gs^Fms      , Ss          , Hh          , Rp          , Rp          , Gg          , Hh          , Hh          , Gs^Fp       , Ss          , Rp          , Hh          
"
	mp_countdown="yes"
	mp_countdown_action_bonus="20"
	mp_countdown_init_time="270"
	mp_countdown_reservoir_time="270"
	mp_countdown_turn_bonus="200"
	mp_fog="yes"
	mp_shroud="no"
	mp_use_map_settings="yes"
	mp_village_gold="2"
	name=_ "2p - Weldyn Channel"
	next_underlying_unit_id="24"
#textdomain wesnoth
	objectives=_ "Victory:
@Defeat enemy leader(s)"
	observer="yes"
	playing_team="0"
	random_calls="1"
	random_seed="69878872"
	random_start_time="no"
	snapshot="yes"
	turn_at="11"
	turns="-1"
	unit_wml_ids="Drake Clasher,Drake Fighter,Drake Glider,Fire Drake,Saurian Augur,Saurian Oracle,Saurian Skirmisher,Saurian Soothsayer,Sky Drake,era_events"
	version="1.6"
	[side]
		action_bonus_count="3"
		aggression="0.5"
		allow_player="yes"
		caution="0.25"
		colour="1"
		controller="human"
		countdown_time="240074"
		current_player="KnightKunibert"
		disallow_observers="no"
		fog="yes"
		global_recruitment_pattern="fighter,fighter,archer,healer,scout,scout"
		gold="61"
		hidden="no"
		id="KnightKunibert1"
		income="0"
		leader_value="3"
		name="KnightKunibert"
		no_leader="yes"
		number_of_possible_recruits_to_force_recruit="3.1"
		objectives=_ "Victory:
@Defeat enemy leader(s)"
		objectives_changed="no"
		recruit="Drake Burner,Drake Clasher,Drake Fighter,Drake Glider,Saurian Augur,Saurian Skirmisher"
		recruitment_pattern="fighter,fighter,archer,healer,scout,scout"
		save_id="KnightKunibert1"
		share_maps="no"
		share_view="yes"
		shroud="no"
		side="1"
		start_gold="100"
		team_name="north"
#textdomain wesnoth-multiplayer
		user_team_name=_ "teamname^North"
		village_gold="2"
		village_value="1"
		villages_per_scout="8"
		[ai]
			recruitment_pattern="fighter,fighter,archer,healer,scout,scout"
			villages_per_scout="8"
			[team_formula]
				rulebase="fai 'recruitment.fai'
		# ===== Some general functions used later ==== #

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

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

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

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

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

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

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

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

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

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

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

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

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

#returns average defense of the unit #

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

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

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

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


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


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

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

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

# ==2== based on village possession #

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

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

# multipled by 1000 to increase precision #

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

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

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

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

#==1==  basic evaluation #

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

faiend
"
			[/team_formula]
		[/ai]
		[ai]
			villages_per_scout="8"
		[/ai]
		[village]
			x="6"
			y="7"
		[/village]
		[village]
			x="6"
			y="15"
		[/village]
		[village]
			x="7"
			y="2"
		[/village]
		[village]
			x="8"
			y="17"
		[/village]
		[village]
			x="13"
			y="6"
		[/village]
		[village]
			x="19"
			y="7"
		[/village]
		[village]
			x="22"
			y="5"
		[/village]
		[village]
			x="24"
			y="2"
		[/village]
		[village]
			x="24"
			y="7"
		[/village]
		[village]
			x="24"
			y="15"
		[/village]
		[unit]
			advances_to="Inferno Drake"
			alignment="lawful"
			allow_changes="yes"
			allow_player="yes"
			alpha="256"
			attacks_left="1"
			canrecruit="yes"
			colour="1"
			controller="human"
			cost="35"
			current_player="KnightKunibert"
			die_sound="drake-die.ogg"
			experience="1"
			facing="se"
			flying="no"
			fog="yes"
			gender="male"
			gold="100"
			goto_x="-999"
			goto_y="-999"
			hitpoints="63"
			id="KnightKunibert1"
			image="units/drakes/fire.png"
			income="0"
#textdomain wesnoth-units
			language_name=_ "Fire Drake"
			leader="Drake Flare,Fire Drake,Drake Slasher,Drake Gladiator,Drake Warrior,Saurian Oracle,Saurian Soothsayer"
			level="2"
			max_attacks="1"
			max_experience="56"
			max_hitpoints="63"
			max_moves="5"
			movement="5"
			movement_type="drakefly"
			moves="5"
			mp_countdown="yes"
			mp_countdown_action_bonus="20"
			mp_countdown_init_time="270"
			mp_countdown_reservoir_time="270"
			mp_countdown_turn_bonus="200"
			name="KnightKunibert"
			profile="portraits/drakes/burner.png"
			race="drake"
			random_leader="Drake Flare,Fire Drake,Drake Slasher,Drake Gladiator,Drake Warrior"
			random_traits="no"
			recruit="Drake Burner,Drake Clasher,Drake Glider,Drake Fighter,Saurian Skirmisher,Saurian Augur"
			resting="yes"
			save_id="KnightKunibert1"
			share_maps="no"
			share_view="yes"
			shroud="no"
			side="1"
			team_name="north"
			terrain_liked="Hh, Ha, Ds, Ss"
			type="Fire Drake"
			undead_variation="drake"
			underlying_id="1"
			unrenamable="no"
			upkeep="full"
			usage="archer"
			user_team_name="wesnoth-multiplayerteamname^North"
			village_gold="2"
			x="6"
			y="16"
			zoc="yes"
			[defense]
				castle="60"
				cave="70"
				deep_water="80"
				flat="70"
				forest="60"
				frozen="80"
				fungus="60"
				hills="60"
				impassable="70"
				mountains="60"
				reef="70"
				sand="60"
				shallow_water="80"
				swamp_water="70"
				unwalkable="60"
				village="60"
			[/defense]
			[movement_costs]
				castle="1"
				cave="3"
				deep_water="2"
				flat="1"
				forest="1"
				frozen="2"
				fungus="2"
				hills="1"
				impassable="99"
				mountains="1"
				reef="1"
				sand="1"
				shallow_water="1"
				swamp_water="1"
				unwalkable="1"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="130"
				blade="90"
				cold="150"
				fire="40"
				impact="80"
				pierce="110"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="9"
				description=_ "claws"
				icon="attacks/claws-drake.png"
				name="claws"
				number="2"
				range="melee"
				type="blade"
			[/attack]
			[attack]
				damage="7"
				description=_ "fire breath"
				icon="attacks/fire-breath-drake.png"
				name="fire breath"
				number="5"
				range="ranged"
				type="fire"
			[/attack]
			[modifications]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Hurricane Drake"
			alignment="lawful"
			alpha="256"
			attacks_left="1"
			cost="30"
			die_sound="drake-die.ogg"
			ellipse="misc/ellipse"
			experience="5"
			facing="s"
			flies="false"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="48"
			id="Drake Glider-3"
			image="units/drakes/sky.png"
			language_name=_ "Sky Drake"
			level="2"
			max_attacks="1"
			max_experience="56"
			max_hitpoints="48"
			max_moves="10"
			movement="9"
			movement_type="fly"
			moves="10"
			name="Garush"
			profile="portraits/drakes/glider.png"
			race="drake"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="1"
			type="Sky Drake"
			undead_variation="drake"
			underlying_id="3"
			unrenamable="no"
			upkeep="full"
			usage="scout"
			x="23"
			y="16"
			zoc="yes"
			[defense]
				castle="50"
				cave="70"
				deep_water="50"
				flat="50"
				forest="50"
				frozen="50"
				fungus="60"
				hills="50"
				impassable="80"
				mountains="50"
				reef="50"
				sand="50"
				shallow_water="50"
				swamp_water="50"
				unwalkable="50"
				village="50"
			[/defense]
			[movement_costs]
				castle="1"
				cave="3"
				deep_water="1"
				flat="1"
				forest="1"
				frozen="1"
				fungus="2"
				hills="1"
				impassable="99"
				mountains="1"
				reef="1"
				sand="1"
				shallow_water="1"
				swamp_water="1"
				unwalkable="1"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="130"
				blade="90"
				cold="150"
				fire="50"
				impact="80"
				pierce="110"
			[/resistance]
			[attack_anim]
				[filter_attack]
					name="fire breath"
				[/filter_attack]
				[if]
					direction="n"
					[missile_frame]
						begin="-400"
						end="100"
						halo="projectiles/fire-breath-n-1.png:80,projectiles/fire-breath-n-2.png:80,projectiles/fire-breath-n-3.png:80,projectiles/fire-breath-n-4.png:80,projectiles/fire-breath-n-5.png:80"
						halo_x="9"
						halo_y="-34"
					[/missile_frame]
				[/if]
				[else]
					direction="s"
					[missile_frame]
						begin="-400"
						end="100"
						halo="projectiles/fire-breath-s-1.png:80,projectiles/fire-breath-s-2.png:80,projectiles/fire-breath-s-3.png:80,projectiles/fire-breath-s-4.png:80,projectiles/fire-breath-s-5.png:80"
						halo_x="9"
						halo_y="15"
					[/missile_frame]
				[/else]
				[else]
					direction="ne,nw"
					[missile_frame]
						begin="-400"
						end="100"
						halo="projectiles/fire-breath-ne-1.png:80,projectiles/fire-breath-ne-2.png:80,projectiles/fire-breath-ne-3.png:80,projectiles/fire-breath-ne-4.png:80,projectiles/fire-breath-ne-5.png:80"
						halo_x="22"
						halo_y="-22"
					[/missile_frame]
				[/else]
				[else]
					direction="se,sw"
					[missile_frame]
						begin="-400"
						end="100"
						halo="projectiles/fire-breath-se-1.png:80,projectiles/fire-breath-se-2.png:80,projectiles/fire-breath-se-3.png:80,projectiles/fire-breath-se-4.png:80,projectiles/fire-breath-se-5.png:80"
						halo_x="24"
						halo_y="10"
					[/missile_frame]
				[/else]
				[if]
					hits="no"
					[frame]
						begin="-400"
						end="-350"
						image="units/drakes/sky.png"
						sound="flame-big-miss.ogg"
					[/frame]
				[/if]
				[else]
					hits="yes"
					[frame]
						begin="-400"
						end="-350"
						image="units/drakes/sky.png"
						sound="flame-big.ogg"
					[/frame]
				[/else]
				[frame]
					begin="-350"
					end="-150"
					image="units/drakes/sky-attack-ranged-fire.png"
				[/frame]
				[frame]
					begin="-150"
					end="0"
					image="units/drakes/sky.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				hits="yes"
				[filter_attack]
					name="slam"
				[/filter_attack]
				[frame]
					begin="-225"
					end="-200"
					image="units/drakes/sky.png"
				[/frame]
				[frame]
					begin="-200"
					end="-150"
					image="units/drakes/sky-attack-ranged-impact.png"
				[/frame]
				[frame]
					begin="-150"
					end="-75"
					image="units/drakes/sky-attack-melee1.png"
				[/frame]
				[frame]
					begin="-75"
					end="50"
					image="units/drakes/sky-attack-melee2.png"
					sound="club.ogg"
				[/frame]
				[frame]
					begin="50"
					end="125"
					image="units/drakes/sky-defend.png"
				[/frame]
				[frame]
					begin="125"
					end="175"
					image="units/drakes/sky-attack-melee1.png"
				[/frame]
				[frame]
					begin="275"
					end="200"
					image="units/drakes/sky.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				hits="no"
				[filter_attack]
					name="slam"
				[/filter_attack]
				[frame]
					begin="-200"
					end="-175"
					image="units/drakes/sky.png"
				[/frame]
				[frame]
					begin="-175"
					end="-150"
					image="units/drakes/sky-attack-ranged-impact.png"
				[/frame]
				[frame]
					begin="-150"
					end="-75"
					image="units/drakes/sky-attack-melee1.png"
				[/frame]
				[frame]
					begin="-75"
					end="50"
					image="units/drakes/sky-attack-melee2.png"
					sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
				[/frame]
				[frame]
					begin="50"
					end="125"
					image="units/drakes/sky-defend.png"
				[/frame]
				[frame]
					begin="125"
					end="175"
					image="units/drakes/sky-attack-melee1.png"
				[/frame]
				[frame]
					begin="275"
					end="200"
					image="units/drakes/sky.png"
				[/frame]
			[/attack_anim]
			[death]
				[frame]
					begin="0"
					end="130"
					image="units/drakes/sky-die-1.png"
				[/frame]
				[frame]
					begin="130"
					end="320"
					image="units/drakes/sky-die-2.png"
				[/frame]
				[frame]
					begin="320"
					end="450"
					image="units/drakes/sky-die-3.png"
				[/frame]
				[frame]
					begin="450"
					end="600"
					image="units/drakes/sky-die-4.png"
				[/frame]
				[frame]
					begin="600"
					end="750"
					image="units/drakes/sky-die-5.png"
				[/frame]
				[frame]
					begin="750"
					end="900"
					image="units/drakes/sky-die-6.png"
				[/frame]
				[frame]
					begin="900"
					end="1050"
					image="units/drakes/sky-die-7.png"
				[/frame]
				[frame]
					begin="1050"
					end="1200"
					image="units/drakes/sky-die-8.png"
				[/frame]
			[/death]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/drakes/sky.png"
				[/frame]
				[frame]
					duration="100"
					image="units/drakes/sky-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/drakes/sky-defend.png"
						sound="drake-hit-1.ogg,drake-hit-2.ogg,drake-hit-3.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/drakes/sky-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/drakes/sky.png"
				[/frame]
			[/defend]
			[movement_anim]
				[frame]
					begin="0"
					end="150"
					image="units/drakes/sky-defend.png"
				[/frame]
			[/movement_anim]
			[standing_anim]
				start_time="0"
				[filter]
					[filter_location]
						terrain="!,W*,Qx*,Ql*"
						[or]
							terrain="Wwf,Wwr,*^V*"
						[/or]
					[/filter_location]
				[/filter]
				[frame]
					duration="150"
					image="units/drakes/sky.png"
				[/frame]
			[/standing_anim]
			[standing_anim]
				layer="60"
				start_time="0"
				submerge="0.01"
				[filter]
					[filter_location]
						terrain="W*,Qx*,Ql*"
						[not]
							terrain="Wwf,Wwr,*^V*"
						[/not]
					[/filter_location]
				[/filter]
				[frame]
					duration="150"
					image="units/drakes/sky-defend.png"
				[/frame]
			[/standing_anim]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="6"
				description=_ "slam"
				icon="attacks/slam-drake.png"
				name="slam"
				number="3"
				range="melee"
				type="impact"
			[/attack]
			[attack]
				damage="5"
				description=_ "fire breath"
				icon="attacks/fire-breath-drake.png"
				name="fire breath"
				number="3"
				range="ranged"
				type="fire"
				[specials]
					[chance_to_hit]
						active_on="offense"
						cumulative="yes"
#textdomain wesnoth
						description=_ "Marksman:
When used offensively, this attack always has at least a 60% chance to hit."
						id="marksman"
						name=_ "marksman"
						value="60"
					[/chance_to_hit]
				[/specials]
			[/attack]
			[modifications]
				[trait]
					female_name=_ "female^resilient"
					id="resilient"
					male_name=_ "resilient"
					name=_ "resilient"
					[effect]
						apply_to="hitpoints"
						increase_total="4"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
						times="per level"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^quick"
					id="quick"
					male_name=_ "quick"
					name=_ "quick"
					[effect]
						apply_to="movement"
						increase="1"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="-5%"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Drake Gladiator,Drake Slasher"
			alignment="lawful"
			alpha="256"
			attacks_left="1"
			cost="19"
			die_sound="drake-die.ogg"
			ellipse="misc/ellipse"
			experience="14"
			facing="nw"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="46"
			id="Drake Clasher-6"
			image="units/drakes/clasher.png"
#textdomain wesnoth-units
			language_name=_ "Drake Clasher"
			level="1"
			max_attacks="1"
			max_experience="32"
			max_hitpoints="46"
			max_moves="6"
			movement="5"
			movement_type="drakefoot"
			moves="6"
			name="Verdinos"
			profile="portraits/drakes/clasher.png"
			race="drake"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="1"
			type="Drake Clasher"
			undead_variation="drake"
			underlying_id="6"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			x="8"
			y="17"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					name="spear"
				[/filter_attack]
				[frame]
					begin="-200"
					end="-100"
					image="units/drakes/clasher-flying.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="75"
						image="units/drakes/clasher-attack-spear.png"
						sound="spear.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="75"
						image="units/drakes/clasher-attack-spear.png"
						sound="spear-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="75"
					end="175"
					image="units/drakes/clasher-flying.png"
				[/frame]
				[frame]
					begin="175"
					end="200"
					image="units/drakes/clasher.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				[filter_attack]
					name="sword"
				[/filter_attack]
				[frame]
					begin="-200"
					end="-100"
					image="units/drakes/clasher-flying.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="75"
						image="units/drakes/clasher-attack-sword.png"
						sound="sword-1.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="75"
						image="units/drakes/clasher-attack-sword.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="75"
					end="175"
					image="units/drakes/clasher-flying.png"
				[/frame]
				[frame]
					begin="175"
					end="200"
					image="units/drakes/clasher.png"
				[/frame]
			[/attack_anim]
			[death]
				[frame]
					begin="0"
					end="130"
					image="units/drakes/clasher-die-1.png"
				[/frame]
				[frame]
					begin="130"
					end="320"
					image="units/drakes/clasher-die-2.png"
				[/frame]
				[frame]
					begin="320"
					end="450"
					image="units/drakes/clasher-die-3.png"
				[/frame]
				[frame]
					begin="450"
					end="600"
					image="units/drakes/clasher-die-4.png"
				[/frame]
				[frame]
					begin="600"
					end="750"
					image="units/drakes/clasher-die-5.png"
				[/frame]
				[frame]
					begin="750"
					end="900"
					image="units/drakes/clasher-die-6.png"
				[/frame]
				[frame]
					begin="900"
					end="1050"
					image="units/drakes/clasher-die-7.png"
				[/frame]
				[frame]
					begin="1050"
					end="1200"
					image="units/drakes/clasher-die-8.png"
				[/frame]
				[frame]
					begin="1200"
					end="1350"
					image="units/drakes/clasher-die-9.png"
				[/frame]
				[frame]
					begin="1350"
					end="1500"
					image="units/drakes/clasher-die-10.png"
				[/frame]
			[/death]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/drakes/clasher.png"
				[/frame]
				[frame]
					duration="100"
					image="units/drakes/clasher-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/drakes/clasher-defend.png"
						sound="drake-hit-1.ogg,drake-hit-2.ogg,drake-hit-3.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/drakes/clasher-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/drakes/clasher.png"
				[/frame]
			[/defend]
			[defense]
				castle="60"
				cave="70"
				deep_water="90"
				flat="70"
				forest="60"
				frozen="80"
				fungus="60"
				hills="60"
				impassable="70"
				mountains="60"
				reef="70"
				sand="60"
				shallow_water="80"
				swamp_water="80"
				unwalkable="80"
				village="60"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="3"
				fungus="2"
				hills="1"
				impassable="99"
				mountains="1"
				reef="2"
				sand="1"
				shallow_water="3"
				swamp_water="3"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="130"
				blade="80"
				cold="150"
				fire="50"
				impact="70"
				pierce="100"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="5"
				description=_ "sword"
				icon="attacks/scimitar.png"
				name="sword"
				number="4"
				range="melee"
				type="blade"
			[/attack]
			[attack]
				damage="6"
				description=_ "spear"
				icon="attacks/spear.png"
				name="spear"
				number="4"
				range="melee"
				type="pierce"
				[specials]
					[firststrike]
#textdomain wesnoth
						description=_ "First Strike:
This unit always strikes first with this attack, even if they are defending."
						id="firststrike"
						name=_ "firststrike"
					[/firststrike]
				[/specials]
			[/attack]
			[modifications]
				[trait]
					female_name=_ "female^quick"
					id="quick"
					male_name=_ "quick"
					name=_ "quick"
					[effect]
						apply_to="movement"
						increase="1"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="-5%"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^resilient"
					id="resilient"
					male_name=_ "resilient"
					name=_ "resilient"
					[effect]
						apply_to="hitpoints"
						increase_total="4"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
						times="per level"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Saurian Oracle,Saurian Soothsayer"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="16"
			die_sound="hiss-die.wav"
			ellipse="misc/ellipse"
			experience="5"
			facing="n"
			flag_rgb="magenta"
			flies="false"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="23"
			id="Saurian Augur-19"
			image="units/saurians/augur.png"
#textdomain wesnoth-units
			language_name=_ "Saurian Augur"
			level="1"
			max_attacks="1"
			max_experience="15"
			max_hitpoints="23"
			max_moves="6"
			movement="6"
			movement_type="lizard"
			moves="6"
			name="Krexiss"
			profile="portraits/saurians/augur.png"
			race="lizard"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="1"
			type="Saurian Augur"
			undead_variation="saurian"
			underlying_id="19"
			unrenamable="no"
			upkeep="full"
			usage="healer"
			x="23"
			y="18"
			zoc="yes"
			[attack_anim]
				start_time="-300"
				[filter_attack]
					name="curse"
				[/filter_attack]
				[if]
					hits="yes"
					[missile_frame]
						begin="-200"
						end="0"
						image="projectiles/whitemissile-n.png"
						image_diagonal="projectiles/whitemissile-ne.png"
						offset="0.0~0.8"
					[/missile_frame]
					[missile_frame]
						begin="0"
						end="50"
						halo="projectiles/whitemissile-impact-1.png"
						offset="0.8"
					[/missile_frame]
					[missile_frame]
						begin="50"
						end="100"
						halo="projectiles/whitemissile-impact-2.png"
						offset="0.92"
					[/missile_frame]
					[missile_frame]
						begin="100"
						end="150"
						halo="projectiles/whitemissile-impact-3.png"
						offset="0.94"
					[/missile_frame]
					[missile_frame]
						begin="150"
						end="200"
						halo="projectiles/whitemissile-impact-4.png"
						offset="0.96"
					[/missile_frame]
					[missile_frame]
						begin="200"
						end="250"
						halo="projectiles/whitemissile-impact-5.png"
						offset="0.98"
					[/missile_frame]
					[missile_frame]
						begin="250"
						end="300"
						halo="projectiles/whitemissile-impact-6.png"
						offset="1.0"
					[/missile_frame]
					[missile_frame]
						begin="300"
						end="350"
						halo="projectiles/whitemissile-impact-7.png"
						offset="1.02"
					[/missile_frame]
					[missile_frame]
						begin="350"
						end="400"
						halo="projectiles/whitemissile-impact-8.png"
						offset="1.04"
					[/missile_frame]
				[/if]
				[else]
					hits="no"
					[missile_frame]
						alpha=".8~0.0:200"
						begin="-200"
						end="0"
						image="projectiles/whitemissile-n.png"
						image_diagonal="projectiles/whitemissile-ne.png"
						offset="0.0~0.8"
					[/missile_frame]
				[/else]
				[frame]
					duration="50"
					halo="halo/saurian-magic-halo-1.png"
					image="units/saurians/augur-magic-1.png"
				[/frame]
				[frame]
					duration="60"
					halo="halo/saurian-magic-halo-2.png"
					image="units/saurians/augur-magic-1.png"
					sound="magicmissile.wav"
				[/frame]
				[frame]
					duration="70"
					halo="halo/saurian-magic-halo-3.png"
					image="units/saurians/augur-magic-2.png"
				[/frame]
				[frame]
					duration="80"
					halo="halo/saurian-magic-halo-4.png"
					image="units/saurians/augur-magic-2.png"
				[/frame]
				[frame]
					duration="90"
					halo="halo/saurian-magic-halo-5.png"
					image="units/saurians/augur-magic-1.png"
				[/frame]
				[frame]
					duration="100"
					halo="halo/saurian-magic-halo-6.png"
					image="units/saurians/augur-magic-1.png"
				[/frame]
				[frame]
					duration="100"
					halo="halo/saurian-magic-halo-7.png"
					image="units/saurians/augur.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				offset="0.0~0.3,0.3~0.45,0.45~0.3,0.3~0.0"
				start_time="-250"
				[filter_attack]
					name="staff"
				[/filter_attack]
				[frame]
					duration="150"
					image="units/saurians/augur-melee-1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						duration="100"
						image="units/saurians/augur-melee-2.png"
						sound="staff.wav"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						duration="100"
						image="units/saurians/augur-melee-2.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					duration="100"
					image="units/saurians/augur-melee-3.png"
				[/frame]
				[frame]
					duration="90"
					image="units/saurians/augur-melee-4.png"
				[/frame]
				[frame]
					duration="80"
					image="units/saurians/augur-melee-5.png"
				[/frame]
				[frame]
					duration="50"
					image="units/saurians/augur-defend-1.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/saurians/augur-defend-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/saurians/augur-defend-2.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/saurians/augur-defend-2.png"
						sound="hiss-hit.wav"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/saurians/augur-defend-2.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/saurians/augur-defend-1.png"
				[/frame]
			[/defend]
			[healing_anim]
				start_time="-300"
				[frame]
					duration="50"
					halo="halo/saurian-magic-halo-1.png"
					image="units/saurians/augur-magic-1.png"
				[/frame]
				[frame]
					duration="60"
					halo="halo/saurian-magic-halo-2.png"
					image="units/saurians/augur-magic-1.png"
				[/frame]
				[frame]
					duration="70"
					halo="halo/saurian-magic-halo-3.png"
					image="units/saurians/augur-magic-2.png"
				[/frame]
				[frame]
					duration="80"
					halo="halo/saurian-magic-halo-4.png"
					image="units/saurians/augur-magic-2.png"
				[/frame]
				[frame]
					duration="90"
					halo="halo/saurian-magic-halo-5.png"
					image="units/saurians/augur-magic-1.png"
				[/frame]
				[frame]
					duration="100"
					halo="halo/saurian-magic-halo-6.png"
					image="units/saurians/augur-magic-1.png"
				[/frame]
				[frame]
					duration="100"
					halo="halo/saurian-magic-halo-7.png"
					image="units/saurians/augur.png"
				[/frame]
			[/healing_anim]
			[portrait]
				image="portraits/saurians/transparent/augur.png"
				mirror="false"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/saurians/transparent/augur.png"
				mirror="true"
				side="right"
				size="400"
			[/portrait]
			[defense]
				castle="40"
				cave="40"
				deep_water="80"
				flat="60"
				forest="40"
				frozen="70"
				fungus="40"
				hills="40"
				impassable="40"
				mountains="40"
				reef="60"
				sand="40"
				shallow_water="60"
				swamp_water="40"
				unwalkable="80"
				village="50"
			[/defense]
			[movement_costs]
				castle="1"
				cave="1"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="4"
				fungus="1"
				hills="1"
				impassable="99"
				mountains="2"
				reef="2"
				sand="1"
				shallow_water="3"
				swamp_water="1"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="110"
				cold="120"
				fire="120"
				impact="110"
				pierce="80"
			[/resistance]
			[abilities]
				[heals]
					affect_allies="yes"
					affect_self="no"
#textdomain wesnoth
					description=_ "Heals +4:
Allows the unit to heal adjacent allied units at the beginning of our turn.

A unit cared for by this healer may heal up to 4 HP per turn, or stop poison from taking effect for that turn.
A poisoned unit cannot be cured of its poison by a healer, and must seek the care of a village or a unit that can cure."
					female_name=_ "female^heals +4"
					id="healing"
					name=_ "heals +4"
					poison="slowed"
					value="4"
					[affect_adjacent]
						adjacent="n,ne,se,s,sw,nw"
					[/affect_adjacent]
				[/heals]
			[/abilities]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="5"
#textdomain wesnoth-units
				description=_ "staff"
				icon="attacks/staff-magic.png"
				name="staff"
				number="2"
				range="melee"
				type="impact"
			[/attack]
			[attack]
				damage="5"
				description=_ "curse"
				icon="attacks/curse.png"
				name="curse"
				number="3"
				range="ranged"
				type="cold"
				[specials]
					[chance_to_hit]
						cumulative="no"
#textdomain wesnoth
						description=_ "Magical:
This attack always has a 70% chance to hit regardless of the defensive ability of the unit being attacked."
						id="magical"
						name=_ "magical"
						value="70"
					[/chance_to_hit]
				[/specials]
			[/attack]
			[modifications]
				[trait]
					female_name=_ "female^intelligent"
					id="intelligent"
					male_name=_ "intelligent"
					name=_ "intelligent"
					[effect]
						apply_to="max_experience"
						increase="-20%"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^strong"
					id="strong"
					male_name=_ "strong"
					name=_ "strong"
					[effect]
						apply_to="attack"
						increase_damage="1"
						range="melee"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Drake Warrior"
			alignment="lawful"
			alpha="256"
			attacks_left="1"
			cost="17"
			die_sound="drake-die.ogg"
			ellipse="misc/ellipse"
			experience="16"
			facing="se"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="38"
			id="Drake Fighter-20"
			image="units/drakes/fighter.png"
#textdomain wesnoth-units
			language_name=_ "Drake Fighter"
			level="1"
			max_attacks="1"
			max_experience="29"
			max_hitpoints="38"
			max_moves="7"
			movement="6"
			movement_type="drakefly"
			moves="7"
			name="Gri Kor"
			profile="portraits/drakes/fighter.png"
			race="drake"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="1"
			type="Drake Fighter"
			undead_variation="drake"
			underlying_id="20"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			x="21"
			y="16"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					name="fire breath"
				[/filter_attack]
				[if]
					direction="n"
					[missile_frame]
						begin="-400"
						end="100"
						halo="projectiles/fire-breath-n-1.png:80,projectiles/fire-breath-n-2.png:80,projectiles/fire-breath-n-3.png:80,projectiles/fire-breath-n-4.png:80,projectiles/fire-breath-n-5.png:80"
						halo_x="11"
						halo_y="-34"
					[/missile_frame]
				[/if]
				[else]
					direction="s"
					[missile_frame]
						begin="-400"
						end="100"
						halo="projectiles/fire-breath-s-1.png:80,projectiles/fire-breath-s-2.png:80,projectiles/fire-breath-s-3.png:80,projectiles/fire-breath-s-4.png:80,projectiles/fire-breath-s-5.png:80"
						halo_x="11"
						halo_y="15"
					[/missile_frame]
				[/else]
				[else]
					direction="ne,nw"
					[missile_frame]
						begin="-400"
						end="100"
						halo="projectiles/fire-breath-ne-1.png:80,projectiles/fire-breath-ne-2.png:80,projectiles/fire-breath-ne-3.png:80,projectiles/fire-breath-ne-4.png:80,projectiles/fire-breath-ne-5.png:80"
						halo_x="24"
						halo_y="-22"
					[/missile_frame]
				[/else]
				[else]
					direction="se,sw"
					[missile_frame]
						begin="-400"
						end="100"
						halo="projectiles/fire-breath-se-1.png:80,projectiles/fire-breath-se-2.png:80,projectiles/fire-breath-se-3.png:80,projectiles/fire-breath-se-4.png:80,projectiles/fire-breath-se-5.png:80"
						halo_x="26"
						halo_y="10"
					[/missile_frame]
				[/else]
				[if]
					hits="no"
					[frame]
						begin="-400"
						end="-350"
						image="units/drakes/fighter-attack-ranged1.png"
						sound="flame-big-miss.ogg"
					[/frame]
				[/if]
				[else]
					hits="yes"
					[frame]
						begin="-400"
						end="-350"
						image="units/drakes/fighter-attack-ranged1.png"
						sound="flame-big.ogg"
					[/frame]
				[/else]
				[frame]
					begin="-350"
					end="-150"
					image="units/drakes/fighter-attack-ranged2.png"
				[/frame]
				[frame]
					begin="-150"
					end="0"
					image="units/drakes/fighter.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				[filter_attack]
					name="scimitar"
				[/filter_attack]
				[frame]
					begin="-200"
					end="-175"
					image="units/drakes/fighter.png"
				[/frame]
				[frame]
					begin="-175"
					end="-100"
					image="units/drakes/fighter-attack-close1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="75"
						image="units/drakes/fighter-attack-close2.png"
						sound="sword-1.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="75"
						image="units/drakes/fighter-attack-close2.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="75"
					end="150"
					image="units/drakes/fighter-defend.png"
				[/frame]
				[frame]
					begin="150"
					end="175"
					image="units/drakes/fighter.png"
				[/frame]
			[/attack_anim]
			[death]
				[frame]
					begin="0"
					end="130"
					image="units/drakes/fighter-die-1.png"
				[/frame]
				[frame]
					begin="130"
					end="320"
					image="units/drakes/fighter-die-2.png"
				[/frame]
				[frame]
					begin="320"
					end="450"
					image="units/drakes/fighter-die-3.png"
				[/frame]
				[frame]
					begin="450"
					end="600"
					image="units/drakes/fighter-die-4.png"
				[/frame]
				[frame]
					begin="600"
					end="750"
					image="units/drakes/fighter-die-5.png"
				[/frame]
				[frame]
					begin="750"
					end="900"
					image="units/drakes/fighter-die-6.png"
				[/frame]
				[frame]
					begin="900"
					end="1050"
					image="units/drakes/fighter-die-7.png"
				[/frame]
				[frame]
					begin="1050"
					end="1200"
					image="units/drakes/fighter-die-8.png"
				[/frame]
			[/death]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/drakes/fighter.png"
				[/frame]
				[frame]
					duration="100"
					image="units/drakes/fighter-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/drakes/fighter-defend.png"
						sound="drake-hit-1.ogg,drake-hit-2.ogg,drake-hit-3.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/drakes/fighter-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/drakes/fighter.png"
				[/frame]
			[/defend]
			[movement_anim]
				[frame]
					begin="0"
					end="150"
					image="units/drakes/fighter-flying.png"
				[/frame]
			[/movement_anim]
			[standing_anim]
				start_time="0"
				[filter]
					[filter_location]
						terrain="!,W*,Qx*,Ql*"
						[or]
							terrain="Wwf,Wwr,*^V*"
						[/or]
					[/filter_location]
				[/filter]
				[frame]
					duration="150"
					image="units/drakes/fighter.png"
				[/frame]
			[/standing_anim]
			[standing_anim]
				layer="60"
				start_time="0"
				submerge="0.01"
				[filter]
					[filter_location]
						terrain="W*,Qx*,Ql*"
						[not]
							terrain="Wwf,Wwr,*^V*"
						[/not]
					[/filter_location]
				[/filter]
				[frame]
					duration="150"
					image="units/drakes/fighter-flying.png"
				[/frame]
			[/standing_anim]
			[defense]
				castle="60"
				cave="70"
				deep_water="80"
				flat="70"
				forest="60"
				frozen="80"
				fungus="60"
				hills="60"
				impassable="70"
				mountains="60"
				reef="70"
				sand="60"
				shallow_water="80"
				swamp_water="70"
				unwalkable="60"
				village="60"
			[/defense]
			[movement_costs]
				castle="1"
				cave="3"
				deep_water="2"
				flat="1"
				forest="1"
				frozen="2"
				fungus="2"
				hills="1"
				impassable="99"
				mountains="1"
				reef="1"
				sand="1"
				shallow_water="1"
				swamp_water="1"
				unwalkable="1"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="130"
				blade="90"
				cold="150"
				fire="50"
				impact="80"
				pierce="110"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="8"
				description=_ "scimitar"
				icon="attacks/scimitar.png"
				name="scimitar"
				number="3"
				range="melee"
				type="blade"
			[/attack]
			[attack]
				damage="3"
				description=_ "fire breath"
				icon="attacks/fire-breath-drake.png"
				name="fire breath"
				number="3"
				range="ranged"
				type="fire"
			[/attack]
			[modifications]
				[trait]
#textdomain wesnoth
					female_name=_ "female^quick"
					id="quick"
					male_name=_ "quick"
					name=_ "quick"
					[effect]
						apply_to="movement"
						increase="1"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="-5%"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^strong"
					id="strong"
					male_name=_ "strong"
					name=_ "strong"
					[effect]
						apply_to="attack"
						increase_damage="1"
						range="melee"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Drake Warrior"
			alignment="lawful"
			alpha="256"
			attacks_left="1"
			cost="17"
			die_sound="drake-die.ogg"
			ellipse="misc/ellipse"
			experience="0"
			facing="s"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="45"
			id="Drake Fighter-23"
			image="units/drakes/fighter.png"
#textdomain wesnoth-units
			language_name=_ "Drake Fighter"
			level="1"
			max_attacks="1"
			max_experience="29"
			max_hitpoints="45"
			max_moves="6"
			movement="6"
			movement_type="drakefly"
			moves="6"
			name="Mark"
			profile="portraits/drakes/fighter.png"
			race="drake"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="1"
			type="Drake Fighter"
			undead_variation="drake"
			underlying_id="23"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			x="22"
			y="13"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					name="fire breath"
				[/filter_attack]
				[if]
					direction="n"
					[missile_frame]
						begin="-400"
						end="100"
						halo="projectiles/fire-breath-n-1.png:80,projectiles/fire-breath-n-2.png:80,projectiles/fire-breath-n-3.png:80,projectiles/fire-breath-n-4.png:80,projectiles/fire-breath-n-5.png:80"
						halo_x="11"
						halo_y="-34"
					[/missile_frame]
				[/if]
				[else]
					direction="s"
					[missile_frame]
						begin="-400"
						end="100"
						halo="projectiles/fire-breath-s-1.png:80,projectiles/fire-breath-s-2.png:80,projectiles/fire-breath-s-3.png:80,projectiles/fire-breath-s-4.png:80,projectiles/fire-breath-s-5.png:80"
						halo_x="11"
						halo_y="15"
					[/missile_frame]
				[/else]
				[else]
					direction="ne,nw"
					[missile_frame]
						begin="-400"
						end="100"
						halo="projectiles/fire-breath-ne-1.png:80,projectiles/fire-breath-ne-2.png:80,projectiles/fire-breath-ne-3.png:80,projectiles/fire-breath-ne-4.png:80,projectiles/fire-breath-ne-5.png:80"
						halo_x="24"
						halo_y="-22"
					[/missile_frame]
				[/else]
				[else]
					direction="se,sw"
					[missile_frame]
						begin="-400"
						end="100"
						halo="projectiles/fire-breath-se-1.png:80,projectiles/fire-breath-se-2.png:80,projectiles/fire-breath-se-3.png:80,projectiles/fire-breath-se-4.png:80,projectiles/fire-breath-se-5.png:80"
						halo_x="26"
						halo_y="10"
					[/missile_frame]
				[/else]
				[if]
					hits="no"
					[frame]
						begin="-400"
						end="-350"
						image="units/drakes/fighter-attack-ranged1.png"
						sound="flame-big-miss.ogg"
					[/frame]
				[/if]
				[else]
					hits="yes"
					[frame]
						begin="-400"
						end="-350"
						image="units/drakes/fighter-attack-ranged1.png"
						sound="flame-big.ogg"
					[/frame]
				[/else]
				[frame]
					begin="-350"
					end="-150"
					image="units/drakes/fighter-attack-ranged2.png"
				[/frame]
				[frame]
					begin="-150"
					end="0"
					image="units/drakes/fighter.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				[filter_attack]
					name="scimitar"
				[/filter_attack]
				[frame]
					begin="-200"
					end="-175"
					image="units/drakes/fighter.png"
				[/frame]
				[frame]
					begin="-175"
					end="-100"
					image="units/drakes/fighter-attack-close1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="75"
						image="units/drakes/fighter-attack-close2.png"
						sound="sword-1.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="75"
						image="units/drakes/fighter-attack-close2.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="75"
					end="150"
					image="units/drakes/fighter-defend.png"
				[/frame]
				[frame]
					begin="150"
					end="175"
					image="units/drakes/fighter.png"
				[/frame]
			[/attack_anim]
			[death]
				[frame]
					begin="0"
					end="130"
					image="units/drakes/fighter-die-1.png"
				[/frame]
				[frame]
					begin="130"
					end="320"
					image="units/drakes/fighter-die-2.png"
				[/frame]
				[frame]
					begin="320"
					end="450"
					image="units/drakes/fighter-die-3.png"
				[/frame]
				[frame]
					begin="450"
					end="600"
					image="units/drakes/fighter-die-4.png"
				[/frame]
				[frame]
					begin="600"
					end="750"
					image="units/drakes/fighter-die-5.png"
				[/frame]
				[frame]
					begin="750"
					end="900"
					image="units/drakes/fighter-die-6.png"
				[/frame]
				[frame]
					begin="900"
					end="1050"
					image="units/drakes/fighter-die-7.png"
				[/frame]
				[frame]
					begin="1050"
					end="1200"
					image="units/drakes/fighter-die-8.png"
				[/frame]
			[/death]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/drakes/fighter.png"
				[/frame]
				[frame]
					duration="100"
					image="units/drakes/fighter-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/drakes/fighter-defend.png"
						sound="drake-hit-1.ogg,drake-hit-2.ogg,drake-hit-3.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/drakes/fighter-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/drakes/fighter.png"
				[/frame]
			[/defend]
			[movement_anim]
				[frame]
					begin="0"
					end="150"
					image="units/drakes/fighter-flying.png"
				[/frame]
			[/movement_anim]
			[standing_anim]
				start_time="0"
				[filter]
					[filter_location]
						terrain="!,W*,Qx*,Ql*"
						[or]
							terrain="Wwf,Wwr,*^V*"
						[/or]
					[/filter_location]
				[/filter]
				[frame]
					duration="150"
					image="units/drakes/fighter.png"
				[/frame]
			[/standing_anim]
			[standing_anim]
				layer="60"
				start_time="0"
				submerge="0.01"
				[filter]
					[filter_location]
						terrain="W*,Qx*,Ql*"
						[not]
							terrain="Wwf,Wwr,*^V*"
						[/not]
					[/filter_location]
				[/filter]
				[frame]
					duration="150"
					image="units/drakes/fighter-flying.png"
				[/frame]
			[/standing_anim]
			[defense]
				castle="60"
				cave="70"
				deep_water="80"
				flat="70"
				forest="60"
				frozen="80"
				fungus="60"
				hills="60"
				impassable="70"
				mountains="60"
				reef="70"
				sand="60"
				shallow_water="80"
				swamp_water="70"
				unwalkable="60"
				village="60"
			[/defense]
			[movement_costs]
				castle="1"
				cave="3"
				deep_water="2"
				flat="1"
				forest="1"
				frozen="2"
				fungus="2"
				hills="1"
				impassable="99"
				mountains="1"
				reef="1"
				sand="1"
				shallow_water="1"
				swamp_water="1"
				unwalkable="1"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="130"
				blade="90"
				cold="150"
				fire="50"
				impact="80"
				pierce="110"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="8"
				description=_ "scimitar"
				icon="attacks/scimitar.png"
				name="scimitar"
				number="3"
				range="melee"
				type="blade"
			[/attack]
			[attack]
				damage="3"
				description=_ "fire breath"
				icon="attacks/fire-breath-drake.png"
				name="fire breath"
				number="3"
				range="ranged"
				type="fire"
			[/attack]
			[modifications]
				[trait]
#textdomain wesnoth
					female_name=_ "female^strong"
					id="strong"
					male_name=_ "strong"
					name=_ "strong"
					[effect]
						apply_to="attack"
						increase_damage="1"
						range="melee"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^resilient"
					id="resilient"
					male_name=_ "resilient"
					name=_ "resilient"
					[effect]
						apply_to="hitpoints"
						increase_total="4"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
						times="per level"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Saurian Oracle,Saurian Soothsayer"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="16"
			die_sound="hiss-die.wav"
			ellipse="misc/ellipse"
			experience="16"
			facing="nw"
			flag_rgb="magenta"
			flies="false"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="22"
			id="Saurian Augur-24"
			image="units/saurians/augur.png"
#textdomain wesnoth-units
			language_name=_ "Saurian Augur"
			level="1"
			max_attacks="1"
			max_experience="20"
			max_hitpoints="22"
			max_moves="7"
			movement="6"
			movement_type="lizard"
			moves="7"
			name="Lazzix"
			profile="portraits/saurians/augur.png"
			race="lizard"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="1"
			type="Saurian Augur"
			undead_variation="saurian"
			underlying_id="24"
			unrenamable="no"
			upkeep="full"
			usage="healer"
			x="24"
			y="17"
			zoc="yes"
			[attack_anim]
				start_time="-300"
				[filter_attack]
					name="curse"
				[/filter_attack]
				[if]
					hits="yes"
					[missile_frame]
						begin="-200"
						end="0"
						image="projectiles/whitemissile-n.png"
						image_diagonal="projectiles/whitemissile-ne.png"
						offset="0.0~0.8"
					[/missile_frame]
					[missile_frame]
						begin="0"
						end="50"
						halo="projectiles/whitemissile-impact-1.png"
						offset="0.8"
					[/missile_frame]
					[missile_frame]
						begin="50"
						end="100"
						halo="projectiles/whitemissile-impact-2.png"
						offset="0.92"
					[/missile_frame]
					[missile_frame]
						begin="100"
						end="150"
						halo="projectiles/whitemissile-impact-3.png"
						offset="0.94"
					[/missile_frame]
					[missile_frame]
						begin="150"
						end="200"
						halo="projectiles/whitemissile-impact-4.png"
						offset="0.96"
					[/missile_frame]
					[missile_frame]
						begin="200"
						end="250"
						halo="projectiles/whitemissile-impact-5.png"
						offset="0.98"
					[/missile_frame]
					[missile_frame]
						begin="250"
						end="300"
						halo="projectiles/whitemissile-impact-6.png"
						offset="1.0"
					[/missile_frame]
					[missile_frame]
						begin="300"
						end="350"
						halo="projectiles/whitemissile-impact-7.png"
						offset="1.02"
					[/missile_frame]
					[missile_frame]
						begin="350"
						end="400"
						halo="projectiles/whitemissile-impact-8.png"
						offset="1.04"
					[/missile_frame]
				[/if]
				[else]
					hits="no"
					[missile_frame]
						alpha=".8~0.0:200"
						begin="-200"
						end="0"
						image="projectiles/whitemissile-n.png"
						image_diagonal="projectiles/whitemissile-ne.png"
						offset="0.0~0.8"
					[/missile_frame]
				[/else]
				[frame]
					duration="50"
					halo="halo/saurian-magic-halo-1.png"
					image="units/saurians/augur-magic-1.png"
				[/frame]
				[frame]
					duration="60"
					halo="halo/saurian-magic-halo-2.png"
					image="units/saurians/augur-magic-1.png"
					sound="magicmissile.wav"
				[/frame]
				[frame]
					duration="70"
					halo="halo/saurian-magic-halo-3.png"
					image="units/saurians/augur-magic-2.png"
				[/frame]
				[frame]
					duration="80"
					halo="halo/saurian-magic-halo-4.png"
					image="units/saurians/augur-magic-2.png"
				[/frame]
				[frame]
					duration="90"
					halo="halo/saurian-magic-halo-5.png"
					image="units/saurians/augur-magic-1.png"
				[/frame]
				[frame]
					duration="100"
					halo="halo/saurian-magic-halo-6.png"
					image="units/saurians/augur-magic-1.png"
				[/frame]
				[frame]
					duration="100"
					halo="halo/saurian-magic-halo-7.png"
					image="units/saurians/augur.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				offset="0.0~0.3,0.3~0.45,0.45~0.3,0.3~0.0"
				start_time="-250"
				[filter_attack]
					name="staff"
				[/filter_attack]
				[frame]
					duration="150"
					image="units/saurians/augur-melee-1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						duration="100"
						image="units/saurians/augur-melee-2.png"
						sound="staff.wav"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						duration="100"
						image="units/saurians/augur-melee-2.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					duration="100"
					image="units/saurians/augur-melee-3.png"
				[/frame]
				[frame]
					duration="90"
					image="units/saurians/augur-melee-4.png"
				[/frame]
				[frame]
					duration="80"
					image="units/saurians/augur-melee-5.png"
				[/frame]
				[frame]
					duration="50"
					image="units/saurians/augur-defend-1.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/saurians/augur-defend-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/saurians/augur-defend-2.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/saurians/augur-defend-2.png"
						sound="hiss-hit.wav"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/saurians/augur-defend-2.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/saurians/augur-defend-1.png"
				[/frame]
			[/defend]
			[healing_anim]
				start_time="-300"
				[frame]
					duration="50"
					halo="halo/saurian-magic-halo-1.png"
					image="units/saurians/augur-magic-1.png"
				[/frame]
				[frame]
					duration="60"
					halo="halo/saurian-magic-halo-2.png"
					image="units/saurians/augur-magic-1.png"
				[/frame]
				[frame]
					duration="70"
					halo="halo/saurian-magic-halo-3.png"
					image="units/saurians/augur-magic-2.png"
				[/frame]
				[frame]
					duration="80"
					halo="halo/saurian-magic-halo-4.png"
					image="units/saurians/augur-magic-2.png"
				[/frame]
				[frame]
					duration="90"
					halo="halo/saurian-magic-halo-5.png"
					image="units/saurians/augur-magic-1.png"
				[/frame]
				[frame]
					duration="100"
					halo="halo/saurian-magic-halo-6.png"
					image="units/saurians/augur-magic-1.png"
				[/frame]
				[frame]
					duration="100"
					halo="halo/saurian-magic-halo-7.png"
					image="units/saurians/augur.png"
				[/frame]
			[/healing_anim]
			[portrait]
				image="portraits/saurians/transparent/augur.png"
				mirror="false"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/saurians/transparent/augur.png"
				mirror="true"
				side="right"
				size="400"
			[/portrait]
			[defense]
				castle="40"
				cave="40"
				deep_water="80"
				flat="60"
				forest="40"
				frozen="70"
				fungus="40"
				hills="40"
				impassable="40"
				mountains="40"
				reef="60"
				sand="40"
				shallow_water="60"
				swamp_water="40"
				unwalkable="80"
				village="50"
			[/defense]
			[movement_costs]
				castle="1"
				cave="1"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="4"
				fungus="1"
				hills="1"
				impassable="99"
				mountains="2"
				reef="2"
				sand="1"
				shallow_water="3"
				swamp_water="1"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="110"
				cold="120"
				fire="120"
				impact="110"
				pierce="80"
			[/resistance]
			[abilities]
				[heals]
					affect_allies="yes"
					affect_self="no"
#textdomain wesnoth
					description=_ "Heals +4:
Allows the unit to heal adjacent allied units at the beginning of our turn.

A unit cared for by this healer may heal up to 4 HP per turn, or stop poison from taking effect for that turn.
A poisoned unit cannot be cured of its poison by a healer, and must seek the care of a village or a unit that can cure."
					female_name=_ "female^heals +4"
					id="healing"
					name=_ "heals +4"
					poison="slowed"
					value="4"
					[affect_adjacent]
						adjacent="n,ne,se,s,sw,nw"
					[/affect_adjacent]
				[/heals]
			[/abilities]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="5"
#textdomain wesnoth-units
				description=_ "staff"
				icon="attacks/staff-magic.png"
				name="staff"
				number="2"
				range="melee"
				type="impact"
			[/attack]
			[attack]
				damage="5"
				description=_ "curse"
				icon="attacks/curse.png"
				name="curse"
				number="3"
				range="ranged"
				type="cold"
				[specials]
					[chance_to_hit]
						cumulative="no"
#textdomain wesnoth
						description=_ "Magical:
This attack always has a 70% chance to hit regardless of the defensive ability of the unit being attacked."
						id="magical"
						name=_ "magical"
						value="70"
					[/chance_to_hit]
				[/specials]
			[/attack]
			[modifications]
				[trait]
					female_name=_ "female^strong"
					id="strong"
					male_name=_ "strong"
					name=_ "strong"
					[effect]
						apply_to="attack"
						increase_damage="1"
						range="melee"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^quick"
					id="quick"
					male_name=_ "quick"
					name=_ "quick"
					[effect]
						apply_to="movement"
						increase="1"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="-5%"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Inferno Drake"
			alignment="lawful"
			allow_changes="yes"
			allow_player="yes"
			alpha="256"
			attacks_left="1"
			canrecruit="yes"
			colour="1"
			controller="human"
			cost="35"
			current_player="KnightKunibert"
			die_sound="drake-die.ogg"
			experience="1"
			facing="se"
			flying="no"
			fog="yes"
			gender="male"
			gold="100"
			goto_x="-999"
			goto_y="-999"
			hitpoints="63"
			id="KnightKunibert1"
			image="units/drakes/fire.png"
			income="0"
#textdomain wesnoth-units
			language_name=_ "Fire Drake"
			leader="Drake Flare,Fire Drake,Drake Slasher,Drake Gladiator,Drake Warrior,Saurian Oracle,Saurian Soothsayer"
			level="2"
			max_attacks="1"
			max_experience="56"
			max_hitpoints="63"
			max_moves="5"
			movement="5"
			movement_type="drakefly"
			moves="5"
			mp_countdown="yes"
			mp_countdown_action_bonus="20"
			mp_countdown_init_time="270"
			mp_countdown_reservoir_time="270"
			mp_countdown_turn_bonus="200"
			name="KnightKunibert"
			profile="portraits/drakes/burner.png"
			race="drake"
			random_leader="Drake Flare,Fire Drake,Drake Slasher,Drake Gladiator,Drake Warrior"
			random_traits="no"
			recruit="Drake Burner,Drake Clasher,Drake Glider,Drake Fighter,Saurian Skirmisher,Saurian Augur"
			resting="yes"
			save_id="KnightKunibert1"
			share_maps="no"
			share_view="yes"
			shroud="no"
			side="1"
			team_name="north"
			terrain_liked="Hh, Ha, Ds, Ss"
			type="Fire Drake"
			undead_variation="drake"
			underlying_id="1"
			unrenamable="no"
			upkeep="full"
			usage="archer"
			user_team_name="wesnoth-multiplayerteamname^North"
			village_gold="2"
			zoc="yes"
			[defense]
				castle="60"
				cave="70"
				deep_water="80"
				flat="70"
				forest="60"
				frozen="80"
				fungus="60"
				hills="60"
				impassable="70"
				mountains="60"
				reef="70"
				sand="60"
				shallow_water="80"
				swamp_water="70"
				unwalkable="60"
				village="60"
			[/defense]
			[movement_costs]
				castle="1"
				cave="3"
				deep_water="2"
				flat="1"
				forest="1"
				frozen="2"
				fungus="2"
				hills="1"
				impassable="99"
				mountains="1"
				reef="1"
				sand="1"
				shallow_water="1"
				swamp_water="1"
				unwalkable="1"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="130"
				blade="90"
				cold="150"
				fire="40"
				impact="80"
				pierce="110"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="9"
				description=_ "claws"
				icon="attacks/claws-drake.png"
				name="claws"
				number="2"
				range="melee"
				type="blade"
			[/attack]
			[attack]
				damage="7"
				description=_ "fire breath"
				icon="attacks/fire-breath-drake.png"
				name="fire breath"
				number="5"
				range="ranged"
				type="fire"
			[/attack]
			[modifications]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Hurricane Drake"
			alignment="lawful"
			alpha="256"
			attacks_left="1"
			cost="30"
			die_sound="drake-die.ogg"
			ellipse="misc/ellipse"
			experience="5"
			facing="s"
			flies="false"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="48"
			id="Drake Glider-3"
			image="units/drakes/sky.png"
			language_name=_ "Sky Drake"
			level="2"
			max_attacks="1"
			max_experience="56"
			max_hitpoints="48"
			max_moves="10"
			movement="9"
			movement_type="fly"
			moves="10"
			name="Garush"
			profile="portraits/drakes/glider.png"
			race="drake"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="1"
			type="Sky Drake"
			undead_variation="drake"
			underlying_id="3"
			unrenamable="no"
			upkeep="full"
			usage="scout"
			zoc="yes"
			[defense]
				castle="50"
				cave="70"
				deep_water="50"
				flat="50"
				forest="50"
				frozen="50"
				fungus="60"
				hills="50"
				impassable="80"
				mountains="50"
				reef="50"
				sand="50"
				shallow_water="50"
				swamp_water="50"
				unwalkable="50"
				village="50"
			[/defense]
			[movement_costs]
				castle="1"
				cave="3"
				deep_water="1"
				flat="1"
				forest="1"
				frozen="1"
				fungus="2"
				hills="1"
				impassable="99"
				mountains="1"
				reef="1"
				sand="1"
				shallow_water="1"
				swamp_water="1"
				unwalkable="1"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="130"
				blade="90"
				cold="150"
				fire="50"
				impact="80"
				pierce="110"
			[/resistance]
			[attack_anim]
				[filter_attack]
					name="fire breath"
				[/filter_attack]
				[if]
					direction="n"
					[missile_frame]
						begin="-400"
						end="100"
						halo="projectiles/fire-breath-n-1.png:80,projectiles/fire-breath-n-2.png:80,projectiles/fire-breath-n-3.png:80,projectiles/fire-breath-n-4.png:80,projectiles/fire-breath-n-5.png:80"
						halo_x="9"
						halo_y="-34"
					[/missile_frame]
				[/if]
				[else]
					direction="s"
					[missile_frame]
						begin="-400"
						end="100"
						halo="projectiles/fire-breath-s-1.png:80,projectiles/fire-breath-s-2.png:80,projectiles/fire-breath-s-3.png:80,projectiles/fire-breath-s-4.png:80,projectiles/fire-breath-s-5.png:80"
						halo_x="9"
						halo_y="15"
					[/missile_frame]
				[/else]
				[else]
					direction="ne,nw"
					[missile_frame]
						begin="-400"
						end="100"
						halo="projectiles/fire-breath-ne-1.png:80,projectiles/fire-breath-ne-2.png:80,projectiles/fire-breath-ne-3.png:80,projectiles/fire-breath-ne-4.png:80,projectiles/fire-breath-ne-5.png:80"
						halo_x="22"
						halo_y="-22"
					[/missile_frame]
				[/else]
				[else]
					direction="se,sw"
					[missile_frame]
						begin="-400"
						end="100"
						halo="projectiles/fire-breath-se-1.png:80,projectiles/fire-breath-se-2.png:80,projectiles/fire-breath-se-3.png:80,projectiles/fire-breath-se-4.png:80,projectiles/fire-breath-se-5.png:80"
						halo_x="24"
						halo_y="10"
					[/missile_frame]
				[/else]
				[if]
					hits="no"
					[frame]
						begin="-400"
						end="-350"
						image="units/drakes/sky.png"
						sound="flame-big-miss.ogg"
					[/frame]
				[/if]
				[else]
					hits="yes"
					[frame]
						begin="-400"
						end="-350"
						image="units/drakes/sky.png"
						sound="flame-big.ogg"
					[/frame]
				[/else]
				[frame]
					begin="-350"
					end="-150"
					image="units/drakes/sky-attack-ranged-fire.png"
				[/frame]
				[frame]
					begin="-150"
					end="0"
					image="units/drakes/sky.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				hits="yes"
				[filter_attack]
					name="slam"
				[/filter_attack]
				[frame]
					begin="-225"
					end="-200"
					image="units/drakes/sky.png"
				[/frame]
				[frame]
					begin="-200"
					end="-150"
					image="units/drakes/sky-attack-ranged-impact.png"
				[/frame]
				[frame]
					begin="-150"
					end="-75"
					image="units/drakes/sky-attack-melee1.png"
				[/frame]
				[frame]
					begin="-75"
					end="50"
					image="units/drakes/sky-attack-melee2.png"
					sound="club.ogg"
				[/frame]
				[frame]
					begin="50"
					end="125"
					image="units/drakes/sky-defend.png"
				[/frame]
				[frame]
					begin="125"
					end="175"
					image="units/drakes/sky-attack-melee1.png"
				[/frame]
				[frame]
					begin="275"
					end="200"
					image="units/drakes/sky.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				hits="no"
				[filter_attack]
					name="slam"
				[/filter_attack]
				[frame]
					begin="-200"
					end="-175"
					image="units/drakes/sky.png"
				[/frame]
				[frame]
					begin="-175"
					end="-150"
					image="units/drakes/sky-attack-ranged-impact.png"
				[/frame]
				[frame]
					begin="-150"
					end="-75"
					image="units/drakes/sky-attack-melee1.png"
				[/frame]
				[frame]
					begin="-75"
					end="50"
					image="units/drakes/sky-attack-melee2.png"
					sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
				[/frame]
				[frame]
					begin="50"
					end="125"
					image="units/drakes/sky-defend.png"
				[/frame]
				[frame]
					begin="125"
					end="175"
					image="units/drakes/sky-attack-melee1.png"
				[/frame]
				[frame]
					begin="275"
					end="200"
					image="units/drakes/sky.png"
				[/frame]
			[/attack_anim]
			[death]
				[frame]
					begin="0"
					end="130"
					image="units/drakes/sky-die-1.png"
				[/frame]
				[frame]
					begin="130"
					end="320"
					image="units/drakes/sky-die-2.png"
				[/frame]
				[frame]
					begin="320"
					end="450"
					image="units/drakes/sky-die-3.png"
				[/frame]
				[frame]
					begin="450"
					end="600"
					image="units/drakes/sky-die-4.png"
				[/frame]
				[frame]
					begin="600"
					end="750"
					image="units/drakes/sky-die-5.png"
				[/frame]
				[frame]
					begin="750"
					end="900"
					image="units/drakes/sky-die-6.png"
				[/frame]
				[frame]
					begin="900"
					end="1050"
					image="units/drakes/sky-die-7.png"
				[/frame]
				[frame]
					begin="1050"
					end="1200"
					image="units/drakes/sky-die-8.png"
				[/frame]
			[/death]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/drakes/sky.png"
				[/frame]
				[frame]
					duration="100"
					image="units/drakes/sky-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/drakes/sky-defend.png"
						sound="drake-hit-1.ogg,drake-hit-2.ogg,drake-hit-3.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/drakes/sky-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/drakes/sky.png"
				[/frame]
			[/defend]
			[movement_anim]
				[frame]
					begin="0"
					end="150"
					image="units/drakes/sky-defend.png"
				[/frame]
			[/movement_anim]
			[standing_anim]
				start_time="0"
				[filter]
					[filter_location]
						terrain="!,W*,Qx*,Ql*"
						[or]
							terrain="Wwf,Wwr,*^V*"
						[/or]
					[/filter_location]
				[/filter]
				[frame]
					duration="150"
					image="units/drakes/sky.png"
				[/frame]
			[/standing_anim]
			[standing_anim]
				layer="60"
				start_time="0"
				submerge="0.01"
				[filter]
					[filter_location]
						terrain="W*,Qx*,Ql*"
						[not]
							terrain="Wwf,Wwr,*^V*"
						[/not]
					[/filter_location]
				[/filter]
				[frame]
					duration="150"
					image="units/drakes/sky-defend.png"
				[/frame]
			[/standing_anim]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="6"
				description=_ "slam"
				icon="attacks/slam-drake.png"
				name="slam"
				number="3"
				range="melee"
				type="impact"
			[/attack]
			[attack]
				damage="5"
				description=_ "fire breath"
				icon="attacks/fire-breath-drake.png"
				name="fire breath"
				number="3"
				range="ranged"
				type="fire"
				[specials]
					[chance_to_hit]
						active_on="offense"
						cumulative="yes"
#textdomain wesnoth
						description=_ "Marksman:
When used offensively, this attack always has at least a 60% chance to hit."
						id="marksman"
						name=_ "marksman"
						value="60"
					[/chance_to_hit]
				[/specials]
			[/attack]
			[modifications]
				[trait]
					female_name=_ "female^resilient"
					id="resilient"
					male_name=_ "resilient"
					name=_ "resilient"
					[effect]
						apply_to="hitpoints"
						increase_total="4"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
						times="per level"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^quick"
					id="quick"
					male_name=_ "quick"
					name=_ "quick"
					[effect]
						apply_to="movement"
						increase="1"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="-5%"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Drake Gladiator,Drake Slasher"
			alignment="lawful"
			alpha="256"
			attacks_left="1"
			cost="19"
			die_sound="drake-die.ogg"
			ellipse="misc/ellipse"
			experience="14"
			facing="nw"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="46"
			id="Drake Clasher-6"
			image="units/drakes/clasher.png"
#textdomain wesnoth-units
			language_name=_ "Drake Clasher"
			level="1"
			max_attacks="1"
			max_experience="32"
			max_hitpoints="46"
			max_moves="6"
			movement="5"
			movement_type="drakefoot"
			moves="6"
			name="Verdinos"
			profile="portraits/drakes/clasher.png"
			race="drake"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="1"
			type="Drake Clasher"
			undead_variation="drake"
			underlying_id="6"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					name="spear"
				[/filter_attack]
				[frame]
					begin="-200"
					end="-100"
					image="units/drakes/clasher-flying.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="75"
						image="units/drakes/clasher-attack-spear.png"
						sound="spear.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="75"
						image="units/drakes/clasher-attack-spear.png"
						sound="spear-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="75"
					end="175"
					image="units/drakes/clasher-flying.png"
				[/frame]
				[frame]
					begin="175"
					end="200"
					image="units/drakes/clasher.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				[filter_attack]
					name="sword"
				[/filter_attack]
				[frame]
					begin="-200"
					end="-100"
					image="units/drakes/clasher-flying.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="75"
						image="units/drakes/clasher-attack-sword.png"
						sound="sword-1.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="75"
						image="units/drakes/clasher-attack-sword.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="75"
					end="175"
					image="units/drakes/clasher-flying.png"
				[/frame]
				[frame]
					begin="175"
					end="200"
					image="units/drakes/clasher.png"
				[/frame]
			[/attack_anim]
			[death]
				[frame]
					begin="0"
					end="130"
					image="units/drakes/clasher-die-1.png"
				[/frame]
				[frame]
					begin="130"
					end="320"
					image="units/drakes/clasher-die-2.png"
				[/frame]
				[frame]
					begin="320"
					end="450"
					image="units/drakes/clasher-die-3.png"
				[/frame]
				[frame]
					begin="450"
					end="600"
					image="units/drakes/clasher-die-4.png"
				[/frame]
				[frame]
					begin="600"
					end="750"
					image="units/drakes/clasher-die-5.png"
				[/frame]
				[frame]
					begin="750"
					end="900"
					image="units/drakes/clasher-die-6.png"
				[/frame]
				[frame]
					begin="900"
					end="1050"
					image="units/drakes/clasher-die-7.png"
				[/frame]
				[frame]
					begin="1050"
					end="1200"
					image="units/drakes/clasher-die-8.png"
				[/frame]
				[frame]
					begin="1200"
					end="1350"
					image="units/drakes/clasher-die-9.png"
				[/frame]
				[frame]
					begin="1350"
					end="1500"
					image="units/drakes/clasher-die-10.png"
				[/frame]
			[/death]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/drakes/clasher.png"
				[/frame]
				[frame]
					duration="100"
					image="units/drakes/clasher-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/drakes/clasher-defend.png"
						sound="drake-hit-1.ogg,drake-hit-2.ogg,drake-hit-3.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/drakes/clasher-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/drakes/clasher.png"
				[/frame]
			[/defend]
			[defense]
				castle="60"
				cave="70"
				deep_water="90"
				flat="70"
				forest="60"
				frozen="80"
				fungus="60"
				hills="60"
				impassable="70"
				mountains="60"
				reef="70"
				sand="60"
				shallow_water="80"
				swamp_water="80"
				unwalkable="80"
				village="60"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="3"
				fungus="2"
				hills="1"
				impassable="99"
				mountains="1"
				reef="2"
				sand="1"
				shallow_water="3"
				swamp_water="3"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="130"
				blade="80"
				cold="150"
				fire="50"
				impact="70"
				pierce="100"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="5"
				description=_ "sword"
				icon="attacks/scimitar.png"
				name="sword"
				number="4"
				range="melee"
				type="blade"
			[/attack]
			[attack]
				damage="6"
				description=_ "spear"
				icon="attacks/spear.png"
				name="spear"
				number="4"
				range="melee"
				type="pierce"
				[specials]
					[firststrike]
#textdomain wesnoth
						description=_ "First Strike:
This unit always strikes first with this attack, even if they are defending."
						id="firststrike"
						name=_ "firststrike"
					[/firststrike]
				[/specials]
			[/attack]
			[modifications]
				[trait]
					female_name=_ "female^quick"
					id="quick"
					male_name=_ "quick"
					name=_ "quick"
					[effect]
						apply_to="movement"
						increase="1"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="-5%"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^resilient"
					id="resilient"
					male_name=_ "resilient"
					name=_ "resilient"
					[effect]
						apply_to="hitpoints"
						increase_total="4"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
						times="per level"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Saurian Oracle,Saurian Soothsayer"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="16"
			die_sound="hiss-die.wav"
			ellipse="misc/ellipse"
			experience="5"
			facing="n"
			flag_rgb="magenta"
			flies="false"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="23"
			id="Saurian Augur-19"
			image="units/saurians/augur.png"
#textdomain wesnoth-units
			language_name=_ "Saurian Augur"
			level="1"
			max_attacks="1"
			max_experience="15"
			max_hitpoints="23"
			max_moves="6"
			movement="6"
			movement_type="lizard"
			moves="6"
			name="Krexiss"
			profile="portraits/saurians/augur.png"
			race="lizard"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="1"
			type="Saurian Augur"
			undead_variation="saurian"
			underlying_id="19"
			unrenamable="no"
			upkeep="full"
			usage="healer"
			zoc="yes"
			[attack_anim]
				start_time="-300"
				[filter_attack]
					name="curse"
				[/filter_attack]
				[if]
					hits="yes"
					[missile_frame]
						begin="-200"
						end="0"
						image="projectiles/whitemissile-n.png"
						image_diagonal="projectiles/whitemissile-ne.png"
						offset="0.0~0.8"
					[/missile_frame]
					[missile_frame]
						begin="0"
						end="50"
						halo="projectiles/whitemissile-impact-1.png"
						offset="0.8"
					[/missile_frame]
					[missile_frame]
						begin="50"
						end="100"
						halo="projectiles/whitemissile-impact-2.png"
						offset="0.92"
					[/missile_frame]
					[missile_frame]
						begin="100"
						end="150"
						halo="projectiles/whitemissile-impact-3.png"
						offset="0.94"
					[/missile_frame]
					[missile_frame]
						begin="150"
						end="200"
						halo="projectiles/whitemissile-impact-4.png"
						offset="0.96"
					[/missile_frame]
					[missile_frame]
						begin="200"
						end="250"
						halo="projectiles/whitemissile-impact-5.png"
						offset="0.98"
					[/missile_frame]
					[missile_frame]
						begin="250"
						end="300"
						halo="projectiles/whitemissile-impact-6.png"
						offset="1.0"
					[/missile_frame]
					[missile_frame]
						begin="300"
						end="350"
						halo="projectiles/whitemissile-impact-7.png"
						offset="1.02"
					[/missile_frame]
					[missile_frame]
						begin="350"
						end="400"
						halo="projectiles/whitemissile-impact-8.png"
						offset="1.04"
					[/missile_frame]
				[/if]
				[else]
					hits="no"
					[missile_frame]
						alpha=".8~0.0:200"
						begin="-200"
						end="0"
						image="projectiles/whitemissile-n.png"
						image_diagonal="projectiles/whitemissile-ne.png"
						offset="0.0~0.8"
					[/missile_frame]
				[/else]
				[frame]
					duration="50"
					halo="halo/saurian-magic-halo-1.png"
					image="units/saurians/augur-magic-1.png"
				[/frame]
				[frame]
					duration="60"
					halo="halo/saurian-magic-halo-2.png"
					image="units/saurians/augur-magic-1.png"
					sound="magicmissile.wav"
				[/frame]
				[frame]
					duration="70"
					halo="halo/saurian-magic-halo-3.png"
					image="units/saurians/augur-magic-2.png"
				[/frame]
				[frame]
					duration="80"
					halo="halo/saurian-magic-halo-4.png"
					image="units/saurians/augur-magic-2.png"
				[/frame]
				[frame]
					duration="90"
					halo="halo/saurian-magic-halo-5.png"
					image="units/saurians/augur-magic-1.png"
				[/frame]
				[frame]
					duration="100"
					halo="halo/saurian-magic-halo-6.png"
					image="units/saurians/augur-magic-1.png"
				[/frame]
				[frame]
					duration="100"
					halo="halo/saurian-magic-halo-7.png"
					image="units/saurians/augur.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				offset="0.0~0.3,0.3~0.45,0.45~0.3,0.3~0.0"
				start_time="-250"
				[filter_attack]
					name="staff"
				[/filter_attack]
				[frame]
					duration="150"
					image="units/saurians/augur-melee-1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						duration="100"
						image="units/saurians/augur-melee-2.png"
						sound="staff.wav"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						duration="100"
						image="units/saurians/augur-melee-2.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					duration="100"
					image="units/saurians/augur-melee-3.png"
				[/frame]
				[frame]
					duration="90"
					image="units/saurians/augur-melee-4.png"
				[/frame]
				[frame]
					duration="80"
					image="units/saurians/augur-melee-5.png"
				[/frame]
				[frame]
					duration="50"
					image="units/saurians/augur-defend-1.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/saurians/augur-defend-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/saurians/augur-defend-2.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/saurians/augur-defend-2.png"
						sound="hiss-hit.wav"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/saurians/augur-defend-2.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/saurians/augur-defend-1.png"
				[/frame]
			[/defend]
			[healing_anim]
				start_time="-300"
				[frame]
					duration="50"
					halo="halo/saurian-magic-halo-1.png"
					image="units/saurians/augur-magic-1.png"
				[/frame]
				[frame]
					duration="60"
					halo="halo/saurian-magic-halo-2.png"
					image="units/saurians/augur-magic-1.png"
				[/frame]
				[frame]
					duration="70"
					halo="halo/saurian-magic-halo-3.png"
					image="units/saurians/augur-magic-2.png"
				[/frame]
				[frame]
					duration="80"
					halo="halo/saurian-magic-halo-4.png"
					image="units/saurians/augur-magic-2.png"
				[/frame]
				[frame]
					duration="90"
					halo="halo/saurian-magic-halo-5.png"
					image="units/saurians/augur-magic-1.png"
				[/frame]
				[frame]
					duration="100"
					halo="halo/saurian-magic-halo-6.png"
					image="units/saurians/augur-magic-1.png"
				[/frame]
				[frame]
					duration="100"
					halo="halo/saurian-magic-halo-7.png"
					image="units/saurians/augur.png"
				[/frame]
			[/healing_anim]
			[portrait]
				image="portraits/saurians/transparent/augur.png"
				mirror="false"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/saurians/transparent/augur.png"
				mirror="true"
				side="right"
				size="400"
			[/portrait]
			[defense]
				castle="40"
				cave="40"
				deep_water="80"
				flat="60"
				forest="40"
				frozen="70"
				fungus="40"
				hills="40"
				impassable="40"
				mountains="40"
				reef="60"
				sand="40"
				shallow_water="60"
				swamp_water="40"
				unwalkable="80"
				village="50"
			[/defense]
			[movement_costs]
				castle="1"
				cave="1"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="4"
				fungus="1"
				hills="1"
				impassable="99"
				mountains="2"
				reef="2"
				sand="1"
				shallow_water="3"
				swamp_water="1"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="110"
				cold="120"
				fire="120"
				impact="110"
				pierce="80"
			[/resistance]
			[abilities]
				[heals]
					affect_allies="yes"
					affect_self="no"
#textdomain wesnoth
					description=_ "Heals +4:
Allows the unit to heal adjacent allied units at the beginning of our turn.

A unit cared for by this healer may heal up to 4 HP per turn, or stop poison from taking effect for that turn.
A poisoned unit cannot be cured of its poison by a healer, and must seek the care of a village or a unit that can cure."
					female_name=_ "female^heals +4"
					id="healing"
					name=_ "heals +4"
					poison="slowed"
					value="4"
					[affect_adjacent]
						adjacent="n,ne,se,s,sw,nw"
					[/affect_adjacent]
				[/heals]
			[/abilities]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="5"
#textdomain wesnoth-units
				description=_ "staff"
				icon="attacks/staff-magic.png"
				name="staff"
				number="2"
				range="melee"
				type="impact"
			[/attack]
			[attack]
				damage="5"
				description=_ "curse"
				icon="attacks/curse.png"
				name="curse"
				number="3"
				range="ranged"
				type="cold"
				[specials]
					[chance_to_hit]
						cumulative="no"
#textdomain wesnoth
						description=_ "Magical:
This attack always has a 70% chance to hit regardless of the defensive ability of the unit being attacked."
						id="magical"
						name=_ "magical"
						value="70"
					[/chance_to_hit]
				[/specials]
			[/attack]
			[modifications]
				[trait]
					female_name=_ "female^intelligent"
					id="intelligent"
					male_name=_ "intelligent"
					name=_ "intelligent"
					[effect]
						apply_to="max_experience"
						increase="-20%"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^strong"
					id="strong"
					male_name=_ "strong"
					name=_ "strong"
					[effect]
						apply_to="attack"
						increase_damage="1"
						range="melee"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Drake Warrior"
			alignment="lawful"
			alpha="256"
			attacks_left="1"
			cost="17"
			die_sound="drake-die.ogg"
			ellipse="misc/ellipse"
			experience="16"
			facing="se"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="38"
			id="Drake Fighter-20"
			image="units/drakes/fighter.png"
#textdomain wesnoth-units
			language_name=_ "Drake Fighter"
			level="1"
			max_attacks="1"
			max_experience="29"
			max_hitpoints="38"
			max_moves="7"
			movement="6"
			movement_type="drakefly"
			moves="7"
			name="Gri Kor"
			profile="portraits/drakes/fighter.png"
			race="drake"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="1"
			type="Drake Fighter"
			undead_variation="drake"
			underlying_id="20"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					name="fire breath"
				[/filter_attack]
				[if]
					direction="n"
					[missile_frame]
						begin="-400"
						end="100"
						halo="projectiles/fire-breath-n-1.png:80,projectiles/fire-breath-n-2.png:80,projectiles/fire-breath-n-3.png:80,projectiles/fire-breath-n-4.png:80,projectiles/fire-breath-n-5.png:80"
						halo_x="11"
						halo_y="-34"
					[/missile_frame]
				[/if]
				[else]
					direction="s"
					[missile_frame]
						begin="-400"
						end="100"
						halo="projectiles/fire-breath-s-1.png:80,projectiles/fire-breath-s-2.png:80,projectiles/fire-breath-s-3.png:80,projectiles/fire-breath-s-4.png:80,projectiles/fire-breath-s-5.png:80"
						halo_x="11"
						halo_y="15"
					[/missile_frame]
				[/else]
				[else]
					direction="ne,nw"
					[missile_frame]
						begin="-400"
						end="100"
						halo="projectiles/fire-breath-ne-1.png:80,projectiles/fire-breath-ne-2.png:80,projectiles/fire-breath-ne-3.png:80,projectiles/fire-breath-ne-4.png:80,projectiles/fire-breath-ne-5.png:80"
						halo_x="24"
						halo_y="-22"
					[/missile_frame]
				[/else]
				[else]
					direction="se,sw"
					[missile_frame]
						begin="-400"
						end="100"
						halo="projectiles/fire-breath-se-1.png:80,projectiles/fire-breath-se-2.png:80,projectiles/fire-breath-se-3.png:80,projectiles/fire-breath-se-4.png:80,projectiles/fire-breath-se-5.png:80"
						halo_x="26"
						halo_y="10"
					[/missile_frame]
				[/else]
				[if]
					hits="no"
					[frame]
						begin="-400"
						end="-350"
						image="units/drakes/fighter-attack-ranged1.png"
						sound="flame-big-miss.ogg"
					[/frame]
				[/if]
				[else]
					hits="yes"
					[frame]
						begin="-400"
						end="-350"
						image="units/drakes/fighter-attack-ranged1.png"
						sound="flame-big.ogg"
					[/frame]
				[/else]
				[frame]
					begin="-350"
					end="-150"
					image="units/drakes/fighter-attack-ranged2.png"
				[/frame]
				[frame]
					begin="-150"
					end="0"
					image="units/drakes/fighter.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				[filter_attack]
					name="scimitar"
				[/filter_attack]
				[frame]
					begin="-200"
					end="-175"
					image="units/drakes/fighter.png"
				[/frame]
				[frame]
					begin="-175"
					end="-100"
					image="units/drakes/fighter-attack-close1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="75"
						image="units/drakes/fighter-attack-close2.png"
						sound="sword-1.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="75"
						image="units/drakes/fighter-attack-close2.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="75"
					end="150"
					image="units/drakes/fighter-defend.png"
				[/frame]
				[frame]
					begin="150"
					end="175"
					image="units/drakes/fighter.png"
				[/frame]
			[/attack_anim]
			[death]
				[frame]
					begin="0"
					end="130"
					image="units/drakes/fighter-die-1.png"
				[/frame]
				[frame]
					begin="130"
					end="320"
					image="units/drakes/fighter-die-2.png"
				[/frame]
				[frame]
					begin="320"
					end="450"
					image="units/drakes/fighter-die-3.png"
				[/frame]
				[frame]
					begin="450"
					end="600"
					image="units/drakes/fighter-die-4.png"
				[/frame]
				[frame]
					begin="600"
					end="750"
					image="units/drakes/fighter-die-5.png"
				[/frame]
				[frame]
					begin="750"
					end="900"
					image="units/drakes/fighter-die-6.png"
				[/frame]
				[frame]
					begin="900"
					end="1050"
					image="units/drakes/fighter-die-7.png"
				[/frame]
				[frame]
					begin="1050"
					end="1200"
					image="units/drakes/fighter-die-8.png"
				[/frame]
			[/death]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/drakes/fighter.png"
				[/frame]
				[frame]
					duration="100"
					image="units/drakes/fighter-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/drakes/fighter-defend.png"
						sound="drake-hit-1.ogg,drake-hit-2.ogg,drake-hit-3.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/drakes/fighter-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/drakes/fighter.png"
				[/frame]
			[/defend]
			[movement_anim]
				[frame]
					begin="0"
					end="150"
					image="units/drakes/fighter-flying.png"
				[/frame]
			[/movement_anim]
			[standing_anim]
				start_time="0"
				[filter]
					[filter_location]
						terrain="!,W*,Qx*,Ql*"
						[or]
							terrain="Wwf,Wwr,*^V*"
						[/or]
					[/filter_location]
				[/filter]
				[frame]
					duration="150"
					image="units/drakes/fighter.png"
				[/frame]
			[/standing_anim]
			[standing_anim]
				layer="60"
				start_time="0"
				submerge="0.01"
				[filter]
					[filter_location]
						terrain="W*,Qx*,Ql*"
						[not]
							terrain="Wwf,Wwr,*^V*"
						[/not]
					[/filter_location]
				[/filter]
				[frame]
					duration="150"
					image="units/drakes/fighter-flying.png"
				[/frame]
			[/standing_anim]
			[defense]
				castle="60"
				cave="70"
				deep_water="80"
				flat="70"
				forest="60"
				frozen="80"
				fungus="60"
				hills="60"
				impassable="70"
				mountains="60"
				reef="70"
				sand="60"
				shallow_water="80"
				swamp_water="70"
				unwalkable="60"
				village="60"
			[/defense]
			[movement_costs]
				castle="1"
				cave="3"
				deep_water="2"
				flat="1"
				forest="1"
				frozen="2"
				fungus="2"
				hills="1"
				impassable="99"
				mountains="1"
				reef="1"
				sand="1"
				shallow_water="1"
				swamp_water="1"
				unwalkable="1"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="130"
				blade="90"
				cold="150"
				fire="50"
				impact="80"
				pierce="110"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="8"
				description=_ "scimitar"
				icon="attacks/scimitar.png"
				name="scimitar"
				number="3"
				range="melee"
				type="blade"
			[/attack]
			[attack]
				damage="3"
				description=_ "fire breath"
				icon="attacks/fire-breath-drake.png"
				name="fire breath"
				number="3"
				range="ranged"
				type="fire"
			[/attack]
			[modifications]
				[trait]
#textdomain wesnoth
					female_name=_ "female^quick"
					id="quick"
					male_name=_ "quick"
					name=_ "quick"
					[effect]
						apply_to="movement"
						increase="1"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="-5%"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^strong"
					id="strong"
					male_name=_ "strong"
					name=_ "strong"
					[effect]
						apply_to="attack"
						increase_damage="1"
						range="melee"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Drake Warrior"
			alignment="lawful"
			alpha="256"
			attacks_left="1"
			cost="17"
			die_sound="drake-die.ogg"
			ellipse="misc/ellipse"
			experience="0"
			facing="s"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="45"
			id="Drake Fighter-23"
			image="units/drakes/fighter.png"
#textdomain wesnoth-units
			language_name=_ "Drake Fighter"
			level="1"
			max_attacks="1"
			max_experience="29"
			max_hitpoints="45"
			max_moves="6"
			movement="6"
			movement_type="drakefly"
			moves="6"
			name="Mark"
			profile="portraits/drakes/fighter.png"
			race="drake"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="1"
			type="Drake Fighter"
			undead_variation="drake"
			underlying_id="23"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					name="fire breath"
				[/filter_attack]
				[if]
					direction="n"
					[missile_frame]
						begin="-400"
						end="100"
						halo="projectiles/fire-breath-n-1.png:80,projectiles/fire-breath-n-2.png:80,projectiles/fire-breath-n-3.png:80,projectiles/fire-breath-n-4.png:80,projectiles/fire-breath-n-5.png:80"
						halo_x="11"
						halo_y="-34"
					[/missile_frame]
				[/if]
				[else]
					direction="s"
					[missile_frame]
						begin="-400"
						end="100"
						halo="projectiles/fire-breath-s-1.png:80,projectiles/fire-breath-s-2.png:80,projectiles/fire-breath-s-3.png:80,projectiles/fire-breath-s-4.png:80,projectiles/fire-breath-s-5.png:80"
						halo_x="11"
						halo_y="15"
					[/missile_frame]
				[/else]
				[else]
					direction="ne,nw"
					[missile_frame]
						begin="-400"
						end="100"
						halo="projectiles/fire-breath-ne-1.png:80,projectiles/fire-breath-ne-2.png:80,projectiles/fire-breath-ne-3.png:80,projectiles/fire-breath-ne-4.png:80,projectiles/fire-breath-ne-5.png:80"
						halo_x="24"
						halo_y="-22"
					[/missile_frame]
				[/else]
				[else]
					direction="se,sw"
					[missile_frame]
						begin="-400"
						end="100"
						halo="projectiles/fire-breath-se-1.png:80,projectiles/fire-breath-se-2.png:80,projectiles/fire-breath-se-3.png:80,projectiles/fire-breath-se-4.png:80,projectiles/fire-breath-se-5.png:80"
						halo_x="26"
						halo_y="10"
					[/missile_frame]
				[/else]
				[if]
					hits="no"
					[frame]
						begin="-400"
						end="-350"
						image="units/drakes/fighter-attack-ranged1.png"
						sound="flame-big-miss.ogg"
					[/frame]
				[/if]
				[else]
					hits="yes"
					[frame]
						begin="-400"
						end="-350"
						image="units/drakes/fighter-attack-ranged1.png"
						sound="flame-big.ogg"
					[/frame]
				[/else]
				[frame]
					begin="-350"
					end="-150"
					image="units/drakes/fighter-attack-ranged2.png"
				[/frame]
				[frame]
					begin="-150"
					end="0"
					image="units/drakes/fighter.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				[filter_attack]
					name="scimitar"
				[/filter_attack]
				[frame]
					begin="-200"
					end="-175"
					image="units/drakes/fighter.png"
				[/frame]
				[frame]
					begin="-175"
					end="-100"
					image="units/drakes/fighter-attack-close1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="75"
						image="units/drakes/fighter-attack-close2.png"
						sound="sword-1.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="75"
						image="units/drakes/fighter-attack-close2.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="75"
					end="150"
					image="units/drakes/fighter-defend.png"
				[/frame]
				[frame]
					begin="150"
					end="175"
					image="units/drakes/fighter.png"
				[/frame]
			[/attack_anim]
			[death]
				[frame]
					begin="0"
					end="130"
					image="units/drakes/fighter-die-1.png"
				[/frame]
				[frame]
					begin="130"
					end="320"
					image="units/drakes/fighter-die-2.png"
				[/frame]
				[frame]
					begin="320"
					end="450"
					image="units/drakes/fighter-die-3.png"
				[/frame]
				[frame]
					begin="450"
					end="600"
					image="units/drakes/fighter-die-4.png"
				[/frame]
				[frame]
					begin="600"
					end="750"
					image="units/drakes/fighter-die-5.png"
				[/frame]
				[frame]
					begin="750"
					end="900"
					image="units/drakes/fighter-die-6.png"
				[/frame]
				[frame]
					begin="900"
					end="1050"
					image="units/drakes/fighter-die-7.png"
				[/frame]
				[frame]
					begin="1050"
					end="1200"
					image="units/drakes/fighter-die-8.png"
				[/frame]
			[/death]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/drakes/fighter.png"
				[/frame]
				[frame]
					duration="100"
					image="units/drakes/fighter-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/drakes/fighter-defend.png"
						sound="drake-hit-1.ogg,drake-hit-2.ogg,drake-hit-3.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/drakes/fighter-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/drakes/fighter.png"
				[/frame]
			[/defend]
			[movement_anim]
				[frame]
					begin="0"
					end="150"
					image="units/drakes/fighter-flying.png"
				[/frame]
			[/movement_anim]
			[standing_anim]
				start_time="0"
				[filter]
					[filter_location]
						terrain="!,W*,Qx*,Ql*"
						[or]
							terrain="Wwf,Wwr,*^V*"
						[/or]
					[/filter_location]
				[/filter]
				[frame]
					duration="150"
					image="units/drakes/fighter.png"
				[/frame]
			[/standing_anim]
			[standing_anim]
				layer="60"
				start_time="0"
				submerge="0.01"
				[filter]
					[filter_location]
						terrain="W*,Qx*,Ql*"
						[not]
							terrain="Wwf,Wwr,*^V*"
						[/not]
					[/filter_location]
				[/filter]
				[frame]
					duration="150"
					image="units/drakes/fighter-flying.png"
				[/frame]
			[/standing_anim]
			[defense]
				castle="60"
				cave="70"
				deep_water="80"
				flat="70"
				forest="60"
				frozen="80"
				fungus="60"
				hills="60"
				impassable="70"
				mountains="60"
				reef="70"
				sand="60"
				shallow_water="80"
				swamp_water="70"
				unwalkable="60"
				village="60"
			[/defense]
			[movement_costs]
				castle="1"
				cave="3"
				deep_water="2"
				flat="1"
				forest="1"
				frozen="2"
				fungus="2"
				hills="1"
				impassable="99"
				mountains="1"
				reef="1"
				sand="1"
				shallow_water="1"
				swamp_water="1"
				unwalkable="1"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="130"
				blade="90"
				cold="150"
				fire="50"
				impact="80"
				pierce="110"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="8"
				description=_ "scimitar"
				icon="attacks/scimitar.png"
				name="scimitar"
				number="3"
				range="melee"
				type="blade"
			[/attack]
			[attack]
				damage="3"
				description=_ "fire breath"
				icon="attacks/fire-breath-drake.png"
				name="fire breath"
				number="3"
				range="ranged"
				type="fire"
			[/attack]
			[modifications]
				[trait]
#textdomain wesnoth
					female_name=_ "female^strong"
					id="strong"
					male_name=_ "strong"
					name=_ "strong"
					[effect]
						apply_to="attack"
						increase_damage="1"
						range="melee"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^resilient"
					id="resilient"
					male_name=_ "resilient"
					name=_ "resilient"
					[effect]
						apply_to="hitpoints"
						increase_total="4"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
						times="per level"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Saurian Oracle,Saurian Soothsayer"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="16"
			die_sound="hiss-die.wav"
			ellipse="misc/ellipse"
			experience="16"
			facing="nw"
			flag_rgb="magenta"
			flies="false"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="22"
			id="Saurian Augur-24"
			image="units/saurians/augur.png"
#textdomain wesnoth-units
			language_name=_ "Saurian Augur"
			level="1"
			max_attacks="1"
			max_experience="20"
			max_hitpoints="22"
			max_moves="7"
			movement="6"
			movement_type="lizard"
			moves="7"
			name="Lazzix"
			profile="portraits/saurians/augur.png"
			race="lizard"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="1"
			type="Saurian Augur"
			undead_variation="saurian"
			underlying_id="24"
			unrenamable="no"
			upkeep="full"
			usage="healer"
			zoc="yes"
			[attack_anim]
				start_time="-300"
				[filter_attack]
					name="curse"
				[/filter_attack]
				[if]
					hits="yes"
					[missile_frame]
						begin="-200"
						end="0"
						image="projectiles/whitemissile-n.png"
						image_diagonal="projectiles/whitemissile-ne.png"
						offset="0.0~0.8"
					[/missile_frame]
					[missile_frame]
						begin="0"
						end="50"
						halo="projectiles/whitemissile-impact-1.png"
						offset="0.8"
					[/missile_frame]
					[missile_frame]
						begin="50"
						end="100"
						halo="projectiles/whitemissile-impact-2.png"
						offset="0.92"
					[/missile_frame]
					[missile_frame]
						begin="100"
						end="150"
						halo="projectiles/whitemissile-impact-3.png"
						offset="0.94"
					[/missile_frame]
					[missile_frame]
						begin="150"
						end="200"
						halo="projectiles/whitemissile-impact-4.png"
						offset="0.96"
					[/missile_frame]
					[missile_frame]
						begin="200"
						end="250"
						halo="projectiles/whitemissile-impact-5.png"
						offset="0.98"
					[/missile_frame]
					[missile_frame]
						begin="250"
						end="300"
						halo="projectiles/whitemissile-impact-6.png"
						offset="1.0"
					[/missile_frame]
					[missile_frame]
						begin="300"
						end="350"
						halo="projectiles/whitemissile-impact-7.png"
						offset="1.02"
					[/missile_frame]
					[missile_frame]
						begin="350"
						end="400"
						halo="projectiles/whitemissile-impact-8.png"
						offset="1.04"
					[/missile_frame]
				[/if]
				[else]
					hits="no"
					[missile_frame]
						alpha=".8~0.0:200"
						begin="-200"
						end="0"
						image="projectiles/whitemissile-n.png"
						image_diagonal="projectiles/whitemissile-ne.png"
						offset="0.0~0.8"
					[/missile_frame]
				[/else]
				[frame]
					duration="50"
					halo="halo/saurian-magic-halo-1.png"
					image="units/saurians/augur-magic-1.png"
				[/frame]
				[frame]
					duration="60"
					halo="halo/saurian-magic-halo-2.png"
					image="units/saurians/augur-magic-1.png"
					sound="magicmissile.wav"
				[/frame]
				[frame]
					duration="70"
					halo="halo/saurian-magic-halo-3.png"
					image="units/saurians/augur-magic-2.png"
				[/frame]
				[frame]
					duration="80"
					halo="halo/saurian-magic-halo-4.png"
					image="units/saurians/augur-magic-2.png"
				[/frame]
				[frame]
					duration="90"
					halo="halo/saurian-magic-halo-5.png"
					image="units/saurians/augur-magic-1.png"
				[/frame]
				[frame]
					duration="100"
					halo="halo/saurian-magic-halo-6.png"
					image="units/saurians/augur-magic-1.png"
				[/frame]
				[frame]
					duration="100"
					halo="halo/saurian-magic-halo-7.png"
					image="units/saurians/augur.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				offset="0.0~0.3,0.3~0.45,0.45~0.3,0.3~0.0"
				start_time="-250"
				[filter_attack]
					name="staff"
				[/filter_attack]
				[frame]
					duration="150"
					image="units/saurians/augur-melee-1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						duration="100"
						image="units/saurians/augur-melee-2.png"
						sound="staff.wav"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						duration="100"
						image="units/saurians/augur-melee-2.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					duration="100"
					image="units/saurians/augur-melee-3.png"
				[/frame]
				[frame]
					duration="90"
					image="units/saurians/augur-melee-4.png"
				[/frame]
				[frame]
					duration="80"
					image="units/saurians/augur-melee-5.png"
				[/frame]
				[frame]
					duration="50"
					image="units/saurians/augur-defend-1.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/saurians/augur-defend-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/saurians/augur-defend-2.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/saurians/augur-defend-2.png"
						sound="hiss-hit.wav"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/saurians/augur-defend-2.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/saurians/augur-defend-1.png"
				[/frame]
			[/defend]
			[healing_anim]
				start_time="-300"
				[frame]
					duration="50"
					halo="halo/saurian-magic-halo-1.png"
					image="units/saurians/augur-magic-1.png"
				[/frame]
				[frame]
					duration="60"
					halo="halo/saurian-magic-halo-2.png"
					image="units/saurians/augur-magic-1.png"
				[/frame]
				[frame]
					duration="70"
					halo="halo/saurian-magic-halo-3.png"
					image="units/saurians/augur-magic-2.png"
				[/frame]
				[frame]
					duration="80"
					halo="halo/saurian-magic-halo-4.png"
					image="units/saurians/augur-magic-2.png"
				[/frame]
				[frame]
					duration="90"
					halo="halo/saurian-magic-halo-5.png"
					image="units/saurians/augur-magic-1.png"
				[/frame]
				[frame]
					duration="100"
					halo="halo/saurian-magic-halo-6.png"
					image="units/saurians/augur-magic-1.png"
				[/frame]
				[frame]
					duration="100"
					halo="halo/saurian-magic-halo-7.png"
					image="units/saurians/augur.png"
				[/frame]
			[/healing_anim]
			[portrait]
				image="portraits/saurians/transparent/augur.png"
				mirror="false"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/saurians/transparent/augur.png"
				mirror="true"
				side="right"
				size="400"
			[/portrait]
			[defense]
				castle="40"
				cave="40"
				deep_water="80"
				flat="60"
				forest="40"
				frozen="70"
				fungus="40"
				hills="40"
				impassable="40"
				mountains="40"
				reef="60"
				sand="40"
				shallow_water="60"
				swamp_water="40"
				unwalkable="80"
				village="50"
			[/defense]
			[movement_costs]
				castle="1"
				cave="1"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="4"
				fungus="1"
				hills="1"
				impassable="99"
				mountains="2"
				reef="2"
				sand="1"
				shallow_water="3"
				swamp_water="1"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="110"
				cold="120"
				fire="120"
				impact="110"
				pierce="80"
			[/resistance]
			[abilities]
				[heals]
					affect_allies="yes"
					affect_self="no"
#textdomain wesnoth
					description=_ "Heals +4:
Allows the unit to heal adjacent allied units at the beginning of our turn.

A unit cared for by this healer may heal up to 4 HP per turn, or stop poison from taking effect for that turn.
A poisoned unit cannot be cured of its poison by a healer, and must seek the care of a village or a unit that can cure."
					female_name=_ "female^heals +4"
					id="healing"
					name=_ "heals +4"
					poison="slowed"
					value="4"
					[affect_adjacent]
						adjacent="n,ne,se,s,sw,nw"
					[/affect_adjacent]
				[/heals]
			[/abilities]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="5"
#textdomain wesnoth-units
				description=_ "staff"
				icon="attacks/staff-magic.png"
				name="staff"
				number="2"
				range="melee"
				type="impact"
			[/attack]
			[attack]
				damage="5"
				description=_ "curse"
				icon="attacks/curse.png"
				name="curse"
				number="3"
				range="ranged"
				type="cold"
				[specials]
					[chance_to_hit]
						cumulative="no"
#textdomain wesnoth
						description=_ "Magical:
This attack always has a 70% chance to hit regardless of the defensive ability of the unit being attacked."
						id="magical"
						name=_ "magical"
						value="70"
					[/chance_to_hit]
				[/specials]
			[/attack]
			[modifications]
				[trait]
					female_name=_ "female^strong"
					id="strong"
					male_name=_ "strong"
					name=_ "strong"
					[effect]
						apply_to="attack"
						increase_damage="1"
						range="melee"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^quick"
					id="quick"
					male_name=_ "quick"
					name=_ "quick"
					[effect]
						apply_to="movement"
						increase="1"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="-5%"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
	[/side]
	[side]
		action_bonus_count="9"
		aggression="0.5"
		allow_player="yes"
		caution="0.25"
		colour="2"
		controller="network"
		countdown_time="270000"
		current_player="Gauteamus"
		disallow_observers="no"
		fog="yes"
		global_recruitment_pattern="fighter,fighter,archer,healer,scout,scout"
		gold="32"
		hidden="no"
		id="Gauteamus2"
		income="0"
		leader_value="3"
		name="Gauteamus"
		no_leader="yes"
		number_of_possible_recruits_to_force_recruit="3.1"
		objectives=_ "Victory:
@Defeat enemy leader(s)"
		objectives_changed="yes"
		recruit="Drake Burner,Drake Clasher,Drake Fighter,Drake Glider,Saurian Augur,Saurian Skirmisher"
		recruitment_pattern="fighter,fighter,archer,healer,scout,scout"
		save_id="Gauteamus2"
		share_maps="no"
		share_view="yes"
		shroud="no"
		side="2"
		start_gold="100"
		team_name="south"
#textdomain wesnoth-multiplayer
		user_team_name=_ "teamname^South"
		village_gold="2"
		village_value="1"
		villages_per_scout="8"
		[ai]
			recruitment_pattern="fighter,fighter,archer,healer,scout,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]
		[unit]
			advances_to="Saurian Ambusher"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="15"
			die_sound="hiss-die.wav"
			ellipse="misc/ellipse"
			experience="5"
			facing="nw"
			flag_rgb="magenta"
			flies="false"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="25"
			id="Saurian Skirmisher-10"
			image="units/saurians/skirmisher.png"
#textdomain wesnoth-units
			language_name=_ "Saurian Skirmisher"
			level="1"
			max_attacks="1"
			max_experience="18"
			max_hitpoints="25"
			max_moves="7"
			movement="6"
			movement_type="lizard"
			moves="7"
			name="Skalap"
			profile="portraits/saurians/skirmisher.png"
			race="lizard"
			random_gender="no"
			random_traits="no"
			resting="no"
			side="2"
			type="Saurian Skirmisher"
			undead_variation="saurian"
			underlying_id="10"
			unrenamable="no"
			upkeep="full"
			usage="scout"
			x="7"
			y="17"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					name="spear"
					range="ranged"
				[/filter_attack]
				[missile_frame]
					begin="-150"
					end="0"
					image="projectiles/spear-n.png"
					image_diagonal="projectiles/spear-ne.png"
				[/missile_frame]
				[frame]
					begin="-200"
					end="-100"
					image="units/saurians/skirmisher-attack-ranged-1.png"
					sound="throw-1.wav,throw-2.wav,throw-3.wav,throw-4.wav"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="50"
						image="units/saurians/skirmisher-attack-ranged-2.png"
						sound="spear.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="50"
						image="units/saurians/skirmisher-attack-ranged-2.png"
					[/frame]
				[/else]
			[/attack_anim]
			[attack_anim]
				direction="ne,nw,s,se,sw"
				[filter_attack]
					name="spear"
					range="melee"
				[/filter_attack]
				[frame]
					begin="-150"
					end="-100"
					image="units/saurians/skirmisher-attack1.png"
				[/frame]
				[if]
					hits="no"
					[frame]
						begin="-100"
						end="50"
						image="units/saurians/skirmisher-attack2.png"
						sound="spear-miss.ogg"
					[/frame]
				[/if]
				[else]
					hits="yes"
					[frame]
						begin="-100"
						end="50"
						image="units/saurians/skirmisher-attack2.png"
						sound="spear.ogg"
					[/frame]
				[/else]
				[frame]
					begin="50"
					end="150"
					image="units/saurians/skirmisher-defend.png"
				[/frame]
				[frame]
					begin="150"
					end="200"
					image="units/saurians/skirmisher.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				direction="n"
				[filter_attack]
					name="spear"
					range="melee"
				[/filter_attack]
				[frame]
					begin="-150"
					end="-100"
					image="units/saurians/skirmisher-attack-n1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="90"
						image="units/saurians/skirmisher-attack-n2.png"
						sound="spear.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="90"
						image="units/saurians/skirmisher-attack-n2.png"
						sound="spear-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="90"
					end="150"
					image="units/saurians/skirmisher-attack1.png"
				[/frame]
				[frame]
					begin="150"
					end="200"
					image="units/saurians/skirmisher.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/saurians/skirmisher.png"
				[/frame]
				[frame]
					duration="100"
					image="units/saurians/skirmisher-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/saurians/skirmisher-defend.png"
						sound="hiss-hit.wav"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/saurians/skirmisher-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/saurians/skirmisher.png"
				[/frame]
			[/defend]
			[idle_anim]
				start_time="0"
				[filter]
					[not]
						[filter_wml]
							[status]
								poisoned="yes"
							[/status]
						[/filter_wml]
					[/not]
				[/filter]
				[filter]
					[filter_adjacent]
						count="0"
						is_enemy="yes"
					[/filter_adjacent]
				[/filter]
				[filter]
					[filter_location]
						[not]
							terrain="C*,K*,*^V*"
						[/not]
					[/filter_location]
				[/filter]
				[frame]
					duration="200"
					image="units/saurians/skirmisher-idle-1.png"
				[/frame]
				[frame]
					duration="200"
					image="units/saurians/skirmisher-idle-2.png"
				[/frame]
				[frame]
					duration="200"
					image="units/saurians/skirmisher-idle-3.png"
				[/frame]
				[frame]
					duration="200"
					image="units/saurians/skirmisher-idle-4.png"
				[/frame]
				[frame]
					duration="200"
					image="units/saurians/skirmisher-idle-5.png"
				[/frame]
				[frame]
					duration="200"
					image="units/saurians/skirmisher-idle-6.png"
				[/frame]
				[frame]
					duration="200"
					image="units/saurians/skirmisher-idle-7.png"
				[/frame]
				[frame]
					duration="200"
					image="units/saurians/skirmisher-idle-6.png"
				[/frame]
				[frame]
					duration="200"
					image="units/saurians/skirmisher-idle-5.png"
				[/frame]
				[frame]
					duration="200"
					image="units/saurians/skirmisher-idle-6.png"
				[/frame]
				[frame]
					duration="200"
					image="units/saurians/skirmisher-idle-8.png"
				[/frame]
				[frame]
					duration="200"
					image="units/saurians/skirmisher-idle-9.png"
				[/frame]
				[frame]
					duration="200"
					image="units/saurians/skirmisher-idle-10.png"
				[/frame]
				[frame]
					duration="200"
					image="units/saurians/skirmisher-idle-11.png"
				[/frame]
				[frame]
					duration="200"
					image="units/saurians/skirmisher-idle-12.png"
				[/frame]
				[frame]
					duration="200"
					image="units/saurians/skirmisher-idle-13.png"
				[/frame]
				[frame]
					duration="225"
					image="units/saurians/skirmisher-idle-12.png"
				[/frame]
				[frame]
					duration="225"
					image="units/saurians/skirmisher-idle-13.png"
				[/frame]
				[frame]
					duration="250"
					image="units/saurians/skirmisher-idle-12.png"
				[/frame]
				[frame]
					duration="250"
					image="units/saurians/skirmisher-idle-13.png"
				[/frame]
			[/idle_anim]
			[portrait]
				image="portraits/saurians/transparent/skirmisher.png"
				mirror="false"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/saurians/transparent/skirmisher.png"
				mirror="true"
				side="right"
				size="400"
			[/portrait]
			[defense]
				castle="40"
				cave="40"
				deep_water="80"
				flat="60"
				forest="40"
				frozen="70"
				fungus="40"
				hills="40"
				impassable="40"
				mountains="40"
				reef="60"
				sand="40"
				shallow_water="60"
				swamp_water="40"
				unwalkable="80"
				village="50"
			[/defense]
			[movement_costs]
				castle="1"
				cave="1"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="4"
				fungus="1"
				hills="1"
				impassable="99"
				mountains="2"
				reef="2"
				sand="1"
				shallow_water="3"
				swamp_water="1"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="110"
				cold="120"
				fire="120"
				impact="110"
				pierce="80"
			[/resistance]
			[abilities]
				[skirmisher]
					affect_self="yes"
#textdomain wesnoth
					description=_ "Skirmisher:
This unit is skilled in moving past enemies quickly, and ignores all enemy Zones of Control."
					female_name=_ "female^skirmisher"
					id="skirmisher"
					name=_ "skirmisher"
				[/skirmisher]
			[/abilities]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="4"
#textdomain wesnoth-units
				description=_ "spear"
				icon="attacks/spear.png"
				name="spear"
				number="4"
				range="melee"
				type="pierce"
			[/attack]
			[attack]
				damage="4"
				description=_ "spear"
				icon="attacks/spear.png"
				name="spear"
				number="2"
				range="ranged"
				type="pierce"
			[/attack]
			[modifications]
				[trait]
#textdomain wesnoth
					female_name=_ "female^intelligent"
					id="intelligent"
					male_name=_ "intelligent"
					name=_ "intelligent"
					[effect]
						apply_to="max_experience"
						increase="-20%"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^quick"
					id="quick"
					male_name=_ "quick"
					name=_ "quick"
					[effect]
						apply_to="movement"
						increase="1"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="-5%"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Saurian Ambusher"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="15"
			die_sound="hiss-die.wav"
			ellipse="misc/ellipse"
			experience="5"
			facing="nw"
			flag_rgb="magenta"
			flies="false"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="25"
			id="Saurian Skirmisher-10"
			image="units/saurians/skirmisher.png"
#textdomain wesnoth-units
			language_name=_ "Saurian Skirmisher"
			level="1"
			max_attacks="1"
			max_experience="18"
			max_hitpoints="25"
			max_moves="7"
			movement="6"
			movement_type="lizard"
			moves="7"
			name="Skalap"
			profile="portraits/saurians/skirmisher.png"
			race="lizard"
			random_gender="no"
			random_traits="no"
			resting="no"
			side="2"
			type="Saurian Skirmisher"
			undead_variation="saurian"
			underlying_id="10"
			unrenamable="no"
			upkeep="full"
			usage="scout"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					name="spear"
					range="ranged"
				[/filter_attack]
				[missile_frame]
					begin="-150"
					end="0"
					image="projectiles/spear-n.png"
					image_diagonal="projectiles/spear-ne.png"
				[/missile_frame]
				[frame]
					begin="-200"
					end="-100"
					image="units/saurians/skirmisher-attack-ranged-1.png"
					sound="throw-1.wav,throw-2.wav,throw-3.wav,throw-4.wav"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="50"
						image="units/saurians/skirmisher-attack-ranged-2.png"
						sound="spear.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="50"
						image="units/saurians/skirmisher-attack-ranged-2.png"
					[/frame]
				[/else]
			[/attack_anim]
			[attack_anim]
				direction="ne,nw,s,se,sw"
				[filter_attack]
					name="spear"
					range="melee"
				[/filter_attack]
				[frame]
					begin="-150"
					end="-100"
					image="units/saurians/skirmisher-attack1.png"
				[/frame]
				[if]
					hits="no"
					[frame]
						begin="-100"
						end="50"
						image="units/saurians/skirmisher-attack2.png"
						sound="spear-miss.ogg"
					[/frame]
				[/if]
				[else]
					hits="yes"
					[frame]
						begin="-100"
						end="50"
						image="units/saurians/skirmisher-attack2.png"
						sound="spear.ogg"
					[/frame]
				[/else]
				[frame]
					begin="50"
					end="150"
					image="units/saurians/skirmisher-defend.png"
				[/frame]
				[frame]
					begin="150"
					end="200"
					image="units/saurians/skirmisher.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				direction="n"
				[filter_attack]
					name="spear"
					range="melee"
				[/filter_attack]
				[frame]
					begin="-150"
					end="-100"
					image="units/saurians/skirmisher-attack-n1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="90"
						image="units/saurians/skirmisher-attack-n2.png"
						sound="spear.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="90"
						image="units/saurians/skirmisher-attack-n2.png"
						sound="spear-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="90"
					end="150"
					image="units/saurians/skirmisher-attack1.png"
				[/frame]
				[frame]
					begin="150"
					end="200"
					image="units/saurians/skirmisher.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/saurians/skirmisher.png"
				[/frame]
				[frame]
					duration="100"
					image="units/saurians/skirmisher-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/saurians/skirmisher-defend.png"
						sound="hiss-hit.wav"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/saurians/skirmisher-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/saurians/skirmisher.png"
				[/frame]
			[/defend]
			[idle_anim]
				start_time="0"
				[filter]
					[not]
						[filter_wml]
							[status]
								poisoned="yes"
							[/status]
						[/filter_wml]
					[/not]
				[/filter]
				[filter]
					[filter_adjacent]
						count="0"
						is_enemy="yes"
					[/filter_adjacent]
				[/filter]
				[filter]
					[filter_location]
						[not]
							terrain="C*,K*,*^V*"
						[/not]
					[/filter_location]
				[/filter]
				[frame]
					duration="200"
					image="units/saurians/skirmisher-idle-1.png"
				[/frame]
				[frame]
					duration="200"
					image="units/saurians/skirmisher-idle-2.png"
				[/frame]
				[frame]
					duration="200"
					image="units/saurians/skirmisher-idle-3.png"
				[/frame]
				[frame]
					duration="200"
					image="units/saurians/skirmisher-idle-4.png"
				[/frame]
				[frame]
					duration="200"
					image="units/saurians/skirmisher-idle-5.png"
				[/frame]
				[frame]
					duration="200"
					image="units/saurians/skirmisher-idle-6.png"
				[/frame]
				[frame]
					duration="200"
					image="units/saurians/skirmisher-idle-7.png"
				[/frame]
				[frame]
					duration="200"
					image="units/saurians/skirmisher-idle-6.png"
				[/frame]
				[frame]
					duration="200"
					image="units/saurians/skirmisher-idle-5.png"
				[/frame]
				[frame]
					duration="200"
					image="units/saurians/skirmisher-idle-6.png"
				[/frame]
				[frame]
					duration="200"
					image="units/saurians/skirmisher-idle-8.png"
				[/frame]
				[frame]
					duration="200"
					image="units/saurians/skirmisher-idle-9.png"
				[/frame]
				[frame]
					duration="200"
					image="units/saurians/skirmisher-idle-10.png"
				[/frame]
				[frame]
					duration="200"
					image="units/saurians/skirmisher-idle-11.png"
				[/frame]
				[frame]
					duration="200"
					image="units/saurians/skirmisher-idle-12.png"
				[/frame]
				[frame]
					duration="200"
					image="units/saurians/skirmisher-idle-13.png"
				[/frame]
				[frame]
					duration="225"
					image="units/saurians/skirmisher-idle-12.png"
				[/frame]
				[frame]
					duration="225"
					image="units/saurians/skirmisher-idle-13.png"
				[/frame]
				[frame]
					duration="250"
					image="units/saurians/skirmisher-idle-12.png"
				[/frame]
				[frame]
					duration="250"
					image="units/saurians/skirmisher-idle-13.png"
				[/frame]
			[/idle_anim]
			[portrait]
				image="portraits/saurians/transparent/skirmisher.png"
				mirror="false"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/saurians/transparent/skirmisher.png"
				mirror="true"
				side="right"
				size="400"
			[/portrait]
			[defense]
				castle="40"
				cave="40"
				deep_water="80"
				flat="60"
				forest="40"
				frozen="70"
				fungus="40"
				hills="40"
				impassable="40"
				mountains="40"
				reef="60"
				sand="40"
				shallow_water="60"
				swamp_water="40"
				unwalkable="80"
				village="50"
			[/defense]
			[movement_costs]
				castle="1"
				cave="1"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="4"
				fungus="1"
				hills="1"
				impassable="99"
				mountains="2"
				reef="2"
				sand="1"
				shallow_water="3"
				swamp_water="1"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="110"
				cold="120"
				fire="120"
				impact="110"
				pierce="80"
			[/resistance]
			[abilities]
				[skirmisher]
					affect_self="yes"
#textdomain wesnoth
					description=_ "Skirmisher:
This unit is skilled in moving past enemies quickly, and ignores all enemy Zones of Control."
					female_name=_ "female^skirmisher"
					id="skirmisher"
					name=_ "skirmisher"
				[/skirmisher]
			[/abilities]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="4"
#textdomain wesnoth-units
				description=_ "spear"
				icon="attacks/spear.png"
				name="spear"
				number="4"
				range="melee"
				type="pierce"
			[/attack]
			[attack]
				damage="4"
				description=_ "spear"
				icon="attacks/spear.png"
				name="spear"
				number="2"
				range="ranged"
				type="pierce"
			[/attack]
			[modifications]
				[trait]
#textdomain wesnoth
					female_name=_ "female^intelligent"
					id="intelligent"
					male_name=_ "intelligent"
					name=_ "intelligent"
					[effect]
						apply_to="max_experience"
						increase="-20%"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^quick"
					id="quick"
					male_name=_ "quick"
					name=_ "quick"
					[effect]
						apply_to="movement"
						increase="1"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="-5%"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
	[/side]
	[time]
		blue="0"
		green="-20"
		id="dawn"
		image="misc/schedule-dawn.png"
		lawful_bonus="0"
		name=_ "Dawn"
		red="-20"
	[/time]
	[time]
		blue="0"
		green="0"
		id="morning"
		image="misc/schedule-morning.png"
		lawful_bonus="25"
		name=_ "Morning"
		red="0"
	[/time]
	[time]
		blue="0"
		green="0"
		id="afternoon"
		image="misc/schedule-afternoon.png"
		lawful_bonus="25"
		name=_ "Afternoon"
		red="0"
	[/time]
	[time]
		blue="-20"
		green="-20"
		id="dusk"
		image="misc/schedule-dusk.png"
		lawful_bonus="0"
		name=_ "Dusk"
		red="0"
	[/time]
	[time]
		blue="-10"
		green="-40"
		id="first_watch"
		image="misc/schedule-firstwatch.png"
		lawful_bonus="-25"
		name=_ "First Watch"
		red="-40"
	[/time]
	[time]
		blue="-10"
		green="-40"
		id="second_watch"
		image="misc/schedule-secondwatch.png"
		lawful_bonus="-25"
		name=_ "Second Watch"
		red="-40"
	[/time]
	[variables]
		damage_inflicted="9"
		side_number="1"
		turn_number="11"
	[/variables]
	[player]
		can_recruit="Drake Burner,Drake Clasher,Drake Fighter,Drake Glider,Saurian Augur,Saurian Skirmisher"
		gold="-1"
		gold_add="no"
		name="Gauteamus"
		save_id="Gauteamus2"
		[unit]
			advances_to="Saurian Ambusher"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="15"
			die_sound="hiss-die.wav"
			ellipse="misc/ellipse"
			experience="5"
			facing="nw"
			flag_rgb="magenta"
			flies="false"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="25"
			id="Saurian Skirmisher-10"
			image="units/saurians/skirmisher.png"
#textdomain wesnoth-units
			language_name=_ "Saurian Skirmisher"
			level="1"
			max_attacks="1"
			max_experience="18"
			max_hitpoints="25"
			max_moves="7"
			movement="6"
			movement_type="lizard"
			moves="7"
			name="Skalap"
			profile="portraits/saurians/skirmisher.png"
			race="lizard"
			random_gender="no"
			random_traits="no"
			resting="no"
			side="2"
			type="Saurian Skirmisher"
			undead_variation="saurian"
			underlying_id="10"
			unrenamable="no"
			upkeep="full"
			usage="scout"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					name="spear"
					range="ranged"
				[/filter_attack]
				[missile_frame]
					begin="-150"
					end="0"
					image="projectiles/spear-n.png"
					image_diagonal="projectiles/spear-ne.png"
				[/missile_frame]
				[frame]
					begin="-200"
					end="-100"
					image="units/saurians/skirmisher-attack-ranged-1.png"
					sound="throw-1.wav,throw-2.wav,throw-3.wav,throw-4.wav"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="50"
						image="units/saurians/skirmisher-attack-ranged-2.png"
						sound="spear.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="50"
						image="units/saurians/skirmisher-attack-ranged-2.png"
					[/frame]
				[/else]
			[/attack_anim]
			[attack_anim]
				direction="ne,nw,s,se,sw"
				[filter_attack]
					name="spear"
					range="melee"
				[/filter_attack]
				[frame]
					begin="-150"
					end="-100"
					image="units/saurians/skirmisher-attack1.png"
				[/frame]
				[if]
					hits="no"
					[frame]
						begin="-100"
						end="50"
						image="units/saurians/skirmisher-attack2.png"
						sound="spear-miss.ogg"
					[/frame]
				[/if]
				[else]
					hits="yes"
					[frame]
						begin="-100"
						end="50"
						image="units/saurians/skirmisher-attack2.png"
						sound="spear.ogg"
					[/frame]
				[/else]
				[frame]
					begin="50"
					end="150"
					image="units/saurians/skirmisher-defend.png"
				[/frame]
				[frame]
					begin="150"
					end="200"
					image="units/saurians/skirmisher.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				direction="n"
				[filter_attack]
					name="spear"
					range="melee"
				[/filter_attack]
				[frame]
					begin="-150"
					end="-100"
					image="units/saurians/skirmisher-attack-n1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="90"
						image="units/saurians/skirmisher-attack-n2.png"
						sound="spear.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="90"
						image="units/saurians/skirmisher-attack-n2.png"
						sound="spear-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="90"
					end="150"
					image="units/saurians/skirmisher-attack1.png"
				[/frame]
				[frame]
					begin="150"
					end="200"
					image="units/saurians/skirmisher.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/saurians/skirmisher.png"
				[/frame]
				[frame]
					duration="100"
					image="units/saurians/skirmisher-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/saurians/skirmisher-defend.png"
						sound="hiss-hit.wav"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/saurians/skirmisher-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/saurians/skirmisher.png"
				[/frame]
			[/defend]
			[idle_anim]
				start_time="0"
				[filter]
					[not]
						[filter_wml]
							[status]
								poisoned="yes"
							[/status]
						[/filter_wml]
					[/not]
				[/filter]
				[filter]
					[filter_adjacent]
						count="0"
						is_enemy="yes"
					[/filter_adjacent]
				[/filter]
				[filter]
					[filter_location]
						[not]
							terrain="C*,K*,*^V*"
						[/not]
					[/filter_location]
				[/filter]
				[frame]
					duration="200"
					image="units/saurians/skirmisher-idle-1.png"
				[/frame]
				[frame]
					duration="200"
					image="units/saurians/skirmisher-idle-2.png"
				[/frame]
				[frame]
					duration="200"
					image="units/saurians/skirmisher-idle-3.png"
				[/frame]
				[frame]
					duration="200"
					image="units/saurians/skirmisher-idle-4.png"
				[/frame]
				[frame]
					duration="200"
					image="units/saurians/skirmisher-idle-5.png"
				[/frame]
				[frame]
					duration="200"
					image="units/saurians/skirmisher-idle-6.png"
				[/frame]
				[frame]
					duration="200"
					image="units/saurians/skirmisher-idle-7.png"
				[/frame]
				[frame]
					duration="200"
					image="units/saurians/skirmisher-idle-6.png"
				[/frame]
				[frame]
					duration="200"
					image="units/saurians/skirmisher-idle-5.png"
				[/frame]
				[frame]
					duration="200"
					image="units/saurians/skirmisher-idle-6.png"
				[/frame]
				[frame]
					duration="200"
					image="units/saurians/skirmisher-idle-8.png"
				[/frame]
				[frame]
					duration="200"
					image="units/saurians/skirmisher-idle-9.png"
				[/frame]
				[frame]
					duration="200"
					image="units/saurians/skirmisher-idle-10.png"
				[/frame]
				[frame]
					duration="200"
					image="units/saurians/skirmisher-idle-11.png"
				[/frame]
				[frame]
					duration="200"
					image="units/saurians/skirmisher-idle-12.png"
				[/frame]
				[frame]
					duration="200"
					image="units/saurians/skirmisher-idle-13.png"
				[/frame]
				[frame]
					duration="225"
					image="units/saurians/skirmisher-idle-12.png"
				[/frame]
				[frame]
					duration="225"
					image="units/saurians/skirmisher-idle-13.png"
				[/frame]
				[frame]
					duration="250"
					image="units/saurians/skirmisher-idle-12.png"
				[/frame]
				[frame]
					duration="250"
					image="units/saurians/skirmisher-idle-13.png"
				[/frame]
			[/idle_anim]
			[portrait]
				image="portraits/saurians/transparent/skirmisher.png"
				mirror="false"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/saurians/transparent/skirmisher.png"
				mirror="true"
				side="right"
				size="400"
			[/portrait]
			[defense]
				castle="40"
				cave="40"
				deep_water="80"
				flat="60"
				forest="40"
				frozen="70"
				fungus="40"
				hills="40"
				impassable="40"
				mountains="40"
				reef="60"
				sand="40"
				shallow_water="60"
				swamp_water="40"
				unwalkable="80"
				village="50"
			[/defense]
			[movement_costs]
				castle="1"
				cave="1"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="4"
				fungus="1"
				hills="1"
				impassable="99"
				mountains="2"
				reef="2"
				sand="1"
				shallow_water="3"
				swamp_water="1"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="110"
				cold="120"
				fire="120"
				impact="110"
				pierce="80"
			[/resistance]
			[abilities]
				[skirmisher]
					affect_self="yes"
#textdomain wesnoth
					description=_ "Skirmisher:
This unit is skilled in moving past enemies quickly, and ignores all enemy Zones of Control."
					female_name=_ "female^skirmisher"
					id="skirmisher"
					name=_ "skirmisher"
				[/skirmisher]
			[/abilities]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="4"
#textdomain wesnoth-units
				description=_ "spear"
				icon="attacks/spear.png"
				name="spear"
				number="4"
				range="melee"
				type="pierce"
			[/attack]
			[attack]
				damage="4"
				description=_ "spear"
				icon="attacks/spear.png"
				name="spear"
				number="2"
				range="ranged"
				type="pierce"
			[/attack]
			[modifications]
				[trait]
#textdomain wesnoth
					female_name=_ "female^intelligent"
					id="intelligent"
					male_name=_ "intelligent"
					name=_ "intelligent"
					[effect]
						apply_to="max_experience"
						increase="-20%"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^quick"
					id="quick"
					male_name=_ "quick"
					name=_ "quick"
					[effect]
						apply_to="movement"
						increase="1"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="-5%"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
	[/player]
	[player]
		can_recruit="Drake Burner,Drake Clasher,Drake Fighter,Drake Glider,Saurian Augur,Saurian Skirmisher"
		gold="-1"
		gold_add="no"
		name="KnightKunibert"
		save_id="KnightKunibert1"
		[unit]
			advances_to="Inferno Drake"
			alignment="lawful"
			allow_changes="yes"
			allow_player="yes"
			alpha="256"
			attacks_left="1"
			canrecruit="yes"
			colour="1"
			controller="human"
			cost="35"
			current_player="KnightKunibert"
			die_sound="drake-die.ogg"
			experience="1"
			facing="se"
			flying="no"
			fog="yes"
			gender="male"
			gold="100"
			goto_x="-999"
			goto_y="-999"
			hitpoints="63"
			id="KnightKunibert1"
			image="units/drakes/fire.png"
			income="0"
#textdomain wesnoth-units
			language_name=_ "Fire Drake"
			leader="Drake Flare,Fire Drake,Drake Slasher,Drake Gladiator,Drake Warrior,Saurian Oracle,Saurian Soothsayer"
			level="2"
			max_attacks="1"
			max_experience="56"
			max_hitpoints="63"
			max_moves="5"
			movement="5"
			movement_type="drakefly"
			moves="5"
			mp_countdown="yes"
			mp_countdown_action_bonus="20"
			mp_countdown_init_time="270"
			mp_countdown_reservoir_time="270"
			mp_countdown_turn_bonus="200"
			name="KnightKunibert"
			profile="portraits/drakes/burner.png"
			race="drake"
			random_leader="Drake Flare,Fire Drake,Drake Slasher,Drake Gladiator,Drake Warrior"
			random_traits="no"
			recruit="Drake Burner,Drake Clasher,Drake Glider,Drake Fighter,Saurian Skirmisher,Saurian Augur"
			resting="yes"
			save_id="KnightKunibert1"
			share_maps="no"
			share_view="yes"
			shroud="no"
			side="1"
			team_name="north"
			terrain_liked="Hh, Ha, Ds, Ss"
			type="Fire Drake"
			undead_variation="drake"
			underlying_id="1"
			unrenamable="no"
			upkeep="full"
			usage="archer"
			user_team_name="wesnoth-multiplayerteamname^North"
			village_gold="2"
			zoc="yes"
			[defense]
				castle="60"
				cave="70"
				deep_water="80"
				flat="70"
				forest="60"
				frozen="80"
				fungus="60"
				hills="60"
				impassable="70"
				mountains="60"
				reef="70"
				sand="60"
				shallow_water="80"
				swamp_water="70"
				unwalkable="60"
				village="60"
			[/defense]
			[movement_costs]
				castle="1"
				cave="3"
				deep_water="2"
				flat="1"
				forest="1"
				frozen="2"
				fungus="2"
				hills="1"
				impassable="99"
				mountains="1"
				reef="1"
				sand="1"
				shallow_water="1"
				swamp_water="1"
				unwalkable="1"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="130"
				blade="90"
				cold="150"
				fire="40"
				impact="80"
				pierce="110"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="9"
				description=_ "claws"
				icon="attacks/claws-drake.png"
				name="claws"
				number="2"
				range="melee"
				type="blade"
			[/attack]
			[attack]
				damage="7"
				description=_ "fire breath"
				icon="attacks/fire-breath-drake.png"
				name="fire breath"
				number="5"
				range="ranged"
				type="fire"
			[/attack]
			[modifications]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Hurricane Drake"
			alignment="lawful"
			alpha="256"
			attacks_left="1"
			cost="30"
			die_sound="drake-die.ogg"
			ellipse="misc/ellipse"
			experience="5"
			facing="s"
			flies="false"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="48"
			id="Drake Glider-3"
			image="units/drakes/sky.png"
			language_name=_ "Sky Drake"
			level="2"
			max_attacks="1"
			max_experience="56"
			max_hitpoints="48"
			max_moves="10"
			movement="9"
			movement_type="fly"
			moves="10"
			name="Garush"
			profile="portraits/drakes/glider.png"
			race="drake"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="1"
			type="Sky Drake"
			undead_variation="drake"
			underlying_id="3"
			unrenamable="no"
			upkeep="full"
			usage="scout"
			zoc="yes"
			[defense]
				castle="50"
				cave="70"
				deep_water="50"
				flat="50"
				forest="50"
				frozen="50"
				fungus="60"
				hills="50"
				impassable="80"
				mountains="50"
				reef="50"
				sand="50"
				shallow_water="50"
				swamp_water="50"
				unwalkable="50"
				village="50"
			[/defense]
			[movement_costs]
				castle="1"
				cave="3"
				deep_water="1"
				flat="1"
				forest="1"
				frozen="1"
				fungus="2"
				hills="1"
				impassable="99"
				mountains="1"
				reef="1"
				sand="1"
				shallow_water="1"
				swamp_water="1"
				unwalkable="1"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="130"
				blade="90"
				cold="150"
				fire="50"
				impact="80"
				pierce="110"
			[/resistance]
			[attack_anim]
				[filter_attack]
					name="fire breath"
				[/filter_attack]
				[if]
					direction="n"
					[missile_frame]
						begin="-400"
						end="100"
						halo="projectiles/fire-breath-n-1.png:80,projectiles/fire-breath-n-2.png:80,projectiles/fire-breath-n-3.png:80,projectiles/fire-breath-n-4.png:80,projectiles/fire-breath-n-5.png:80"
						halo_x="9"
						halo_y="-34"
					[/missile_frame]
				[/if]
				[else]
					direction="s"
					[missile_frame]
						begin="-400"
						end="100"
						halo="projectiles/fire-breath-s-1.png:80,projectiles/fire-breath-s-2.png:80,projectiles/fire-breath-s-3.png:80,projectiles/fire-breath-s-4.png:80,projectiles/fire-breath-s-5.png:80"
						halo_x="9"
						halo_y="15"
					[/missile_frame]
				[/else]
				[else]
					direction="ne,nw"
					[missile_frame]
						begin="-400"
						end="100"
						halo="projectiles/fire-breath-ne-1.png:80,projectiles/fire-breath-ne-2.png:80,projectiles/fire-breath-ne-3.png:80,projectiles/fire-breath-ne-4.png:80,projectiles/fire-breath-ne-5.png:80"
						halo_x="22"
						halo_y="-22"
					[/missile_frame]
				[/else]
				[else]
					direction="se,sw"
					[missile_frame]
						begin="-400"
						end="100"
						halo="projectiles/fire-breath-se-1.png:80,projectiles/fire-breath-se-2.png:80,projectiles/fire-breath-se-3.png:80,projectiles/fire-breath-se-4.png:80,projectiles/fire-breath-se-5.png:80"
						halo_x="24"
						halo_y="10"
					[/missile_frame]
				[/else]
				[if]
					hits="no"
					[frame]
						begin="-400"
						end="-350"
						image="units/drakes/sky.png"
						sound="flame-big-miss.ogg"
					[/frame]
				[/if]
				[else]
					hits="yes"
					[frame]
						begin="-400"
						end="-350"
						image="units/drakes/sky.png"
						sound="flame-big.ogg"
					[/frame]
				[/else]
				[frame]
					begin="-350"
					end="-150"
					image="units/drakes/sky-attack-ranged-fire.png"
				[/frame]
				[frame]
					begin="-150"
					end="0"
					image="units/drakes/sky.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				hits="yes"
				[filter_attack]
					name="slam"
				[/filter_attack]
				[frame]
					begin="-225"
					end="-200"
					image="units/drakes/sky.png"
				[/frame]
				[frame]
					begin="-200"
					end="-150"
					image="units/drakes/sky-attack-ranged-impact.png"
				[/frame]
				[frame]
					begin="-150"
					end="-75"
					image="units/drakes/sky-attack-melee1.png"
				[/frame]
				[frame]
					begin="-75"
					end="50"
					image="units/drakes/sky-attack-melee2.png"
					sound="club.ogg"
				[/frame]
				[frame]
					begin="50"
					end="125"
					image="units/drakes/sky-defend.png"
				[/frame]
				[frame]
					begin="125"
					end="175"
					image="units/drakes/sky-attack-melee1.png"
				[/frame]
				[frame]
					begin="275"
					end="200"
					image="units/drakes/sky.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				hits="no"
				[filter_attack]
					name="slam"
				[/filter_attack]
				[frame]
					begin="-200"
					end="-175"
					image="units/drakes/sky.png"
				[/frame]
				[frame]
					begin="-175"
					end="-150"
					image="units/drakes/sky-attack-ranged-impact.png"
				[/frame]
				[frame]
					begin="-150"
					end="-75"
					image="units/drakes/sky-attack-melee1.png"
				[/frame]
				[frame]
					begin="-75"
					end="50"
					image="units/drakes/sky-attack-melee2.png"
					sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
				[/frame]
				[frame]
					begin="50"
					end="125"
					image="units/drakes/sky-defend.png"
				[/frame]
				[frame]
					begin="125"
					end="175"
					image="units/drakes/sky-attack-melee1.png"
				[/frame]
				[frame]
					begin="275"
					end="200"
					image="units/drakes/sky.png"
				[/frame]
			[/attack_anim]
			[death]
				[frame]
					begin="0"
					end="130"
					image="units/drakes/sky-die-1.png"
				[/frame]
				[frame]
					begin="130"
					end="320"
					image="units/drakes/sky-die-2.png"
				[/frame]
				[frame]
					begin="320"
					end="450"
					image="units/drakes/sky-die-3.png"
				[/frame]
				[frame]
					begin="450"
					end="600"
					image="units/drakes/sky-die-4.png"
				[/frame]
				[frame]
					begin="600"
					end="750"
					image="units/drakes/sky-die-5.png"
				[/frame]
				[frame]
					begin="750"
					end="900"
					image="units/drakes/sky-die-6.png"
				[/frame]
				[frame]
					begin="900"
					end="1050"
					image="units/drakes/sky-die-7.png"
				[/frame]
				[frame]
					begin="1050"
					end="1200"
					image="units/drakes/sky-die-8.png"
				[/frame]
			[/death]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/drakes/sky.png"
				[/frame]
				[frame]
					duration="100"
					image="units/drakes/sky-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/drakes/sky-defend.png"
						sound="drake-hit-1.ogg,drake-hit-2.ogg,drake-hit-3.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/drakes/sky-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/drakes/sky.png"
				[/frame]
			[/defend]
			[movement_anim]
				[frame]
					begin="0"
					end="150"
					image="units/drakes/sky-defend.png"
				[/frame]
			[/movement_anim]
			[standing_anim]
				start_time="0"
				[filter]
					[filter_location]
						terrain="!,W*,Qx*,Ql*"
						[or]
							terrain="Wwf,Wwr,*^V*"
						[/or]
					[/filter_location]
				[/filter]
				[frame]
					duration="150"
					image="units/drakes/sky.png"
				[/frame]
			[/standing_anim]
			[standing_anim]
				layer="60"
				start_time="0"
				submerge="0.01"
				[filter]
					[filter_location]
						terrain="W*,Qx*,Ql*"
						[not]
							terrain="Wwf,Wwr,*^V*"
						[/not]
					[/filter_location]
				[/filter]
				[frame]
					duration="150"
					image="units/drakes/sky-defend.png"
				[/frame]
			[/standing_anim]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="6"
				description=_ "slam"
				icon="attacks/slam-drake.png"
				name="slam"
				number="3"
				range="melee"
				type="impact"
			[/attack]
			[attack]
				damage="5"
				description=_ "fire breath"
				icon="attacks/fire-breath-drake.png"
				name="fire breath"
				number="3"
				range="ranged"
				type="fire"
				[specials]
					[chance_to_hit]
						active_on="offense"
						cumulative="yes"
#textdomain wesnoth
						description=_ "Marksman:
When used offensively, this attack always has at least a 60% chance to hit."
						id="marksman"
						name=_ "marksman"
						value="60"
					[/chance_to_hit]
				[/specials]
			[/attack]
			[modifications]
				[trait]
					female_name=_ "female^resilient"
					id="resilient"
					male_name=_ "resilient"
					name=_ "resilient"
					[effect]
						apply_to="hitpoints"
						increase_total="4"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
						times="per level"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^quick"
					id="quick"
					male_name=_ "quick"
					name=_ "quick"
					[effect]
						apply_to="movement"
						increase="1"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="-5%"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Drake Gladiator,Drake Slasher"
			alignment="lawful"
			alpha="256"
			attacks_left="1"
			cost="19"
			die_sound="drake-die.ogg"
			ellipse="misc/ellipse"
			experience="14"
			facing="nw"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="46"
			id="Drake Clasher-6"
			image="units/drakes/clasher.png"
#textdomain wesnoth-units
			language_name=_ "Drake Clasher"
			level="1"
			max_attacks="1"
			max_experience="32"
			max_hitpoints="46"
			max_moves="6"
			movement="5"
			movement_type="drakefoot"
			moves="6"
			name="Verdinos"
			profile="portraits/drakes/clasher.png"
			race="drake"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="1"
			type="Drake Clasher"
			undead_variation="drake"
			underlying_id="6"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					name="spear"
				[/filter_attack]
				[frame]
					begin="-200"
					end="-100"
					image="units/drakes/clasher-flying.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="75"
						image="units/drakes/clasher-attack-spear.png"
						sound="spear.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="75"
						image="units/drakes/clasher-attack-spear.png"
						sound="spear-miss.ogg"
					[/frame]
				[/else]
				[frame]
					begin="75"
					end="175"
					image="units/drakes/clasher-flying.png"
				[/frame]
				[frame]
					begin="175"
					end="200"
					image="units/drakes/clasher.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				[filter_attack]
					name="sword"
				[/filter_attack]
				[frame]
					begin="-200"
					end="-100"
					image="units/drakes/clasher-flying.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="75"
						image="units/drakes/clasher-attack-sword.png"
						sound="sword-1.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="75"
						image="units/drakes/clasher-attack-sword.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="75"
					end="175"
					image="units/drakes/clasher-flying.png"
				[/frame]
				[frame]
					begin="175"
					end="200"
					image="units/drakes/clasher.png"
				[/frame]
			[/attack_anim]
			[death]
				[frame]
					begin="0"
					end="130"
					image="units/drakes/clasher-die-1.png"
				[/frame]
				[frame]
					begin="130"
					end="320"
					image="units/drakes/clasher-die-2.png"
				[/frame]
				[frame]
					begin="320"
					end="450"
					image="units/drakes/clasher-die-3.png"
				[/frame]
				[frame]
					begin="450"
					end="600"
					image="units/drakes/clasher-die-4.png"
				[/frame]
				[frame]
					begin="600"
					end="750"
					image="units/drakes/clasher-die-5.png"
				[/frame]
				[frame]
					begin="750"
					end="900"
					image="units/drakes/clasher-die-6.png"
				[/frame]
				[frame]
					begin="900"
					end="1050"
					image="units/drakes/clasher-die-7.png"
				[/frame]
				[frame]
					begin="1050"
					end="1200"
					image="units/drakes/clasher-die-8.png"
				[/frame]
				[frame]
					begin="1200"
					end="1350"
					image="units/drakes/clasher-die-9.png"
				[/frame]
				[frame]
					begin="1350"
					end="1500"
					image="units/drakes/clasher-die-10.png"
				[/frame]
			[/death]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/drakes/clasher.png"
				[/frame]
				[frame]
					duration="100"
					image="units/drakes/clasher-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/drakes/clasher-defend.png"
						sound="drake-hit-1.ogg,drake-hit-2.ogg,drake-hit-3.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/drakes/clasher-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/drakes/clasher.png"
				[/frame]
			[/defend]
			[defense]
				castle="60"
				cave="70"
				deep_water="90"
				flat="70"
				forest="60"
				frozen="80"
				fungus="60"
				hills="60"
				impassable="70"
				mountains="60"
				reef="70"
				sand="60"
				shallow_water="80"
				swamp_water="80"
				unwalkable="80"
				village="60"
			[/defense]
			[movement_costs]
				castle="1"
				cave="2"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="3"
				fungus="2"
				hills="1"
				impassable="99"
				mountains="1"
				reef="2"
				sand="1"
				shallow_water="3"
				swamp_water="3"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="130"
				blade="80"
				cold="150"
				fire="50"
				impact="70"
				pierce="100"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="5"
				description=_ "sword"
				icon="attacks/scimitar.png"
				name="sword"
				number="4"
				range="melee"
				type="blade"
			[/attack]
			[attack]
				damage="6"
				description=_ "spear"
				icon="attacks/spear.png"
				name="spear"
				number="4"
				range="melee"
				type="pierce"
				[specials]
					[firststrike]
#textdomain wesnoth
						description=_ "First Strike:
This unit always strikes first with this attack, even if they are defending."
						id="firststrike"
						name=_ "firststrike"
					[/firststrike]
				[/specials]
			[/attack]
			[modifications]
				[trait]
					female_name=_ "female^quick"
					id="quick"
					male_name=_ "quick"
					name=_ "quick"
					[effect]
						apply_to="movement"
						increase="1"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="-5%"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^resilient"
					id="resilient"
					male_name=_ "resilient"
					name=_ "resilient"
					[effect]
						apply_to="hitpoints"
						increase_total="4"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
						times="per level"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Saurian Oracle,Saurian Soothsayer"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="16"
			die_sound="hiss-die.wav"
			ellipse="misc/ellipse"
			experience="5"
			facing="n"
			flag_rgb="magenta"
			flies="false"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="23"
			id="Saurian Augur-19"
			image="units/saurians/augur.png"
#textdomain wesnoth-units
			language_name=_ "Saurian Augur"
			level="1"
			max_attacks="1"
			max_experience="15"
			max_hitpoints="23"
			max_moves="6"
			movement="6"
			movement_type="lizard"
			moves="6"
			name="Krexiss"
			profile="portraits/saurians/augur.png"
			race="lizard"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="1"
			type="Saurian Augur"
			undead_variation="saurian"
			underlying_id="19"
			unrenamable="no"
			upkeep="full"
			usage="healer"
			zoc="yes"
			[attack_anim]
				start_time="-300"
				[filter_attack]
					name="curse"
				[/filter_attack]
				[if]
					hits="yes"
					[missile_frame]
						begin="-200"
						end="0"
						image="projectiles/whitemissile-n.png"
						image_diagonal="projectiles/whitemissile-ne.png"
						offset="0.0~0.8"
					[/missile_frame]
					[missile_frame]
						begin="0"
						end="50"
						halo="projectiles/whitemissile-impact-1.png"
						offset="0.8"
					[/missile_frame]
					[missile_frame]
						begin="50"
						end="100"
						halo="projectiles/whitemissile-impact-2.png"
						offset="0.92"
					[/missile_frame]
					[missile_frame]
						begin="100"
						end="150"
						halo="projectiles/whitemissile-impact-3.png"
						offset="0.94"
					[/missile_frame]
					[missile_frame]
						begin="150"
						end="200"
						halo="projectiles/whitemissile-impact-4.png"
						offset="0.96"
					[/missile_frame]
					[missile_frame]
						begin="200"
						end="250"
						halo="projectiles/whitemissile-impact-5.png"
						offset="0.98"
					[/missile_frame]
					[missile_frame]
						begin="250"
						end="300"
						halo="projectiles/whitemissile-impact-6.png"
						offset="1.0"
					[/missile_frame]
					[missile_frame]
						begin="300"
						end="350"
						halo="projectiles/whitemissile-impact-7.png"
						offset="1.02"
					[/missile_frame]
					[missile_frame]
						begin="350"
						end="400"
						halo="projectiles/whitemissile-impact-8.png"
						offset="1.04"
					[/missile_frame]
				[/if]
				[else]
					hits="no"
					[missile_frame]
						alpha=".8~0.0:200"
						begin="-200"
						end="0"
						image="projectiles/whitemissile-n.png"
						image_diagonal="projectiles/whitemissile-ne.png"
						offset="0.0~0.8"
					[/missile_frame]
				[/else]
				[frame]
					duration="50"
					halo="halo/saurian-magic-halo-1.png"
					image="units/saurians/augur-magic-1.png"
				[/frame]
				[frame]
					duration="60"
					halo="halo/saurian-magic-halo-2.png"
					image="units/saurians/augur-magic-1.png"
					sound="magicmissile.wav"
				[/frame]
				[frame]
					duration="70"
					halo="halo/saurian-magic-halo-3.png"
					image="units/saurians/augur-magic-2.png"
				[/frame]
				[frame]
					duration="80"
					halo="halo/saurian-magic-halo-4.png"
					image="units/saurians/augur-magic-2.png"
				[/frame]
				[frame]
					duration="90"
					halo="halo/saurian-magic-halo-5.png"
					image="units/saurians/augur-magic-1.png"
				[/frame]
				[frame]
					duration="100"
					halo="halo/saurian-magic-halo-6.png"
					image="units/saurians/augur-magic-1.png"
				[/frame]
				[frame]
					duration="100"
					halo="halo/saurian-magic-halo-7.png"
					image="units/saurians/augur.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				offset="0.0~0.3,0.3~0.45,0.45~0.3,0.3~0.0"
				start_time="-250"
				[filter_attack]
					name="staff"
				[/filter_attack]
				[frame]
					duration="150"
					image="units/saurians/augur-melee-1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						duration="100"
						image="units/saurians/augur-melee-2.png"
						sound="staff.wav"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						duration="100"
						image="units/saurians/augur-melee-2.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					duration="100"
					image="units/saurians/augur-melee-3.png"
				[/frame]
				[frame]
					duration="90"
					image="units/saurians/augur-melee-4.png"
				[/frame]
				[frame]
					duration="80"
					image="units/saurians/augur-melee-5.png"
				[/frame]
				[frame]
					duration="50"
					image="units/saurians/augur-defend-1.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/saurians/augur-defend-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/saurians/augur-defend-2.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/saurians/augur-defend-2.png"
						sound="hiss-hit.wav"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/saurians/augur-defend-2.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/saurians/augur-defend-1.png"
				[/frame]
			[/defend]
			[healing_anim]
				start_time="-300"
				[frame]
					duration="50"
					halo="halo/saurian-magic-halo-1.png"
					image="units/saurians/augur-magic-1.png"
				[/frame]
				[frame]
					duration="60"
					halo="halo/saurian-magic-halo-2.png"
					image="units/saurians/augur-magic-1.png"
				[/frame]
				[frame]
					duration="70"
					halo="halo/saurian-magic-halo-3.png"
					image="units/saurians/augur-magic-2.png"
				[/frame]
				[frame]
					duration="80"
					halo="halo/saurian-magic-halo-4.png"
					image="units/saurians/augur-magic-2.png"
				[/frame]
				[frame]
					duration="90"
					halo="halo/saurian-magic-halo-5.png"
					image="units/saurians/augur-magic-1.png"
				[/frame]
				[frame]
					duration="100"
					halo="halo/saurian-magic-halo-6.png"
					image="units/saurians/augur-magic-1.png"
				[/frame]
				[frame]
					duration="100"
					halo="halo/saurian-magic-halo-7.png"
					image="units/saurians/augur.png"
				[/frame]
			[/healing_anim]
			[portrait]
				image="portraits/saurians/transparent/augur.png"
				mirror="false"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/saurians/transparent/augur.png"
				mirror="true"
				side="right"
				size="400"
			[/portrait]
			[defense]
				castle="40"
				cave="40"
				deep_water="80"
				flat="60"
				forest="40"
				frozen="70"
				fungus="40"
				hills="40"
				impassable="40"
				mountains="40"
				reef="60"
				sand="40"
				shallow_water="60"
				swamp_water="40"
				unwalkable="80"
				village="50"
			[/defense]
			[movement_costs]
				castle="1"
				cave="1"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="4"
				fungus="1"
				hills="1"
				impassable="99"
				mountains="2"
				reef="2"
				sand="1"
				shallow_water="3"
				swamp_water="1"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="110"
				cold="120"
				fire="120"
				impact="110"
				pierce="80"
			[/resistance]
			[abilities]
				[heals]
					affect_allies="yes"
					affect_self="no"
#textdomain wesnoth
					description=_ "Heals +4:
Allows the unit to heal adjacent allied units at the beginning of our turn.

A unit cared for by this healer may heal up to 4 HP per turn, or stop poison from taking effect for that turn.
A poisoned unit cannot be cured of its poison by a healer, and must seek the care of a village or a unit that can cure."
					female_name=_ "female^heals +4"
					id="healing"
					name=_ "heals +4"
					poison="slowed"
					value="4"
					[affect_adjacent]
						adjacent="n,ne,se,s,sw,nw"
					[/affect_adjacent]
				[/heals]
			[/abilities]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="5"
#textdomain wesnoth-units
				description=_ "staff"
				icon="attacks/staff-magic.png"
				name="staff"
				number="2"
				range="melee"
				type="impact"
			[/attack]
			[attack]
				damage="5"
				description=_ "curse"
				icon="attacks/curse.png"
				name="curse"
				number="3"
				range="ranged"
				type="cold"
				[specials]
					[chance_to_hit]
						cumulative="no"
#textdomain wesnoth
						description=_ "Magical:
This attack always has a 70% chance to hit regardless of the defensive ability of the unit being attacked."
						id="magical"
						name=_ "magical"
						value="70"
					[/chance_to_hit]
				[/specials]
			[/attack]
			[modifications]
				[trait]
					female_name=_ "female^intelligent"
					id="intelligent"
					male_name=_ "intelligent"
					name=_ "intelligent"
					[effect]
						apply_to="max_experience"
						increase="-20%"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^strong"
					id="strong"
					male_name=_ "strong"
					name=_ "strong"
					[effect]
						apply_to="attack"
						increase_damage="1"
						range="melee"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Drake Warrior"
			alignment="lawful"
			alpha="256"
			attacks_left="1"
			cost="17"
			die_sound="drake-die.ogg"
			ellipse="misc/ellipse"
			experience="16"
			facing="se"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="38"
			id="Drake Fighter-20"
			image="units/drakes/fighter.png"
#textdomain wesnoth-units
			language_name=_ "Drake Fighter"
			level="1"
			max_attacks="1"
			max_experience="29"
			max_hitpoints="38"
			max_moves="7"
			movement="6"
			movement_type="drakefly"
			moves="7"
			name="Gri Kor"
			profile="portraits/drakes/fighter.png"
			race="drake"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="1"
			type="Drake Fighter"
			undead_variation="drake"
			underlying_id="20"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					name="fire breath"
				[/filter_attack]
				[if]
					direction="n"
					[missile_frame]
						begin="-400"
						end="100"
						halo="projectiles/fire-breath-n-1.png:80,projectiles/fire-breath-n-2.png:80,projectiles/fire-breath-n-3.png:80,projectiles/fire-breath-n-4.png:80,projectiles/fire-breath-n-5.png:80"
						halo_x="11"
						halo_y="-34"
					[/missile_frame]
				[/if]
				[else]
					direction="s"
					[missile_frame]
						begin="-400"
						end="100"
						halo="projectiles/fire-breath-s-1.png:80,projectiles/fire-breath-s-2.png:80,projectiles/fire-breath-s-3.png:80,projectiles/fire-breath-s-4.png:80,projectiles/fire-breath-s-5.png:80"
						halo_x="11"
						halo_y="15"
					[/missile_frame]
				[/else]
				[else]
					direction="ne,nw"
					[missile_frame]
						begin="-400"
						end="100"
						halo="projectiles/fire-breath-ne-1.png:80,projectiles/fire-breath-ne-2.png:80,projectiles/fire-breath-ne-3.png:80,projectiles/fire-breath-ne-4.png:80,projectiles/fire-breath-ne-5.png:80"
						halo_x="24"
						halo_y="-22"
					[/missile_frame]
				[/else]
				[else]
					direction="se,sw"
					[missile_frame]
						begin="-400"
						end="100"
						halo="projectiles/fire-breath-se-1.png:80,projectiles/fire-breath-se-2.png:80,projectiles/fire-breath-se-3.png:80,projectiles/fire-breath-se-4.png:80,projectiles/fire-breath-se-5.png:80"
						halo_x="26"
						halo_y="10"
					[/missile_frame]
				[/else]
				[if]
					hits="no"
					[frame]
						begin="-400"
						end="-350"
						image="units/drakes/fighter-attack-ranged1.png"
						sound="flame-big-miss.ogg"
					[/frame]
				[/if]
				[else]
					hits="yes"
					[frame]
						begin="-400"
						end="-350"
						image="units/drakes/fighter-attack-ranged1.png"
						sound="flame-big.ogg"
					[/frame]
				[/else]
				[frame]
					begin="-350"
					end="-150"
					image="units/drakes/fighter-attack-ranged2.png"
				[/frame]
				[frame]
					begin="-150"
					end="0"
					image="units/drakes/fighter.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				[filter_attack]
					name="scimitar"
				[/filter_attack]
				[frame]
					begin="-200"
					end="-175"
					image="units/drakes/fighter.png"
				[/frame]
				[frame]
					begin="-175"
					end="-100"
					image="units/drakes/fighter-attack-close1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="75"
						image="units/drakes/fighter-attack-close2.png"
						sound="sword-1.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="75"
						image="units/drakes/fighter-attack-close2.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="75"
					end="150"
					image="units/drakes/fighter-defend.png"
				[/frame]
				[frame]
					begin="150"
					end="175"
					image="units/drakes/fighter.png"
				[/frame]
			[/attack_anim]
			[death]
				[frame]
					begin="0"
					end="130"
					image="units/drakes/fighter-die-1.png"
				[/frame]
				[frame]
					begin="130"
					end="320"
					image="units/drakes/fighter-die-2.png"
				[/frame]
				[frame]
					begin="320"
					end="450"
					image="units/drakes/fighter-die-3.png"
				[/frame]
				[frame]
					begin="450"
					end="600"
					image="units/drakes/fighter-die-4.png"
				[/frame]
				[frame]
					begin="600"
					end="750"
					image="units/drakes/fighter-die-5.png"
				[/frame]
				[frame]
					begin="750"
					end="900"
					image="units/drakes/fighter-die-6.png"
				[/frame]
				[frame]
					begin="900"
					end="1050"
					image="units/drakes/fighter-die-7.png"
				[/frame]
				[frame]
					begin="1050"
					end="1200"
					image="units/drakes/fighter-die-8.png"
				[/frame]
			[/death]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/drakes/fighter.png"
				[/frame]
				[frame]
					duration="100"
					image="units/drakes/fighter-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/drakes/fighter-defend.png"
						sound="drake-hit-1.ogg,drake-hit-2.ogg,drake-hit-3.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/drakes/fighter-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/drakes/fighter.png"
				[/frame]
			[/defend]
			[movement_anim]
				[frame]
					begin="0"
					end="150"
					image="units/drakes/fighter-flying.png"
				[/frame]
			[/movement_anim]
			[standing_anim]
				start_time="0"
				[filter]
					[filter_location]
						terrain="!,W*,Qx*,Ql*"
						[or]
							terrain="Wwf,Wwr,*^V*"
						[/or]
					[/filter_location]
				[/filter]
				[frame]
					duration="150"
					image="units/drakes/fighter.png"
				[/frame]
			[/standing_anim]
			[standing_anim]
				layer="60"
				start_time="0"
				submerge="0.01"
				[filter]
					[filter_location]
						terrain="W*,Qx*,Ql*"
						[not]
							terrain="Wwf,Wwr,*^V*"
						[/not]
					[/filter_location]
				[/filter]
				[frame]
					duration="150"
					image="units/drakes/fighter-flying.png"
				[/frame]
			[/standing_anim]
			[defense]
				castle="60"
				cave="70"
				deep_water="80"
				flat="70"
				forest="60"
				frozen="80"
				fungus="60"
				hills="60"
				impassable="70"
				mountains="60"
				reef="70"
				sand="60"
				shallow_water="80"
				swamp_water="70"
				unwalkable="60"
				village="60"
			[/defense]
			[movement_costs]
				castle="1"
				cave="3"
				deep_water="2"
				flat="1"
				forest="1"
				frozen="2"
				fungus="2"
				hills="1"
				impassable="99"
				mountains="1"
				reef="1"
				sand="1"
				shallow_water="1"
				swamp_water="1"
				unwalkable="1"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="130"
				blade="90"
				cold="150"
				fire="50"
				impact="80"
				pierce="110"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="8"
				description=_ "scimitar"
				icon="attacks/scimitar.png"
				name="scimitar"
				number="3"
				range="melee"
				type="blade"
			[/attack]
			[attack]
				damage="3"
				description=_ "fire breath"
				icon="attacks/fire-breath-drake.png"
				name="fire breath"
				number="3"
				range="ranged"
				type="fire"
			[/attack]
			[modifications]
				[trait]
#textdomain wesnoth
					female_name=_ "female^quick"
					id="quick"
					male_name=_ "quick"
					name=_ "quick"
					[effect]
						apply_to="movement"
						increase="1"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="-5%"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^strong"
					id="strong"
					male_name=_ "strong"
					name=_ "strong"
					[effect]
						apply_to="attack"
						increase_damage="1"
						range="melee"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Drake Warrior"
			alignment="lawful"
			alpha="256"
			attacks_left="1"
			cost="17"
			die_sound="drake-die.ogg"
			ellipse="misc/ellipse"
			experience="0"
			facing="s"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="45"
			id="Drake Fighter-23"
			image="units/drakes/fighter.png"
#textdomain wesnoth-units
			language_name=_ "Drake Fighter"
			level="1"
			max_attacks="1"
			max_experience="29"
			max_hitpoints="45"
			max_moves="6"
			movement="6"
			movement_type="drakefly"
			moves="6"
			name="Mark"
			profile="portraits/drakes/fighter.png"
			race="drake"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="1"
			type="Drake Fighter"
			undead_variation="drake"
			underlying_id="23"
			unrenamable="no"
			upkeep="full"
			usage="fighter"
			zoc="yes"
			[attack_anim]
				[filter_attack]
					name="fire breath"
				[/filter_attack]
				[if]
					direction="n"
					[missile_frame]
						begin="-400"
						end="100"
						halo="projectiles/fire-breath-n-1.png:80,projectiles/fire-breath-n-2.png:80,projectiles/fire-breath-n-3.png:80,projectiles/fire-breath-n-4.png:80,projectiles/fire-breath-n-5.png:80"
						halo_x="11"
						halo_y="-34"
					[/missile_frame]
				[/if]
				[else]
					direction="s"
					[missile_frame]
						begin="-400"
						end="100"
						halo="projectiles/fire-breath-s-1.png:80,projectiles/fire-breath-s-2.png:80,projectiles/fire-breath-s-3.png:80,projectiles/fire-breath-s-4.png:80,projectiles/fire-breath-s-5.png:80"
						halo_x="11"
						halo_y="15"
					[/missile_frame]
				[/else]
				[else]
					direction="ne,nw"
					[missile_frame]
						begin="-400"
						end="100"
						halo="projectiles/fire-breath-ne-1.png:80,projectiles/fire-breath-ne-2.png:80,projectiles/fire-breath-ne-3.png:80,projectiles/fire-breath-ne-4.png:80,projectiles/fire-breath-ne-5.png:80"
						halo_x="24"
						halo_y="-22"
					[/missile_frame]
				[/else]
				[else]
					direction="se,sw"
					[missile_frame]
						begin="-400"
						end="100"
						halo="projectiles/fire-breath-se-1.png:80,projectiles/fire-breath-se-2.png:80,projectiles/fire-breath-se-3.png:80,projectiles/fire-breath-se-4.png:80,projectiles/fire-breath-se-5.png:80"
						halo_x="26"
						halo_y="10"
					[/missile_frame]
				[/else]
				[if]
					hits="no"
					[frame]
						begin="-400"
						end="-350"
						image="units/drakes/fighter-attack-ranged1.png"
						sound="flame-big-miss.ogg"
					[/frame]
				[/if]
				[else]
					hits="yes"
					[frame]
						begin="-400"
						end="-350"
						image="units/drakes/fighter-attack-ranged1.png"
						sound="flame-big.ogg"
					[/frame]
				[/else]
				[frame]
					begin="-350"
					end="-150"
					image="units/drakes/fighter-attack-ranged2.png"
				[/frame]
				[frame]
					begin="-150"
					end="0"
					image="units/drakes/fighter.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				[filter_attack]
					name="scimitar"
				[/filter_attack]
				[frame]
					begin="-200"
					end="-175"
					image="units/drakes/fighter.png"
				[/frame]
				[frame]
					begin="-175"
					end="-100"
					image="units/drakes/fighter-attack-close1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						begin="-100"
						end="75"
						image="units/drakes/fighter-attack-close2.png"
						sound="sword-1.ogg"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						begin="-100"
						end="75"
						image="units/drakes/fighter-attack-close2.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					begin="75"
					end="150"
					image="units/drakes/fighter-defend.png"
				[/frame]
				[frame]
					begin="150"
					end="175"
					image="units/drakes/fighter.png"
				[/frame]
			[/attack_anim]
			[death]
				[frame]
					begin="0"
					end="130"
					image="units/drakes/fighter-die-1.png"
				[/frame]
				[frame]
					begin="130"
					end="320"
					image="units/drakes/fighter-die-2.png"
				[/frame]
				[frame]
					begin="320"
					end="450"
					image="units/drakes/fighter-die-3.png"
				[/frame]
				[frame]
					begin="450"
					end="600"
					image="units/drakes/fighter-die-4.png"
				[/frame]
				[frame]
					begin="600"
					end="750"
					image="units/drakes/fighter-die-5.png"
				[/frame]
				[frame]
					begin="750"
					end="900"
					image="units/drakes/fighter-die-6.png"
				[/frame]
				[frame]
					begin="900"
					end="1050"
					image="units/drakes/fighter-die-7.png"
				[/frame]
				[frame]
					begin="1050"
					end="1200"
					image="units/drakes/fighter-die-8.png"
				[/frame]
			[/death]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/drakes/fighter.png"
				[/frame]
				[frame]
					duration="100"
					image="units/drakes/fighter-defend.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/drakes/fighter-defend.png"
						sound="drake-hit-1.ogg,drake-hit-2.ogg,drake-hit-3.ogg"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/drakes/fighter-defend.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/drakes/fighter.png"
				[/frame]
			[/defend]
			[movement_anim]
				[frame]
					begin="0"
					end="150"
					image="units/drakes/fighter-flying.png"
				[/frame]
			[/movement_anim]
			[standing_anim]
				start_time="0"
				[filter]
					[filter_location]
						terrain="!,W*,Qx*,Ql*"
						[or]
							terrain="Wwf,Wwr,*^V*"
						[/or]
					[/filter_location]
				[/filter]
				[frame]
					duration="150"
					image="units/drakes/fighter.png"
				[/frame]
			[/standing_anim]
			[standing_anim]
				layer="60"
				start_time="0"
				submerge="0.01"
				[filter]
					[filter_location]
						terrain="W*,Qx*,Ql*"
						[not]
							terrain="Wwf,Wwr,*^V*"
						[/not]
					[/filter_location]
				[/filter]
				[frame]
					duration="150"
					image="units/drakes/fighter-flying.png"
				[/frame]
			[/standing_anim]
			[defense]
				castle="60"
				cave="70"
				deep_water="80"
				flat="70"
				forest="60"
				frozen="80"
				fungus="60"
				hills="60"
				impassable="70"
				mountains="60"
				reef="70"
				sand="60"
				shallow_water="80"
				swamp_water="70"
				unwalkable="60"
				village="60"
			[/defense]
			[movement_costs]
				castle="1"
				cave="3"
				deep_water="2"
				flat="1"
				forest="1"
				frozen="2"
				fungus="2"
				hills="1"
				impassable="99"
				mountains="1"
				reef="1"
				sand="1"
				shallow_water="1"
				swamp_water="1"
				unwalkable="1"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="130"
				blade="90"
				cold="150"
				fire="50"
				impact="80"
				pierce="110"
			[/resistance]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="8"
				description=_ "scimitar"
				icon="attacks/scimitar.png"
				name="scimitar"
				number="3"
				range="melee"
				type="blade"
			[/attack]
			[attack]
				damage="3"
				description=_ "fire breath"
				icon="attacks/fire-breath-drake.png"
				name="fire breath"
				number="3"
				range="ranged"
				type="fire"
			[/attack]
			[modifications]
				[trait]
#textdomain wesnoth
					female_name=_ "female^strong"
					id="strong"
					male_name=_ "strong"
					name=_ "strong"
					[effect]
						apply_to="attack"
						increase_damage="1"
						range="melee"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^resilient"
					id="resilient"
					male_name=_ "resilient"
					name=_ "resilient"
					[effect]
						apply_to="hitpoints"
						increase_total="4"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
						times="per level"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
		[unit]
			advances_to="Saurian Oracle,Saurian Soothsayer"
			alignment="chaotic"
			alpha="256"
			attacks_left="1"
			cost="16"
			die_sound="hiss-die.wav"
			ellipse="misc/ellipse"
			experience="16"
			facing="nw"
			flag_rgb="magenta"
			flies="false"
			flying="no"
			gender="male"
			goto_x="-999"
			goto_y="-999"
			hitpoints="22"
			id="Saurian Augur-24"
			image="units/saurians/augur.png"
#textdomain wesnoth-units
			language_name=_ "Saurian Augur"
			level="1"
			max_attacks="1"
			max_experience="20"
			max_hitpoints="22"
			max_moves="7"
			movement="6"
			movement_type="lizard"
			moves="7"
			name="Lazzix"
			profile="portraits/saurians/augur.png"
			race="lizard"
			random_gender="no"
			random_traits="no"
			resting="yes"
			side="1"
			type="Saurian Augur"
			undead_variation="saurian"
			underlying_id="24"
			unrenamable="no"
			upkeep="full"
			usage="healer"
			zoc="yes"
			[attack_anim]
				start_time="-300"
				[filter_attack]
					name="curse"
				[/filter_attack]
				[if]
					hits="yes"
					[missile_frame]
						begin="-200"
						end="0"
						image="projectiles/whitemissile-n.png"
						image_diagonal="projectiles/whitemissile-ne.png"
						offset="0.0~0.8"
					[/missile_frame]
					[missile_frame]
						begin="0"
						end="50"
						halo="projectiles/whitemissile-impact-1.png"
						offset="0.8"
					[/missile_frame]
					[missile_frame]
						begin="50"
						end="100"
						halo="projectiles/whitemissile-impact-2.png"
						offset="0.92"
					[/missile_frame]
					[missile_frame]
						begin="100"
						end="150"
						halo="projectiles/whitemissile-impact-3.png"
						offset="0.94"
					[/missile_frame]
					[missile_frame]
						begin="150"
						end="200"
						halo="projectiles/whitemissile-impact-4.png"
						offset="0.96"
					[/missile_frame]
					[missile_frame]
						begin="200"
						end="250"
						halo="projectiles/whitemissile-impact-5.png"
						offset="0.98"
					[/missile_frame]
					[missile_frame]
						begin="250"
						end="300"
						halo="projectiles/whitemissile-impact-6.png"
						offset="1.0"
					[/missile_frame]
					[missile_frame]
						begin="300"
						end="350"
						halo="projectiles/whitemissile-impact-7.png"
						offset="1.02"
					[/missile_frame]
					[missile_frame]
						begin="350"
						end="400"
						halo="projectiles/whitemissile-impact-8.png"
						offset="1.04"
					[/missile_frame]
				[/if]
				[else]
					hits="no"
					[missile_frame]
						alpha=".8~0.0:200"
						begin="-200"
						end="0"
						image="projectiles/whitemissile-n.png"
						image_diagonal="projectiles/whitemissile-ne.png"
						offset="0.0~0.8"
					[/missile_frame]
				[/else]
				[frame]
					duration="50"
					halo="halo/saurian-magic-halo-1.png"
					image="units/saurians/augur-magic-1.png"
				[/frame]
				[frame]
					duration="60"
					halo="halo/saurian-magic-halo-2.png"
					image="units/saurians/augur-magic-1.png"
					sound="magicmissile.wav"
				[/frame]
				[frame]
					duration="70"
					halo="halo/saurian-magic-halo-3.png"
					image="units/saurians/augur-magic-2.png"
				[/frame]
				[frame]
					duration="80"
					halo="halo/saurian-magic-halo-4.png"
					image="units/saurians/augur-magic-2.png"
				[/frame]
				[frame]
					duration="90"
					halo="halo/saurian-magic-halo-5.png"
					image="units/saurians/augur-magic-1.png"
				[/frame]
				[frame]
					duration="100"
					halo="halo/saurian-magic-halo-6.png"
					image="units/saurians/augur-magic-1.png"
				[/frame]
				[frame]
					duration="100"
					halo="halo/saurian-magic-halo-7.png"
					image="units/saurians/augur.png"
				[/frame]
			[/attack_anim]
			[attack_anim]
				offset="0.0~0.3,0.3~0.45,0.45~0.3,0.3~0.0"
				start_time="-250"
				[filter_attack]
					name="staff"
				[/filter_attack]
				[frame]
					duration="150"
					image="units/saurians/augur-melee-1.png"
				[/frame]
				[if]
					hits="yes"
					[frame]
						duration="100"
						image="units/saurians/augur-melee-2.png"
						sound="staff.wav"
					[/frame]
				[/if]
				[else]
					hits="no"
					[frame]
						duration="100"
						image="units/saurians/augur-melee-2.png"
						sound="miss-1.ogg,miss-2.ogg,miss-3.ogg"
					[/frame]
				[/else]
				[frame]
					duration="100"
					image="units/saurians/augur-melee-3.png"
				[/frame]
				[frame]
					duration="90"
					image="units/saurians/augur-melee-4.png"
				[/frame]
				[frame]
					duration="80"
					image="units/saurians/augur-melee-5.png"
				[/frame]
				[frame]
					duration="50"
					image="units/saurians/augur-defend-1.png"
				[/frame]
			[/attack_anim]
			[defend]
				start_time="-126"
				[frame]
					duration="1"
					image="units/saurians/augur-defend-1.png"
				[/frame]
				[frame]
					duration="100"
					image="units/saurians/augur-defend-2.png"
				[/frame]
				[if]
					hits="hit"
					[frame]
						duration="150"
						image="units/saurians/augur-defend-2.png"
						sound="hiss-hit.wav"
					[/frame]
				[/if]
				[else]
					hits="miss,kill"
					[frame]
						duration="150"
						image="units/saurians/augur-defend-2.png"
					[/frame]
				[/else]
				[frame]
					duration="1"
					image="units/saurians/augur-defend-1.png"
				[/frame]
			[/defend]
			[healing_anim]
				start_time="-300"
				[frame]
					duration="50"
					halo="halo/saurian-magic-halo-1.png"
					image="units/saurians/augur-magic-1.png"
				[/frame]
				[frame]
					duration="60"
					halo="halo/saurian-magic-halo-2.png"
					image="units/saurians/augur-magic-1.png"
				[/frame]
				[frame]
					duration="70"
					halo="halo/saurian-magic-halo-3.png"
					image="units/saurians/augur-magic-2.png"
				[/frame]
				[frame]
					duration="80"
					halo="halo/saurian-magic-halo-4.png"
					image="units/saurians/augur-magic-2.png"
				[/frame]
				[frame]
					duration="90"
					halo="halo/saurian-magic-halo-5.png"
					image="units/saurians/augur-magic-1.png"
				[/frame]
				[frame]
					duration="100"
					halo="halo/saurian-magic-halo-6.png"
					image="units/saurians/augur-magic-1.png"
				[/frame]
				[frame]
					duration="100"
					halo="halo/saurian-magic-halo-7.png"
					image="units/saurians/augur.png"
				[/frame]
			[/healing_anim]
			[portrait]
				image="portraits/saurians/transparent/augur.png"
				mirror="false"
				side="left"
				size="400"
			[/portrait]
			[portrait]
				image="portraits/saurians/transparent/augur.png"
				mirror="true"
				side="right"
				size="400"
			[/portrait]
			[defense]
				castle="40"
				cave="40"
				deep_water="80"
				flat="60"
				forest="40"
				frozen="70"
				fungus="40"
				hills="40"
				impassable="40"
				mountains="40"
				reef="60"
				sand="40"
				shallow_water="60"
				swamp_water="40"
				unwalkable="80"
				village="50"
			[/defense]
			[movement_costs]
				castle="1"
				cave="1"
				deep_water="99"
				flat="1"
				forest="2"
				frozen="4"
				fungus="1"
				hills="1"
				impassable="99"
				mountains="2"
				reef="2"
				sand="1"
				shallow_water="3"
				swamp_water="1"
				unwalkable="99"
				village="1"
			[/movement_costs]
			[resistance]
				arcane="80"
				blade="110"
				cold="120"
				fire="120"
				impact="110"
				pierce="80"
			[/resistance]
			[abilities]
				[heals]
					affect_allies="yes"
					affect_self="no"
#textdomain wesnoth
					description=_ "Heals +4:
Allows the unit to heal adjacent allied units at the beginning of our turn.

A unit cared for by this healer may heal up to 4 HP per turn, or stop poison from taking effect for that turn.
A poisoned unit cannot be cured of its poison by a healer, and must seek the care of a village or a unit that can cure."
					female_name=_ "female^heals +4"
					id="healing"
					name=_ "heals +4"
					poison="slowed"
					value="4"
					[affect_adjacent]
						adjacent="n,ne,se,s,sw,nw"
					[/affect_adjacent]
				[/heals]
			[/abilities]
			[variables]
			[/variables]
			[status]
				hidden="yes"
			[/status]
			[attack]
				damage="5"
#textdomain wesnoth-units
				description=_ "staff"
				icon="attacks/staff-magic.png"
				name="staff"
				number="2"
				range="melee"
				type="impact"
			[/attack]
			[attack]
				damage="5"
				description=_ "curse"
				icon="attacks/curse.png"
				name="curse"
				number="3"
				range="ranged"
				type="cold"
				[specials]
					[chance_to_hit]
						cumulative="no"
#textdomain wesnoth
						description=_ "Magical:
This attack always has a 70% chance to hit regardless of the defensive ability of the unit being attacked."
						id="magical"
						name=_ "magical"
						value="70"
					[/chance_to_hit]
				[/specials]
			[/attack]
			[modifications]
				[trait]
					female_name=_ "female^strong"
					id="strong"
					male_name=_ "strong"
					name=_ "strong"
					[effect]
						apply_to="attack"
						increase_damage="1"
						range="melee"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="1"
					[/effect]
				[/trait]
				[trait]
					female_name=_ "female^quick"
					id="quick"
					male_name=_ "quick"
					name=_ "quick"
					[effect]
						apply_to="movement"
						increase="1"
					[/effect]
					[effect]
						apply_to="hitpoints"
						increase_total="-5%"
					[/effect]
				[/trait]
			[/modifications]
		[/unit]
	[/player]
[/snapshot]
[replay_start]
	current_tod="0"
#textdomain wesnoth-multiplayer
	description=_ "This vital supply route has played a key role in many of Wesnoth's greatest battles."
	experience_modifier="70"
	hash="ni><w8>Ksy9E6lpej<-R7zqNgF0HH1GU14mLcPs+Y0>x<lui3JMr96tqaCJ+gLs7vdDsR,OV+p41UARdwDMp8w8hABAeHRqXh0zHL5LEGp<BJU2ovj4yzohfX.yffdE0"
	id="multiplayer_Weldyn_Channel"
	map_data="border_size=1
usage=map

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

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

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

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

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

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

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

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

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

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

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

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

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

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

#returns average defense of the unit #

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

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

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

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


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


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

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

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

# ==2== based on village possession #

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

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

# multipled by 1000 to increase precision #

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

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

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

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

#==1==  basic evaluation #

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

#returns average defense of the unit #

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

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

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

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


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


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

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

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

# ==2== based on village possession #

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

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

# multipled by 1000 to increase precision #

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

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

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

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

#==1==  basic evaluation #

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

#returns average defense of the unit #

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

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

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

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


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


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

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

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

# ==2== based on village possession #

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

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

# multipled by 1000 to increase precision #

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

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

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

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

#==1==  basic evaluation #

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

#returns average defense of the unit #

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

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

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

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


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


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

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

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

# ==2== based on village possession #

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

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

# multipled by 1000 to increase precision #

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

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

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

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

#==1==  basic evaluation #

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

#returns average defense of the unit #

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

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

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

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


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


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

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

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

# ==2== based on village possession #

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

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

# multipled by 1000 to increase precision #

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

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

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

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

#==1==  basic evaluation #

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

#returns average defense of the unit #

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

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

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

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


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


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

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

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

# ==2== based on village possession #

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

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

# multipled by 1000 to increase precision #

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

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

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

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

#==1==  basic evaluation #

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

faiend
"
				[/team_formula]
			[/ai]
		[/multiplayer_side]
		[event]
			name="prestart"
			[store_unit]
				kill="yes"
				variable="leaders_to_make_quick"
				[filter]
					canrecruit="yes"
					[filter_wml]
						max_moves="4"
					[/filter_wml]
				[/filter]
			[/store_unit]
			[set_variable]
				name="i"
				value="0"
			[/set_variable]
			[while]
				[variable]
					less_than="$leaders_to_make_quick.length"
					name="i"
				[/variable]
				[do]
					[set_variables]
						mode="merge"
						name="leaders_to_make_quick[$i].modifications"
						[literal]
							[trait]
#textdomain wesnoth
								female_name=_ "female^quick"
								id="quick"
								male_name=_ "quick"
								[effect]
									apply_to="movement"
									increase="1"
								[/effect]
								[effect]
									apply_to="hitpoints"
									increase_total="-5%"
								[/effect]
							[/trait]
						[/literal]
					[/set_variables]
					[clear_variable]
						name="leaders_to_make_quick[$i].max_moves,leaders_to_make_quick[$i].moves,leaders_to_make_quick[$i].max_hitpoints,leaders_to_make_quick[$i].hitpoints"
					[/clear_variable]
					[unstore_unit]
						variable="leaders_to_make_quick[$i]"
					[/unstore_unit]
					[set_variable]
						add="1"
						name="i"
					[/set_variable]
				[/do]
			[/while]
			[clear_variable]
				name="i"
			[/clear_variable]
			[clear_variable]
				name="leaders_to_make_quick"
			[/clear_variable]
		[/event]
	[/era]
	[side]
		allow_changes="yes"
		allow_player="yes"
		canrecruit="yes"
		colour="1"
		controller="human"
		current_player="KnightKunibert"
		flag_rgb="magenta"
		fog="yes"
		gender="male"
		gold="100"
		id="KnightKunibert1"
		image="units/drakes/flare.png"
		income="0"
		leader="Drake Flare,Fire Drake,Drake Slasher,Drake Gladiator,Drake Warrior,Saurian Oracle,Saurian Soothsayer"
		mp_countdown="yes"
		mp_countdown_action_bonus="20"
		mp_countdown_init_time="270"
		mp_countdown_reservoir_time="270"
		mp_countdown_turn_bonus="200"
		name="KnightKunibert"
		random_leader="Drake Flare,Fire Drake,Drake Slasher,Drake Gladiator,Drake Warrior"
		recruit="Drake Burner,Drake Clasher,Drake Glider,Drake Fighter,Saurian Skirmisher,Saurian Augur"
		save_id="KnightKunibert1"
		share_maps="no"
		share_view="yes"
		shroud="no"
		side="1"
		team_name="north"
		terrain_liked="Hh, Ha, Ds, Ss"
		type="Fire Drake"
		user_team_name="wesnoth-multiplayerteamname^North"
		village_gold="2"
		[ai]
			recruitment_pattern="fighter,fighter,archer,healer,scout,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="Gauteamus"
		flag_rgb="magenta"
		fog="yes"
		gender="male"
		gold="100"
		id="Gauteamus2"
		image="units/drakes/flare.png"
		income="0"
		leader="Drake Flare,Fire Drake,Drake Slasher,Drake Gladiator,Drake Warrior,Saurian Oracle,Saurian Soothsayer"
		mp_countdown="yes"
		mp_countdown_action_bonus="20"
		mp_countdown_init_time="270"
		mp_countdown_reservoir_time="270"
		mp_countdown_turn_bonus="200"
		name="Gauteamus"
		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"
		save_id="Gauteamus2"
		share_maps="no"
		share_view="yes"
		shroud="no"
		side="2"
		team_name="south"
		terrain_liked="Hh, Ha, Ds, Ss"
		type="Fire Drake"
		user_team_name="wesnoth-multiplayerteamname^South"
		village_gold="2"
		[ai]
			recruitment_pattern="fighter,fighter,archer,healer,scout,scout"
			villages_per_scout="8"
			[team_formula]
				rulebase="fai 'recruitment.fai'
		# ===== Some general functions used later ==== #

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

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

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

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

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

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

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

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

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

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

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

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

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

#returns average defense of the unit #

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

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

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

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


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


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

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

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

# ==2== based on village possession #

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

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

# multipled by 1000 to increase precision #

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

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

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

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

#==1==  basic evaluation #

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

faiend
"
			[/team_formula]
		[/ai]
		[ai]
			villages_per_scout="8"
		[/ai]
	[/side]
[/replay_start]
[statistics]
	mid_scenario="yes"
	[scenario]
		scenario="2p - Weldyn Channel"
		[team]
			[recruits]
				Drake Clasher="1"
				Drake Fighter="1"
				Saurian Augur="6"
				Saurian Skirmisher="2"
			[/recruits]
			[recalls]
			[/recalls]
			[advances]
				Saurian Oracle="1"
			[/advances]
			[deaths]
				Drake Clasher="1"
				Drake Fighter="1"
				Fire Drake="1"
				Saurian Augur="5"
				Saurian Oracle="1"
				Saurian Skirmisher="1"
			[/deaths]
			[killed]
				Drake Clasher="1"
				Drake Fighter="1"
				Saurian Augur="3"
				Saurian Oracle="1"
			[/killed]
			[attacks]
				[sequence]
					s0000="1"
					s0010="1"
					_num="40"
				[/sequence]
				[sequence]
					s00="1"
					s1="1"
					s10="2"
					s10101="1"
					s1110="2"
					_num="60"
				[/sequence]
				[sequence]
					s001="1"
					s011="1"
					s1="2"
					s100="1"
					s101="3"
					s11="2"
					s110="1"
					s111="2"
					_num="70"
				[/sequence]
			[/attacks]
			[defends]
				[sequence]
					s="2"
					_num="0"
				[/sequence]
				[sequence]
					s00="1"
					s01000="1"
					s1="1"
					s11001="1"
					_num="40"
				[/sequence]
				[sequence]
					s11="1"
					_num="50"
				[/sequence]
				[sequence]
					s="2"
					s00100="1"
					s011="1"
					s0110="1"
					s1="1"
					s11="2"
					s110="1"
					_num="60"
				[/sequence]
				[sequence]
					s="2"
					s0="1"
					s011="1"
					s1="1"
					s11="2"
					s110="1"
					_num="70"
				[/sequence]
			[/defends]
			recruit_cost="162"
			recall_cost="0"
			damage_inflicted="369"
			damage_taken="384"
			expected_damage_inflicted="336620"
			expected_damage_taken="356924"
			turn_damage_inflicted="36"
			turn_damage_taken="33"
			turn_expected_damage_inflicted="30865"
			turn_expected_damage_taken="37778"
			save_id="Gauteamus2"
		[/team]
		[team]
			[recruits]
				Drake Clasher="2"
				Drake Fighter="3"
				Drake Glider="1"
				Saurian Augur="6"
			[/recruits]
			[recalls]
			[/recalls]
			[advances]
				Saurian Oracle="1"
				Sky Drake="1"
			[/advances]
			[deaths]
				Drake Clasher="1"
				Drake Fighter="1"
				Saurian Augur="3"
				Saurian Oracle="1"
			[/deaths]
			[killed]
				Drake Clasher="1"
				Drake Fighter="1"
				Fire Drake="1"
				Saurian Augur="5"
				Saurian Oracle="1"
				Saurian Skirmisher="1"
			[/killed]
			[attacks]
				[sequence]
					s001="1"
					s0011="1"
					s01="1"
					s1="3"
					s11="1"
					s11000="1"
					s1101="1"
					s111="1"
					_num="60"
				[/sequence]
				[sequence]
					s01="1"
					s011="2"
					s1="1"
					s100="1"
					s101="1"
					s11="1"
					s110="2"
					s111="5"
					_num="70"
				[/sequence]
			[/attacks]
			[defends]
				[sequence]
					s="6"
					_num="0"
				[/sequence]
				[sequence]
					s10="1"
					_num="40"
				[/sequence]
				[sequence]
					s="1"
					s01="1"
					s010="2"
					s10="1"
					_num="60"
				[/sequence]
				[sequence]
					s="2"
					s000="1"
					s01="1"
					s1="2"
					s101="1"
					s111="3"
					_num="70"
				[/sequence]
			[/defends]
			recruit_cost="201"
			recall_cost="0"
			damage_inflicted="384"
			damage_taken="369"
			expected_damage_inflicted="356924"
			expected_damage_taken="336620"
			turn_damage_inflicted="29"
			turn_damage_taken="26"
			turn_expected_damage_inflicted="33186"
			turn_expected_damage_taken="20665"
			save_id="KnightKunibert1"
		[/team]
	[/scenario]
[/statistics]
