#include <define.h>

//#define NAME                    SCRIPT_

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



procedure start;
#include <push.h>
procedure combat;
procedure critter_p_proc;
procedure pickup_p_proc;
procedure talk_p_proc;
procedure destroy_p_proc;
procedure look_at_p_proc;
procedure Kane00;
procedure Kane01;
procedure Kane02;
procedure Kane03;
procedure Kane04;
procedure Kane05;
procedure Kane06;
procedure Kane07;
procedure Kane08;
procedure Kane09;
procedure Kane10;
procedure Kane11;
procedure Kane12;
procedure Kane13;
procedure Kane14;
procedure Kane15;
procedure Kane16;
procedure Kane17;
procedure Kane18;
procedure Kane19;
procedure Kane29;
procedure Kane30;
procedure Kane31;
procedure Kane32;
procedure Kane33;
procedure Kane34;
procedure Kane35;
procedure Kane36;
procedure Kane36a;
procedure Kane37;
procedure Kane38;
procedure Kane39;
procedure Kane40;
procedure Kane41;
procedure Kane41a;
procedure Kane42;
procedure Kane43;
procedure Kane44;
procedure Kane45;
procedure Kane46;
procedure Kane47;
procedure Kane47a;
procedure Kane48;
procedure Kane49;
procedure Kane50;
procedure Kane51;
procedure Kane52;
procedure Kane53;
procedure Kane54;
procedure Kane55;
procedure Kane56;
procedure Kane57;
procedure Kane58;
procedure Kane59;
procedure Kane60;
procedure Kane61;
procedure Kane62;
procedure Kane63;
procedure Kane71;
procedure Kane72;
procedure Kane73;
procedure Kane74;
procedure Kane75;
procedure Kane75a;
procedure Kane76;
procedure Kane77;
procedure Kane78;
procedure Kane79;
procedure Kane80;
procedure Kane81;
procedure Kane82;
procedure Kane83;
procedure Kane84;
procedure Kane85;
procedure Kane86;
procedure Kane87;
procedure Kane88;
procedure Kane89;
procedure Kane90;
procedure Kane91;
procedure Kane92;
procedure Kane93;
procedure Kane93a;
procedure Kane94;
procedure Kane95;
procedure Kane96;
procedure Kane97;
procedure Kane98;
procedure Kane99;
procedure Kane100;
procedure Kane101;
procedure Kane102;
procedure Kane103;
procedure Kane104;
procedure Kane105;
procedure Kane106;
procedure Kane131;
procedure Kane132;
procedure Kane133;
procedure Kane134;
procedure Kane135;
procedure Kane136;
procedure Kane137;
procedure Kane138;
procedure Kane139;
procedure Kane140;
procedure Kane146;
procedure Kane147;
procedure Kane148;
procedure Kane149;
procedure Kane150;
procedure Kane151;
procedure Kane152;
procedure Kane153;
procedure Kane154;
procedure Kane155;
procedure KaneEnd;
procedure KaneEndHostile;
procedure KaneEndNotAcceptedOrDeclined;
procedure KaneEndDeclined;
procedure KaneEndAnnoyed;
procedure KaneEndTakeHike;
procedure KaneEndRefuses;
procedure KaneTravel;
procedure GoToDecker;

variable hostile1;
variable Only_Once := 1;
variable travel;

import variable Kane_Ptr;
import variable Decker_Ptr;

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;
		Kane_Ptr := self_obj;
		if (map_var(49) == 1) then begin
			set_obj_visibility(self_obj, 1);
		end
		critter_add_trait(self_obj, TRAIT_OBJECT, OBJECT_TEAM_NUM, 38);
		critter_add_trait(self_obj, TRAIT_OBJECT, OBJECT_AI_PACKET, AI_CAIN);
	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 combat
begin
	hostile1 := 1;
end

procedure critter_p_proc
begin
	if (hostile1) then begin
		hostile1 := 0;
		attack_complex(dude_obj, 0, 1, 0, 0, 30000, 0, 0);
	end
	if (map_var(51) == 1) then begin
		dialogue_system_enter;
	end
	if (travel == 1) then begin
		travel := 0;
		call GoToDecker;
	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;
	if (map_var(51) == 1) then begin
		set_map_var(51, 0);
		float_msg(self_obj, message_str(SCRIPT_KANE, 300), FLOAT_MSG_RED);
	end
	else 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
			if (local_var(6) == 0) then begin
				set_local_var(6, 1);
				call Kane61;
			end
			else begin
				if (local_var(6) == 1) then begin
					set_local_var(6, 2);
					call Kane62;
				end
				else begin
					call Kane63;
				end
			end
		end
		else begin
			if (local_var(4) == 0) then begin
				set_local_var(4, 1);
				if (((global_var(GVAR_KILLIAN_DEAD) == 0) and (global_var(GVAR_GIZMO_DEAD) == 0)) == 1) 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
						start_gdialog(SCRIPT_KANE, self_obj, 4, -1, -1);
						gsay_start;
						call Kane11;
						gsay_end;
						end_dialogue;
					end
					else begin
						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
							start_gdialog(SCRIPT_KANE, self_obj, 4, -1, -1);
							gsay_start;
							call Kane15;
							gsay_end;
							end_dialogue;
						end
						else begin
							start_gdialog(SCRIPT_KANE, self_obj, 4, -1, -1);
							gsay_start;
							call Kane60;
							gsay_end;
							end_dialogue;
						end
					end
				end
				else begin
					if (((global_var(GVAR_KILLIAN_DEAD) == 1) == 1) and ((global_var(GVAR_GIZMO_DEAD) == 1) == 0)) then begin
						start_gdialog(SCRIPT_KANE, self_obj, 4, -1, -1);
						gsay_start;
						call Kane12;
						gsay_end;
						end_dialogue;
					end
					else begin
						if (((global_var(GVAR_GIZMO_DEAD) == 1) == 1) and ((global_var(GVAR_KILLIAN_DEAD) == 1) == 0)) then begin
							start_gdialog(SCRIPT_KANE, self_obj, 4, -1, -1);
							gsay_start;
							call Kane13;
							gsay_end;
							end_dialogue;
						end
						else begin
							if (((global_var(GVAR_KILLIAN_DEAD) == 1) and (global_var(GVAR_GIZMO_DEAD) == 1)) == 1) then begin
								start_gdialog(SCRIPT_KANE, self_obj, 4, -1, -1);
								gsay_start;
								call Kane14;
								gsay_end;
								end_dialogue;
							end
							else begin
								start_gdialog(SCRIPT_KANE, self_obj, 4, -1, -1);
								gsay_start;
								call Kane60;
								gsay_end;
								end_dialogue;
							end
						end
					end
				end
			end
			else begin
				if ((map_var(44) == 1) or (map_var(11) == 1)) then begin
					call Kane10;
				end
				else begin
					if (map_var(45) == 2) then begin
						start_gdialog(SCRIPT_KANE, self_obj, 4, -1, -1);
						gsay_start;
						call Kane93;
						gsay_end;
						end_dialogue;
					end
					else begin
						if (map_var(45) == 5) then begin
							start_gdialog(SCRIPT_KANE, self_obj, 4, -1, -1);
							gsay_start;
							call Kane100;
							gsay_end;
							end_dialogue;
						end
						else begin
							if (map_var(45) == 4) then begin
								start_gdialog(SCRIPT_KANE, self_obj, 4, -1, -1);
								gsay_start;
								call Kane106;
								gsay_end;
								end_dialogue;
							end
							else begin
								if ((global_var(GVAR_KILL_MERCHANT) != 2) and (local_var(7) == 0)) then begin
									if (map_var(46) == 0) then begin
										start_gdialog(SCRIPT_KANE, self_obj, 4, -1, -1);
										gsay_start;
										call Kane60;
										gsay_end;
										end_dialogue;
									end
									else begin
										if (map_var(46) == 1) then begin
											start_gdialog(SCRIPT_KANE, self_obj, 4, -1, -1);
											gsay_start;
											call Kane10;
											gsay_end;
											end_dialogue;
										end
										else begin
											if (map_var(46) == 2) then begin
												if (global_var(GVAR_KILL_MERCHANT) == 5) then begin
													start_gdialog(SCRIPT_KANE, self_obj, 4, -1, -1);
													gsay_start;
													call Kane153;
													gsay_end;
													end_dialogue;
												end
												else begin
													start_gdialog(SCRIPT_KANE, self_obj, 4, -1, -1);
													gsay_start;
													call Kane86;
													gsay_end;
													end_dialogue;
												end
											end
											else begin
												if (map_var(46) == 4) then begin
													if (global_var(GVAR_KILL_MERCHANT) == 5) then begin
														start_gdialog(SCRIPT_KANE, self_obj, 4, -1, -1);
														gsay_start;
														call Kane153;
														gsay_end;
														end_dialogue;
													end
													else begin
														start_gdialog(SCRIPT_KANE, self_obj, 4, -1, -1);
														gsay_start;
														call Kane135;
														gsay_end;
														end_dialogue;
													end
												end
											end
										end
									end
								end
								else begin
									if ((global_var(GVAR_KILL_MERCHANT) == 2) and (local_var(7) == 0)) then begin
										if (map_var(46) == 0) then begin
											start_gdialog(SCRIPT_KANE, self_obj, 4, -1, -1);
											gsay_start;
											call Kane71;
											gsay_end;
											end_dialogue;
										end
										else begin
											if (map_var(46) == 1) then begin
												start_gdialog(SCRIPT_KANE, self_obj, 4, -1, -1);
												gsay_start;
												call Kane79;
												gsay_end;
												end_dialogue;
											end
											else begin
												if (map_var(46) == 2) then begin
													start_gdialog(SCRIPT_KANE, self_obj, 4, -1, -1);
													gsay_start;
													call Kane89;
													gsay_end;
													end_dialogue;
												end
												else begin
													if (map_var(46) == 4) then begin
														start_gdialog(SCRIPT_KANE, self_obj, 4, -1, -1);
														gsay_start;
														call Kane87;
														gsay_end;
														end_dialogue;
													end
												end
											end
										end
									end
									else begin
										if ((global_var(GVAR_KILL_JAIN) != 2) and (local_var(7) == 112)) then begin
											if (map_var(47) == 0) then begin
												start_gdialog(SCRIPT_KANE, self_obj, 4, -1, -1);
												gsay_start;
												call Kane134;
												gsay_end;
												end_dialogue;
											end
											else begin
												if (map_var(47) == 2) then begin
													start_gdialog(SCRIPT_KANE, self_obj, 4, -1, -1);
													gsay_start;
													call Kane10;
													gsay_end;
													end_dialogue;
												end
												else begin
													if (map_var(47) == 3) then begin
														start_gdialog(SCRIPT_KANE, self_obj, 4, -1, -1);
														gsay_start;
														call Kane91;
														gsay_end;
														end_dialogue;
													end
													else begin
														if (map_var(47) == 5) then begin
															start_gdialog(SCRIPT_KANE, self_obj, 4, -1, -1);
															gsay_start;
															call Kane135;
															gsay_end;
															end_dialogue;
														end
													end
												end
											end
										end
										else begin
											if ((global_var(GVAR_KILL_JAIN) == 2) and (local_var(7) == 112)) then begin
												if (map_var(47) == 0) then begin
													start_gdialog(SCRIPT_KANE, self_obj, 4, -1, -1);
													gsay_start;
													call Kane80;
													gsay_end;
													end_dialogue;
												end
												else begin
													if (map_var(47) == 2) then begin
														start_gdialog(SCRIPT_KANE, self_obj, 4, -1, -1);
														gsay_start;
														call Kane79;
														gsay_end;
														end_dialogue;
													end
													else begin
														if (map_var(47) == 3) then begin
															start_gdialog(SCRIPT_KANE, self_obj, 4, -1, -1);
															gsay_start;
															call Kane90;
															gsay_end;
															end_dialogue;
														end
														else begin
															if (map_var(47) == 5) then begin
																start_gdialog(SCRIPT_KANE, self_obj, 4, -1, -1);
																gsay_start;
																call Kane92;
																gsay_end;
																end_dialogue;
															end
															else begin
																if (map_var(47) == 6) then begin
																	start_gdialog(SCRIPT_KANE, self_obj, 4, -1, -1);
																	gsay_start;
																	call Kane134;
																	gsay_end;
																	end_dialogue;
																end
															end
														end
													end
												end
											end
										end
									end
								end
							end
						end
					end
				end
			end
		end
	end
end

procedure destroy_p_proc
begin
	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_BAD_MONSTER, global_var(GVAR_BAD_MONSTER) + 1);
		if ((global_var(GVAR_BAD_MONSTER) % 6) == 0) then begin
			set_global_var(GVAR_PLAYER_REPUTATION, global_var(GVAR_PLAYER_REPUTATION) + 1);
		end
	end
	set_map_var(49, 1);
	if ((map_var(49) == 1) and (map_var(50) == 1)) then begin
		set_global_var(GVAR_UNDERGROUND_STATUS, 1);
		set_map_var(11, 1);
		set_map_var(44, 1);
	end
end

procedure look_at_p_proc
begin
	script_overrides;
	display_msg(message_str(SCRIPT_KANE, 100));
end

procedure Kane00
begin
	giq_option(4, SCRIPT_KANE, 101, Kane02, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_KANE, 102, Kane04, BAD_REACTION);
	giq_option(4, SCRIPT_KANE, 104, Kane07, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_KANE, 105, KaneEndDeclined, NEUTRAL_REACTION);
	giq_option(-3, SCRIPT_KANE, 106, Kane01, NEUTRAL_REACTION);
end

procedure Kane01
begin
	gsay_message(SCRIPT_KANE, 107, NEUTRAL_REACTION);
	call KaneEndRefuses;
end

procedure Kane02
begin
	gsay_reply(SCRIPT_KANE, 108);
	giq_option(4, SCRIPT_KANE, 109, Kane03, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_KANE, 110, Kane06, NEUTRAL_REACTION);
	giq_option(6, SCRIPT_KANE, 111, Kane09, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_KANE, 112, Kane08, NEUTRAL_REACTION);
end

procedure Kane03
begin
	gsay_message(SCRIPT_KANE, 113, NEUTRAL_REACTION);
	call KaneTravel;
end

procedure Kane04
begin
	gsay_reply(SCRIPT_KANE, 114);
	giq_option(4, SCRIPT_KANE, 115, Kane02, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_KANE, 116, Kane05, BAD_REACTION);
end

procedure Kane05
begin
	if (dude_is_male) then begin
		gsay_reply(SCRIPT_KANE, 117);
	end
	else begin
		gsay_reply(SCRIPT_KANE, 118);
	end
	giq_option(4, SCRIPT_KANE, 119, KaneEndHostile, BAD_REACTION);
	giq_option(4, SCRIPT_KANE, 120, Kane02, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_KANE, 121, KaneEndNotAcceptedOrDeclined, NEUTRAL_REACTION);
end

procedure Kane06
begin
	gsay_message(SCRIPT_KANE, 123, NEUTRAL_REACTION);
	call KaneEndNotAcceptedOrDeclined;
end

procedure Kane07
begin
	gsay_message(SCRIPT_KANE, 124, NEUTRAL_REACTION);
	call KaneEndNotAcceptedOrDeclined;
end

procedure Kane08
begin
	gsay_reply(SCRIPT_KANE, 125);
	giq_option(4, SCRIPT_KANE, 126, Kane03, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_KANE, 127, KaneEndDeclined, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_KANE, 128, Kane06, NEUTRAL_REACTION);
end

procedure Kane09
begin
	gsay_reply(SCRIPT_KANE, 129);
	giq_option(4, SCRIPT_KANE, 130, KaneTravel, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_KANE, 131, KaneEndDeclined, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_KANE, 132, Kane06, NEUTRAL_REACTION);
end

procedure Kane10
begin
	if (local_var(5) < 3) then begin
		set_local_var(5, local_var(5) + 1);
		float_msg(self_obj, message_str(SCRIPT_KANE, random(133, 136)), FLOAT_MSG_RED);
	end
	else begin
		set_map_var(11, 1);
		set_map_var(45, 4);
		set_map_var(44, 1);
		float_msg(self_obj, message_str(SCRIPT_KANE, 137), FLOAT_MSG_RED);
		call combat;
	end
end

procedure Kane11
begin
	if (dude_is_male) then begin
		gsay_reply(SCRIPT_KANE, 138);
	end
	else begin
		gsay_reply(SCRIPT_KANE, 139);
	end
	call Kane00;
end

procedure Kane12
begin
	gsay_reply(SCRIPT_KANE, 140);
	call Kane00;
end

procedure Kane13
begin
	gsay_reply(SCRIPT_KANE, 141);
	call Kane00;
end

procedure Kane14
begin
	if (dude_is_male) then begin
		gsay_reply(SCRIPT_KANE, 143);
	end
	else begin
		gsay_reply(SCRIPT_KANE, 142);
	end
	call Kane00;
end

procedure Kane15
begin
	gsay_reply(SCRIPT_KANE, 144);
	call Kane16;
end

procedure Kane16
begin
	if (global_var(GVAR_FIND_WATER_CHIP) != 2) then begin
		giq_option(4, SCRIPT_KANE, 145, Kane17, NEUTRAL_REACTION);
	end
	if (global_var(GVAR_DECKER_KNOWN) == 1) then begin
		giq_option(4, SCRIPT_KANE, 146, Kane36, NEUTRAL_REACTION);
	end
	else begin
		giq_option(4, SCRIPT_KANE, 147, Kane32, NEUTRAL_REACTION);
	end
	giq_option(4, SCRIPT_KANE, 151, Kane29, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_KANE, 152, KaneEndNotAcceptedOrDeclined, NEUTRAL_REACTION);
	giq_option(-3, SCRIPT_KANE, 154, Kane01, NEUTRAL_REACTION);
	giq_option(-3, SCRIPT_KANE, 155, Kane01, NEUTRAL_REACTION);
end

procedure Kane17
begin
	gsay_reply(SCRIPT_KANE, 156);
	giq_option(6, SCRIPT_KANE, 157, Kane18, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_KANE, 158, Kane19, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_KANE, 159, Kane16, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_KANE, 160, KaneEndNotAcceptedOrDeclined, NEUTRAL_REACTION);
end

procedure Kane18
begin
	gsay_reply(SCRIPT_KANE, 161);
	call Kane16;
end

procedure Kane19
begin
	gsay_reply(SCRIPT_KANE, 162);
	call Kane16;
end

procedure Kane29
begin
	gsay_reply(SCRIPT_KANE, 200);
	giq_option(4, SCRIPT_KANE, 201, Kane59, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_KANE, 202, Kane31, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_KANE, 203, Kane30, NEUTRAL_REACTION);
end

procedure Kane30
begin
	gsay_reply(SCRIPT_KANE, 204);
	call Kane16;
end

procedure Kane31
begin
	gsay_message(SCRIPT_KANE, 205, BAD_REACTION);
	call KaneEndRefuses;
end

procedure Kane32
begin
	gsay_reply(SCRIPT_KANE, 206);
	giq_option(4, SCRIPT_KANE, 207, Kane33, BAD_REACTION);
	giq_option(4, SCRIPT_KANE, 208, Kane35, NEUTRAL_REACTION);
end

procedure Kane33
begin
	gsay_reply(SCRIPT_KANE, 209);
	giq_option(4, SCRIPT_KANE, 210, Kane34, BAD_REACTION);
	giq_option(4, SCRIPT_KANE, 211, Kane35, NEUTRAL_REACTION);
end

procedure Kane34
begin
	gsay_message(SCRIPT_KANE, 212, BAD_REACTION);
	call KaneEndHostile;
end

procedure Kane35
begin
	gsay_reply(SCRIPT_KANE, 213);
	call Kane16;
end

procedure Kane36
begin
	gsay_reply(SCRIPT_KANE, 214);
	giq_option(4, SCRIPT_KANE, 215, Kane41, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_KANE, 216, Kane39, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_KANE, 217, Kane36a, NEUTRAL_REACTION);
end

procedure Kane36a
begin
	if (is_success(roll_vs_skill(dude_obj, 14, -15))) then begin
		call Kane37;
	end
	else begin
		call Kane38;
	end
end

procedure Kane37
begin
	if (dude_is_male) then begin
		gsay_message(SCRIPT_KANE, 218, NEUTRAL_REACTION);
	end
	else begin
		gsay_message(SCRIPT_KANE, 219, NEUTRAL_REACTION);
	end
	call KaneTravel;
end

procedure Kane38
begin
	gsay_message(SCRIPT_KANE, 220, BAD_REACTION);
	call KaneEndTakeHike;
end

procedure Kane39
begin
	gsay_reply(SCRIPT_KANE, 221);
	giq_option(4, SCRIPT_KANE, 222, Kane41, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_KANE, 223, Kane40, NEUTRAL_REACTION);
end

procedure Kane40
begin
	gsay_message(SCRIPT_KANE, 224, NEUTRAL_REACTION);
	call KaneEndAnnoyed;
end

procedure Kane41
begin
	gsay_reply(SCRIPT_KANE, 225);
	if (map_var(33) == 1) then begin
		giq_option(4, SCRIPT_KANE, 226, Kane42, NEUTRAL_REACTION);
	end
	if (map_var(18) == 1) then begin
		giq_option(4, SCRIPT_KANE, 227, Kane41a, NEUTRAL_REACTION);
	end
	if (global_var(GVAR_Loxley_known) == 1) then begin
		giq_option(4, SCRIPT_KANE, 228, Kane47, NEUTRAL_REACTION);
	end
	giq_option(4, SCRIPT_KANE, 229, Kane45, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_KANE, 230, Kane44, NEUTRAL_REACTION);
end

procedure Kane41a
begin
	if (map_var(21) == 1) then begin
		call Kane57;
	end
	else begin
		if (is_success(roll_vs_skill(dude_obj, 14, -15))) then begin
			call Kane57;
		end
		else begin
			call Kane58;
		end
	end
end

procedure Kane42
begin
	gsay_reply(SCRIPT_KANE, 231);
	giq_option(4, SCRIPT_KANE, 232, Kane43, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_KANE, 233, Kane46, NEUTRAL_REACTION);
end

procedure Kane43
begin
	gsay_message(SCRIPT_KANE, 234, BAD_REACTION);
	call KaneEndAnnoyed;
end

procedure Kane44
begin
	gsay_message(SCRIPT_KANE, 235, BAD_REACTION);
	call KaneEndAnnoyed;
end

procedure Kane45
begin
	gsay_message(SCRIPT_KANE, 236, BAD_REACTION);
	call KaneEndHostile;
end

procedure Kane46
begin
	gsay_message(SCRIPT_KANE, 237, NEUTRAL_REACTION);
	call KaneEndAnnoyed;
end

procedure Kane47
begin
	gsay_reply(SCRIPT_KANE, 238);
	giq_option(4, SCRIPT_KANE, 239, Kane47a, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_KANE, 240, Kane49, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_KANE, 241, KaneEndRefuses, BAD_REACTION);
	giq_option(4, SCRIPT_KANE, 242, Kane48, NEUTRAL_REACTION);
end

procedure Kane47a
begin
	if (is_success(roll_vs_skill(dude_obj, 14, 0))) then begin
		call Kane50;
	end
	else begin
		call Kane53;
	end
end

procedure Kane48
begin
	gsay_message(SCRIPT_KANE, 243, BAD_REACTION);
	call KaneEndRefuses;
end

procedure Kane49
begin
	gsay_message(SCRIPT_KANE, 244, NEUTRAL_REACTION);
	call KaneTravel;
end

procedure Kane50
begin
	gsay_reply(SCRIPT_KANE, 245);
	giq_option(4, SCRIPT_KANE, 246, Kane51, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_KANE, 247, Kane52, NEUTRAL_REACTION);
end

procedure Kane51
begin
	gsay_message(SCRIPT_KANE, 248, BAD_REACTION);
	call KaneEndRefuses;
end

procedure Kane52
begin
	gsay_message(SCRIPT_KANE, 249, NEUTRAL_REACTION);
	call KaneTravel;
end

procedure Kane53
begin
	gsay_reply(SCRIPT_KANE, 250);
	giq_option(4, SCRIPT_KANE, 251, Kane55, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_KANE, 252, Kane54, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_KANE, 253, Kane56, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_KANE, 254, Kane54, NEUTRAL_REACTION);
end

procedure Kane54
begin
	gsay_message(SCRIPT_KANE, 255, NEUTRAL_REACTION);
	call KaneEndAnnoyed;
end

procedure Kane55
begin
	gsay_message(SCRIPT_KANE, 256, NEUTRAL_REACTION);
	call KaneEndAnnoyed;
end

procedure Kane56
begin
	gsay_message(SCRIPT_KANE, 257, NEUTRAL_REACTION);
	call KaneTravel;
end

procedure Kane57
begin
	gsay_message(SCRIPT_KANE, 258, NEUTRAL_REACTION);
	call KaneTravel;
end

procedure Kane58
begin
	gsay_message(SCRIPT_KANE, 259, BAD_REACTION);
	call KaneEndRefuses;
end

procedure Kane59
begin
	if (dude_is_male) then begin
		gsay_message(SCRIPT_KANE, 260, GOOD_REACTION);
	end
	else begin
		gsay_message(SCRIPT_KANE, 261, GOOD_REACTION);
	end
	call KaneEndNotAcceptedOrDeclined;
end

procedure Kane60
begin
	gsay_reply(SCRIPT_KANE, 262);
	call Kane16;
end

procedure Kane61
begin
	float_msg(self_obj, message_str(SCRIPT_KANE, 263), FLOAT_MSG_RED);
end

procedure Kane62
begin
	float_msg(self_obj, message_str(SCRIPT_KANE, 264), FLOAT_MSG_RED);
end

procedure Kane63
begin
	float_msg(self_obj, message_str(SCRIPT_KANE, 265), FLOAT_MSG_RED);
end

procedure Kane71
begin
	set_map_var(46, 6);
	gsay_reply(SCRIPT_KANE, 278);
	call Kane72;
end

procedure Kane72
begin
	giq_option(4, SCRIPT_KANE, 279, Kane73, BAD_REACTION);
	giq_option(4, SCRIPT_KANE, 280, Kane74, BAD_REACTION);
	giq_option(4, SCRIPT_KANE, 281, Kane78, BAD_REACTION);
end

procedure Kane73
begin
	gsay_message(SCRIPT_KANE, 282, BAD_REACTION);
	call KaneEndHostile;
end

procedure Kane74
begin
	gsay_message(SCRIPT_KANE, 283, BAD_REACTION);
	call KaneEndHostile;
end

procedure Kane75
begin
	variable LVar0 := 0;
	variable LVar1 := 0;
	set_map_var(46, 5);
	give_exp_points(300);
	display_msg(message_str(SCRIPT_GENCHAT, 103) + 300 + message_str(SCRIPT_GENCHAT, 104));
	set_global_var(GVAR_PLAYER_REPUTATION, global_var(GVAR_PLAYER_REPUTATION) - 1);
	LVar1 := item_caps_adjust(dude_obj, 1500);
	gsay_reply(SCRIPT_KANE, 284);
	giq_option(4, SCRIPT_KANE, 285, Kane75a, BAD_REACTION);
	giq_option(4, SCRIPT_KANE, 286, Kane76, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_KANE, 287, Kane77, BAD_REACTION);
	giq_option(-3, SCRIPT_KANE, 288, Kane78, BAD_REACTION);
end

procedure Kane75a
begin
	set_map_var(47, 6);
	call KaneEndRefuses;
end

procedure Kane76
begin
	gsay_message(SCRIPT_KANE, 289, NEUTRAL_REACTION);
	call KaneTravel;
end

procedure Kane77
begin
	gsay_message(SCRIPT_KANE, 290, BAD_REACTION);
	call KaneEndHostile;
end

procedure Kane78
begin
	gsay_message(SCRIPT_KANE, 291, BAD_REACTION);
	call KaneEndHostile;
end

procedure Kane79
begin
	set_map_var(46, 6);
	gsay_message(SCRIPT_KANE, 292, BAD_REACTION);
	call KaneEndHostile;
end

procedure Kane80
begin
	variable LVar0 := 0;
	variable LVar1 := 0;
	give_exp_points(350);
	display_msg(message_str(SCRIPT_GENCHAT, 103) + 350 + message_str(SCRIPT_GENCHAT, 104));
	set_global_var(GVAR_PLAYER_REPUTATION, global_var(GVAR_PLAYER_REPUTATION) - 1);
	LVar1 := item_caps_adjust(dude_obj, 1000);
	set_map_var(47, 7);
	gsay_reply(SCRIPT_KANE, 293);
	call Kane81;
end

procedure Kane81
begin
	giq_option(4, SCRIPT_KANE, 294, Kane82, BAD_REACTION);
	giq_option(4, SCRIPT_KANE, 295, Kane83, BAD_REACTION);
	giq_option(-3, SCRIPT_KANE, 296, Kane84, BAD_REACTION);
end

procedure Kane82
begin
	gsay_message(SCRIPT_KANE, 297, BAD_REACTION);
	call KaneEndRefuses;
end

procedure Kane83
begin
	gsay_message(SCRIPT_KANE, 298, BAD_REACTION);
	call KaneEndRefuses;
end

procedure Kane84
begin
	gsay_message(SCRIPT_KANE, 299, BAD_REACTION);
	call KaneEndRefuses;
end

procedure Kane85
begin
	float_msg(self_obj, message_str(SCRIPT_KANE, 300), FLOAT_MSG_RED);
end

procedure Kane86
begin
	variable LVar0 := 0;
	set_map_var(46, 4);
	set_global_var(GVAR_MARK_HUB_4, 1);
	LVar0 := item_caps_adjust(dude_obj, 500);
	gsay_message(SCRIPT_KANE, 301, NEUTRAL_REACTION);
end

procedure Kane87
begin
	variable LVar0 := 0;
	LVar0 := item_caps_adjust(dude_obj, 2500);
	give_exp_points(600);
	display_msg(message_str(SCRIPT_GENCHAT, 103) + 600 + message_str(SCRIPT_GENCHAT, 104));
	set_global_var(GVAR_PLAYER_REPUTATION, global_var(GVAR_PLAYER_REPUTATION) - 2);
	set_map_var(46, 5);
	set_local_var(7, 112);
	gsay_message(SCRIPT_KANE, 302, NEUTRAL_REACTION);
end

procedure Kane88
begin
	variable LVar0 := 0;
	LVar0 := item_caps_adjust(dude_obj, 3500);
	give_exp_points(600);
	display_msg(message_str(SCRIPT_GENCHAT, 103) + 600 + message_str(SCRIPT_GENCHAT, 104));
	set_global_var(GVAR_PLAYER_REPUTATION, global_var(GVAR_PLAYER_REPUTATION) - 2);
	set_map_var(46, 5);
	set_map_var(47, 5);
	set_local_var(7, 112);
	set_global_var(GVAR_KILL_JAIN, 1);
	gsay_message(SCRIPT_KANE, 303, NEUTRAL_REACTION);
end

procedure Kane89
begin
	variable LVar0 := 0;
	LVar0 := item_caps_adjust(dude_obj, 3000);
	give_exp_points(600);
	display_msg(message_str(SCRIPT_GENCHAT, 103) + 600 + message_str(SCRIPT_GENCHAT, 104));
	set_global_var(GVAR_PLAYER_REPUTATION, global_var(GVAR_PLAYER_REPUTATION) - 2);
	set_map_var(46, 5);
	set_local_var(7, 112);
	gsay_message(SCRIPT_KANE, 304, NEUTRAL_REACTION);
end

procedure Kane90
begin
	variable LVar0 := 0;
	LVar0 := item_caps_adjust(dude_obj, 5000);
	give_exp_points(700);
	display_msg(message_str(SCRIPT_GENCHAT, 103) + 700 + message_str(SCRIPT_GENCHAT, 104));
	set_global_var(GVAR_PLAYER_REPUTATION, global_var(GVAR_PLAYER_REPUTATION) - 2);
	set_map_var(47, 6);
	gsay_message(SCRIPT_KANE, 305, NEUTRAL_REACTION);
	gsay_message(SCRIPT_KANE, 306, NEUTRAL_REACTION);
end

procedure Kane91
begin
	variable LVar0 := 0;
	set_global_var(GVAR_MARK_HUB_6, 1);
	LVar0 := item_caps_adjust(dude_obj, 1000);
	set_map_var(47, 5);
	gsay_message(SCRIPT_KANE, 308, NEUTRAL_REACTION);
end

procedure Kane92
begin
	variable LVar0 := 0;
	LVar0 := item_caps_adjust(dude_obj, 4000);
	give_exp_points(700);
	display_msg(message_str(SCRIPT_GENCHAT, 103) + 700 + message_str(SCRIPT_GENCHAT, 104));
	set_global_var(GVAR_PLAYER_REPUTATION, global_var(GVAR_PLAYER_REPUTATION) - 2);
	set_map_var(47, 6);
	gsay_message(SCRIPT_KANE, 309, NEUTRAL_REACTION);
end

procedure Kane93
begin
	gsay_reply(SCRIPT_KANE, 310);
	giq_option(4, SCRIPT_KANE, 311, Kane95, NEUTRAL_REACTION);
	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
		giq_option(4, SCRIPT_KANE, 312, Kane148, BAD_REACTION);
	end
	giq_option(4, SCRIPT_KANE, 313, Kane93a, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_KANE, 314, Kane149, BAD_REACTION);
	giq_option(-3, SCRIPT_KANE, 315, Kane94, NEUTRAL_REACTION);
	giq_option(-3, SCRIPT_KANE, 316, Kane94, NEUTRAL_REACTION);
end

procedure Kane93a
begin
	if (is_success(roll_vs_skill(dude_obj, 14, 0))) then begin
		call Kane151;
	end
	else begin
		call Kane152;
	end
end

procedure Kane94
begin
	gsay_message(SCRIPT_KANE, 317, NEUTRAL_REACTION);
	call KaneEndRefuses;
end

procedure Kane95
begin
	gsay_reply(SCRIPT_KANE, 318);
	giq_option(4, SCRIPT_KANE, 319, Kane98, BAD_REACTION);
	giq_option(4, SCRIPT_KANE, 320, Kane99, BAD_REACTION);
	giq_option(4, SCRIPT_KANE, 321, Kane97, BAD_REACTION);
	giq_option(4, SCRIPT_KANE, 322, Kane98, BAD_REACTION);
	if (map_var(48) == 1) then begin
		giq_option(4, SCRIPT_KANE, 323, Kane96, BAD_REACTION);
	end
end

procedure Kane96
begin
	gsay_message(SCRIPT_KANE, 324, BAD_REACTION);
	call KaneEndHostile;
end

procedure Kane97
begin
	gsay_message(SCRIPT_KANE, 325, BAD_REACTION);
	call KaneEndRefuses;
end

procedure Kane98
begin
	gsay_message(SCRIPT_KANE, 326, BAD_REACTION);
	call KaneEndRefuses;
end

procedure Kane99
begin
	gsay_message(SCRIPT_KANE, 327, BAD_REACTION);
	call KaneEndHostile;
end

procedure Kane100
begin
	gsay_reply(SCRIPT_KANE, 328);
	giq_option(4, SCRIPT_KANE, 330, Kane103, BAD_REACTION);
	giq_option(4, SCRIPT_KANE, 331, Kane102, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_KANE, 332, Kane104, BAD_REACTION);
	giq_option(4, SCRIPT_KANE, 333, Kane105, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_KANE, 334, Kane101, NEUTRAL_REACTION);
end

procedure Kane101
begin
	gsay_message(SCRIPT_KANE, 335, NEUTRAL_REACTION);
	call KaneEnd;
end

procedure Kane102
begin
	gsay_message(SCRIPT_KANE, 336, NEUTRAL_REACTION);
	call KaneTravel;
end

procedure Kane103
begin
	gsay_message(SCRIPT_KANE, 337, BAD_REACTION);
	call KaneEndHostile;
end

procedure Kane104
begin
	gsay_message(SCRIPT_KANE, 338, BAD_REACTION);
	call KaneEndHostile;
end

procedure Kane105
begin
	gsay_message(SCRIPT_KANE, 339, BAD_REACTION);
	call KaneEndHostile;
end

procedure Kane106
begin
	gsay_reply(SCRIPT_KANE, 340);
	if (map_var(21) == 1) then begin
		giq_option(4, SCRIPT_KANE, 341, Kane57, NEUTRAL_REACTION);
	end
	else begin
		giq_option(4, SCRIPT_KANE, 343, Kane132, NEUTRAL_REACTION);
	end
	giq_option(4, SCRIPT_KANE, 344, KaneEnd, NEUTRAL_REACTION);
	giq_option(-3, SCRIPT_KANE, 345, Kane101, NEUTRAL_REACTION);
end

procedure Kane131
begin
	gsay_message(SCRIPT_KANE, random(403, 407), NEUTRAL_REACTION);
	call KaneTravel;
end

procedure Kane132
begin
	gsay_message(SCRIPT_KANE, 408, NEUTRAL_REACTION);
	call KaneEndTakeHike;
end

procedure Kane133
begin
	giq_option(4, SCRIPT_KANE, 409, Kane131, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_KANE, 411, KaneEnd, NEUTRAL_REACTION);
	giq_option(-3, SCRIPT_KANE, 412, Kane101, NEUTRAL_REACTION);
end

procedure Kane134
begin
	gsay_reply(SCRIPT_KANE, 413);
	call Kane133;
end

procedure Kane135
begin
	gsay_message(SCRIPT_KANE, 415, BAD_REACTION);
end

procedure Kane136
begin
	gsay_message(SCRIPT_KANE, 417, BAD_REACTION);
end

procedure Kane137
begin
	gsay_message(SCRIPT_KANE, 418, BAD_REACTION);
end

procedure Kane138
begin
	gsay_reply(SCRIPT_KANE, 420);
	giq_option(4, SCRIPT_KANE, 423, Kane139, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_KANE, 424, KaneEnd, NEUTRAL_REACTION);
	giq_option(-3, SCRIPT_KANE, 425, KaneEnd, NEUTRAL_REACTION);
end

procedure Kane139
begin
	gsay_reply(SCRIPT_KANE, 426);
	giq_option(4, SCRIPT_KANE, 427, Kane140, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_KANE, 428, KaneEndHostile, NEUTRAL_REACTION);
end

procedure Kane140
begin
	gsay_message(SCRIPT_KANE, 429, NEUTRAL_REACTION);
end

procedure Kane146
begin
	float_msg(self_obj, message_str(SCRIPT_KANE, 449), FLOAT_MSG_RED);
end

procedure Kane147
begin
	float_msg(self_obj, message_str(SCRIPT_KANE, 451), FLOAT_MSG_RED);
end

procedure Kane148
begin
	gsay_message(SCRIPT_KANE, 453, BAD_REACTION);
	call KaneEndHostile;
end

procedure Kane149
begin
	gsay_message(SCRIPT_KANE, 454, BAD_REACTION);
	call KaneEndHostile;
end

procedure Kane150
begin
	display_msg(message_str(SCRIPT_KANE, 455));
end

procedure Kane151
begin
	gsay_message(SCRIPT_KANE, 456, NEUTRAL_REACTION);
	call KaneTravel;
end

procedure Kane152
begin
	gsay_message(SCRIPT_KANE, 457, NEUTRAL_REACTION);
	call KaneEndRefuses;
end

procedure Kane153
begin
	gsay_reply(SCRIPT_KANE, 458);
	giq_option(4, SCRIPT_KANE, 459, Kane154, NEUTRAL_REACTION);
	giq_option(-3, SCRIPT_KANE, 460, Kane154, NEUTRAL_REACTION);
end

procedure Kane154
begin
	gsay_reply(SCRIPT_KANE, 461);
	giq_option(4, SCRIPT_KANE, 462, Kane155, NEUTRAL_REACTION);
	giq_option(-3, SCRIPT_KANE, 463, Kane155, NEUTRAL_REACTION);
end

procedure Kane155
begin
	gsay_message(SCRIPT_KANE, 464, BAD_REACTION);
	call KaneEndHostile;
end

procedure KaneEnd
begin
end

procedure KaneEndHostile
begin
	set_map_var(11, 1);
	set_map_var(44, 1);
	set_map_var(45, 4);
end

procedure KaneEndNotAcceptedOrDeclined
begin
	set_map_var(45, 3);
end

procedure KaneEndDeclined
begin
	set_map_var(45, 2);
end

procedure KaneEndAnnoyed
begin
	set_map_var(45, 6);
end

procedure KaneEndTakeHike
begin
	set_map_var(45, 5);
end

procedure KaneEndRefuses
begin
	set_map_var(45, 4);
	set_map_var(11, 1);
end

procedure KaneTravel
begin
	travel := 1;
end

procedure GoToDecker
begin
	set_map_var(45, 1);
	gfade_out(1000);
	move_to(self_obj, 22526, 1);
	anim(self_obj, 1000, rotation_to_tile(tile_num(self_obj), tile_num(Decker_Ptr)));
	move_to(dude_obj, 23722, 1);
	anim(dude_obj, 1000, rotation_to_tile(tile_num(dude_obj), tile_num(Decker_Ptr)));
	gfade_in(1000);
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