<?xml version="1.0" standalone="no"?>

<unit>
	<parameters>
		<size value="1"/>
		<height value="2"/>
		<max-hp value="700" regeneration="0"/>
		<max-ep value="0"/>
		<armor value="30"/>	
		<armor-type value="leather"/>				
		<sight value="10"/>
		<time value="50"/>	
		<multi-selection value="true"/>	
		<cellmap value="false"/>
		<levels>
			<level name="veteran" kills="3"/>
			<level name="elite" kills="7"/>
			<level name="master" kills="15"/>
			<level name="grandmaster" kills="35"/>
			<level name="legendary" kills="70"/>
		</levels>
		<fields>
			<field value="land"/>
		</fields>	
		<properties/>
		<light enabled="false"/>
		<unit-requirements>
			<unit name="barracks"/>
		</unit-requirements>
		<upgrade-requirements/>
		<resource-requirements>
			<resource name="wood" amount="50"/>
			<resource name="gold" amount="90"/>
			<resource name="food" amount="1"/>						
		</resource-requirements>
		<resources-stored/>
		<image path="images/spearman.png"/>
		<image-cancel path="../archer/images/order_cancel.png"/>
		<meeting-point value="false"/>
		<selection-sounds enabled="true">
			<sound path="$COMMONDATAPATH/sounds/swordman_select1.wav"/>
			<sound path="$COMMONDATAPATH/sounds/swordman_select2.wav"/>
			<sound path="$COMMONDATAPATH/sounds/swordman_select3.wav"/>
			<sound path="$COMMONDATAPATH/sounds/swordman_select4.wav"/>
			<sound path="$COMMONDATAPATH/sounds/swordman_select5.wav"/>
			<sound path="$COMMONDATAPATH/sounds/swordman_select6.wav"/>
			<sound path="$COMMONDATAPATH/sounds/swordman_select7.wav"/>
		</selection-sounds>
		<command-sounds enabled="true">
			<sound path="$COMMONDATAPATH/sounds/swordman_ack1.wav"/>
			<sound path="$COMMONDATAPATH/sounds/swordman_ack2.wav"/>
			<sound path="$COMMONDATAPATH/sounds/swordman_ack3.wav"/>
			<sound path="$COMMONDATAPATH/sounds/swordman_ack4.wav"/>
			<sound path="$COMMONDATAPATH/sounds/swordman_ack5.wav"/>
			<sound path="$COMMONDATAPATH/sounds/swordman_ack6.wav"/>
		</command-sounds>
	</parameters>

	<skills>
	
		<skill>
			<type value="stop"/>
			<name value="stop_skill"/>		
			<ep-cost value="0"/>
			<speed value="1000"/>
			<anim-speed value="60"/>
			<animation path="models/spearman_standing.g3d"/>
			<sound enabled="false"/>
		</skill>

		<skill>
			<type value="stop"/>
			<name value="hold_stop_skill"/>		
			<ep-cost value="0"/>
			<speed value="1000"/>
			<anim-speed value="10"/>
			<animation path="models/spearman_holding.g3d"/>
			<sound enabled="false"/>
		</skill>
		
		<skill>
			<type value="stop"/>
			<name value="shield_wall_skill"/>		
			<ep-cost value="0"/>
			<speed value="1000"/>
			<anim-speed value="12"/>
			<animation path="models/spearman_holding.g3d"/>
			<sound enabled="false"/>
			<attack-boost>
				<allow-multiple-boosts value="false"/>
				<radius value="0"/>
				<target value="faction" include-self="true">				
					<unit-type name="spearman"/>
					<!--unit-type name="swordsman"/-->					
				</target>
				<max-hp value="0" />
				<max-ep value="0"/>
				<sight value="0"/>
				<attack-strenght value="0"/>
				<attack-range value="0"/>
				<armor value="50"/>
				<move-speed value="0" />
				<production-speed value="0"/>
				<particles value="false"/>
			</attack-boost>	
		</skill>		
		
		<skill>
			<type value="move"/>
			<name value="move_skill"/>		
			<ep-cost value="0"/>
			<speed value="220"/>
			<anim-speed value="120"/>
			<animation path="models/spearman_walking.g3d"/>
			<sound enabled="false"/>
		</skill>

		<skill>
			<type value="move"/>
			<name value="charge_skill"/>		
			<ep-cost value="0"/>
			<speed value="220"/>
			<anim-speed value="125"/>
			<animation path="models/spearman_charging.g3d"/>
			<sound enabled="false"/>
		</skill>		

		<skill>
			<type value="attack"/>
			<name value="attack_skill"/>		
			<ep-cost value="0"/>
			<speed value="90"/>
			<anim-speed value="90"/>
			<animation path="models/spearman_attacking.g3d"/>
			<sound enabled="true" start-time="0.47">
				<sound-file path="$COMMONDATAPATH/sounds/swordman_attack1.wav"/>
				<sound-file path="$COMMONDATAPATH/sounds/swordman_attack2.wav"/>
				<sound-file path="$COMMONDATAPATH/sounds/swordman_attack3.wav"/>
				<sound-file path="$COMMONDATAPATH/sounds/swordman_attack4.wav"/>
				<sound-file path="$COMMONDATAPATH/sounds/swordman_attack5.wav"/>
				<sound-file path="$COMMONDATAPATH/sounds/swordman_attack6.wav"/>
				<sound-file path="$COMMONDATAPATH/sounds/swordman_attack7.wav"/>
				<sound-file path="$COMMONDATAPATH/sounds/swordman_attack8.wav"/>
				<sound-file path="$COMMONDATAPATH/sounds/swordman_attack9.wav"/>
				<sound-file path="$COMMONDATAPATH/sounds/swordman_attack10.wav"/>
				<sound-file path="$COMMONDATAPATH/sounds/swordman_attack11.wav"/>
				<sound-file path="$COMMONDATAPATH/sounds/swordman_attack12.wav"/>
			</sound> 
			<attack-strenght value="60"/>
			<attack-var value="20"/>
			<attack-range value="2"/>
			<attack-type value="piercing"/>
			<attack-fields>
				<field value="land"/>
			</attack-fields>
			<attack-start-time value="0"/>
			<projectile value="false"/>
			<splash value="false"/>
		</skill>

		<skill>
			<type value="die"/>
			<name value="die_skill"/>		
			<ep-cost value="0"/>
			<speed value="60"/>
			<anim-speed value="90"/>
			<animation path="models/spearman_dying.g3d"/>
			<sound enabled="true" start-time="0">
				<sound-file path="$COMMONDATAPATH/sounds/swordman_die1.wav"/>
				<sound-file path="$COMMONDATAPATH/sounds/swordman_die2.wav"/>
			</sound>			
			<fade value="false"/>
		</skill>


	</skills>
	
	<commands>
		
		<command>
			<type value="stop"/>
			<name value="stop"/>
			<image path="../archer/images/order_halt.png"/>
			<unit-requirements/>
			<upgrade-requirements/>
			<stop-skill value="stop_skill"/>
		</command>

		<command>
			<type value="move"/>
			<name value="move"/>
			<image path="../archer/images/order_move.png"/>
			<unit-requirements/>
			<upgrade-requirements/>
			<move-skill value="move_skill"/>
		</command>

		<command>
			<type value="attack"/>
			<name value="attack"/>
			<image path="images/spearman_attack.png"/>
			<unit-requirements/>
			<upgrade-requirements/>
			<move-skill value="charge_skill"/>
			<attack-skill value="attack_skill"/>
		</command>
		
		<command>
			<type value="attack_stopped"/>
			<name value="hold_position"/>
			<image path="images/round_shield.png"/>
			<unit-requirements/>
			<upgrade-requirements>
				<upgrade name="training_field"/>
			</upgrade-requirements>
			<stop-skill value="stop_skill"/>
			<attack-skill value="attack_skill"/>
		</command>
		
		<command>
			<type value="attack_stopped"/>
			<name value="shield_wall_formation"/>
			<image path="images/shield_wall.png"/>
			<unit-requirements>
				<unit name="lord"/>
			</unit-requirements>			
			<upgrade-requirements>
				<upgrade name="training_field"/>
				<!--upgrade name="advanced_tactics"/-->				
			</upgrade-requirements>
			<stop-skill value="shield_wall_skill"/>
			<attack-skill value="attack_skill"/>
		</command>		

	</commands>
</unit>