#include <define.h>

//#define NAME                    SCRIPT_

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



procedure start;
#include <push.h>
procedure goto0;
procedure goto1;
procedure goto2;
procedure goto3;
procedure goto3a;
procedure goto4;
procedure goto5;
procedure goto10;
procedure goto11;
procedure goto11a;
procedure goto12;
procedure goto13;
procedure goto13a;
procedure goto13b;
procedure goto14;
procedure goto15;
procedure goto16;
procedure goto16a;
procedure goto16b;
procedure goto17;
procedure goto18;
procedure goto19;
procedure goto20;
procedure goto21;
procedure goto22;
procedure goto23;
procedure goto24;
procedure goto26;
procedure goto27;
procedure goto28;
procedure goto29;
procedure goto30;
procedure goto38;
procedure goto39;
procedure goto40;
procedure goto41;
procedure goto42;
procedure goto43;
procedure goto44a;
procedure goto44b;
procedure goto44c;
procedure goto44d;
procedure goto44e;
procedure goto44f;
procedure goto44g;
procedure goto44h;
procedure goto44i;
procedure goto47;
procedure goto47a;
procedure goto48;
procedure goto49;
procedure goto50;
procedure goto51;
procedure goto52;
procedure goto52a;
procedure goto53;
procedure goto54;
procedure goto55;
procedure goto56;
procedure goto57;
procedure goto58;
procedure goto59;
procedure goto60;
procedure goto61;
procedure goto144;
procedure goto145;
procedure goto146;
procedure goto147;
procedure goto148;
procedure goto149;
procedure goto150;
procedure Do_Dialogue;
procedure CheckFlag;
procedure combat;
procedure gotoend;
procedure critter_p_proc;
procedure pickup_p_proc;
procedure talk_p_proc;
procedure destroy_p_proc;
procedure look_at_p_proc;

variable hostile1;
variable Only_Once := 1;
variable Open_Door;
variable Herebefore;
variable item;
variable Hear_28;
variable Hear_29;
variable Hear_50;
variable temp;
variable temp2;

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
		critter_add_trait(self_obj, TRAIT_OBJECT, OBJECT_TEAM_NUM, 44);
	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 goto0
begin
	float_msg(self_obj, message_str(SCRIPT_MICHAEL, 103), FLOAT_MSG_NORMAL);
end

procedure goto1
begin
	float_msg(self_obj, message_str(SCRIPT_MICHAEL, 104), FLOAT_MSG_NORMAL);
end

procedure goto2
begin
	float_msg(self_obj, message_str(SCRIPT_MICHAEL, 105), FLOAT_MSG_NORMAL);
end

procedure goto3
begin
	gsay_reply(0, message_str(SCRIPT_MICHAEL, 106));
	giq_option(5, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 107), goto3a, GOOD_REACTION);
	giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 108), goto11, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 109), goto10, NEUTRAL_REACTION);
	giq_option(-3, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 110), goto4, NEUTRAL_REACTION);
end

procedure goto3a
begin
	call Up_React;
	call goto11;
end

procedure goto4
begin
	gsay_reply(0, message_str(SCRIPT_MICHAEL, 111));
	giq_option(-3, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 112), goto5, NEUTRAL_REACTION);
	giq_option(-3, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 113), goto5, NEUTRAL_REACTION);
end

procedure goto5
begin
	gsay_message(0, message_str(SCRIPT_MICHAEL, 114), NEUTRAL_REACTION);
end

procedure goto10
begin
	gsay_message(0, message_str(SCRIPT_MICHAEL, 115), NEUTRAL_REACTION);
end

procedure goto11
begin
	gsay_reply(0, message_str(SCRIPT_MICHAEL, 116));
	giq_option(5, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 117), goto11a, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 118), goto26, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 119), gotoend, NEUTRAL_REACTION);
end

procedure goto11a
begin
	if (is_success(do_check(dude_obj, 3, 0))) then begin
		call goto13;
	end
	else begin
		call goto12;
	end
end

procedure goto12
begin
	gsay_message(0, message_str(SCRIPT_MICHAEL, 120), NEUTRAL_REACTION);
end

procedure goto13
begin
	gsay_message(0, message_str(SCRIPT_MICHAEL, 121), NEUTRAL_REACTION);
	giq_option(5, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 122), goto13a, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 123), goto13b, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 124), goto22, NEUTRAL_REACTION);
end

procedure goto13a
begin
	if (is_success(do_check(dude_obj, 3, 0))) then begin
		if (dude_is_male) then begin
			call goto16;
		end
		else begin
			call goto18;
		end
	end
	else begin
		if (dude_is_male) then begin
			call goto14;
		end
		else begin
			call goto17;
		end
	end
end

procedure goto13b
begin
	if (is_success(do_check(dude_obj, 3, 0))) then begin
		call goto22;
	end
	else begin
		call goto15;
	end
end

procedure goto14
begin
	gsay_message(0, message_str(SCRIPT_MICHAEL, 125), NEUTRAL_REACTION);
	call Down_React;
end

procedure goto15
begin
	gsay_message(0, message_str(SCRIPT_MICHAEL, 126), NEUTRAL_REACTION);
	call Down_React;
end

procedure goto16
begin
	gsay_reply(0, message_str(SCRIPT_MICHAEL, 127));
	giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 128), goto16a, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 129), goto16b, NEUTRAL_REACTION);
end

procedure goto16a
begin
	call Big_Up_React;
	call goto19;
end

procedure goto16b
begin
	call Down_React;
	call goto20;
end

procedure goto17
begin
	gsay_message(0, message_str(SCRIPT_MICHAEL, 130), NEUTRAL_REACTION);
	call Down_React;
end

procedure goto18
begin
	gsay_reply(0, message_str(SCRIPT_MICHAEL, 131));
	giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 132), goto16a, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 133), goto16b, NEUTRAL_REACTION);
end

procedure goto19
begin
	gsay_message(0, message_str(SCRIPT_MICHAEL, 134), NEUTRAL_REACTION);
	call Top_React;
	item := create_object_sid(27, 0, 0, -1);
	add_obj_to_inven(dude_obj, item);
	item := create_object_sid(27, 0, 0, -1);
	add_obj_to_inven(dude_obj, item);
	item := create_object_sid(27, 0, 0, -1);
	add_obj_to_inven(dude_obj, item);
end

procedure goto20
begin
	gsay_message(0, message_str(SCRIPT_MICHAEL, 135), NEUTRAL_REACTION);
end

procedure goto21
begin
	gsay_message(0, message_str(SCRIPT_MICHAEL, 136), NEUTRAL_REACTION);
end

procedure goto22
begin
	gsay_reply(0, message_str(SCRIPT_MICHAEL, 137));
	giq_option(6, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 138), goto23, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 139), goto24, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 140), gotoend, NEUTRAL_REACTION);
end

procedure goto23
begin
	gsay_message(0, message_str(SCRIPT_MICHAEL, 141), NEUTRAL_REACTION);
	call Top_React;
	item := create_object_sid(50, 0, 0, -1);
	add_obj_to_inven(dude_obj, item);
	item := create_object_sid(50, 0, 0, -1);
	add_obj_to_inven(dude_obj, item);
end

procedure goto24
begin
	if (dude_is_male) then begin
		gsay_message(0, message_str(SCRIPT_MICHAEL, 142), NEUTRAL_REACTION);
	end
	else begin
		gsay_message(0, message_str(SCRIPT_MICHAEL, 143), NEUTRAL_REACTION);
	end
end

procedure goto26
begin
	gsay_reply(0, message_str(SCRIPT_MICHAEL, 144));
	giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 145), goto27, NEUTRAL_REACTION);
	if (map_var(9) > 0) then begin
		giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 146), goto48, NEUTRAL_REACTION);
	end
	giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 147), goto27, NEUTRAL_REACTION);
end

procedure goto27
begin
	gsay_reply(0, message_str(SCRIPT_MICHAEL, 148));
	giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 149), goto28, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 150), goto29, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 151), gotoend, NEUTRAL_REACTION);
end

procedure goto28
begin
	Hear_28 := 1;
	gsay_reply(0, message_str(SCRIPT_MICHAEL, 152));
	if (Hear_29 == 0) then begin
		giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 153), goto29, NEUTRAL_REACTION);
	end
	giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 154), gotoend, NEUTRAL_REACTION);
end

procedure goto29
begin
	Hear_29 := 1;
	gsay_reply(0, message_str(SCRIPT_MICHAEL, 155));
	if (Hear_28 == 0) then begin
		giq_option(8, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 156), goto30, NEUTRAL_REACTION);
		giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 157), goto28, NEUTRAL_REACTION);
	end
	giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 158), gotoend, NEUTRAL_REACTION);
end

procedure goto30
begin
	gsay_reply(0, message_str(SCRIPT_MICHAEL, 159));
	giq_option(8, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 160), Up_React, NEUTRAL_REACTION);
end

procedure goto38
begin
	gsay_reply(0, message_str(SCRIPT_MICHAEL, 167));
	temp2 := map_var(11) + 1;
	set_map_var(11, temp2);
	item := create_object_sid(temp, 0, 0, -1);
	add_obj_to_inven(dude_obj, item);
	giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 168), gotoend, NEUTRAL_REACTION);
	if (map_var(9) > 0) then begin
		giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 169), goto43, NEUTRAL_REACTION);
	end
end

procedure goto39
begin
	gsay_reply(0, message_str(SCRIPT_MICHAEL, 170));
	giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 171), gotoend, NEUTRAL_REACTION);
	if (map_var(9) > 0) then begin
		giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 172), goto43, NEUTRAL_REACTION);
	end
end

procedure goto40
begin
	gsay_reply(0, message_str(SCRIPT_MICHAEL, 173));
	giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 174), gotoend, NEUTRAL_REACTION);
	if (map_var(9) > 0) then begin
		giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 175), goto43, NEUTRAL_REACTION);
	end
end

procedure goto41
begin
	gsay_reply(0, message_str(SCRIPT_MICHAEL, 176));
	giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 177), gotoend, NEUTRAL_REACTION);
	if (map_var(9) > 0) then begin
		giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 178), goto43, NEUTRAL_REACTION);
	end
end

procedure goto42
begin
	gsay_reply(0, message_str(SCRIPT_MICHAEL, 179));
	giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 180), gotoend, NEUTRAL_REACTION);
	if (map_var(9) > 0) then begin
		giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 181), goto43, NEUTRAL_REACTION);
	end
end

procedure goto43
begin
	gsay_message(0, message_str(SCRIPT_MICHAEL, 182), NEUTRAL_REACTION);
	call goto49;
end

procedure goto44a
begin
	temp := 29;
	call goto38;
end

procedure goto44b
begin
	temp := 30;
	call goto38;
end

procedure goto44c
begin
	temp := 31;
	call goto38;
end

procedure goto44d
begin
	temp := 111;
	call goto38;
end

procedure goto44e
begin
	temp := 33;
	call goto38;
end

procedure goto44f
begin
	temp := 34;
	call goto38;
end

procedure goto44g
begin
	temp := 35;
	call goto38;
end

procedure goto44h
begin
	temp := 36;
	call goto38;
end

procedure goto44i
begin
	temp := 95;
	call goto38;
end

procedure goto47
begin
	gsay_reply(0, message_str(SCRIPT_MICHAEL, 183));
	if (Hear_50 == 0) then begin
		giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 184), goto50, NEUTRAL_REACTION);
	end
	if (map_var(9) > 0) then begin
		giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 185), goto48, NEUTRAL_REACTION);
	end
	giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 186), gotoend, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 187), goto47a, NEUTRAL_REACTION);
end

procedure goto47a
begin
	call Big_Down_React;
	call gotoend;
end

procedure goto48
begin
	gsay_message(0, message_str(SCRIPT_MICHAEL, 188), NEUTRAL_REACTION);
	call goto49;
end

procedure goto49
begin
	gsay_message(0, message_str(SCRIPT_MICHAEL, 189), NEUTRAL_REACTION);
	if (map_var(10) > map_var(11)) then begin
		call goto144;
	end
	else begin
		if (map_var(12) > 0) then begin
			call goto146;
		end
		else begin
			if (map_var(13) > 0) then begin
				call goto147;
			end
			else begin
				if (map_var(14) > 0) then begin
					call goto148;
				end
				else begin
					if (map_var(15) > 0) then begin
						call goto149;
					end
					else begin
						if (map_var(16) > 0) then begin
							call goto150;
						end
					end
				end
			end
		end
	end
	temp := 0;
	temp := temp + map_var(10) - map_var(11);
	temp := temp + map_var(12);
	temp := temp + map_var(13);
	temp := temp + map_var(14);
	temp := temp + map_var(15);
	temp := temp + map_var(16);
	if (temp == 0) then begin
		set_map_var(9, 0);
	end
end

procedure goto50
begin
	Hear_50 := 1;
	gsay_reply(0, message_str(SCRIPT_MICHAEL, 190));
	giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 191), goto51, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 192), gotoend, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 193), goto47a, BAD_REACTION);
end

procedure goto51
begin
	gsay_message(0, message_str(SCRIPT_MICHAEL, 194), NEUTRAL_REACTION);
	set_local_var(5, game_time / (10 * 60 * 60));
	set_map_var(6, 1);
	item := create_object_sid(27, 0, 0, -1);
	add_obj_to_inven(dude_obj, item);
	item := create_object_sid(27, 0, 0, -1);
	add_obj_to_inven(dude_obj, item);
	item := create_object_sid(27, 0, 0, -1);
	add_obj_to_inven(dude_obj, item);
end

procedure goto52
begin
	gsay_reply(0, message_str(SCRIPT_MICHAEL, 195));
	giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 196), goto53, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 197), goto57, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 198), gotoend, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 199), goto52a, NEUTRAL_REACTION);
end

procedure goto52a
begin
	if (dude_is_male) then begin
		call goto54;
	end
	else begin
		call goto55;
	end
end

procedure goto53
begin
	gsay_message(0, message_str(SCRIPT_MICHAEL, 200), NEUTRAL_REACTION);
end

procedure goto54
begin
	gsay_message(0, message_str(SCRIPT_MICHAEL, 201), NEUTRAL_REACTION);
end

procedure goto55
begin
	gsay_message(0, message_str(SCRIPT_MICHAEL, 202), NEUTRAL_REACTION);
end

procedure goto56
begin
	gsay_message(0, message_str(SCRIPT_MICHAEL, 203), NEUTRAL_REACTION);
end

procedure goto57
begin
	gsay_message(0, message_str(SCRIPT_MICHAEL, 204), NEUTRAL_REACTION);
end

procedure goto58
begin
	gsay_message(0, message_str(SCRIPT_MICHAEL, 205), NEUTRAL_REACTION);
end

procedure goto59
begin
	gsay_message(0, message_str(SCRIPT_MICHAEL, 206), NEUTRAL_REACTION);
end

procedure goto60
begin
	gsay_reply(0, message_str(SCRIPT_MICHAEL, 207));
	if (map_var(9) > 0) then begin
		giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 208), goto61, NEUTRAL_REACTION);
	end
	giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 209), gotoend, NEUTRAL_REACTION);
end

procedure goto61
begin
	gsay_message(0, message_str(SCRIPT_MICHAEL, 210), NEUTRAL_REACTION);
	call goto49;
end

procedure goto144
begin
	gsay_reply(0, message_str(SCRIPT_MICHAEL, 211));
	giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 212), goto145, NEUTRAL_REACTION);
	if (map_var(10) > map_var(11)) then begin
		giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 213), goto44a, NEUTRAL_REACTION);
		giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 214), goto44b, NEUTRAL_REACTION);
		giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 215), goto44c, NEUTRAL_REACTION);
		giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 216), goto44d, NEUTRAL_REACTION);
		giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 217), goto44e, NEUTRAL_REACTION);
		giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 218), goto44f, NEUTRAL_REACTION);
		giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 219), goto44g, NEUTRAL_REACTION);
		giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 220), goto44h, NEUTRAL_REACTION);
		giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 221), goto44i, NEUTRAL_REACTION);
	end
	display_msg("sadg");
end

procedure goto145
begin
	gsay_message(0, message_str(SCRIPT_MICHAEL, 222), NEUTRAL_REACTION);
end

procedure goto146
begin
	gsay_reply(0, message_str(SCRIPT_MICHAEL, 223));
	temp2 := map_var(12) - 1;
	set_map_var(12, temp2);
	item := create_object_sid(9, 0, 0, -1);
	add_obj_to_inven(dude_obj, item);
	giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 224), gotoend, NEUTRAL_REACTION);
	if (map_var(9) > 0) then begin
		giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 225), goto43, NEUTRAL_REACTION);
	end
end

procedure goto147
begin
	gsay_reply(0, message_str(SCRIPT_MICHAEL, 226));
	temp2 := map_var(13) - 1;
	set_map_var(13, temp2);
	item := create_object_sid(22, 0, 0, -1);
	add_obj_to_inven(dude_obj, item);
	giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 227), gotoend, NEUTRAL_REACTION);
	if (map_var(9) > 0) then begin
		giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 228), goto43, NEUTRAL_REACTION);
	end
end

procedure goto148
begin
	gsay_reply(0, message_str(SCRIPT_MICHAEL, 229));
	temp2 := map_var(14) - 1;
	set_map_var(14, temp2);
	item := create_object_sid(17, 0, 0, -1);
	add_obj_to_inven(dude_obj, item);
	giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 230), gotoend, NEUTRAL_REACTION);
	if (map_var(9) > 0) then begin
		giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 231), goto43, NEUTRAL_REACTION);
	end
end

procedure goto149
begin
	gsay_reply(0, message_str(SCRIPT_MICHAEL, 232));
	temp2 := map_var(15) - 1;
	set_map_var(15, temp2);
	item := create_object_sid(3, 0, 0, -1);
	add_obj_to_inven(dude_obj, item);
	giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 233), gotoend, NEUTRAL_REACTION);
	if (map_var(9) > 0) then begin
		giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 234), goto43, NEUTRAL_REACTION);
	end
end

procedure goto150
begin
	gsay_reply(0, message_str(SCRIPT_MICHAEL, 235));
	temp2 := map_var(16) - 1;
	set_map_var(16, temp2);
	item := create_object_sid(52, 0, 0, -1);
	add_obj_to_inven(dude_obj, item);
	giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 236), gotoend, NEUTRAL_REACTION);
	if (map_var(9) > 0) then begin
		giq_option(4, SCRIPT_MICHAEL, message_str(SCRIPT_MICHAEL, 237), goto43, NEUTRAL_REACTION);
	end
end

procedure Do_Dialogue
begin
	if (map_var(8)) then begin
		set_map_var(8, 2);
		call goto59;
	end
	else begin
		if (map_var(7)) then begin
			call goto56;
		end
		else begin
			if (map_var(6) and (((game_time / (10 * 60 * 60)) - local_var(5)) < 48)) then begin
				call goto52;
			end
			else begin
				if (map_var(6) and (((game_time / (10 * 60 * 60)) - local_var(5)) >= 48)) then begin
					call goto58;
				end
				else begin
					if (Herebefore) then begin
						if (local_var(1) < 2) then begin
							call goto60;
						end
						else begin
							call goto47;
						end
					end
					else begin
						call goto3;
					end
				end
			end
		end
	end
end

procedure CheckFlag
begin
end

procedure combat
begin
	hostile1 := 1;
end

procedure gotoend
begin
end

procedure critter_p_proc
begin
	if (hostile1) then begin
		hostile1 := 0;
		attack_complex(dude_obj, 0, 1, 0, 0, 30000, 0, 0);
	end
end

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

procedure talk_p_proc
begin
	call Get_Reaction;
	start_gdialog(SCRIPT_MICHAEL, self_obj, 4, -1, -1);
	gsay_start;
	call Do_Dialogue;
	gsay_end;
	end_dialogue;
end

procedure destroy_p_proc
begin
	if (source_obj == dude_obj) then begin
		set_global_var(GVAR_GOOD_MONSTER, global_var(GVAR_GOOD_MONSTER) + 1);
	end
end

procedure look_at_p_proc
begin
	script_overrides;
	display_msg(message_str(SCRIPT_MICHAEL, 100));
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) > (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_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