// .txt

beginzonescript;

variables;

short im_hostile = 0;
short max_crime = 5;
short last_abil;
short counter = 0;

body;

beginstate INIT_STATE;
	last_abil = get_current_tick();

//	set_name(,"");

	add_range_to_group(8424,8428,49);

	set_name(8429,"Horde Spy");
	set_name(8430,"Horde Spy");
	set_name(8431,"Horde Spy");
	set_level(8429,22);
	set_level(8430,22);
	set_level(8431,22);
	set_aggression(8429,60);
	set_aggression(8430,60);
	set_aggression(8431,60);

	add_range_to_group(8443,8448,50);
	set_aggression(30050,60);

	set_aggression(8449,40);
	set_aggression(8450,40);
	set_aggression(8451,40);
	set_aggression(8452,40);
	set_aggression(8453,40);
	
	set_crime_tolerance(max_crime);

	break;

beginstate EXIT_STATE;

break;

beginstate START_STATE;
	if (gf(77,4) == 3) {
		sf(77,4,4);
		sf(78,5,1);
		activate_hidden_group(49);
		begin_talk_mode(200);
		}
		
	if ((get_crime_level() >= max_crime) && (im_hostile == 0)) {
		//print_str_color("DEBUG ALERT: EAST OF FORT DRANLON NOW HOSTILE. TAKE SCREENSHOT",3);
		//print_str_color("  AND OR SAVE GAME AND REPORT IT.",3); 

		make_zone_hostile();
		im_hostile = 1;
		sf(77,9,1);
		}

	// if (gf(,) == 0) {
	//if (get_ran(1,0,100) < 10)
	//	give_char_text_bubble(,"");
	//	}

	//if (((is_combat()) && (tick_difference(last_abil,get_current_tick()) > 0)) || ((is_group()) && (tick_difference(last_abil,get_current_tick()) > 5))) {
	//	last_abil = get_current_tick();
	//	}
break;

beginstate 10;
	set_terrain_string_range("This is a vantage point where soldiers can watch for attackers. They could also light signal fires to guide caravans. There's nobody here right now.",1);
break;

beginstate 11;
break;

beginstate 12;
break;

beginstate 13;
break;

beginstate 14;
	if (gf(78,4) == 0) {
		sf(78,4,1);
		if (has_spec_item(13) == 0)
			activate_hidden_group(50);
		begin_talk_mode(6);
		}
break;

//	print_str("");
//	set_terrain_string_range(".",1);
//	set_terrain_string_range("The sign says - .",1);
