// .txt

beginzonescript;

variables;

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

body;

beginstate INIT_STATE;
	last_abil = get_current_tick();

	set_name(10368,"Belgan");
	set_name(10369,"Goodwife Kreger");
	set_name(10370,"Epridge");
	if (gf(96,6) > 0) {
		erase_char(10370);
		erase_char(10403);
		set_terrain(0,786,430,0);
		}
		
	set_name(10400,"Ogre Mage Tragym");
	set_boss_level(10400,1);
	
	add_range_to_group(10371,10375,1);
	add_range_to_group(10376,10379,2);
	set_name(30002,"Frenzied Rat");
	set_level(30002,20);
	add_range_to_group(10380,10383,3);
	set_name(30003,"Frenzied Rat");
	set_level(30003,20);

	add_range_to_group(10385,10391,4);
	set_aggression(30004,50);
	
	set_crime_tolerance(max_crime);

	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(10368,"Hmmph.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(10368,"What was that?");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(10368,"Need two cords.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(10369,"Soldiers are always welcome.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(10369,"Have some tea.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(10369,"Do you need wood?");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(10369,"Do you have an order?");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(10370,"No hope.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(10370,"Best get moving.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(10370,"Miss my family.");

//	}

	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();
		
		counter = counter + 1;
		if (counter == 12) {
			counter = 0;
			if (gf(96,9) == 0)
				sf(96,9,1);
				else sf(96,9,0);
			}
		}
break;

beginstate 10;
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);
