"SPECIAL_GEN_FOLLOW_UNIT"
{
	INT my_unit_recno 
	my_unit_recno = FUNC("get_character_recno") 

	INT random_number 
	INT enemy_recno
//	INT near_enemy_recno 
	INT enemy_item_recno
	INT target_recno

	INT follow_unit_recno 
	follow_unit_recno = FUNC("get_curr_task_para" , my_unit_recno, 1) 

	INT follow_direction
	follow_direction = FUNC("get_curr_task_para" , my_unit_recno, 2) 

	if( follow_direction == 0 )
	{
		follow_direction = 180 
	}

	INT unit_dist
	unit_dist = FUNC("get_unit_dist" , my_unit_recno, follow_unit_recno) 
	target_recno = FUNC("search_for_unit", my_unit_recno, "T", 0, 0, 0, 0)

	if( unit_dist > 400 ) // if the follow unit is not here even in 400 radius!!!
	{
		// go back to follow formation and don't do anything
		ACTION("give_order" , my_unit_recno, "FOLLOW_UNIT" , 5 , 0 , follow_unit_recno , follow_direction , 200 , 0, 5000)
		FUNC("set_unit_target_unit_recno", my_unit_recno, 0)
		exit
	}

	if( target_recno == 0 )	
	{
		ACTION("give_order" , my_unit_recno, "FOLLOW_UNIT" , -1 , 0 , follow_unit_recno , follow_direction , 200 , 0, 5000)
	}
}
   


