// .txt

beginzonescript;

variables;

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

body;

beginstate INIT_STATE;
	last_abil = get_current_tick();

	set_name(9183,"Galvas");
	set_name(9184,"Abyss Warrior");
	set_name(9185,"Abyss Warrior");
	set_name(9186,"Abyss Warrior");
	set_name(9187,"Hrramen-Drayssa");


	add_range_to_group(9183,9186,7);
	add_range_to_group(9187,9189,8);
	set_boss_level(30008,2);

	add_range_to_group(9190,9195,9);
	set_name(30009,"Sentry Lizard");
	set_level(30009,16);
	alter_stat(30009,19,8);
	alter_stat(30009,26,8);
	set_aggression(30009,60);
	
	add_range_to_group(9196,9201,10);
	set_name(30010,"Sentry Lizard");
	set_level(30010,16);
	alter_stat(30010,19,8);
	alter_stat(30010,26,8);
	set_aggression(30010,60);

	add_range_to_group(9206,9211,11);
	set_name(30011,"Icebat");
	set_coloradj(30011,1);
	set_level(30011,14);
	set_new_abil(30011,14);
	set_aggression(30011,60);
	
	set_crime_tolerance(max_crime);


	break;

beginstate EXIT_STATE;

break;

beginstate START_STATE;
	if ((char_ok(9187)) && (get_attitude(9187) >= 10)) {
		if ((char_ok(9188)) && (get_attitude(9188) < 10)) 
			set_attitude(9188,10);
		if ((char_ok(9189)) && (get_attitude(9189) < 10)) 
			set_attitude(9189,10);
		}
	
	if ((set_att == 0) && (char_ok(9187)) && (get_attitude(9187) < 10) && (gf(85,10) > 0)) {
		set_attitude(30009,4);
		set_attitude(30010,4);
		}
		
	//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(9183,"This fort is ours!");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(9183,"You can't have it!");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(9183,"Back off!");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(9183,"Too many pests here.");
	if (gf(170,1) == 16) {
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(9187,"Message must be found.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(9187,"Melanchion is mighty.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(9187,"The dragon has much to offer.");
		}
//	}

	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 == 5) {
			counter = 0;
			if (gf(85,8) == 0)
				sf(85,8,1);
				else sf(85,8,0);
			}
		}
break;

beginstate 10;
	set_terrain_string_range("The sign says - RECORDS HALL.",1);
break;

beginstate 11;
	set_terrain_string_range("The sign says - HOLDING CELLS.",1);
break;

beginstate 12;
	set_terrain_string_range("The sign says - Supply Room. No Abyss residents to enter here without accompanying guard.",1);
break;

beginstate 14;
	set_terrain_string_range("The sign says - To barracks, library, alchemy.",1);
break;

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