#include <define.h>

//#define NAME                    SCRIPT_

#include <command.h>
//#include <ModReact.h>



procedure start;
#include <push.h>
procedure pre_dialogue;
procedure do_dialogue;
procedure weapon_check;
procedure Jennifer00;
procedure Jennifer01;
procedure Jennifer01a;
procedure Jennifer01b;
procedure Jennifer02;
procedure Jennifer05;
procedure Jennifer07;
procedure Jennifer08;
procedure Jennifer11;
procedure Jennifer13;
procedure Jennifer14;
procedure Jennifer15;
procedure Jennifer16;
procedure Jennifer17;
procedure Jennifer18;
procedure Jennifer19;
procedure Jennifer20;
procedure Jennifer21;
procedure Jennifer22;
procedure Jennifer23;
procedure Jennifer25;
procedure Jennifer26;
procedure Jennifer27;
procedure Jennifer28;
procedure Jennifer29;
procedure Jennifer30;
procedure Jennifer31;
procedure JenniferCharm;
procedure JenniferEnd;
procedure JenniferRandom1;
procedure JenniferRandom2;
procedure JenniferRandom3;
procedure JenniferBackground1;
procedure combat;
procedure critter_p_proc;
procedure pickup_p_proc;
procedure talk_p_proc;
procedure destroy_p_proc;
procedure look_at_p_proc;

variable known;
variable armed;
variable warned;
variable first_time := 1;
variable last_seen;
variable flag1;
variable flag2;
variable line2flag;
variable line5flag;
variable line14flag;
variable hostile1;
variable only_once := 1;

procedure Get_Reaction;
procedure React_To_Level;
procedure Level_To_React;
procedure Up_React;
procedure Down_React;
procedure Bottom_React;
procedure Top_React;
procedure Big_Up_React;
procedure Big_Down_React;
procedure Up_React_Level;
procedure Down_React_Level;
procedure Goodbyes;

variable exit_line;


procedure start
begin
	if (only_once) then begin
		only_once := 0;
		critter_add_trait(self_obj, TRAIT_OBJECT, OBJECT_TEAM_NUM, 44);
		critter_add_trait(self_obj, TRAIT_OBJECT, OBJECT_AI_PACKET, AI_BROTHERHOOD_PALADIN);
	end
	if (script_action == look_at_proc) then begin
		call look_at_p_proc;
	end
	else begin
		if (script_action == pickup_proc) then begin
			call pickup_p_proc;
		end
		else begin
			if (script_action == talk_proc) then begin
				call talk_p_proc;
			end
			else begin
				if (script_action == critter_proc) then begin
					call critter_p_proc;
				end
				else begin
					if (script_action == destroy_proc) then begin
						call destroy_p_proc;
					end
				end
			end
		end
	end
end

procedure pre_dialogue
begin
	call Get_Reaction;
	if (not(first_time)) then begin
		if (local_var(0) < 2) then begin
			call JenniferRandom3;
		end
		else begin
			call JenniferRandom2;
		end
	end
	else begin
		first_time := 0;
		call do_dialogue;
	end
end

procedure do_dialogue
begin
	start_gdialog(-1, self_obj, 4, -1, -1);
	gsay_start;
	call Jennifer01;
	gsay_end;
	end_dialogue;
end

procedure weapon_check
begin
	if ((obj_item_subtype(critter_inven_obj(dude_obj, 1)) == 3) or (obj_item_subtype(critter_inven_obj(dude_obj, 2)) == 3)) then begin
		armed := 1;
	end
	else begin
		armed := 0;
	end
end

procedure Jennifer00
begin
	warned := 1;
	float_msg(self_obj, message_str(SCRIPT_JENNIFER, 102), FLOAT_MSG_NORMAL);
	float_msg(self_obj, message_str(SCRIPT_JENNIFER, 103), FLOAT_MSG_NORMAL);
end

procedure Jennifer01
begin
	gsay_reply(SCRIPT_JENNIFER, 104);
	if (dude_is_female) then begin
		giq_option(5, SCRIPT_JENNIFER, 105, Jennifer14, NEUTRAL_REACTION);
	end
	else begin
		giq_option(5, SCRIPT_JENNIFER, 106, JenniferCharm, NEUTRAL_REACTION);
		giq_option(-3, SCRIPT_JENNIFER, 107, Jennifer11, NEUTRAL_REACTION);
	end
	giq_option(5, SCRIPT_JENNIFER, 108, Jennifer01a, GOOD_REACTION);
	giq_option(4, SCRIPT_JENNIFER, 109, Jennifer01b, BAD_REACTION);
	giq_option(4, SCRIPT_JENNIFER, 110, Jennifer02, NEUTRAL_REACTION);
	giq_option(-3, SCRIPT_JENNIFER, 111, Jennifer13, NEUTRAL_REACTION);
end

procedure Jennifer01a
begin
	call Up_React;
	call Jennifer02;
end

procedure Jennifer01b
begin
	call Big_Down_React;
	call Jennifer20;
end

procedure Jennifer02
begin
	line2flag := 1;
	gsay_message(SCRIPT_JENNIFER, 112, NEUTRAL_REACTION);
	gsay_reply(SCRIPT_JENNIFER, 113);
	giq_option(5, SCRIPT_JENNIFER, 114, Up_React, NEUTRAL_REACTION);
	if (not(line5flag)) then begin
		giq_option(4, SCRIPT_JENNIFER, 115, Jennifer05, NEUTRAL_REACTION);
	end
	call Goodbyes;
	giq_option(4, 0, exit_line, JenniferEnd, NEUTRAL_REACTION);
end

procedure Jennifer05
begin
	line5flag := 1;
	gsay_message(SCRIPT_JENNIFER, 116, NEUTRAL_REACTION);
	call Jennifer07;
end

procedure Jennifer07
begin
	gsay_reply(SCRIPT_JENNIFER, 117);
	giq_option(4, SCRIPT_JENNIFER, 118, Up_React, GOOD_REACTION);
	giq_option(4, SCRIPT_JENNIFER, 119, Jennifer08, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_JENNIFER, 120, Down_React, BAD_REACTION);
end

procedure Jennifer08
begin
	gsay_reply(SCRIPT_JENNIFER, 121);
	giq_option(5, SCRIPT_JENNIFER, 122, Up_React, NEUTRAL_REACTION);
	giq_option(6, SCRIPT_JENNIFER, 123, Jennifer29, NEUTRAL_REACTION);
	if (dude_is_female) then begin
		if (not(line14flag)) then begin
			giq_option(5, SCRIPT_JENNIFER, 124, Jennifer14, NEUTRAL_REACTION);
		end
	end
	else begin
		if (not(flag1) and not(flag2) and (dude_is_male)) then begin
			giq_option(5, SCRIPT_JENNIFER, 125, JenniferCharm, NEUTRAL_REACTION);
		end
	end
	giq_option(4, SCRIPT_JENNIFER, 126, JenniferEnd, NEUTRAL_REACTION);
end

procedure Jennifer11
begin
	gsay_reply(SCRIPT_JENNIFER, 127);
	giq_option(-3, SCRIPT_JENNIFER, 128, Jennifer13, NEUTRAL_REACTION);
end

procedure Jennifer13
begin
	gsay_message(SCRIPT_JENNIFER, 129, NEUTRAL_REACTION);
end

procedure Jennifer14
begin
	line14flag := 1;
	call Top_React;
	gsay_message(SCRIPT_JENNIFER, 130, NEUTRAL_REACTION);
	gsay_reply(SCRIPT_JENNIFER, 131);
	giq_option(8, SCRIPT_JENNIFER, 132, Jennifer16, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_JENNIFER, 133, Jennifer15, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_JENNIFER, 134, Jennifer17, NEUTRAL_REACTION);
end

procedure Jennifer15
begin
	gsay_reply(SCRIPT_JENNIFER, 135);
	giq_option(4, SCRIPT_JENNIFER, 136, Jennifer17, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_JENNIFER, 137, Jennifer17, NEUTRAL_REACTION);
end

procedure Jennifer16
begin
	gsay_reply(SCRIPT_JENNIFER, 138);
	giq_option(8, SCRIPT_JENNIFER, 139, Jennifer18, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_JENNIFER, 140, Jennifer17, NEUTRAL_REACTION);
end

procedure Jennifer17
begin
	gsay_reply(SCRIPT_JENNIFER, 141);
	if (not(line2flag)) then begin
		giq_option(4, SCRIPT_JENNIFER, 142, Jennifer02, NEUTRAL_REACTION);
	end
	if (not(line5flag)) then begin
		giq_option(4, SCRIPT_JENNIFER, 143, Jennifer05, NEUTRAL_REACTION);
	end
	giq_option(4, SCRIPT_JENNIFER, 144, JenniferEnd, NEUTRAL_REACTION);
end

procedure Jennifer18
begin
	gsay_message(SCRIPT_JENNIFER, 145, NEUTRAL_REACTION);
	gsay_reply(SCRIPT_JENNIFER, 146);
	giq_option(4, SCRIPT_JENNIFER, 147, Jennifer19, NEUTRAL_REACTION);
	call Goodbyes;
	giq_option(4, 0, exit_line, JenniferEnd, NEUTRAL_REACTION);
end

procedure Jennifer19
begin
	gsay_message(SCRIPT_JENNIFER, 148, NEUTRAL_REACTION);
	gsay_reply(SCRIPT_JENNIFER, 149);
	call Goodbyes;
	giq_option(4, 0, exit_line, JenniferEnd, NEUTRAL_REACTION);
end

procedure Jennifer20
begin
	gsay_reply(SCRIPT_JENNIFER, 150);
	giq_option(5, SCRIPT_JENNIFER, 151, Bottom_React, BAD_REACTION);
	giq_option(4, SCRIPT_JENNIFER, 152, Up_React, GOOD_REACTION);
	giq_option(4, SCRIPT_JENNIFER, 153, Down_React, BAD_REACTION);
end

procedure Jennifer21
begin
	gsay_reply(SCRIPT_JENNIFER, 154);
	giq_option(4, SCRIPT_JENNIFER, 155, Jennifer22, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_JENNIFER, 156, JenniferEnd, NEUTRAL_REACTION);
end

procedure Jennifer22
begin
	gsay_message(SCRIPT_JENNIFER, 157, NEUTRAL_REACTION);
end

procedure Jennifer23
begin
	call Top_React;
	flag1 := 1;
	flag2 := 0;
	last_seen := game_time;
	gsay_message(SCRIPT_JENNIFER, 163, GOOD_REACTION);
	gsay_reply(SCRIPT_JENNIFER, 164);
	if (line2flag == 0) then begin
		giq_option(4, SCRIPT_JENNIFER, 165, Jennifer02, NEUTRAL_REACTION);
	end
	if (line5flag == 0) then begin
		giq_option(4, SCRIPT_JENNIFER, 166, Jennifer05, NEUTRAL_REACTION);
	end
	giq_option(4, SCRIPT_JENNIFER, 167, JenniferEnd, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_JENNIFER, 168, JenniferEnd, NEUTRAL_REACTION);
end

procedure Jennifer25
begin
	flag1 := 0;
	flag2 := 1;
	gsay_message(SCRIPT_JENNIFER, 163, NEUTRAL_REACTION);
	gsay_reply(SCRIPT_JENNIFER, 164);
	if (not(line2flag)) then begin
		giq_option(4, SCRIPT_JENNIFER, 165, Jennifer02, NEUTRAL_REACTION);
	end
	if (not(line5flag)) then begin
		giq_option(4, SCRIPT_JENNIFER, 166, Jennifer05, NEUTRAL_REACTION);
	end
	giq_option(4, SCRIPT_JENNIFER, 167, JenniferEnd, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_JENNIFER, 168, JenniferEnd, NEUTRAL_REACTION);
end

procedure Jennifer26
begin
	gsay_reply(SCRIPT_JENNIFER, 169);
	giq_option(4, SCRIPT_JENNIFER, 170, Big_Down_React, BAD_REACTION);
	giq_option(4, SCRIPT_JENNIFER, 171, Jennifer27, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_JENNIFER, 172, JenniferEnd, NEUTRAL_REACTION);
end

procedure Jennifer27
begin
	gsay_reply(SCRIPT_JENNIFER, 173);
	if (not(line2flag)) then begin
		giq_option(4, SCRIPT_JENNIFER, 174, Jennifer02, NEUTRAL_REACTION);
	end
	if (not(line5flag)) then begin
		giq_option(4, SCRIPT_JENNIFER, 175, Jennifer05, NEUTRAL_REACTION);
	end
	giq_option(4, SCRIPT_JENNIFER, 176, JenniferEnd, NEUTRAL_REACTION);
end

procedure Jennifer28
begin
	gsay_reply(SCRIPT_JENNIFER, 177);
	giq_option(4, SCRIPT_JENNIFER, 178, Jennifer27, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_JENNIFER, 179, Jennifer27, BAD_REACTION);
	giq_option(4, SCRIPT_JENNIFER, 180, JenniferEnd, NEUTRAL_REACTION);
end

procedure Jennifer29
begin
	gsay_reply(SCRIPT_JENNIFER, 181);
	giq_option(4, SCRIPT_JENNIFER, 182, Jennifer30, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_JENNIFER, 183, Bottom_React, BAD_REACTION);
end

procedure Jennifer30
begin
	gsay_message(SCRIPT_JENNIFER, 184, NEUTRAL_REACTION);
	gsay_message(SCRIPT_JENNIFER, 185, NEUTRAL_REACTION);
	gsay_reply(SCRIPT_JENNIFER, 186);
	giq_option(7, SCRIPT_JENNIFER, 187, Jennifer31, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_JENNIFER, 188, Up_React, GOOD_REACTION);
	giq_option(4, SCRIPT_JENNIFER, 189, Down_React, BAD_REACTION);
	if (not(line2flag)) then begin
		giq_option(4, SCRIPT_JENNIFER, 190, Jennifer02, NEUTRAL_REACTION);
	end
end

procedure Jennifer31
begin
	gsay_reply(SCRIPT_JENNIFER, 191);
	giq_option(4, SCRIPT_JENNIFER, 192, JenniferEnd, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_JENNIFER, 193, Down_React, BAD_REACTION);
	if (not(line2flag)) then begin
		giq_option(4, SCRIPT_JENNIFER, 194, Jennifer02, NEUTRAL_REACTION);
	end
end

procedure JenniferCharm
begin
	variable LVar0 := 0;
	LVar0 := do_check(dude_obj, 3, 0);
	if (is_success(LVar0)) then begin
		if (is_critical(LVar0)) then begin
			call Big_Up_React;
			flag1 := 1;
			call Jennifer23;
		end
		else begin
			call Jennifer25;
		end
	end
	else begin
		if (is_critical(LVar0)) then begin
			call Jennifer28;
		end
		else begin
			call Jennifer26;
		end
	end
end

procedure JenniferEnd
begin
end

procedure JenniferRandom1
begin
	variable LVar0 := 0;
	variable LVar1 := 0;
	if (not(LVar0)) then begin
		LVar0 := random(1, 10);
	end
	if ((game_time_hour > 800) and (game_time_hour < 1700)) then begin
		if (LVar0 > 10) then begin
			LVar0 := 1;
		end
		LVar1 := message_str(SCRIPT_JENNIFER, 195);
		if (LVar0 == 2) then begin
			LVar1 := message_str(SCRIPT_JENNIFER, 196);
		end
		else begin
			if (LVar0 == 3) then begin
				LVar1 := message_str(SCRIPT_JENNIFER, 197);
			end
			else begin
				if (LVar0 == 4) then begin
					LVar1 := message_str(SCRIPT_JENNIFER, 198);
				end
				else begin
					if (LVar0 == 5) then begin
						LVar1 := message_str(SCRIPT_JENNIFER, 199);
					end
					else begin
						if (LVar0 == 6) then begin
							LVar1 := message_str(SCRIPT_JENNIFER, 200);
						end
						else begin
							if (LVar0 == 7) then begin
								LVar1 := message_str(SCRIPT_JENNIFER, 201);
							end
							else begin
								if ((last_seen - game_time) > 86400) then begin
									if (LVar0 == 8) then begin
										LVar1 := message_str(SCRIPT_JENNIFER, 202);
									end
									if (LVar0 == 9) then begin
										LVar1 := message_str(SCRIPT_JENNIFER, 203);
									end
									if (LVar0 == 10) then begin
										LVar1 := message_str(SCRIPT_JENNIFER, 204);
									end
								end
								else begin
									LVar0 := 1;
								end
							end
						end
					end
				end
			end
		end
	end
	else begin
		if (LVar0 > 6) then begin
			LVar0 := 1;
		end
		LVar1 := message_str(SCRIPT_JENNIFER, 205);
		if (LVar0 == 2) then begin
			LVar1 := message_str(SCRIPT_JENNIFER, 206);
		end
		else begin
			if (LVar0 == 3) then begin
				LVar1 := message_str(SCRIPT_JENNIFER, 207);
			end
			else begin
				if (LVar0 == 4) then begin
					LVar1 := message_str(SCRIPT_JENNIFER, 208);
				end
				else begin
					if (LVar0 == 5) then begin
						LVar1 := message_str(SCRIPT_JENNIFER, 209);
					end
					else begin
						if (LVar0 == 6) then begin
							LVar1 := message_str(SCRIPT_JENNIFER, 210);
						end
					end
				end
			end
		end
	end
	LVar0 := LVar0 + 1;
	last_seen := game_time;
	float_msg(self_obj, LVar1, FLOAT_MSG_NORMAL);
end

procedure JenniferRandom2
begin
	variable LVar0 := 0;
	variable LVar1 := 0;
	if (not(LVar0)) then begin
		LVar0 := random(1, 5);
	end
	if (LVar0 > 5) then begin
		LVar0 := 1;
	end
	LVar1 := message_str(SCRIPT_JENNIFER, 211);
	if (LVar0 == 2) then begin
		LVar1 := message_str(SCRIPT_JENNIFER, 212) + proto_data(obj_pid(dude_obj), 1) + message_str(SCRIPT_JENNIFER, 213);
	end
	else begin
		if (LVar0 == 3) then begin
			LVar1 := message_str(SCRIPT_JENNIFER, 214);
		end
		else begin
			if (LVar0 == 4) then begin
				LVar1 := message_str(SCRIPT_JENNIFER, 215) + proto_data(obj_pid(dude_obj), 1) + message_str(SCRIPT_JENNIFER, 216);
			end
			else begin
				if (LVar0 == 5) then begin
					LVar1 := message_str(SCRIPT_JENNIFER, 217);
				end
			end
		end
	end
	LVar0 := LVar0 + 1;
	float_msg(self_obj, LVar1, FLOAT_MSG_NORMAL);
end

procedure JenniferRandom3
begin
	variable LVar0 := 0;
	variable LVar1 := 0;
	if (not(LVar0)) then begin
		LVar0 := random(1, 8);
	end
	if (LVar0 > 8) then begin
		LVar0 := 1;
	end
	LVar1 := message_str(SCRIPT_JENNIFER, 218);
	if (LVar0 == 2) then begin
		LVar1 := message_str(SCRIPT_JENNIFER, 219);
	end
	else begin
		if (LVar0 == 3) then begin
			LVar1 := message_str(SCRIPT_JENNIFER, 220);
		end
		else begin
			if (LVar0 == 4) then begin
				LVar1 := message_str(SCRIPT_JENNIFER, 221);
			end
			else begin
				if (LVar0 == 5) then begin
					LVar1 := message_str(SCRIPT_JENNIFER, 222);
				end
				else begin
					if (LVar0 == 6) then begin
						LVar1 := message_str(SCRIPT_JENNIFER, 223);
					end
					else begin
						if (LVar0 == 7) then begin
							LVar1 := message_str(SCRIPT_JENNIFER, 224);
						end
						else begin
							if (LVar0 == 8) then begin
								LVar1 := message_str(SCRIPT_JENNIFER, 225);
							end
						end
					end
				end
			end
		end
	end
	LVar0 := LVar0 + 1;
	float_msg(self_obj, LVar1, FLOAT_MSG_NORMAL);
end

procedure JenniferBackground1
begin
	variable LVar0 := 0;
	variable LVar1 := 0;
	if (not(LVar0)) then begin
		LVar0 := random(1, 11);
	end
	if ((game_time_hour > 800) and (game_time_hour < 1700)) then begin
		if (LVar0 > 11) then begin
			LVar0 := 1;
		end
		if (LVar0 == 1) then begin
			LVar1 := message_str(SCRIPT_JENNIFER, 226);
		end
		else begin
			if (LVar0 == 2) then begin
				LVar1 := message_str(SCRIPT_JENNIFER, 227);
			end
			else begin
				if (LVar0 == 3) then begin
					LVar1 := proto_data(obj_pid(dude_obj), 1) + message_str(SCRIPT_JENNIFER, 228);
				end
				else begin
					if (LVar0 == 4) then begin
						LVar1 := message_str(SCRIPT_JENNIFER, 229);
					end
					else begin
						if (LVar0 == 5) then begin
							LVar1 := message_str(SCRIPT_JENNIFER, 230);
						end
						else begin
							if (LVar0 == 6) then begin
								LVar1 := message_str(SCRIPT_JENNIFER, 231);
							end
							else begin
								if (LVar0 == 7) then begin
									LVar1 := message_str(SCRIPT_JENNIFER, 232);
								end
								else begin
									if (LVar0 == 8) then begin
										LVar1 := message_str(SCRIPT_JENNIFER, 233);
									end
									else begin
										if (LVar0 == 9) then begin
											LVar1 := message_str(SCRIPT_JENNIFER, 234);
										end
										else begin
											if (LVar0 == 10) then begin
												LVar1 := message_str(SCRIPT_JENNIFER, 235);
											end
											else begin
												if (LVar0 == 11) then begin
													LVar1 := message_str(SCRIPT_JENNIFER, 236);
												end
											end
										end
									end
								end
							end
						end
					end
				end
			end
		end
	end
	else begin
		if (LVar0 == 1) then begin
			LVar1 := message_str(SCRIPT_JENNIFER, 237);
		end
		else begin
			if (LVar0 == 2) then begin
				LVar1 := message_str(SCRIPT_JENNIFER, 238);
			end
			else begin
				if (LVar0 == 3) then begin
					LVar1 := message_str(SCRIPT_JENNIFER, 239);
				end
				else begin
					if (LVar0 == 4) then begin
						LVar1 := message_str(SCRIPT_JENNIFER, 240);
					end
					else begin
						if (LVar0 == 5) then begin
							LVar1 := message_str(SCRIPT_JENNIFER, 241);
						end
					end
				end
			end
		end
	end
	LVar0 := LVar0 + 1;
	float_msg(self_obj, LVar1, FLOAT_MSG_NORMAL);
	last_seen := game_time;
end

procedure combat
begin
	hostile1 := 1;
end

procedure critter_p_proc
begin
	if (global_var(GVAR_ENEMY_BROTHERHOOD)) then begin
		hostile1 := 1;
	end
	if (tile_distance_objs(self_obj, dude_obj) > 12) then begin
		hostile1 := 0;
	end
	if (hostile1) then begin
		set_global_var(GVAR_ENEMY_BROTHERHOOD, 1);
		hostile1 := 0;
		attack_complex(dude_obj, 0, 1, 0, 0, 30000, 0, 0);
	end
	else begin
		if (warned == 0) then begin
			if (obj_can_see_obj(self_obj, dude_obj)) then begin
				if (armed == 0) then begin
					call weapon_check;
				end
				if (armed) then begin
					call Jennifer00;
				end
			end
		end
	end
end

procedure pickup_p_proc
begin
	if (source_obj == dude_obj) then begin
		hostile1 := 1;
	end
end

procedure talk_p_proc
begin
	call pre_dialogue;
end

procedure destroy_p_proc
begin
	set_global_var(GVAR_ENEMY_BROTHERHOOD, 1);
	rm_timer_event(self_obj);
	if (source_obj == dude_obj) then begin
		if (((global_var(GVAR_BAD_MONSTER) + global_var(GVAR_GOOD_MONSTER)) >= 25) and ((global_var(GVAR_GOOD_MONSTER) > (2 * global_var(GVAR_BAD_MONSTER))) or (global_var(GVAR_BERSERKER_REPUTATION) == 1))) then begin
			set_global_var(GVAR_BERSERKER_REPUTATION, 1);
			set_global_var(GVAR_CHAMPION_REPUTATION, 0);
		end
		if (((global_var(GVAR_BAD_MONSTER) + global_var(GVAR_GOOD_MONSTER)) >= 25) and ((global_var(GVAR_BAD_MONSTER) > (3 * global_var(GVAR_GOOD_MONSTER))) or (global_var(GVAR_CHAMPION_REPUTATION) == 1))) then begin
			set_global_var(GVAR_CHAMPION_REPUTATION, 1);
			set_global_var(GVAR_BERSERKER_REPUTATION, 0);
		end
		set_global_var(GVAR_GOOD_MONSTER, global_var(GVAR_GOOD_MONSTER) + 1);
		if ((global_var(GVAR_GOOD_MONSTER) % 2) == 0) then begin
			set_global_var(GVAR_PLAYER_REPUTATION, global_var(GVAR_PLAYER_REPUTATION) - 1);
		end
	end
end

procedure look_at_p_proc
begin
	script_overrides;
	if (known) then begin
		display_msg(message_str(SCRIPT_JENNIFER, 100));
	end
	else begin
		display_msg(message_str(SCRIPT_JENNIFER, 101));
	end
end

procedure Get_Reaction
begin
	if (local_var(2) == 0) then begin
		set_local_var(0, 50);
		set_local_var(1, 2);
		set_local_var(2, 1);
		set_local_var(0, local_var(0) + (5 * get_critter_stat(dude_obj, 3)) - 25);
		set_local_var(0, local_var(0) + (10 * has_trait(0, dude_obj, 10)));
		if (has_trait(0, dude_obj, 39)) then begin
			if (global_var(GVAR_PLAYER_REPUTATION) > 0) then begin
				set_local_var(0, local_var(0) + global_var(GVAR_PLAYER_REPUTATION));
			end
			else begin
				set_local_var(0, local_var(0) - global_var(GVAR_PLAYER_REPUTATION));
			end
		end
		else begin
			if (local_var(3) == 1) then begin
				set_local_var(0, local_var(0) - global_var(GVAR_PLAYER_REPUTATION));
			end
			else begin
				set_local_var(0, local_var(0) + global_var(GVAR_PLAYER_REPUTATION));
			end
		end
		if (global_var(GVAR_CHILDKILLER_REPUTATION) > 2) then begin
			set_local_var(0, local_var(0) - 30);
		end
		if (((global_var(GVAR_BAD_MONSTER) + global_var(GVAR_GOOD_MONSTER)) >= 25) and ((global_var(GVAR_BAD_MONSTER) > (3 * global_var(GVAR_GOOD_MONSTER))) or (global_var(GVAR_CHAMPION_REPUTATION) == 1))) then begin
			set_local_var(0, local_var(0) + 20);
		end
		if (((global_var(GVAR_BAD_MONSTER) + global_var(GVAR_GOOD_MONSTER)) >= 25) and ((global_var(GVAR_GOOD_MONSTER) > (2 * global_var(GVAR_BAD_MONSTER))) or (global_var(GVAR_BERSERKER_REPUTATION) == 1))) then begin
			set_local_var(0, local_var(0) - 20);
		end
		call React_To_Level;
	end
end

procedure React_To_Level
begin
	if (local_var(0) <= 25) then begin
		set_local_var(1, 1);
	end
	else begin
		if (local_var(0) <= 75) then begin
			set_local_var(1, 2);
		end
		else begin
			set_local_var(1, 3);
		end
	end
end

procedure Level_To_React
begin
	if (local_var(1) == 1) then begin
		set_local_var(0, random(1, 25));
	end
	else begin
		if (local_var(1) == 2) then begin
			set_local_var(0, random(26, 75));
		end
		else begin
			set_local_var(0, random(76, 100));
		end
	end
end

procedure Up_React
begin
	set_local_var(0, local_var(0) + 10);
	call React_To_Level;
end

procedure Down_React
begin
	set_local_var(0, local_var(0) - 10);
	call React_To_Level;
end

procedure Bottom_React
begin
	set_local_var(1, 1);
	set_local_var(0, 1);
end

procedure Top_React
begin
	set_local_var(0, 100);
	set_local_var(1, 3);
end

procedure Big_Up_React
begin
	set_local_var(0, local_var(0) + 25);
	call React_To_Level;
end

procedure Big_Down_React
begin
	set_local_var(0, local_var(0) - 25);
	call React_To_Level;
end

procedure Up_React_Level
begin
	set_local_var(1, local_var(1) + 1);
	if (local_var(1) > 3) then begin
		set_local_var(1, 3);
	end
	call Level_To_React;
end

procedure Down_React_Level
begin
	set_local_var(1, local_var(1) - 1);
	if (local_var(1) < 1) then begin
		set_local_var(1, 1);
	end
	call Level_To_React;
end

procedure Goodbyes
begin
	exit_line := message_str(SCRIPT_MODREACT, random(100, 105));
end