procedure start;
procedure talk_p_proc;
procedure Zax01;
procedure Zax02;
procedure Zax03;
procedure Zax04;
procedure Zax05;
procedure Zax06;
procedure Zax07;
procedure Zax08;
procedure Zax09;
procedure Zax10;
procedure Zax11;
procedure Zax12;
procedure Zax13;
procedure Zax14;
procedure Zax15;
procedure Zax16;
procedure Zax17;
procedure Zax18;
procedure Zax19;
procedure Zax20;
procedure Zax21;
procedure Zax22;
procedure Zax23;
procedure Zax24;
procedure Zax25;
procedure ZaxClearance;
procedure Term01;
procedure Term02;
procedure Term03;
procedure Term03a;
procedure Term04;
procedure Term05;
procedure Term06;
procedure Term06a;
procedure Term07;
procedure Term08;
procedure Term09;
procedure Term09a;
procedure Term10;
procedure Term11;
procedure Term11a;
procedure Term12;
procedure Term13;
procedure Term14;
procedure Term14a;
procedure Term15;
procedure TermEnd;
procedure TermStart;
procedure Mainframe00;
procedure Mainframe01;
procedure Mainframe02;
procedure Mainframe03;
procedure Mainframe04;
procedure Mainframe04a;
procedure Mainframe05;
procedure Mainframe05a;
procedure Mainframe05b;
procedure Mainframe05c;
procedure Mainframe06;
procedure Mainframe06a;
procedure Mainframe07;
procedure Mainframe07a;
procedure Mainframe08;
procedure Mainframe08a;
procedure Mainframe09;
procedure Mainframe10;
procedure get_reaction;
procedure ReactToLevel;
procedure LevelToReact;
procedure UpReact;
procedure DownReact;
procedure BottomReact;
procedure TopReact;
procedure BigUpReact;
procedure BigDownReact;
procedure UpReactLevel;
procedure DownReactLevel;
procedure Goodbyes;
variable exit_line;
procedure start
begin
if (script_action == 11) then begin
call talk_p_proc;
end
else begin
if (script_action == 6) then begin
dialogue_system_enter;
end
else begin
if ((script_action == 21) or (script_action == 3)) then begin
script_overrides;
if (local_var(4) == 1) then begin
display_msg(message_str(312, 100));
end
else begin
display_msg(message_str(312, 101));
end
end
end
end
end
procedure talk_p_proc
begin
script_overrides;
start_gdialog(312, self_obj, 4, -1, -1);
gsay_start;
call Zax01;
gsay_end;
end_dialogue;
end
procedure Zax01
begin
gsay_reply(312, 102);
if (local_var(4) == 0) then begin
giq_option(5, 312, 103, Zax02, 50);
end
giq_option(5, 312, 105, Zax04, 50);
if (local_var(6) == 0) then begin
giq_option(5, 312, 106, Zax12, 50);
end
giq_option(5, 828, 200, Mainframe00, 50);
giq_option(5, 312, 108, Zax13, 50);
giq_option(-4, 312, 109, Zax05, 50);
end
procedure Zax02
begin
set_local_var(4, 1);
gsay_reply(312, 110);
giq_option(5, 312, 111, Zax06, 50);
giq_option(5, 312, 112, Zax04, 50);
giq_option(5, 312, 113, Zax07, 50);
giq_option(7, 312, 114, Zax08, 50);
giq_option(0, 312, 115, Zax13, 50);
end
procedure Zax03
begin
gsay_message(312, 116, 50);
set_local_var(5, 1);
call Zax01;
end
procedure Zax04
begin
call ZaxClearance;
gsay_reply(828, message_str(828, 211) + message_str(828, 241) + message_str(828, 242) + message_str(828, 243));
giq_option(7, 312, 119, Zax21, 50);
giq_option(7, 312, 120, Zax15, 50);
giq_option(5, 312, 121, Zax13, 50);
end
procedure Zax05
begin
gsay_message(312, 122, 50);
end
procedure Zax06
begin
call ZaxClearance;
gsay_reply(312, 123);
giq_option(5, 312, 124, Zax14, 50);
giq_option(7, 312, 125, Zax15, 50);
giq_option(5, 312, 126, Zax07, 50);
end
procedure Zax07
begin
gsay_reply(312, 127);
giq_option(7, 312, 128, Zax08, 50);
end
procedure Zax08
begin
gsay_message(312, 129, 50);
gsay_reply(312, 130);
giq_option(5, 312, 131, Zax01, 50);
giq_option(7, 312, 132, Zax09, 50);
giq_option(9, 312, 133, Zax11, 50);
end
procedure Zax09
begin
gsay_message(312, 134, 50);
gsay_reply(312, 135);
giq_option(7, 312, 136, Zax10, 50);
giq_option(7, 312, 137, Zax01, 50);
giq_option(9, 312, 138, Zax11, 50);
end
procedure Zax10
begin
gsay_message(312, 139, 50);
gsay_reply(312, 140);
giq_option(7, 312, 141, Zax01, 50);
giq_option(9, 312, 142, Zax11, 50);
end
procedure Zax11
begin
gsay_message(312, 143, 50);
gsay_message(312, 144, 50);
gsay_reply(312, 145);
giq_option(5, 312, 146, Zax01, 50);
giq_option(5, 312, 147, Zax13, 50);
end
procedure Zax12
begin
variable LVar0 := 0;
gsay_message(312, 148, 50);
gfade_out(600);
game_time_advance(game_ticks(7200));
LVar0 := do_check(dude_obj, 4, 0);
gfade_in(600);
if (is_success(LVar0)) then begin
if (is_critical(LVar0)) then begin
gsay_reply(312, 149);
set_local_var(6, 1);
give_exp_points(700);
end
else begin
gsay_reply(312, 150);
end
end
else begin
gsay_reply(312, 150);
end
giq_option(5, 312, 151, Zax12, 50);
giq_option(5, 312, 152, Zax01, 50);
end
procedure Zax13
begin
gsay_message(312, 153, 50);
end
procedure Zax14
begin
gsay_reply(312, 154);
giq_option(5, 312, 155, Zax13, 50);
giq_option(5, 312, 156, Zax01, 50);
end
procedure Zax15
begin
gsay_message(312, 157, 50);
gsay_reply(312, 158);
giq_option(5, 312, 159, Zax16, 50);
giq_option(7, 312, 160, Zax17, 50);
giq_option(9, 312, 161, Zax18, 50);
end
procedure Zax16
begin
gsay_reply(312, 162);
giq_option(5, 312, 163, Zax01, 50);
giq_option(7, 312, 164, Zax17, 50);
giq_option(9, 312, 165, Zax18, 50);
end
procedure Zax17
begin
gsay_reply(312, 166);
giq_option(5, 312, 167, Zax01, 50);
giq_option(9, 312, 168, Zax18, 50);
end
procedure Zax18
begin
gsay_message(312, 169, 50);
gsay_message(312, 170, 50);
gsay_message(312, 171, 50);
gsay_message(312, 172, 50);
gsay_reply(312, 173);
giq_option(9, 312, 174, Zax19, 50);
giq_option(10, 312, 175, Zax20, 50);
giq_option(5, 312, 176, Zax01, 50);
giq_option(5, 312, 177, Zax13, 50);
end
procedure Zax19
begin
gsay_message(312, 178, 50);
gsay_message(312, 179, 50);
gsay_reply(312, 180);
giq_option(10, 312, 181, Zax20, 50);
giq_option(5, 312, 182, Zax01, 50);
giq_option(5, 312, 183, Zax13, 50);
end
procedure Zax20
begin
gsay_reply(312, 184);
giq_option(9, 312, 185, Zax19, 50);
giq_option(5, 312, 186, Zax01, 50);
giq_option(5, 312, 187, Zax13, 50);
end
procedure Zax21
begin
gsay_reply(312, 188);
giq_option(5, 312, 189, Zax22, 50);
giq_option(5, 312, 190, Zax23, 50);
giq_option(5, 312, 191, Zax24, 50);
giq_option(5, 312, 192, Zax01, 50);
end
procedure Zax22
begin
gsay_reply(312, 193);
giq_option(5, 312, 194, Zax23, 50);
giq_option(5, 312, 195, Zax24, 50);
giq_option(5, 312, 196, Zax01, 50);
giq_option(5, 312, 197, Zax13, 50);
end
procedure Zax23
begin
gsay_reply(312, 198);
giq_option(5, 312, 199, Zax22, 50);
giq_option(5, 312, 200, Zax24, 50);
giq_option(5, 312, 201, Zax01, 50);
giq_option(5, 312, 202, Zax13, 50);
end
procedure Zax24
begin
gsay_reply(312, 203);
giq_option(5, 312, 204, Zax22, 50);
giq_option(5, 312, 205, Zax23, 50);
giq_option(5, 312, 206, Zax01, 50);
giq_option(5, 312, 207, Zax13, 50);
end
procedure Zax25
begin
gsay_message(312, 208, 50);
if (global_var(142) == 1) then begin
gsay_message(312, 209, 50);
set_global_var(142, 2);
end
end
procedure ZaxClearance
begin
if (global_var(140)) then begin
gsay_message(312, 210, 50);
gsay_message(312, 211, 50);
set_global_var(140, 0);
end
end
procedure Term01
begin
gsay_reply(828, 100);
giq_option(4, 828, 101, Term02, 50);
giq_option(-3, 828, 102, Term10, 50);
giq_option(0, 828, 103, Mainframe02, 50);
end
procedure Term02
begin
gsay_reply(828, 104);
giq_option(4, 828, 105, Term03, 50);
giq_option(4, 828, 106, Term06, 50);
giq_option(4, 828, 107, Term01, 50);
end
procedure Term03
begin
gsay_reply(828, 108);
giq_option(4, 828, 109, Term03a, 50);
giq_option(4, 828, 110, Term02, 50);
end
procedure Term03a
begin
if (global_var(139) != 2) then begin
call Term04;
end
else begin
set_global_var(224, 2);
end
end
procedure Term04
begin
gsay_reply(828, 111);
giq_option(8, 828, 112, Term05, 50);
giq_option(4, 828, 113, Term02, 50);
end
procedure Term05
begin
gsay_reply(828, 114);
giq_option(4, 828, 115, Term02, 50);
end
procedure Term06
begin
gsay_reply(828, 116);
giq_option(4, 828, 117, Term06a, 50);
giq_option(4, 828, 118, Term02, 50);
end
procedure Term06a
begin
set_global_var(224, 0);
end
procedure Term07
begin
gsay_reply(828, 119);
giq_option(4, 828, 120, Term08, 50);
giq_option(0, 828, 121, Mainframe02, 50);
end
procedure Term08
begin
gsay_reply(828, 122);
giq_option(4, 828, 123, Term09a, 50);
giq_option(4, 828, 124, Term07, 50);
end
procedure Term09
begin
gsay_reply(828, 125);
giq_option(-3, 828, 126, Term09a, 50);
giq_option(4, 828, 127, Term09a, 50);
giq_option(0, 828, 128, Mainframe02, 50);
end
procedure Term09a
begin
set_global_var(224, 1);
end
procedure Term10
begin
gsay_reply(828, 129);
giq_option(-3, 828, 130, Term11, 50);
giq_option(-3, 828, 131, Term13, 50);
giq_option(-3, 828, 132, Term01, 50);
end
procedure Term11
begin
gsay_reply(828, 133);
giq_option(-3, 828, 134, Term11a, 50);
giq_option(-3, 828, 135, Term10, 50);
end
procedure Term11a
begin
if (global_var(139) != 2) then begin
call Term12;
end
else begin
set_global_var(224, 2);
end
end
procedure Term12
begin
gsay_reply(828, 136);
giq_option(-3, 828, 137, Term10, 50);
end
procedure Term13
begin
gsay_reply(828, 138);
giq_option(-3, 828, 148, Term06a, 50);
giq_option(-3, 828, 137, Term10, 50);
end
procedure Term14
begin
gsay_reply(828, 139);
giq_option(4, 828, 140, Term14a, 50);
giq_option(-3, 828, 141, Term15, 50);
giq_option(-3, 828, 142, Term15, 50);
giq_option(-3, 828, 143, Term14a, 50);
giq_option(-3, 828, 144, Term15, 50);
giq_option(0, 828, 145, Mainframe02, 50);
end
procedure Term14a
begin
set_global_var(224, 1);
if (global_var(139) == 2) then begin
call Term01;
end
end
procedure Term15
begin
gsay_reply(828, 146);
giq_option(0, 828, 147, Mainframe02, 50);
end
procedure TermEnd
begin
end
procedure TermStart
begin
if (global_var(224) == 0) then begin
call Term14;
end
else begin
if (global_var(224) == 1) then begin
call Term01;
end
else begin
call Term09;
end
end
end
procedure Mainframe00
begin
if (has_skill(dude_obj, 12) >= 25) then begin
set_local_var(8, 0);
end
if (local_var(8) == 0) then begin
if (local_var(7) == 1) then begin
call Mainframe01;
end
else begin
if (is_success(roll_vs_skill(dude_obj, 12, -10))) then begin
set_local_var(7, 1);
call Mainframe01;
end
else begin
if (has_skill(dude_obj, 12) < 25) then begin
set_local_var(8, 1);
end
gsay_message(828, 201, 50);
end
end
end
else begin
gsay_message(828, 201, 50);
display_msg(message_str(312, 300));
end
end
procedure Mainframe01
begin
gsay_reply(828, 202);
giq_option(4, 828, 203, Mainframe02, 50);
giq_option(4, 828, 204, Zax01, 50);
end
procedure Mainframe02
begin
gsay_reply(828, 206);
giq_option(4, 828, 207, Mainframe03, 50);
giq_option(4, 828, 208, Mainframe04, 50);
giq_option(4, 828, 209, Mainframe05, 50);
giq_option(4, 828, 210, TermStart, 50);
giq_option(4, 828, 204, Zax01, 50);
end
procedure Mainframe03
begin
gsay_reply(828, message_str(828, 211) + message_str(828, 241) + message_str(828, 242) + message_str(828, 243));
giq_option(4, 828, 203, Mainframe02, 50);
giq_option(4, 828, 205, TermEnd, 50);
end
procedure Mainframe04
begin
if ((global_var(140) == 0) and (global_var(224) == 2)) then begin
gsay_reply(828, 212);
end
else begin
gsay_reply(828, 213);
end
if (global_var(224) == 2) then begin
if (global_var(140) == 0) then begin
giq_option(4, 828, 214, Mainframe04a, 50);
end
else begin
giq_option(4, 828, 215, Mainframe04a, 50);
end
end
giq_option(4, 828, 203, Mainframe02, 50);
giq_option(4, 828, 205, TermEnd, 50);
end
procedure Mainframe04a
begin
game_time_advance(game_ticks(600));
if (has_skill(dude_obj, 12) >= 40) then begin
set_local_var(9, 0);
end
if (global_var(163) == 1) then begin
if (global_var(140) == 0) then begin
set_global_var(140, 1);
end
else begin
set_global_var(140, 0);
end
give_exp_points(100);
call Mainframe09;
end
if (local_var(9) == 0) then begin
if (is_success(roll_vs_skill(dude_obj, 12, -25))) then begin
if (global_var(140) == 0) then begin
set_global_var(140, 1);
end
else begin
set_global_var(140, 0);
end
give_exp_points(100);
call Mainframe09;
end
else begin
if (has_skill(dude_obj, 12) < 40) then begin
set_local_var(9, 1);
end
call Mainframe10;
end
end
else begin
if (local_var(9) == 1) then begin
display_msg(message_str(312, 300));
call Mainframe10;
end
else begin
call Mainframe10;
end
end
end
procedure Mainframe05
begin
gsay_reply(828, 216);
giq_option(4, 828, 217, Mainframe05a, 50);
giq_option(4, 828, 218, Mainframe05b, 50);
giq_option(4, 828, 219, Mainframe05c, 50);
giq_option(4, 828, 203, Mainframe02, 50);
giq_option(4, 828, 205, TermEnd, 50);
end
procedure Mainframe05a
begin
call Mainframe06;
end
procedure Mainframe05b
begin
call Mainframe07;
end
procedure Mainframe05c
begin
call Mainframe08;
end
procedure Mainframe06
begin
gsay_message(828, 220, 50);
gsay_message(828, 221, 50);
gsay_message(828, 222, 50);
gsay_message(828, 223, 50);
gsay_message(828, 224, 50);
gsay_message(828, 225, 50);
gsay_message(828, 226, 50);
gsay_message(828, 227, 50);
gsay_reply(828, 228);
giq_option(4, 828, 229, Mainframe06a, 50);
giq_option(4, 828, 230, Mainframe05, 50);
giq_option(4, 828, 205, TermEnd, 50);
end
procedure Mainframe06a
begin
set_global_var(260, 1);
call Mainframe05;
end
procedure Mainframe07
begin
gsay_reply(828, message_str(828, 231) + message_str(828, 250) + message_str(828, 251) + message_str(828, 252));
giq_option(4, 828, 229, Mainframe07a, 50);
giq_option(4, 828, 230, Mainframe05, 50);
giq_option(4, 828, 205, TermEnd, 50);
end
procedure Mainframe07a
begin
set_global_var(259, 1);
call Mainframe05;
end
procedure Mainframe08
begin
gsay_message(828, message_str(828, 232) + message_str(828, 233), 50);
gsay_message(828, message_str(828, 234) + message_str(828, 235), 50);
gsay_reply(828, message_str(828, 236) + message_str(828, 237) + message_str(828, 238));
giq_option(4, 828, 229, Mainframe08a, 50);
giq_option(4, 828, 230, Mainframe05, 50);
giq_option(4, 828, 205, TermEnd, 50);
end
procedure Mainframe08a
begin
set_global_var(258, 1);
call Mainframe05;
end
procedure Mainframe09
begin
gsay_reply(828, 239);
giq_option(4, 828, 203, Mainframe02, 50);
giq_option(4, 828, 205, TermEnd, 50);
end
procedure Mainframe10
begin
game_time_advance(game_ticks(18000));
gsay_reply(828, 240);
giq_option(4, 828, 203, Mainframe02, 50);
giq_option(4, 828, 205, TermEnd, 50);
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(155) > 0) then begin
set_local_var(0, local_var(0) + global_var(155));
end
else begin
set_local_var(0, local_var(0) - global_var(155));
end
end
else begin
if (local_var(3) == 1) then begin
set_local_var(0, local_var(0) - global_var(155));
end
else begin
set_local_var(0, local_var(0) + global_var(155));
end
end
if (global_var(158) > 2) then begin
set_local_var(0, local_var(0) - 30);
end
if (((global_var(160) + global_var(159)) >= 25) and ((global_var(160) > (3 * global_var(159))) or (global_var(157) == 1))) then begin
set_local_var(0, local_var(0) + 20);
end
if (((global_var(160) + global_var(159)) >= 25) and ((global_var(159) > (2 * global_var(160))) or (global_var(156) == 1))) then begin
set_local_var(0, local_var(0) - 20);
end
call ReactToLevel;
end
end
procedure ReactToLevel
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 LevelToReact
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 UpReact
begin
set_local_var(0, local_var(0) + 10);
call ReactToLevel;
end
procedure DownReact
begin
set_local_var(0, local_var(0) - 10);
call ReactToLevel;
end
procedure BottomReact
begin
set_local_var(1, 1);
set_local_var(0, 1);
end
procedure TopReact
begin
set_local_var(0, 100);
set_local_var(1, 3);
end
procedure BigUpReact
begin
set_local_var(0, local_var(0) + 25);
call ReactToLevel;
end
procedure BigDownReact
begin
set_local_var(0, local_var(0) - 25);
call ReactToLevel;
end
procedure UpReactLevel
begin
set_local_var(1, local_var(1) + 1);
if (local_var(1) > 3) then begin
set_local_var(1, 3);
end
call LevelToReact;
end
procedure DownReactLevel
begin
set_local_var(1, local_var(1) - 1);
if (local_var(1) < 1) then begin
set_local_var(1, 1);
end
call LevelToReact;
end
procedure Goodbyes
begin
exit_line := message_str(634, random(100, 105));
end