Fallout Wiki
Advertisement
Fallout Wiki
Details
Type Decompiled script
SCRIPTS.LST comment generic Knights in the Brotherhood.
MSG file KNIGHTB.MSG
Transcript

procedure start;
procedure KnightBRandom;
procedure critter_p_proc;
procedure pickup_p_proc;
procedure talk_p_proc;
procedure destroy_p_proc;
procedure look_at_p_proc;
variable hostile;
variable only_once := 1;
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 == 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
procedure KnightBRandom
begin
        variable LVar0 := 0;
        variable LVar1 := 0;
        if (not(LVar0)) then begin
                LVar0 := random(1, 11);
        end
        if (LVar0 > 11) then begin
                LVar0 := 1;
        end
        LVar1 := message_str(330, 101);
        if (LVar0 == 2) then begin
                LVar1 := message_str(330, 102);
        end
        else begin
                if (LVar0 == 3) then begin
                        LVar1 := message_str(330, 103);
                end
                else begin
                        if (LVar0 == 4) then begin
                                LVar1 := message_str(330, 104);
                        end
                        else begin
                                if (LVar0 == 5) then begin
                                        LVar1 := message_str(330, 105);
                                end
                                else begin
                                        if (LVar0 == 6) then begin
                                                LVar1 := message_str(330, 106);
                                        end
                                        else begin
                                                if (LVar0 == 7) then begin
                                                        LVar1 := message_str(330, 107);
                                                end
                                                else begin
                                                        if (LVar0 == 8) then begin
                                                                LVar1 := message_str(330, 108);
                                                        end
                                                        else begin
                                                                if (LVar0 == 9) then begin
                                                                        LVar1 := message_str(330, 109);
                                                                end
                                                                else begin
                                                                        if (LVar0 == 10) then begin
                                                                                LVar1 := message_str(330, 110);
                                                                        end
                                                                        else begin
                                                                                if (LVar0 == 11) then begin
                                                                                        LVar1 := message_str(330, 111);
                                                                                end
                                                                                else begin
                                                                                        LVar0 := 1;
                                                                                end
                                                                        end
                                                                end
                                                        end
                                                end
                                        end
                                end
                        end
                end
        end
        LVar0 := LVar0 + 1;
        float_msg(self_obj, LVar1, 0);
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
end
procedure pickup_p_proc
begin
        if (source_obj == dude_obj) then begin
                hostile := 1;
        end
end
procedure talk_p_proc
begin
        call KnightBRandom;
end
procedure destroy_p_proc
begin
        set_global_var(250, 1);
        rm_timer_event(self_obj);
        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;
        display_msg(message_str(330, 100));
end

Advertisement