// .txt

beginzonescript;

variables;

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

body;

beginstate INIT_STATE;
	last_abil = get_current_tick();

//	set_name(,"");
//	add_range_to_group(,,groupn);

	add_range_to_group(16956,16961,37);
	set_name(16961,"Scuttler Packmaster");
	set_aggression(30037,40);
	
	add_range_to_group(16963,16970,38);

	add_range_to_group(16981,16986,39);
	add_range_to_group(16987,16992,40);
	
	add_range_to_group(16995,16997,41);
	set_name(30041,"Trained Worg");
	set_boss_level(30041,1);
	set_aggression(30041,40);
	
	add_range_to_group(16998,17005,42);
	set_level(30042,5);
	set_name(30042,"Poor Squatter");
	set_name(16998,"Dhera");
	set_boss_level(16998,1);
	
	set_crime_tolerance(max_crime);

	break;

beginstate EXIT_STATE;

break;

beginstate START_STATE;
	if (has_spec_item(23))
		sf(157,10,1);
		
	if ((get_crime_level() >= max_crime) && (im_hostile == 0)) {
		make_zone_hostile();
		im_hostile = 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();
		if ((defense > 0) && (defense < 3)) {
			defense = defense + 1;
			if (defense == 3)
				set_attitude(30038,10);
			}
		}
break;

beginstate 10;
	if ((defense == 0) && (has_spec_item(23) == 0) && (num_chars_in_group(38) > 0)) {
		defense = 1;
		begin_talk_mode(5);
		}
break;

beginstate 11;
	if ((defense2 == 0) && (gf(157,1) == 0) && (num_chars_in_group(42) > 0)) {
		defense2 = 1;
		print_str_color("The squatters panic and attack!",2);
		set_attitude(30042,10);
		}
break;

beginstate 12;
	if (gf(157,6) == 0) {
		sf(157,6,1);
		print_str_color("Suddenly, a pack of wolves runs around the corner and toward you!",2);
		activate_hidden_group(37);
		}
break;

beginstate 13;
	set_terrain_string_range("These skulls are old, dusty, and enormous. Perhaps a colony of giants once lived here.",1);
break;

beginstate 21;
	if (is_combat() == FALSE)
		print_str_color("You climb the stairs.",2);
	change_level(212,757,6);
	// direction - 0,1 - north 2,3 - west 4,5 - south 6,7 - east
break;

beginstate 22;
	if (is_combat() == FALSE)
		print_str_color("You climb the stairs.",2);
	change_level(210,757,2);
	// direction - 0,1 - north 2,3 - west 4,5 - south 6,7 - east
break;

beginstate 23;
	if (is_combat() == FALSE)
		print_str_color("You climb the stairs.",2);
	change_level(227,709,4);
	// direction - 0,1 - north 2,3 - west 4,5 - south 6,7 - east
break;

beginstate 24;
	if (is_combat() == FALSE)
		print_str_color("You climb the stairs.",2);
	change_level(223,708,2);
	// direction - 0,1 - north 2,3 - west 4,5 - south 6,7 - east
break;

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