procedure start;
procedure destroy_p_proc;
procedure do_dialogue;
procedure Lenore00;
procedure Lenore01;
procedure Lenore02;
procedure Lenore03;
procedure Lenore04;
variable initialized;
variable home_tile := 29081;
variable CurrentHP;
variable MaxHP;
/*
?import? variable hostile; // not used
?import? variable armed; // not used
?import? variable dog_is_angry; // map_var(5)
?import? variable smartass_1; // map_var(6)
?import? variable smartass_2; // map_var(7)
?import? variable growling; // map_var(9)
*/
procedure start
begin
if (metarule(14, 0) and (CurrentHP != 1)) then begin
MaxHP := get_critter_stat(self_obj, 7);
critter_heal(self_obj, MaxHP);
CurrentHP := 1;
end
if (not(initialized)) then begin
critter_add_trait(self_obj, 1, 6, 5);
initialized := 1;
end
else begin
if (script_action == 11) then begin
call do_dialogue;
end
else begin
if (script_action == 18) then begin
call destroy_p_proc;
end
else begin
if (script_action == 4) then begin
attack_complex(dude_obj, 0, 1, 0, 0, 30000, 0, 0);
end
else begin
if (script_action == 12) then begin
if (global_var(628) == 1) then begin
if (obj_can_see_obj(self_obj, dude_obj)) then begin
attack_complex(dude_obj, 0, 1, 0, 0, 30000, 0, 0);
end
end
if (map_var(9) == 1) then begin
call Lenore00;
end
if (map_var(5) == 0) then begin
animate_move_obj_to_tile(self_obj, home_tile, 0);
end
end
else begin
if (script_action == 8) then begin
if (action_being_used == 14) then begin
dialogue_system_enter;
end
end
end
end
end
end
end
end
procedure destroy_p_proc
begin
variable LVar0 := 0;
variable LVar1 := 0;
LVar1 := critter_inven_obj(self_obj, 1);
LVar0 := tile_num_in_direction(tile_num(self_obj), random(0, 5), random(0, 2));
if ((LVar1 != 21) or (LVar1 != 234) or (LVar1 != 235) or (critter_inven_obj(self_obj, 2) != 21) or (critter_inven_obj(self_obj, 2) != 234) or (critter_inven_obj(self_obj, 2) != 235)) then begin
rm_obj_from_inven(self_obj, LVar1);
move_to(LVar1, LVar0, elevation(self_obj));
end
if (source_obj == dude_obj) then begin
set_global_var(628, 1);
set_global_var(247, 1);
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 do_dialogue
begin
if (global_var(5)) then begin
call Lenore02;
end
else begin
if (not(map_var(5))) then begin
call Lenore04;
end
else begin
if ((obj_item_subtype(critter_inven_obj(dude_obj, 1)) == 3) or (obj_item_subtype(critter_inven_obj(dude_obj, 2)) == 3)) then begin
call Lenore01;
end
else begin
call Lenore03;
end
end
end
end
procedure Lenore00
begin
variable LVar0 := 0;
variable LVar1 := 0;
LVar0 := random(1, 3);
if (LVar0 == 1) then begin
LVar1 := message_str(375, 101);
end
else begin
if (LVar0 == 2) then begin
LVar1 := message_str(375, 102);
end
else begin
if (LVar0 == 3) then begin
// set_global_var(187, 1);
LVar1 := message_str(375, 103);
end
end
end
// if (map_var(5)) then begin
float_msg(self_obj, LVar1, 0);
// end
// set_map_var (7, 0);
end
procedure Lenore01
begin
// if (map_var(5)) then begin
float_msg(self_obj, message_str(375, 104), 0);
// end
end
procedure Lenore02
begin
// if (map_var(5)) then begin
float_msg(self_obj, message_str(375, 105), 0);
// end
end
procedure Lenore03
begin
float_msg(self_obj, message_str(375, 106), 0);
set_map_var (6, 1);
end
procedure Lenore04
begin
float_msg(self_obj, message_str(375, 107), 0);
end