// .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(15444,15448,19);
	set_level(30019,7);
	set_aggression(30019,70);
	set_name(15448,"Shaman Torkh");

	set_name(15449,"Cavarin");
	
	set_level(15463,12);
	set_new_abil(15463,12);

	set_aggression(15467,70);
	set_aggression(15468,70);
	set_aggression(15469,70);
	set_aggression(15470,70);
	add_range_to_group(15467,15470,21);
	set_name(15467,"Rodent Hivetender");
	set_name(15468,"Rodent Hivetender");
	set_name(15469,"Rodent Hivetender");

	
	set_crime_tolerance(max_crime);

				sf(143,6,0);
				sf(143,7,0);
	if (gf(143,8) == 0) {
		spawn_creature(15477);
		spawn_creature(15478);
		spawn_creature(15479);
		spawn_creature(15480);
		spawn_creature(15481);
		spawn_creature(15482);
		spawn_creature(15483);
		spawn_creature(15484);
		}
	add_range_to_group(15477,15484,22);

	add_range_to_group(15485,15490,23);
	set_name(15490,"Scuttler Packmaster");
	set_aggression(30023,40);
	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(15449,"A visitor!");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(15449,"So nice!");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(15449,"A soldier!");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(15449,"I sell leather goods.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(15449,"I do custom work!");
	//	}

	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(143,6) > 0) {
			if (party_within_dist(209,658,10) == FALSE) {
				sf(143,6,0);
				set_attitude(30022,4);
				begin_talk_mode(7);
				}
				else {
					inc_flag(143,7,1);
					if ((num_chars_in_group(22) == 0) || (gf(143,7) >= 10)) {
						sf(143,6,0);
						set_attitude(30022,4);
						if (gf(143,1) == 0)
							sf(143,1,1);
							else sf(143,2,1);
						sf(143,7,0);
						begin_talk_mode(6);
						}
					}
			}
		}
break;

beginstate 10;
	set_terrain_string_range("Someone has been tanning hides here recently.",1);
break;

beginstate 11;
break;

beginstate 12;
break;

beginstate 13;
break;

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