// .txt

beginzonescript;

variables;

short im_hostile = 0;
short max_crime = 3;
short last_abil;
short counter = 0;
short r1;

body;

beginstate INIT_STATE;
	last_abil = get_current_tick();

	set_name(6402,"Goro-Drayssa");
	set_level(6402,32);
	set_boss_level(6402,2);
	set_attack_bonus(6402,40);
	set_name(6403,"Breck-Drayssa");
	set_level(6403,32);
	set_boss_level(6403,2);
	set_attack_bonus(6403,40);
	if (gf(170,11) > 0)
		erase_char(6403);
	set_name(6404,"Glenny-Drayssa");
	set_name(6405,"Poila-Tel-Drayssa");
	set_name(6406,"Vassch-Drayssa");
	set_level(6406,32);
	set_boss_level(6406,2);
	set_attack_bonus(6406,40);
	
	r1 = get_ran(1,0,3);
	spawn_creature(6407 + r1);
	set_name(6407 + r1,"Message Shade");
	set_level(6407 + r1,1);
	
	set_name(6411,"Kitchen Drayssa");
	set_name(6412,"Kitchen Drayssa");
	set_name(6413,"Dragon Worshipper");
	set_name(6414,"Dragon Worshipper");
	set_name(6415,"Dragon Worshipper");
	set_name(6416,"Dragon Worshipper");
	set_name(6417,"Dragon Worshipper");
	set_name(6418,"Dragon Worshipper");
	set_name(6419,"Dragon Worshipper");
	set_name(6420,"Dragon Worshipper");
	set_name(6421,"Dragon Worshipper");
	set_name(6422,"Dragon Worshipper");
	set_name(6423,"Dragon Worshipper");
	set_name(6424,"Dragon Worshipper");
	set_name(6425,"Dragon Worshipper");
	set_name(6426,"Dragon Worshipper");
	set_name(6427,"Dragon Worshipper");

	add_range_to_group(6428,6435,20);
	set_name(30200,"Chanting Drayssa");
	set_level(30200,30);
	
	add_range_to_group(6389,6396,19);
	set_name(30019,"Draconic Sentinel");
	set_level(30019,35);
	set_boss_level(30019,2);
	set_attack_bonus(30019,25);
	set_new_abil(30019,20);
	
	set_aggression(6379,60);
	set_aggression(6380,60);
	
	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;
		sf(59,7,1);
		}
	if ((gf(59,7) > 0) && (gf(170,1) < 30)) {
		begin_talk_mode(299);
		}

	if (gf(59,7) == 0) {
		if ((get_ran(1,0,100) < 10) && (gf(63,23) < 2))
			give_char_text_bubble(6397,"So you have come.");
		if ((get_ran(1,0,100) < 10) && (gf(63,23) < 2))
			give_char_text_bubble(6397,"I can help Avernum.");
		if ((get_ran(1,0,100) < 10) && (gf(63,23) < 2))
			give_char_text_bubble(6397,"I bring peace.");
		if ((get_ran(1,0,100) < 10) && (gf(63,23) < 2))
			give_char_text_bubble(6397,"I offer a trade.");
		if ((get_ran(1,0,100) < 10) && (gf(63,23) >= 2))
			give_char_text_bubble(6397,"It is done.");
		if ((get_ran(1,0,100) < 10) && (gf(63,23) >= 2))
			give_char_text_bubble(6397,"Return to the Castle.");
		if ((get_ran(1,0,100) < 10) && (gf(63,23) >= 2))
			give_char_text_bubble(6397,"Talk to your king.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(6402,"Ghhhurrrr.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(6402,"Rrrruhh.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(6402,"Treasures!");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(6402,"Treasure for the master!");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(6403,"I will guide you.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(6403,"Rest. For a time.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(6403,"Here is for Drayssas.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(6404,"Wait your turn!");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(6404,"Watch the soup!");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(6404,"Melanchion wants his roast!");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(6404,"Pay attention!");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(6406,"The visitor!");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(6406,"So much to do.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(6406,"Must tend to my mushrooms.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(6406,"Potions for the mighty dragon.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(6428 + get_ran(1,0,7),"Ahmmmm.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(6428 + get_ran(1,0,7),"Ohmmmmm.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(6428 + get_ran(1,0,7),"Oh, great dragon!");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(6428 + get_ran(1,0,7),"Mighty Melanchion!");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(6428 + get_ran(1,0,7),"We serve 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;
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(196,309,4);
	// 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(196,307,0);
	// direction - 0,1 - north 2,3 - west 4,5 - south 6,7 - east
break;

beginstate 22;
		if ((revive_party()) && (gf(59,7) == 0) && (char_ok(6397)) && (get_attitude(6397) < 10)) {
			print_str_color("Entering or leaving Melanchion's Keep heals your wounds",2);
			print_str_color("  and restores your spell energy.",2);
			}
break;

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