#GENERAL
*name       = "soldier_02";
*faction = "npc";
*enemy_faction = "hair";

*rad        = 1.0;
*mass       = 2000.0;
*elasticity = 0.3;
*drag       = 0.5;
*friction   = 4.0;
*hardness   = 0.3;
*roll       = 1.0;

*model = "npc_soldier_01";
*model_scale = 1.0;
*bleed_rate = 3.0;
*leak_decal_vec = {"decals/big_blood_01.tga"};
*dam_part_vec = {"blood_01"};

#ATTRIBUTE "ccrange";
#BASE      1.5;
#ATTRIBUTE "ccspeed";
#BASE      2.0;
#ATTRIBUTE "ccdamage";
#BASE      0.5;
#ATTRIBUTE "attract";
#BASE      20.0;
#ATTRIBUTE "leak";
#BASE      0.0;
#ATTRIBUTE "speed";
#BASE      0.0;
#ATTRIBUTE "power";
#BASE      0.0;
#ATTRIBUTE "health";
#BASE      50.0;
#ATTRIBUTE "res";
#BASE      1.0;
#ATTRIBUTE "rot_speed";
#BASE      100.0;
#ATTRIBUTE "exp";
#BASE      0.0;

#CONTROL "script";
##BEGIN

#SEQUENCE "follow";
# move(1000, 1000, 0);
  wait(.1, 1);
# this_control_jump( 
  "range faction",
  "*faction       = \"hair\";
   *min_dist      = 0.0;
   *max_dist      = 20.0;
   *aggressive    = 1;
   *avoid_faction = \"good\";
   *avoid_dist = rand(1,2);

// The action is going to be kinda hairy, because we've got to insert numerical
// values into a string.
*action =
  \"
    var script = \\\" \\\";
    script =
      add(
        \\\"  *faction       = \\\\\\\"hair\\\\\\\";
            *move_x        = \\\", num_to_str( this_x(),  1 ),\\\"; 
			*move_y        = \\\", num_to_str( this_y(),  1 ),\\\"; 
		    *orig_x        = -1;
            *orig_y        = -1.1;
            *orig_z        = rand(.9,1.0);
            *speed         = 50;
            *shots         = 1;
            *rate          = rand(.3333,1.0);
            *error         = 1;
            *damage        = rand( 2, 3 );
			*particle      = \\\\\\\"beam_03\\\\\\\";
            *vec_sounds    = { \\\\\\\"monsters/turret_01.wav\\\\\\\", \\\\\\\"monsters/turret_02.wav\\\\\\\", \\\\\\\"monsters/turret_03.wav\\\\\\\"  };
            *line_of_sight = 3.0;
		\\\"
        );

    this_control_push(
      \\\"shoot\\\",
      script,
      1
      );

	*wait = rand( 0.1, 0.12 );
	\";", 1.0);
  wait( .15, 1 );
  move_to(char_get_x("player"), char_get_y("player"), 0);
# seq_jump("wait");

#SEQUENCE "wait";
# wait( 10000 );

##END