procedure start;
procedure do_dialogue;
procedure pre_dialogue;
procedure Darrel01;
procedure Darrel02;
procedure Darrel02a;
procedure Darrel02b;
procedure Darrel02c;
procedure Darrel03;
procedure Darrel04;
procedure Darrel05;
procedure Darrel06;
procedure Darrel07;
procedure Darrel08;
procedure Darrel09;
procedure Darrel10;
procedure Darrel11;
procedure Darrel12;
procedure Darrel13;
procedure Darrel14;
procedure Darrel15;
procedure Darrel16;
procedure Darrel58;
procedure Darrel59;
procedure Darrel60;
procedure Darrel61;
procedure Darrel62;
procedure Darrel63;
procedure Darrel64;
procedure Darrel66;
procedure Darrel67;
procedure Darrel68;
procedure Darrel69;
procedure Darrel70;
procedure Darrel71;
procedure Darrel72;
procedure Darrel73;
procedure Darrel75;
procedure Darrel76;
procedure DarrelEnd;
procedure giveradx;
procedure combat;
procedure damage_p_proc;
procedure critter_p_proc;
procedure pickup_p_proc;
procedure talk_p_proc;
procedure destroy_p_proc;
procedure look_at_p_proc;
variable known;
variable only_once := 1;
variable hostile;
variable radx;
variable second;
variable ccount;
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 (only_once) then begin
only_once := 0;
critter_add_trait(self_obj, 1, 6, 44);
critter_add_trait(self_obj, 1, 5, 64);
end
if (script_action == 21) then begin
call look_at_p_proc;
end
else begin
if (script_action == 14) then begin
call damage_p_proc;
end
else begin
if (script_action == 4) then begin
call pickup_p_proc;
end
else begin
if (script_action == 11) then begin
call talk_p_proc;
end
else begin
if (script_action == 12) then begin
call critter_p_proc;
end
else begin
if (script_action == 18) then begin
call destroy_p_proc;
end
end
end
end
end
end
end
procedure do_dialogue
begin
call get_reaction;
start_gdialog(316, self_obj, 4, -1, -1);
gsay_start;
if (global_var(108) == 1) then begin
if (second) then begin
call Darrel71;
end
else begin
second := 1;
call Darrel59;
end
end
else begin
if (local_var(4) == 0) then begin
call Darrel01;
end
else begin
call Darrel16;
end
end
gsay_end;
end_dialogue;
set_local_var(4, 1);
end
procedure pre_dialogue
begin
if (local_var(4) == 0) then begin
call do_dialogue;
end
else begin
if (global_var(108) == 2) then begin
call Darrel73;
end
else begin
call do_dialogue;
end
end
end
procedure Darrel01
begin
gsay_reply(316, 102);
giq_option(-3, 316, 103, Darrel02, 50);
giq_option(4, 316, 104, Darrel03, 50);
if (global_var(30) != 1) then begin
giq_option(4, 316, 105, Darrel04, 50);
end
if (global_var(106) == 1) then begin
giq_option(4, 316, 106, Darrel75, 50);
end
giq_option(4, 316, 107, DarrelEnd, 50);
end
procedure Darrel02
begin
if (local_var(6) == 0) then begin
gsay_reply(316, 108);
giq_option(-3, 316, 300, Darrel02a, 50);
end
else begin
gsay_message(316, 108, 50);
end
end
procedure Darrel02a
begin
gsay_reply(316, 209);
giq_option(-3, 316, 300, Darrel02b, 50);
end
procedure Darrel02b
begin
gsay_reply(316, 210);
giq_option(-3, 316, 300, Darrel02c, 50);
end
procedure Darrel02c
begin
gsay_reply(316, 211);
giq_option(-3, 316, 300, giveradx, 50);
end
procedure Darrel03
begin
gsay_reply(316, 110);
giq_option(4, 316, 111, Darrel05, 50);
giq_option(4, 316, 112, Darrel12, 50);
giq_option(4, 316, 113, Darrel06, 50);
giq_option(4, 316, 114, DarrelEnd, 50);
end
procedure Darrel04
begin
gsay_reply(316, 115);
giq_option(4, 316, 116, Darrel07, 50);
giq_option(4, 316, 201, DarrelEnd, 50);
giq_option(4, 316, 118, Darrel11, 50);
end
procedure Darrel05
begin
gsay_reply(316, 119);
if (((global_var(160) + global_var(159)) >= 25) and ((global_var(159) > (2 * global_var(160))) or (global_var(156) == 1))) then begin
giq_option(4, 316, 120, DarrelEnd, 50);
end
giq_option(4, 316, 121, Darrel08, 50);
giq_option(4, 316, 122, Darrel09, 50);
end
procedure Darrel06
begin
gsay_reply(316, 123);
giq_option(4, 316, 202, DarrelEnd, 50);
giq_option(4, 316, 125, Darrel04, 50);
end
procedure Darrel07
begin
gsay_reply(316, 126);
giq_option(4, 316, 202, DarrelEnd, 50);
giq_option(4, 316, 127, Darrel03, 50);
end
procedure Darrel08
begin
gsay_reply(316, 128);
giq_option(4, 316, 129, Darrel10, 50);
giq_option(4, 316, 130, Darrel11, 50);
end
procedure Darrel09
begin
gsay_reply(316, 109);
giq_option(4, 316, 129, Darrel10, 50);
giq_option(4, 316, 130, Darrel11, 50);
end
procedure Darrel10
begin
gsay_reply(316, 131);
giq_option(4, 316, 132, Darrel07, 50);
giq_option(4, 316, 133, Darrel11, 50);
end
procedure Darrel11
begin
gsay_message(316, 134, 50);
end
procedure Darrel12
begin
gsay_reply(316, 135);
giq_option(4, 316, 136, Darrel13, 50);
giq_option(4, 316, 137, Darrel15, 50);
giq_option(4, 316, 203, DarrelEnd, 50);
end
procedure Darrel13
begin
gsay_reply(316, 139);
giq_option(4, 316, 140, Darrel13, 50);
giq_option(4, 316, 132, Darrel07, 50);
giq_option(4, 316, 204, DarrelEnd, 50);
end
procedure Darrel14
begin
gsay_reply(316, 143);
if (((global_var(160) + global_var(159)) >= 25) and ((global_var(159) > (2 * global_var(160))) or (global_var(156) == 1))) then begin
giq_option(4, 316, 144, combat, 51);
end
giq_option(4, 316, 141, Darrel07, 50);
giq_option(4, 316, 145, DarrelEnd, 50);
giq_option(4, 316, 146, Darrel05, 50);
end
procedure Darrel15
begin
gsay_reply(316, 147);
giq_option(4, 316, 148, Darrel14, 50);
giq_option(4, 316, 149, Darrel07, 50);
giq_option(4, 316, 203, DarrelEnd, 50);
end
procedure Darrel16
begin
float_msg(self_obj, message_str(316, 151), 2);
end
procedure Darrel58
begin
set_local_var(5, 1);
if (get_critter_stat(dude_obj, 34) == 0) then begin
float_msg(self_obj, message_str(316, 152), 2);
end
else begin
float_msg(self_obj, message_str(316, 153), 2);
end
end
procedure Darrel59
begin
gsay_reply(316, 154);
giq_option(4, 316, 155, Darrel60, 50);
giq_option(4, 316, 156, Darrel61, 50);
giq_option(4, 316, 157, Darrel62, 50);
giq_option(4, 316, 158, DarrelEnd, 50);
giq_option(-3, 316, 103, Darrel02, 50);
end
procedure Darrel60
begin
gsay_reply(316, 159);
giq_option(4, 316, 160, Darrel63, 50);
giq_option(4, 316, 161, Darrel63, 50);
giq_option(4, 316, 162, Darrel64, 50);
giq_option(4, 316, 163, Darrel61, 50);
end
procedure Darrel61
begin
gsay_reply(316, 164);
giq_option(4, 316, 165, Darrel66, 50);
giq_option(4, 316, 166, Darrel67, 50);
end
procedure Darrel62
begin
gsay_message(316, 167, 50);
end
procedure Darrel63
begin
gsay_reply(316, 168);
giq_option(4, 316, 203, DarrelEnd, 50);
giq_option(4, 316, 170, Darrel72, 50);
end
procedure Darrel64
begin
gsay_reply(316, 171);
giq_option(4, 316, 205, DarrelEnd, 50);
giq_option(4, 316, 170, Darrel69, 50);
end
procedure Darrel66
begin
gsay_reply(316, 174);
giq_option(4, 316, 175, Darrel68, 50);
giq_option(4, 316, 176, DarrelEnd, 50);
giq_option(4, 316, 177, Darrel63, 50);
giq_option(4, 316, 206, DarrelEnd, 50);
end
procedure Darrel67
begin
gsay_reply(316, 179);
giq_option(4, 316, 180, Darrel64, 50);
giq_option(4, 316, 203, DarrelEnd, 50);
end
procedure Darrel68
begin
gsay_reply(316, 181);
giq_option(4, 316, 182, DarrelEnd, 50);
giq_option(4, 316, 183, Darrel63, 50);
giq_option(4, 316, 184, DarrelEnd, 50);
end
procedure Darrel69
begin
gsay_reply(316, 189);
giq_option(4, 316, 203, DarrelEnd, 50);
giq_option(4, 316, 190, Darrel72, 50);
end
procedure Darrel70
begin
gsay_reply(316, 168);
giq_option(4, 316, 203, DarrelEnd, 50);
giq_option(4, 316, 190, Darrel72, 50);
end
procedure Darrel71
begin
gsay_reply(316, 191);
giq_option(4, 316, 188, Darrel72, 50);
giq_option(4, 316, 192, DarrelEnd, 50);
giq_option(-3, 316, 103, Darrel02, 50);
end
procedure Darrel72
begin
gsay_reply(316, 193);
giq_option(4, 316, 186, Darrel69, 50);
giq_option(4, 316, 187, Darrel70, 50);
if (global_var(106) == 1) then begin
giq_option(4, 316, 106, Darrel75, 50);
end
giq_option(4, 316, 207, DarrelEnd, 50);
end
procedure Darrel73
begin
ccount := ccount + 1;
if (ccount < 6) then begin
float_msg(self_obj, message_str(723, 200 + random(0, 2)), 2);
end
else begin
if (ccount < 9) then begin
float_msg(self_obj, message_str(723, 203 + random(0, 4)), 2);
end
else begin
if (ccount < 12) then begin
float_msg(self_obj, message_str(723, 209 + random(0, 3)), 2);
end
else begin
display_msg(message_str(723, 213));
end
end
end
end
procedure Darrel75
begin
gsay_reply(316, 195);
giq_option(4, 316, 196, Darrel11, 50);
giq_option(4, 316, 197, Darrel76, 50);
giq_option(4, 316, 104, Darrel03, 50);
giq_option(4, 316, 198, DarrelEnd, 50);
end
procedure Darrel76
begin
gsay_reply(316, 199);
giq_option(4, 316, 104, Darrel03, 50);
if (global_var(30) != 1) then begin
giq_option(4, 316, 105, Darrel04, 50);
end
giq_option(4, 316, 208, DarrelEnd, 50);
end
procedure DarrelEnd
begin
end
procedure giveradx
begin
set_local_var(6, 1);
radx := create_object_sid(109, 0, 0, -1);
add_obj_to_inven(dude_obj, radx);
gsay_reply(316, 212);
giq_option(-3, 316, 300, DarrelEnd, 50);
end
procedure combat
begin
hostile := 1;
end
procedure damage_p_proc
begin
set_global_var(250, 1);
end
procedure critter_p_proc
begin
if (global_var(250)) then begin
hostile := 1;
end
if (tile_distance_objs(self_obj, dude_obj) > 12) then begin
hostile := 0;
end
if (hostile) then begin
set_global_var(250, 1);
hostile := 0;
attack_complex(dude_obj, 0, 1, 0, 0, 30000, 0, 0);
end
if (local_var(5) == 0) then begin
if (global_var(108) == 1) then begin
call Darrel58;
end
end
end
procedure pickup_p_proc
begin
if (source_obj == dude_obj) then begin
hostile := 1;
end
end
procedure talk_p_proc
begin
if (global_var(108) == 5) then begin
float_msg(self_obj, message_str(40, 233), 2);
end
else begin
call pre_dialogue;
end
end
procedure destroy_p_proc
begin
set_global_var(250, 1);
if (source_obj == dude_obj) then begin
if (((global_var(160) + global_var(159)) >= 25) and ((global_var(159) > (2 * global_var(160))) or (global_var(156) == 1))) then begin
set_global_var(156, 1);
set_global_var(157, 0);
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_global_var(157, 1);
set_global_var(156, 0);
end
set_global_var(159, global_var(159) + 1);
if ((global_var(159) % 2) == 0) then begin
set_global_var(155, global_var(155) - 1);
end
end
end
procedure look_at_p_proc
begin
script_overrides;
if (known) then begin
display_msg(message_str(316, 100));
end
else begin
display_msg(message_str(316, 101));
end
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