// .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(17951,"Smithy Sentinel");
	set_level(17951,30);
	set_boss_level(17951,2);
	set_attack_bonus(17951,12);
	set_name(17952,"Smithy Sentinel");
	set_level(17952,30);
	set_boss_level(17952,2);
	set_attack_bonus(17952,12);
	set_name(17953,"Smithy Sentinel");
	set_level(17953,30);
	set_boss_level(17953,2);
	set_attack_bonus(17953,12);
	set_name(17954,"Smithy Sentinel");
	set_level(17954,30);
	set_boss_level(17954,2);
	set_attack_bonus(17954,12);
	
	set_name(17955,"Komlos");


	add_range_to_group(17933,17937,37);
	add_range_to_group(17938,17942,38);
	add_range_to_group(17943,17947,39);
	set_aggression(30039,50);
	add_range_to_group(17948,17950,40);

	set_crime_tolerance(max_crime);

	sf(166,2,0);
	
	sf(166,13,0);
	sf(166,14,0);
	if (gf(166,3) == 0) {
		activate_hidden_group(37);
		add_range_to_group(17957,17962,41);
		set_name(30041,"Slimy Horrorspawn");
		set_level(30041,26);
		set_attack_bonus(30041,20);
		}
	break;

beginstate EXIT_STATE;

break;

beginstate START_STATE;
		
	if ((get_crime_level() >= max_crime) && (im_hostile == 0)) {
		sf(152,15,1);
		make_zone_hostile();
		im_hostile = 1;
		}

	 if (gf(152,15) == 0) {
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(17955,"My work is the finest.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(17955,"You are there.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(17955,"No ogre stench.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(17955,"I sense you.");
		}

	//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;
	sf(166,2,1);
break;

beginstate 11;
break;

beginstate 12;
break;

beginstate 13;
break;

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

beginstate 21;
	if (is_combat() == FALSE)
		print_str_color("You climb the stairs.",2);
	change_level(777,763,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);
