#SEQUENCE "follow";
# this_control_jump( 
  "range faction",
  "*faction       = \"player\";
   *min_dist      = 15.0;
   *max_dist   = 30.0;
   *aggressive    = 0;
   *avoid_faction = \"good\";
   *avoid_dist = rand(1,2);
   *predict_dist = 32;
   *predict_weight = .9;

// 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       = \\\\\\\"evil\\\\\\\";
            *move_x        = \\\", num_to_str( this_x(),  1 ),\\\"; 
			*move_y        = \\\", num_to_str( this_y(),  1 ),\\\"; 
		    *orig_x        = .7;
            *orig_y        = .7;
            *orig_z        = rand(1.85, 2.15);
            *speed         = this_get_attribute(\\\\\\\"projspeed\\\\\\\");
            *shots         = 1;
            *rate          = 1;
            *error         = 2;
            *damage        = mult(this_get_attribute(\\\\\\\"projdamage\\\\\\\"), avar(\\\\\\\"projdamage_level\\\\\\\"));
            *particle      = \\\\\\\"wood_dust_02\\\\\\\";
            *vec_sounds    = { \\\\\\\"monsters/tree_shot_01.wav\\\\\\\", \\\\\\\"monsters/tree_shot_02.wav\\\\\\\" };
            *line_of_sight = 3.0;
		\\\"
        );

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

	*wait = rand(sub(this_get_attribute(\\\"projwait\\\"), .5) , add(this_get_attribute(\\\"projwait\\\"), .5));
\";", 1.0);
# seq_jump("wait");

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