#include <define.h>

//#define NAME                    SCRIPT_

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



procedure start;
#include <push.h>
procedure do_dialogue;
procedure tylier01;
procedure tylier02;
procedure tylier03;
procedure tylier04;
procedure tylier05;
procedure tylier06;
procedure tylier07;
procedure tylier08;
procedure tylier09;
procedure tylierend;


procedure start
begin
	if (script_action == talk_proc) then begin
		call do_dialogue;
	end
	else begin
		if ((script_action == look_at_proc) or (script_action == description_proc)) then begin
			script_overrides;
			float_msg(self_obj, message_str(SCRIPT_TYLIER, 100), FLOAT_MSG_NORMAL);
		end
	end
end

procedure do_dialogue
begin
	start_gdialog(SCRIPT_TYLIER, self_obj, 4, -1, -1);
	gsay_start;
	if (global_var(GVAR_WEAPONS_ARMED)) then begin
		call tylier01;
	end
	else begin
		call tylier09;
	end
	gsay_end;
	end_dialogue;
end

procedure tylier01
begin
	gsay_reply(SCRIPT_TYLIER, 101);
	giq_option(-3, SCRIPT_TYLIER, 102, tylier02, NEUTRAL_REACTION);
	giq_option(-3, SCRIPT_TYLIER, 103, tylier02, NEUTRAL_REACTION);
	giq_option(4, SCRIPT_TYLIER, 104, tylier02, NEUTRAL_REACTION);
	giq_option(5, SCRIPT_TYLIER, message_str(SCRIPT_TYLIER, 105) + proto_data(obj_pid(dude_obj), 1) + message_str(SCRIPT_TYLIER, 106), tylier02, NEUTRAL_REACTION);
	giq_option(5, SCRIPT_TYLIER, 107, tylier03, NEUTRAL_REACTION);
end

procedure tylier02
begin
	gsay_message(SCRIPT_TYLIER, 108, NEUTRAL_REACTION);
end

procedure tylier03
begin
	gsay_reply(SCRIPT_TYLIER, 109);
	giq_option(5, SCRIPT_TYLIER, 110, tylier04, NEUTRAL_REACTION);
	giq_option(5, SCRIPT_TYLIER, 111, tylier04, NEUTRAL_REACTION);
	giq_option(5, SCRIPT_TYLIER, 112, tylierend, NEUTRAL_REACTION);
end

procedure tylier04
begin
	gsay_reply(SCRIPT_TYLIER, 113);
	giq_option(5, SCRIPT_TYLIER, 114, tylier05, NEUTRAL_REACTION);
	giq_option(5, SCRIPT_TYLIER, 115, tylierend, NEUTRAL_REACTION);
	giq_option(6, SCRIPT_TYLIER, 116, tylier06, NEUTRAL_REACTION);
end

procedure tylier05
begin
	gsay_message(SCRIPT_TYLIER, 117, NEUTRAL_REACTION);
end

procedure tylier06
begin
	gsay_reply(SCRIPT_TYLIER, 118);
	if (global_var(GVAR_FOUND_DISK)) then begin
		giq_option(5, SCRIPT_TYLIER, 119, tylier07, NEUTRAL_REACTION);
	end
	giq_option(5, SCRIPT_TYLIER, 120, tylier06, NEUTRAL_REACTION);
	giq_option(5, SCRIPT_TYLIER, 121, tylier06, NEUTRAL_REACTION);
	giq_option(5, SCRIPT_TYLIER, 122, tylier06, NEUTRAL_REACTION);
	giq_option(0, SCRIPT_TYLIER, 123, tylierend, NEUTRAL_REACTION);
end

procedure tylier07
begin
	gsay_message(SCRIPT_TYLIER, 124, NEUTRAL_REACTION);
	set_global_var(GVAR_WEAPONS_ARMED, 1);
end

procedure tylier08
begin
	gsay_reply(SCRIPT_TYLIER, 125);
	giq_option(5, SCRIPT_TYLIER, 126, tylier06, NEUTRAL_REACTION);
	giq_option(0, SCRIPT_TYLIER, 127, tylierend, NEUTRAL_REACTION);
end

procedure tylier09
begin
	gsay_message(SCRIPT_TYLIER, 128, NEUTRAL_REACTION);
end

procedure tylierend
begin
end