#include <define.h>

//#define NAME                    SCRIPT_

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



procedure start;
#include <push.h>
procedure use_p_proc;
procedure use_skill_on_p_proc;
procedure use_obj_on_p_proc;
procedure look_at_p_proc;
procedure description_p_proc;
procedure damage_p_proc;
procedure map_enter_p_proc;
procedure map_update_p_proc;
procedure Trapped_And_Locked;
procedure Locked_Door;
procedure Trapped_Door;
procedure Damage_Dude;
procedure Skill_Checks;
procedure Stat_Checks;
procedure Locks_Check;
procedure Display_Armed_And_Locked;
procedure Display_Locked;
procedure Display_Trapped;

variable Only_Once;
variable Locks;
variable Traps;
variable Per;


procedure start
begin
	if (script_action == use_proc) then begin
		call use_p_proc;
	end
	else begin
		if (script_action == map_enter_proc) then begin
			call map_enter_p_proc;
		end
		else begin
			if (script_action == map_update_proc) then begin
				call map_update_p_proc;
			end
			else begin
				if (script_action == use_obj_on_proc) then begin
					call use_obj_on_p_proc;
				end
				else begin
					if (script_action == look_at_proc) then begin
						call look_at_p_proc;
					end
					else begin
						if (script_action == description_proc) then begin
							call description_p_proc;
						end
						else begin
							if (script_action == use_skill_on_proc) then begin
								call use_skill_on_p_proc;
							end
							else begin
								if (script_action == damage_proc) then begin
									call damage_p_proc;
								end
							end
						end
					end
				end
			end
		end
	end
end

procedure use_p_proc
begin
	variable LVar0 := 0;
	LVar0 := roll_vs_skill(source_obj, 11, -20);
	if (global_var(GVAR_GLOW_POWER) == 0) then begin
		script_overrides;
		display_msg(message_str(SCRIPT_GLORDDOR, 205));
	end
	else begin
		if (local_var(2) == 0) then begin
			if (is_success(LVar0)) then begin
				script_overrides;
				display_msg(message_str(SCRIPT_GLORDDOR, 204));
				reg_anim_func(2, source_obj);
			end
			else begin
				if (obj_is_locked(self_obj)) then begin
					script_overrides;
					set_local_var(0, local_var(0) + 1);
					call Damage_Dude;
				end
				else begin
					script_overrides;
					set_local_var(0, local_var(0) + 1);
					call Damage_Dude;
				end
			end
		end
		else begin
			if (local_var(3) == 0) then begin
				script_overrides;
				display_msg(message_str(SCRIPT_GLORDDOR, 105));
			end
		end
	end
end

procedure use_skill_on_p_proc
begin
	if ((local_var(2) == 0) and obj_is_locked(self_obj)) then begin
		call Trapped_And_Locked;
	end
	else begin
		if (local_var(2) == 0) then begin
			call Trapped_Door;
		end
		else begin
			if (obj_is_locked(self_obj)) then begin
				call Locked_Door;
			end
		end
	end
end

procedure use_obj_on_p_proc
begin
	variable LVar0 := 0;
	variable LVar1 := 0;
	variable LVar2 := 0;
	LVar0 := obj_pid(obj_being_used_with);
	if (LVar0 == 77) then begin
		script_overrides;
		if (local_var(2) == 0) then begin
			LVar1 := roll_vs_skill(source_obj, 11, -20);
			if (is_success(LVar1)) then begin
				display_msg(204);
				reg_anim_func(2, source_obj);
			end
			else begin
				set_local_var(0, local_var(0) + 1);
				call Damage_Dude;
			end
		end
		if (obj_is_locked(self_obj)) then begin
			LVar2 := roll_vs_skill(source_obj, 9, -10);
			if (is_success(LVar2)) then begin
				obj_unlock(self_obj);
				set_local_var(3, 1);
				display_msg(message_str(SCRIPT_GLORDDOR, 109));
				display_msg(message_str(SCRIPT_GENCHAT, 103) + "45" + message_str(SCRIPT_GENCHAT, 104));
				give_exp_points(45);
			end
			else begin
				if (is_critical(LVar2)) then begin
					display_msg(message_str(SCRIPT_GLORDDOR, 121));
					jam_lock(self_obj);
					display_msg(message_str(SCRIPT_GLORDDOR, 110));
					rm_obj_from_inven(source_obj, LVar0);
					destroy_object(LVar0);
				end
				else begin
					display_msg(message_str(SCRIPT_GLORDDOR, 122));
				end
			end
		end
	end
	else begin
		if (LVar0 == 96) then begin
			script_overrides;
			set_local_var(2, 1);
			obj_unlock(self_obj);
			set_local_var(3, 1);
			display_msg(message_str(SCRIPT_GLORDDOR, 106));
		end
	end
end

procedure look_at_p_proc
begin
	script_overrides;
	display_msg(message_str(SCRIPT_GLORDDOR, 123));
end

procedure description_p_proc
begin
	script_overrides;
	if ((local_var(3) == 0) and (local_var(2) == 0)) then begin
		call Skill_Checks;
		call Display_Armed_And_Locked;
	end
	else begin
		if (local_var(2) == 0) then begin
			call Skill_Checks;
			call Display_Trapped;
		end
		else begin
			if (local_var(3) == 0) then begin
				call Locks_Check;
				call Display_Locked;
			end
			else begin
				display_msg(message_str(SCRIPT_GLORDDOR, 123));
			end
		end
	end
end

procedure damage_p_proc
begin
	if (local_var(1) > 3) then begin
		set_local_var(2, 1);
		set_obj_visibility(self_obj, 1);
		obj_open(self_obj);
		set_local_var(3, 1);
	end
end

procedure map_enter_p_proc
begin
	if (local_var(3) == 0) then begin
		obj_lock(self_obj);
	end
end

procedure map_update_p_proc
begin
	if (local_var(3) == 0) then begin
		obj_lock(self_obj);
	end
	else begin
		obj_unlock(self_obj);
	end
end

procedure Trapped_And_Locked
begin
	variable LVar0 := 0;
	variable LVar1 := 0;
	if (action_being_used == 11) then begin
		script_overrides;
		LVar0 := roll_vs_skill(source_obj, 11, -20);
		if (is_success(LVar0)) then begin
			display_msg(message_str(SCRIPT_GLORDDOR, 113));
			set_local_var(2, 1);
			display_msg(message_str(SCRIPT_GENCHAT, 103) + "45" + message_str(SCRIPT_GENCHAT, 104));
			give_exp_points(45);
		end
		else begin
			if (is_critical(LVar0)) then begin
				display_msg(message_str(SCRIPT_GLORDDOR, 114));
				jam_lock(self_obj);
				display_msg(message_str(SCRIPT_GLORDDOR, 110));
				if (local_var(0) == 0) then begin
					set_local_var(0, 4);
				end
				else begin
					set_local_var(0, local_var(0) + 4);
				end
				call Damage_Dude;
			end
			else begin
				set_local_var(0, local_var(0) + 1);
				display_msg(message_str(SCRIPT_GLORDDOR, 115));
				call Damage_Dude;
			end
		end
	end
	else begin
		if (action_being_used == 9) then begin
			script_overrides;
			LVar0 := roll_vs_skill(source_obj, 9, -30);
			LVar1 := roll_vs_skill(source_obj, 11, -20);
			if (is_success(LVar1)) then begin
				if (is_success(LVar0)) then begin
					obj_unlock(self_obj);
					set_local_var(3, 1);
					display_msg(message_str(SCRIPT_GLORDDOR, 116));
					display_msg(message_str(SCRIPT_GENCHAT, 103) + "55" + message_str(SCRIPT_GENCHAT, 104));
					give_exp_points(55);
				end
				else begin
					if (is_critical(LVar0)) then begin
						jam_lock(self_obj);
						display_msg(message_str(SCRIPT_GLORDDOR, 110));
						set_local_var(0, local_var(0) + 2);
						display_msg(message_str(SCRIPT_GLORDDOR, 117));
						call Damage_Dude;
					end
					else begin
						set_local_var(0, local_var(0) + 1);
						display_msg(message_str(SCRIPT_GLORDDOR, 118));
						call Damage_Dude;
					end
				end
			end
			else begin
				if (is_critical(LVar1)) then begin
					display_msg(message_str(SCRIPT_GLORDDOR, 120));
					if (local_var(0) == 0) then begin
						set_local_var(0, 4);
					end
					else begin
						set_local_var(0, local_var(0) + 4);
					end
					call Damage_Dude;
				end
				else begin
					set_local_var(0, local_var(0) + 1);
					display_msg(message_str(SCRIPT_GLORDDOR, 119));
					call Damage_Dude;
				end
			end
		end
	end
end

procedure Locked_Door
begin
	variable LVar0 := 0;
	if (action_being_used == 9) then begin
		script_overrides;
		LVar0 := roll_vs_skill(source_obj, 9, -30);
		if (is_success(LVar0)) then begin
			obj_unlock(self_obj);
			set_local_var(3, 1);
			display_msg(message_str(SCRIPT_GLORDDOR, 116));
			display_msg(message_str(SCRIPT_GENCHAT, 103) + "55" + message_str(SCRIPT_GENCHAT, 104));
			give_exp_points(55);
		end
		else begin
			if (is_critical(LVar0)) then begin
				display_msg(message_str(SCRIPT_GLORDDOR, 121));
				jam_lock(self_obj);
				display_msg(message_str(SCRIPT_GLORDDOR, 110));
				game_time_advance(game_ticks(600));
			end
			else begin
				display_msg(message_str(SCRIPT_GLORDDOR, 122));
			end
		end
	end
end

procedure Trapped_Door
begin
	variable LVar0 := 0;
	if (action_being_used == 11) then begin
		script_overrides;
		LVar0 := roll_vs_skill(source_obj, 11, -20);
		if (is_success(LVar0)) then begin
			display_msg(message_str(SCRIPT_GLORDDOR, 113));
			set_local_var(2, 1);
			display_msg(message_str(SCRIPT_GENCHAT, 103) + "45" + message_str(SCRIPT_GENCHAT, 104));
			give_exp_points(45);
		end
		else begin
			if (is_critical(LVar0)) then begin
				display_msg(message_str(SCRIPT_GLORDDOR, 114));
				if (local_var(0) == 0) then begin
					set_local_var(0, 4);
				end
				else begin
					set_local_var(0, local_var(0) + 4);
				end
				call Damage_Dude;
			end
			else begin
				set_local_var(0, local_var(0) + 1);
				display_msg(message_str(SCRIPT_GLORDDOR, 115));
				call Damage_Dude;
			end
		end
	end
end

procedure Damage_Dude
begin
	critter_dmg(source_obj, local_var(0), 4 bwor 256);
	if (local_var(0) == 1) then begin
		display_msg(message_str(SCRIPT_GLORDDOR, 101));
	end
	else begin
		display_msg(message_str(SCRIPT_GLORDDOR, 102) + local_var(0) + message_str(SCRIPT_GLORDDOR, 103));
	end
end

procedure Skill_Checks
begin
	variable LVar0 := 0;
	variable LVar1 := 0;
	variable LVar2 := 0;
	LVar0 := roll_vs_skill(source_obj, 11, 0);
	LVar1 := roll_vs_skill(source_obj, 9, -10);
	LVar2 := do_check(source_obj, 1, 0);
	if (is_success(LVar0)) then begin
		if (is_critical(LVar0)) then begin
			call Locks_Check;
			Traps := 3;
		end
		else begin
			call Locks_Check;
			Traps := 2;
		end
	end
	else begin
		if (is_critical(LVar0)) then begin
			call Locks_Check;
			Traps := 0;
		end
		else begin
			call Locks_Check;
			Traps := 1;
		end
	end
end

procedure Stat_Checks
begin
	variable LVar0 := 0;
	LVar0 := do_check(source_obj, 1, 0);
	if (is_success(LVar0)) then begin
		if (is_critical(LVar0)) then begin
			Per := 3;
		end
		else begin
			Per := 2;
		end
	end
	else begin
		if (is_critical(LVar0)) then begin
			Per := 0;
		end
		else begin
			Per := 1;
		end
	end
end

procedure Locks_Check
begin
	variable LVar0 := 0;
	variable LVar1 := 0;
	LVar0 := roll_vs_skill(source_obj, 9, -10);
	LVar1 := do_check(source_obj, 1, 0);
	if (is_success(LVar0)) then begin
		if (is_critical(LVar0)) then begin
			call Stat_Checks;
			Locks := 3;
		end
		else begin
			call Stat_Checks;
			Locks := 2;
		end
	end
	else begin
		if (is_critical(LVar0)) then begin
			call Stat_Checks;
			Locks := 0;
		end
		else begin
			call Stat_Checks;
			Locks := 1;
		end
	end
end

procedure Display_Armed_And_Locked
begin
	if (Per == 0) then begin
		if (Locks == 0) then begin
			if (Traps == 0) then begin
				display_msg(message_str(SCRIPT_GLORDDOR, 124));
			end
			else begin
				if (Traps == 1) then begin
					display_msg(message_str(SCRIPT_GLORDDOR, 125));
				end
				else begin
					if (Traps == 2) then begin
						display_msg(message_str(SCRIPT_GLORDDOR, 126));
					end
					else begin
						display_msg(message_str(SCRIPT_GLORDDOR, 127));
					end
				end
			end
		end
		else begin
			if (Locks == 1) then begin
				if (Traps == 0) then begin
					display_msg(message_str(SCRIPT_GLORDDOR, 128));
				end
				else begin
					if (Traps == 1) then begin
						display_msg(message_str(SCRIPT_GLORDDOR, 129));
					end
					else begin
						if (Traps == 2) then begin
							display_msg(message_str(SCRIPT_GLORDDOR, 130));
						end
						else begin
							display_msg(message_str(SCRIPT_GLORDDOR, 131));
						end
					end
				end
			end
			else begin
				if (Locks == 2) then begin
					if (Traps == 0) then begin
						display_msg(message_str(SCRIPT_GLORDDOR, 132));
					end
					else begin
						if (Traps == 1) then begin
							display_msg(message_str(SCRIPT_GLORDDOR, 133));
						end
						else begin
							if (Traps == 2) then begin
								display_msg(message_str(SCRIPT_GLORDDOR, 134));
							end
							else begin
								display_msg(message_str(SCRIPT_GLORDDOR, 135));
							end
						end
					end
				end
				else begin
					if (Traps == 0) then begin
						display_msg(message_str(SCRIPT_GLORDDOR, 136));
					end
					else begin
						if (Traps == 1) then begin
							display_msg(message_str(SCRIPT_GLORDDOR, 137));
						end
						else begin
							if (Traps == 2) then begin
								display_msg(message_str(SCRIPT_GLORDDOR, 138));
							end
							else begin
								display_msg(message_str(SCRIPT_GLORDDOR, 139));
							end
						end
					end
				end
			end
		end
	end
	else begin
		if (Per == 1) then begin
			if (Locks == 0) then begin
				if (Traps == 0) then begin
					display_msg(message_str(SCRIPT_GLORDDOR, 140));
				end
				else begin
					if (Traps == 1) then begin
						display_msg(message_str(SCRIPT_GLORDDOR, 141));
					end
					else begin
						if (Traps == 2) then begin
							display_msg(message_str(SCRIPT_GLORDDOR, 142));
						end
						else begin
							display_msg(message_str(SCRIPT_GLORDDOR, 143));
						end
					end
				end
			end
			else begin
				if (Locks == 1) then begin
					if (Traps == 0) then begin
						display_msg(message_str(SCRIPT_GLORDDOR, 144));
					end
					else begin
						if (Traps == 1) then begin
							display_msg(message_str(SCRIPT_GLORDDOR, 145));
						end
						else begin
							if (Traps == 2) then begin
								display_msg(message_str(SCRIPT_GLORDDOR, 146));
							end
							else begin
								display_msg(message_str(SCRIPT_GLORDDOR, 147));
							end
						end
					end
				end
				else begin
					if (Locks == 2) then begin
						if (Traps == 0) then begin
							display_msg(message_str(SCRIPT_GLORDDOR, 148));
						end
						else begin
							if (Traps == 1) then begin
								display_msg(message_str(SCRIPT_GLORDDOR, 149));
							end
							else begin
								if (Traps == 2) then begin
									display_msg(message_str(SCRIPT_GLORDDOR, 150));
								end
								else begin
									display_msg(message_str(SCRIPT_GLORDDOR, 151));
								end
							end
						end
					end
					else begin
						if (Traps == 0) then begin
							display_msg(message_str(SCRIPT_GLORDDOR, 152));
						end
						else begin
							if (Traps == 1) then begin
								display_msg(message_str(SCRIPT_GLORDDOR, 153));
							end
							else begin
								if (Traps == 2) then begin
									display_msg(message_str(SCRIPT_GLORDDOR, 154));
								end
								else begin
									display_msg(message_str(SCRIPT_GLORDDOR, 155));
								end
							end
						end
					end
				end
			end
		end
		else begin
			if (Per == 2) then begin
				if (Locks == 0) then begin
					if (Traps == 0) then begin
						display_msg(message_str(SCRIPT_GLORDDOR, 156));
					end
					else begin
						if (Traps == 1) then begin
							display_msg(message_str(SCRIPT_GLORDDOR, 157));
						end
						else begin
							if (Traps == 2) then begin
								display_msg(message_str(SCRIPT_GLORDDOR, 158));
							end
							else begin
								display_msg(message_str(SCRIPT_GLORDDOR, 159));
							end
						end
					end
				end
				else begin
					if (Locks == 1) then begin
						if (Traps == 0) then begin
							display_msg(message_str(SCRIPT_GLORDDOR, 160));
						end
						else begin
							if (Traps == 1) then begin
								display_msg(message_str(SCRIPT_GLORDDOR, 161));
							end
							else begin
								if (Traps == 2) then begin
									display_msg(message_str(SCRIPT_GLORDDOR, 162));
								end
								else begin
									display_msg(message_str(SCRIPT_GLORDDOR, 163));
								end
							end
						end
					end
					else begin
						if (Locks == 2) then begin
							if (Traps == 0) then begin
								display_msg(message_str(SCRIPT_GLORDDOR, 164));
							end
							else begin
								if (Traps == 1) then begin
									display_msg(message_str(SCRIPT_GLORDDOR, 165));
								end
								else begin
									if (Traps == 2) then begin
										display_msg(message_str(SCRIPT_GLORDDOR, 166));
									end
									else begin
										display_msg(message_str(SCRIPT_GLORDDOR, 167));
									end
								end
							end
						end
						else begin
							if (Traps == 0) then begin
								display_msg(message_str(SCRIPT_GLORDDOR, 168));
							end
							else begin
								if (Traps == 1) then begin
									display_msg(message_str(SCRIPT_GLORDDOR, 169));
								end
								else begin
									if (Traps == 2) then begin
										display_msg(message_str(SCRIPT_GLORDDOR, 170));
									end
									else begin
										display_msg(message_str(SCRIPT_GLORDDOR, 171));
									end
								end
							end
						end
					end
				end
			end
			else begin
				if (Locks == 0) then begin
					if (Traps == 0) then begin
						display_msg(message_str(SCRIPT_GLORDDOR, 172));
					end
					else begin
						if (Traps == 1) then begin
							display_msg(message_str(SCRIPT_GLORDDOR, 173));
						end
						else begin
							if (Traps == 2) then begin
								display_msg(message_str(SCRIPT_GLORDDOR, 174));
							end
							else begin
								display_msg(message_str(SCRIPT_GLORDDOR, 175));
							end
						end
					end
				end
				else begin
					if (Locks == 1) then begin
						if (Traps == 0) then begin
							display_msg(message_str(SCRIPT_GLORDDOR, 176));
						end
						else begin
							if (Traps == 1) then begin
								display_msg(message_str(SCRIPT_GLORDDOR, 177));
							end
							else begin
								if (Traps == 2) then begin
									display_msg(message_str(SCRIPT_GLORDDOR, 178));
								end
								else begin
									display_msg(message_str(SCRIPT_GLORDDOR, 179));
								end
							end
						end
					end
					else begin
						if (Locks == 2) then begin
							if (Traps == 0) then begin
								display_msg(message_str(SCRIPT_GLORDDOR, 180));
							end
							else begin
								if (Traps == 1) then begin
									display_msg(message_str(SCRIPT_GLORDDOR, 181));
								end
								else begin
									if (Traps == 2) then begin
										display_msg(message_str(SCRIPT_GLORDDOR, 182));
									end
									else begin
										display_msg(message_str(SCRIPT_GLORDDOR, 183));
									end
								end
							end
						end
						else begin
							if (Traps == 0) then begin
								display_msg(message_str(SCRIPT_GLORDDOR, 184));
							end
							else begin
								if (Traps == 1) then begin
									display_msg(message_str(SCRIPT_GLORDDOR, 185));
								end
								else begin
									if (Traps == 2) then begin
										display_msg(message_str(SCRIPT_GLORDDOR, 186));
									end
									else begin
										display_msg(message_str(SCRIPT_GLORDDOR, 187));
									end
								end
							end
						end
					end
				end
			end
		end
	end
end

procedure Display_Locked
begin
	if (Per == 0) then begin
		if (Locks == 0) then begin
			display_msg(message_str(SCRIPT_GLORDDOR, 124));
		end
		else begin
			if (Locks == 1) then begin
				display_msg(message_str(SCRIPT_GLORDDOR, 128));
			end
			else begin
				if (Locks == 2) then begin
					display_msg(message_str(SCRIPT_GLORDDOR, 132));
				end
				else begin
					display_msg(message_str(SCRIPT_GLORDDOR, 136));
				end
			end
		end
	end
	else begin
		if (Per == 1) then begin
			if (Locks == 0) then begin
				display_msg(message_str(SCRIPT_GLORDDOR, 140));
			end
			else begin
				if (Locks == 1) then begin
					display_msg(message_str(SCRIPT_GLORDDOR, 144));
				end
				else begin
					if (Locks == 2) then begin
						display_msg(message_str(SCRIPT_GLORDDOR, 148));
					end
					else begin
						display_msg(message_str(SCRIPT_GLORDDOR, 152));
					end
				end
			end
		end
		else begin
			if (Per == 2) then begin
				if (Locks == 0) then begin
					display_msg(message_str(SCRIPT_GLORDDOR, 156));
				end
				else begin
					if (Locks == 1) then begin
						display_msg(message_str(SCRIPT_GLORDDOR, 160));
					end
					else begin
						if (Locks == 2) then begin
							display_msg(message_str(SCRIPT_GLORDDOR, 164));
						end
						else begin
							display_msg(message_str(SCRIPT_GLORDDOR, 168));
						end
					end
				end
			end
			else begin
				if (Locks == 0) then begin
					display_msg(message_str(SCRIPT_GLORDDOR, 172));
				end
				else begin
					if (Locks == 1) then begin
						display_msg(message_str(SCRIPT_GLORDDOR, 176));
					end
					else begin
						if (Locks == 2) then begin
							display_msg(message_str(SCRIPT_GLORDDOR, 180));
						end
						else begin
							display_msg(message_str(SCRIPT_GLORDDOR, 184));
						end
					end
				end
			end
		end
	end
end

procedure Display_Trapped
begin
	if (Per == 0) then begin
		if (Traps == 0) then begin
			display_msg(message_str(SCRIPT_GLORDDOR, 188));
		end
		else begin
			if (Traps == 1) then begin
				display_msg(message_str(SCRIPT_GLORDDOR, 189));
			end
			else begin
				if (Traps == 2) then begin
					display_msg(message_str(SCRIPT_GLORDDOR, 190));
				end
				else begin
					display_msg(message_str(SCRIPT_GLORDDOR, 191));
				end
			end
		end
	end
	else begin
		if (Per == 1) then begin
			if (Traps == 0) then begin
				display_msg(message_str(SCRIPT_GLORDDOR, 192));
			end
			else begin
				if (Traps == 1) then begin
					display_msg(message_str(SCRIPT_GLORDDOR, 193));
				end
				else begin
					if (Traps == 2) then begin
						display_msg(message_str(SCRIPT_GLORDDOR, 194));
					end
					else begin
						display_msg(message_str(SCRIPT_GLORDDOR, 195));
					end
				end
			end
		end
		else begin
			if (Per == 2) then begin
				if (Traps == 0) then begin
					display_msg(message_str(SCRIPT_GLORDDOR, 196));
				end
				else begin
					if (Traps == 1) then begin
						display_msg(message_str(SCRIPT_GLORDDOR, 197));
					end
					else begin
						if (Traps == 2) then begin
							display_msg(message_str(SCRIPT_GLORDDOR, 198));
						end
						else begin
							display_msg(message_str(SCRIPT_GLORDDOR, 199));
						end
					end
				end
			end
			else begin
				if (Traps == 0) then begin
					display_msg(message_str(SCRIPT_GLORDDOR, 200));
				end
				else begin
					if (Traps == 1) then begin
						display_msg(message_str(SCRIPT_GLORDDOR, 201));
					end
					else begin
						if (Traps == 2) then begin
							display_msg(message_str(SCRIPT_GLORDDOR, 202));
						end
						else begin
							display_msg(message_str(SCRIPT_GLORDDOR, 203));
						end
					end
				end
			end
		end
	end
end