// .txt

beginzonescript;

variables;

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

body;

beginstate INIT_STATE;
	last_abil = get_current_tick();

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

	set_aggression(8547,50);
	set_aggression(8548,50);
	set_aggression(8549,50);
	set_aggression(8550,50);

	add_range_to_group(8551,8554,37);
	set_aggression(30037,50);
	set_name(30037,"Goblin Assassin");
	set_level(30037,18);
	alter_stat(30037,19,8);
	alter_stat(30037,28,8);

	add_range_to_group(8555,8559,38);
	set_name(30038,"Nesting Hellhound");
	

	add_range_to_group(8560,8567,39);
	add_range_to_group(8568,8574,40);
	set_name(30039,"Goblin Swampwalker");
	set_level(30039,20);
	set_new_abil(30039,11);
	alter_stat(30039,20,8);
	alter_stat(30039,28,8);
	set_level(30040,20);
	set_new_abil(30040,11);
	alter_stat(30040,20,8);
	alter_stat(30040,28,8);
	set_aggression(30039,60);
	set_aggression(30040,60);

	set_name(8576,"Swampwalker Shaman");
	set_level(8576,20);
	
	set_name(8575,"Swampwalker Galk");
	set_level(8575,20);
	set_boss_level(8575,1);
	set_new_abil(8575,11);
	alter_stat(8575,28,8);

	add_range_to_group(8589,8594,41);
	set_aggression(30041,50);

	set_crime_tolerance(max_crime);

	sf(79,10,2);
	break;

beginstate EXIT_STATE;

break;

beginstate START_STATE;
		
	//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 ((gf(79,8) > 0) && (gf(79,8) < 100)) {
			inc_flag(79,8,1);
			if (gf(79,8) == 6) {
				print_str_color("You can hear more hissing and clicking. The swarm continues",3);
				print_str_color("  to pour into this tunnel.",3);
				activate_hidden_group(40);
				}
			}
			
		}
break;

beginstate 10;
	if (gf(79,6) == 0) {
		sf(79,6,1);
		if (has_spec_item(13) == 0)
			activate_hidden_group(37);
		begin_talk_mode(12);
		}
break;

beginstate 11;
	if (gf(79,7) == 0) {
		sf(79,7,1);
		if (has_spec_item(13) == 0)
			activate_hidden_group(38);
		begin_talk_mode(12);
		}
break;

beginstate 12;
break;

beginstate 13;
	if (gf(79,8) == 0) {
		sf(79,8,1);
		activate_hidden_group(39);
		begin_talk_mode(13);
		}
break;

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