// .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(,"");

	add_range_to_group(5076,5083,13);
	set_name(30013,"Muck Wight");
	set_level(30013,25);
	set_coloradj(30013,512);

	add_range_to_group(5090,5095,14);
	set_name(5095,"Drethnar");
	set_boss_level(5095,1);
	set_name(5092,"Giant Bruiser");
	set_aggression(30014,40);

	add_range_to_group(5096,5103,15);
	set_name(30015,"Drayssa Defender");
	set_level(30015,35);
	set_resistance(30015,7,75);
	set_boss_level(30015,1);
	set_attack_bonus(30015,50);
	set_name(5096,"Tarmik-Drayssa");
	set_boss_level(5096,1);

	add_range_to_group(5104,5107,16);
	
	set_crime_tolerance(max_crime);

	sf(47,2,0);
		sf(47,5,0);

	if (gf(62,1) == 0) {
		set_terrain(0,367,241,1);
		set_terrain(0,367,242,1);
		set_terrain(0,367,243,3);
		}
	break;

beginstate EXIT_STATE;

break;

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

	if (gf(46,5) == 0) {
		if ((get_ran(1,0,100) < 10) && (gf(47,6) == 0))
			give_char_text_bubble(5096,"You may not pass.");
		if ((get_ran(1,0,100) < 10) && (gf(47,6) == 0))
			give_char_text_bubble(5096,"The gate is sealed.");
		if ((get_ran(1,0,100) < 10) && (gf(47,6) == 0))
			give_char_text_bubble(5096,"We don't want to kill you.");
		if ((get_ran(1,0,100) < 10) && (gf(47,6) > 0))
			give_char_text_bubble(5096,"You may pass.");
		if ((get_ran(1,0,100) < 10) && (gf(47,6) > 0))
			give_char_text_bubble(5096,"All hail Melanchion.");
		if ((get_ran(1,0,100) < 10) && (gf(47,6) > 0))
			give_char_text_bubble(5096,"We are not worthy.");
		}
		
	//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;
	if ((gf(47,6) == 0) && (gf(47,5) == 0) && (gf(46,5) == 0) && (num_chars_in_group(15) > 0)) {
		sf(47,5,1);
		force_char_status(30015,24,10);
		set_attitude(30015,10);
		begin_talk_mode(9);
		}
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);
