procedure start;
procedure critter_p_proc;
procedure damage_p_proc;
procedure destroy_p_proc;
procedure look_at_p_proc;
procedure pickup_p_proc;
procedure talk_p_proc;
procedure Sammael01;
procedure Sammael02;
procedure Sammael03;
procedure Sammael04;
procedure Sammael05;
procedure Sammael06;
procedure Sammael07;
procedure Sammael08;
procedure Sammael09;
procedure Sammael10;
procedure Sammael11;
procedure Sammael12;
procedure Sammael13;
procedure Sammael14;
procedure Sammael15;
variable hostile;
variable initialized;
procedure start
begin
if (not(initialized)) then begin
if ((global_var(613) == 9103) or (global_var(613) == 9102)) then begin
critter_add_trait(self_obj, 1, 6, 0);
end
else begin
critter_add_trait(self_obj, 1, 6, 49);
end
critter_add_trait(self_obj, 1, 5, 29);
initialized := 1;
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
else begin
if (script_action == 21) then begin
call look_at_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
end
end
end
end
end
end
procedure critter_p_proc
begin
if (hostile) then begin
hostile := 0;
attack_complex(dude_obj, 0, 1, 0, 0, 30000, 0, 0);
end
else begin
if (tile_distance_objs(dude_obj, self_obj) > get_critter_stat(dude_obj, 1)) then begin
set_obj_visibility(self_obj, 1);
end
else begin
set_obj_visibility(self_obj, 0);
end
end
end
procedure damage_p_proc
begin
if (source_obj == dude_obj) then begin
set_global_var(251, 1);
critter_add_trait(self_obj, 1, 6, 49);
end
end
procedure destroy_p_proc
begin
if (source_obj == dude_obj) then begin
set_global_var(251, 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
critter_add_trait(self_obj, 1, 6, 49);
end
end
procedure look_at_p_proc
begin
script_overrides;
if (local_var(4)) then begin
display_msg(message_str(254, 100));
end
else begin
display_msg(message_str(254, 101));
end
end
procedure pickup_p_proc
begin
set_global_var(251, 1);
end
procedure talk_p_proc
begin
start_gdialog(254, self_obj, 4, -1, -1);
gsay_start;
if (local_var(4)) then begin
call Sammael14;
end
else begin
call Sammael01;
end
gsay_end;
end_dialogue;
end
procedure Sammael01
begin
gsay_reply(254, 102);
giq_option(4, 254, message_str(254, 103) + proto_data(obj_pid(dude_obj), 1) + message_str(254, 104), Sammael02, 50);
giq_option(4, 254, 105, Sammael03, 50);
giq_option(-3, 254, 106, Sammael15, 50);
end
procedure Sammael02
begin
set_local_var(4, 1);
gsay_reply(254, 107);
giq_option(4, 254, 108, Sammael04, 50);
giq_option(4, 254, 109, Sammael05, 50);
end
procedure Sammael03
begin
gsay_message(254, 110, 50);
end
procedure Sammael04
begin
gsay_reply(254, 111);
giq_option(4, 254, 112, Sammael06, 50);
giq_option(4, 254, 113, Sammael07, 50);
giq_option(6, 254, 114, Sammael08, 50);
giq_option(0, 254, 115, Sammael05, 50);
end
procedure Sammael05
begin
gsay_message(254, 116, 50);
end
procedure Sammael06
begin
gsay_reply(254, 117);
giq_option(4, 254, 118, Sammael07, 50);
giq_option(6, 254, 119, Sammael08, 50);
giq_option(4, 254, 120, Sammael05, 50);
end
procedure Sammael07
begin
gsay_message(254, 121, 50);
end
procedure Sammael08
begin
gsay_reply(254, 122);
giq_option(4, 254, 123, Sammael09, 50);
giq_option(4, 254, 124, Sammael10, 50);
giq_option(4, 254, 125, Sammael11, 50);
giq_option(4, 254, 126, Sammael12, 50);
giq_option(4, 254, 127, Sammael13, 50);
giq_option(4, 254, 128, Sammael05, 50);
end
procedure Sammael09
begin
gsay_message(254, 129, 50);
call Sammael08;
end
procedure Sammael10
begin
gsay_message(254, 130, 50);
gsay_message(254, 131, 50);
call Sammael08;
end
procedure Sammael11
begin
gsay_message(254, 132, 50);
call Sammael08;
end
procedure Sammael12
begin
gsay_message(254, 133, 50);
call Sammael08;
end
procedure Sammael13
begin
gsay_message(254, 134, 50);
gsay_message(254, 135, 50);
call Sammael08;
end
procedure Sammael14
begin
gsay_reply(254, 136);
giq_option(4, 254, 137, Sammael04, 50);
giq_option(4, 254, 138, Sammael05, 50);
end
procedure Sammael15
begin
gsay_message(254, 139, 50);
end