// .txt

beginzonescript;

variables;

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

body;

beginstate INIT_STATE;
	last_abil = get_current_tick();

//	set_name(,"");

	add_range_to_group(11448,11452,31);
	set_name(11449,"Oculus Cultist");
	set_name(11450,"Oculus Cultist");
	set_name(11451,"Oculus Cultist");
	set_name(11452,"Oculus Cultist");

	add_range_to_group(11453,11457,32);
	set_name(30032,"Oculus Cultist");
	set_name(11456,"Oculus Chanter");
	set_name(11457,"Oculus Chanter");

	set_name(11458,"Oculus Chanter");
	set_name(11459,"Oculus Chanter");
	set_name(11460,"Oculus Chanter");
	set_name(11461,"Oculus Chanter");

	set_crime_tolerance(max_crime);

	sf(106,0,0);
	break;

beginstate EXIT_STATE;

break;

beginstate START_STATE;
	if ((on_which_layer() == 1) && (gf(106,0) == 0) && (gf(106,1) == 0) && (gf(94,8) > 0))
		sf(106,0,1);

	if ((on_which_layer() == 0) && (gf(106,0) == 1)) {
		sf(106,0,2);
		
		if (gf(106,8) == 0) {
		
			activate_hidden_group(33);
			add_range_to_group(11477,11484,33);
			set_aggression(30033,50);
			set_level(30033,18);
			set_name(30033,"Oculus Cultist");
			set_name(11477,"Frenzied Cultist");
			set_name(11478,"Frenzied Cultist");
			set_name(11479,"Frenzied Cultist");
			set_name(11480,"Frenzied Cultist");
			set_resistance(30033,7,50);
			
			spawn_creature(11485);
			set_level(11485,24);
			set_name(11485,"Kivara Farsight");
			set_boss_level(11485,2);
			
			}
			
		spawn_creature(11486);
		}
	
	if ((on_which_layer() == 1) && (char_ok(11486)) && (gf(106,1) > 0))
		erase_char(11486);
		
		
	//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(,"");
	//	}

	//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(106,11) == 0) {
		activate_hidden_group(31);
		sf(106,11,1);
		set_name(11471,"Oculus Cultist");
		set_name(11472,"Oculus Cultist");
		set_name(11473,"Oculus Cultist");
		set_name(11474,"Oculus Cultist");
		}
break;

beginstate 11;
	if ((gf(106,7) == 0) && (gf(94,8) > 0) && (char_ok(11476) == FALSE)) 
		spawn_creature(11476);
break;

beginstate 12;

break;

beginstate 13;
break;

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