![]() |
This is the transcript of a script file, which runs certain tasks in the game upon execution. |
---|
Details | |
---|---|
Type | Decompiled script |
SCRIPTS.LST comment | The ghoul manager of the Necropolis hotel. |
MSG file | GHOUL.MSG |
procedure start;
procedure timeforwhat;
procedure do_dialogue;
procedure pre_dialogue;
procedure ghoulend;
procedure ghoulcbt;
procedure ghoul00;
procedure ghoul01;
procedure ghoul02;
procedure ghoul03;
procedure ghoul04;
procedure ghoul05;
procedure ghoul05a;
procedure ghoul06;
procedure ghoul07;
procedure ghoul08;
variable Hostile;
variable initialized;
variable noevent;
variable loopcount;
procedure start
begin
if (not(initialized)) then begin
critter_add_trait(self_obj, 1, 6, 30);
critter_add_trait(self_obj, 1, 5, 78);
initialized := 1;
end
else begin
if (script_action == 22) then begin
call timeforwhat;
end
else begin
if (script_action == 11) then begin
call pre_dialogue;
end
else begin
if (script_action == 4) then begin
Hostile := 1;
end
else begin
if (script_action == 12) then begin
if (Hostile) then begin
Hostile := 0;
attack_complex(dude_obj, 0, 1, 0, 0, 30000, 0, 0);
end
else begin
if ((game_time_hour >= 1900) or (game_time_hour < 600) and (tile_num(self_obj) != 22531)) then begin
animate_move_obj_to_tile(self_obj, 22531, 0);
end
if ((game_time_hour >= 700) and (game_time_hour < 1800) and (tile_num(self_obj) != 24730)) then begin
animate_move_obj_to_tile(self_obj, 24730, 0);
end
loopcount := loopcount + 1;
if (loopcount > 40) then begin
loopcount := 0;
if (tile_distance_objs(self_obj, dude_obj) < 7) then begin
if (obj_can_see_obj(self_obj, dude_obj)) then begin
if (noevent == 0) then begin
noevent := 1;
add_timer_event(self_obj, game_ticks(5), 0);
end
end
end
end
end
end
else begin
if ((script_action == 21) or (script_action == 3)) then begin
script_overrides;
display_msg(message_str(30, 100));
end
else begin
if (script_action == 18) then begin
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(160, global_var(160) + 1);
if ((global_var(160) % 6) == 0) then begin
set_global_var(155, global_var(155) + 1);
end
end
end
end
end
end
end
end
end
end
procedure timeforwhat
begin
if (fixed_param == 1) then begin
Hostile := 1;
end
else begin
if (local_var(0) == 0) then begin
dialogue_system_enter;
end
end
end
procedure do_dialogue
begin
start_gdialog(30, self_obj, 4, -1, -1);
gsay_start;
set_local_var(0, 1);
call ghoul00;
gsay_end;
end_dialogue;
end
procedure pre_dialogue
begin
if (local_var(0)) then begin
call ghoul08;
end
else begin
call do_dialogue;
end
end
procedure ghoulend
begin
end
procedure ghoulcbt
begin
add_timer_event(self_obj, game_ticks(2), 1);
end
procedure ghoul00
begin
gsay_reply(30, 101);
giq_option(6, 30, 102, ghoul01, 50);
giq_option(4, 30, 103, ghoul04, 50);
giq_option(4, 30, 104, ghoul05, 50);
giq_option(-3, 30, 105, ghoulend, 50);
end
procedure ghoul01
begin
gsay_reply(30, 106);
giq_option(6, 30, 107, ghoul02, 50);
giq_option(6, 30, 108, ghoul03, 50);
end
procedure ghoul02
begin
gsay_message(30, 109, 50);
call ghoulend;
end
procedure ghoul03
begin
gsay_message(30, 110, 50);
call ghoulend;
end
procedure ghoul04
begin
gsay_message(30, 111, 50);
call ghoulend;
end
procedure ghoul05
begin
gsay_reply(30, 112);
giq_option(4, 30, 113, ghoul07, 50);
giq_option(4, 30, 114, ghoul05a, 50);
call ghoulend;
end
procedure ghoul05a
begin
if (is_success(do_check(dude_obj, 14, 0))) then begin
call ghoul06;
end
else begin
call ghoul07;
end
end
procedure ghoul06
begin
gsay_message(30, 115, 50);
call ghoulend;
end
procedure ghoul07
begin
gsay_message(30, 116, 50);
call ghoulcbt;
end
procedure ghoul08
begin
float_msg(self_obj, message_str(30, 117), 7);
call ghoulend;
end