AIRGRD.INT

*This image comes from* Fallout Mod *or from websites created and owned by Game publisher or Game developer, who hold the copyright of* Fallout Mod*. All trademarks and registered trademarks present in the image are proprietary to Game publisher.
The use of images to illustrate articles concerning the subject of the images in question is believed to qualify as **fair use** under United States copyright law, as such display does not significantly impede the right of the copyright holder to sell the copyrighted material.*

Template:Scriptfile

Template:Scriptbox

File:Transcript.png
procedure start;

procedure do\_dialogue;

procedure dialog;

procedure airgrd00;

procedure airgrd01;

procedure airgrd02;

procedure airgrd03;

procedure airgrd03a;

procedure airgrd04;

procedure airgrd04a;

procedure airgrd04b;

procedure airgrd05;

procedure airgrd06;

procedure airgrd07;

procedure airgrd08;

procedure airgrd09;

procedure airgrd10;

procedure airgrd11;

procedure airgrd12;

procedure airgrd13;

procedure airgrd14;

procedure airgrd15;

procedure bluff\_end;

procedure dialog\_end;

procedure airgrdtim;

procedure combat;

variable HOSTILE;

variable only\_once := 1;

variable Weapons;

variable DISGUISED;

variable again;

variable first;

variable rndx;

variable jumpcode;

variable indialog;

variable temp;

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, 34);

                critter\_add\_trait(self\_obj, 1, 5, 46);

        end

        else begin

                if (script\_action == 14) then begin

                        if (global\_var(245) == 0) then begin

                                set\_global\_var(245, 1);

                        end

                end

                else begin

                        if (script\_action == 11) then begin

                                call do\_dialogue;

                        end

                        else begin

                                if (script\_action == 4) then begin

                                        HOSTILE := 1;

                                end

                                else begin

                                        if (script\_action == 22) then 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 combat;

                                                end

                                        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

                                                        if (obj\_can\_see\_obj(self\_obj, dude\_obj) and (tile\_distance\_objs(self\_obj, dude\_obj) < 6)) then 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

                                                                        if (Weapons == 0) then begin

                                                                                Weapons := 1;

                                                                                again := 1;

                                                                                dialogue\_system\_enter;

                                                                        end

                                                                end

                                                                DISGUISED := 0;

                                                                if (obj\_pid(critter\_inven\_obj(dude\_obj, 0)) == 113) then begin

                                                                        if (metarule(16, 0) > 1) then begin

                                                                                DISGUISED := 0;

                                                                        end

                                                                        else begin

                                                                                DISGUISED := 1;

                                                                        end

                                                                end

                                                                if (DISGUISED == 0) then begin

                                                                        again := 1;

                                                                        dialogue\_system\_enter;

                                                                end

                                                                if (again == 0) then begin

                                                                        again := 1;

                                                                        dialogue\_system\_enter;

                                                                end

                                                        end

                                                end

                                                else begin

                                                        if ((script\_action == 21) or (script\_action == 3)) then begin

                                                                script\_overrides;

                                                        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

end

procedure do\_dialogue

begin

        if (obj\_pid(critter\_inven\_obj(dude\_obj, 0)) == 113) then begin

                if (metarule(16, 0) > 1) then begin

                        DISGUISED := 0;

                end

                else begin

                        DISGUISED := 1;

                end

        end

        if ((map\_var(1) == 1) and (global\_var(231) == 1)) then begin

                call airgrd00;

        end

        else begin

                if (DISGUISED) then begin

                        if (Weapons) then begin

                                jumpcode := 1;

                                call dialog;

                        end

                        else begin

                                if (first == 0) then begin

                                        first := 1;

                                        jumpcode := 2;

                                        call dialog;

                                end

                                else begin

                                        if (first == 1) then begin

                                                call airgrd08;

                                        end

                                end

                        end

                end

                else begin

                        if (Weapons) then begin

                                call airgrd15;

                        end

                        else begin

                                jumpcode := 3;

                                call dialog;

                        end

                end

        end

end

procedure dialog

begin

        set\_local\_var(3, 1);

        call get\_reaction;

        start\_gdialog(673, self\_obj, 4, -1, -1);

        gsay\_start;

        indialog := 1;

        if (jumpcode < 2) then begin

                call airgrd01;

        end

        else begin

                if (jumpcode == 2) then begin

                        call airgrd03;

                end

                else begin

                        if (jumpcode > 2) then begin

                                call airgrd09;

                        end

                end

        end

        indialog := 0;

        gsay\_end;

        end\_dialogue;

end

procedure airgrd00

begin

        float\_msg(self\_obj, message\_str(673, random(102, 104)), 2);

end

procedure airgrd01

begin

        gsay\_reply(673, 105);

        giq\_option(-3, 673, 106, airgrd02, 51);

        giq\_option(4, 673, 107, airgrdtim, 50);

        giq\_option(4, 673, 108, airgrd02, 51);

        giq\_option(4, 673, 109, airgrdtim, 50);

end

procedure airgrd02

begin

        gsay\_message(673, 110, 51);

        call combat;

end

procedure airgrd03

begin

        gsay\_reply(673, 111);

        giq\_option(-3, 673, 112, airgrd02, 51);

        giq\_option(4, 673, 113, airgrd04, 50);

        giq\_option(4, 673, 114, airgrd03a, 50);

        giq\_option(4, 673, 115, airgrd02, 51);

end

procedure airgrd03a

begin

        if (is\_success(roll\_vs\_skill(dude\_obj, 14, 0))) then begin

                call airgrd06;

        end

        else begin

                call airgrd08;

        end

end

procedure airgrd04

begin

        gsay\_reply(673, 116);

        giq\_option(4, 673, 117, airgrd04a, 50);

        giq\_option(6, 673, 118, airgrd04b, 50);

end

procedure airgrd04a

begin

        if (is\_success(roll\_vs\_skill(dude\_obj, 14, -30))) then begin

                call airgrd06;

        end

        else begin

                call airgrd05;

        end

end

procedure airgrd04b

begin

        if (is\_success(roll\_vs\_skill(dude\_obj, 14, -15))) then begin

                call airgrd06;

        end

        else begin

                call airgrd05;

        end

end

procedure airgrd05

begin

        gsay\_message(673, 119, 51);

        call combat;

end

procedure airgrd06

begin

        gsay\_reply(673, 120);

        giq\_option(4, 673, 121, bluff\_end, 50);

        giq\_option(4, 673, 122, airgrd07, 51);

        giq\_option(4, 673, 123, bluff\_end, 50);

end

procedure airgrd07

begin

        gsay\_message(673, 124, 51);

        call combat;

end

procedure airgrd08

begin

        if (indialog == 1) then begin

                gsay\_message(673, random(125, 127), 50);

        end

        else begin

                float\_msg(self\_obj, message\_str(673, random(125, 127)), 2);

        end

        call bluff\_end;

end

procedure airgrd09

begin

        gsay\_reply(673, 128);

        giq\_option(-3, 673, 129, airgrd10, 51);

        giq\_option(4, 673, 130, airgrd10, 51);

        giq\_option(4, 673, 131, airgrd11, 51);

        giq\_option(4, 673, 132, airgrd02, 51);

end

procedure airgrd10

begin

        gsay\_message(673, 133, 51);

        call combat;

end

procedure airgrd11

begin

        gsay\_reply(673, 134);

        giq\_option(4, 673, 135, airgrd02, 51);

        giq\_option(4, 673, 136, airgrd12, 51);

end

procedure airgrd12

begin

        gsay\_reply(673, 137);

        giq\_option(4, 673, 138, airgrd13, 51);

        giq\_option(6, 673, 139, airgrd14, 51);

end

procedure airgrd13

begin

        gsay\_message(673, 140, 51);

        call combat;

end

procedure airgrd14

begin

        gsay\_message(673, 141, 51);

        call combat;

end

procedure airgrd15

begin

        gsay\_message(673, 142, 51);

        call combat;

end

procedure bluff\_end

begin

        if (local\_var(4) == 0) then begin

                set\_local\_var(4, 1);

                temp := 750;

                display\_msg(message\_str(673, 200) + temp + message\_str(673, 201));

                give\_exp\_points(temp);

        end

end

procedure dialog\_end

begin

end

procedure airgrdtim

begin

        add\_timer\_event(self\_obj, game\_ticks(10), 1);

end

procedure combat

begin

        HOSTILE := 1;

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