ARMSDEAL.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 combat;

procedure critter\_p\_proc;

procedure pickup\_p\_proc;

procedure talk\_p\_proc;

procedure destroy\_p\_proc;

procedure look\_at\_p\_proc;

procedure Merchant00;

procedure Merchant01;

procedure Merchant02;

procedure Merchant03;

procedure Merchant04;

procedure Merchant05;

procedure Get\_Stuff;

procedure Put\_Stuff;

variable hostile;

variable Only\_Once := 1;

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

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

        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 combat

begin

        hostile := 1;

end

procedure critter\_p\_proc

begin

        if (hostile) then begin

                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 get\_reaction;

        call Get\_Stuff;

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

        gsay\_start;

        call Merchant00;

        gsay\_end;

        end\_dialogue;

        call Put\_Stuff;

end

procedure destroy\_p\_proc

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(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(782, 110));

end

procedure Merchant00

begin

        gsay\_reply(782, 101);

        giq\_option(4, 782, 102, Merchant01, 50);

        giq\_option(4, 782, 103, Merchant02, 50);

        giq\_option(4, 782, 104, Merchant03, 50);

        giq\_option(-3, 782, 105, Merchant04, 50);

end

procedure Merchant01

begin

        gsay\_message(782, 106, 50);

        gdialog\_mod\_barter(-10);

        call Merchant05;

end

procedure Merchant02

begin

        gsay\_message(782, 107, 50);

        gdialog\_mod\_barter(-10);

        call Merchant05;

end

procedure Merchant03

begin

end

procedure Merchant04

begin

        gsay\_message(782, 108, 50);

end

procedure Merchant05

begin

        gsay\_message(782, 109, 50);

end

procedure Get\_Stuff

begin

        variable LVar0 := 0;

        LVar0 := create\_object\_sid(32, 0, 0, -1);

        add\_mult\_objs\_to\_inven(self\_obj, LVar0, 5);

        LVar0 := create\_object\_sid(14, 0, 0, -1);

        add\_mult\_objs\_to\_inven(self\_obj, LVar0, 5);

        LVar0 := create\_object\_sid(25, 0, 0, -1);

        add\_mult\_objs\_to\_inven(self\_obj, LVar0, 6);

        LVar0 := create\_object\_sid(11, 0, 0, -1);

        add\_mult\_objs\_to\_inven(self\_obj, LVar0, 2);

        LVar0 := create\_object\_sid(10, 0, 0, -1);

        add\_mult\_objs\_to\_inven(self\_obj, LVar0, 2);

        LVar0 := create\_object\_sid(23, 0, 0, -1);

        add\_mult\_objs\_to\_inven(self\_obj, LVar0, 1);

        LVar0 := create\_object\_sid(27, 0, 0, -1);

        add\_mult\_objs\_to\_inven(self\_obj, LVar0, 6);

        LVar0 := create\_object\_sid(13, 0, 0, -1);

        add\_mult\_objs\_to\_inven(self\_obj, LVar0, 1);

        LVar0 := create\_object\_sid(9, 0, 0, -1);

        add\_mult\_objs\_to\_inven(self\_obj, LVar0, 2);

        LVar0 := create\_object\_sid(143, 0, 0, -1);

        add\_mult\_objs\_to\_inven(self\_obj, LVar0, 1);

end

procedure Put\_Stuff

begin

        variable LVar0 := 0;

        variable LVar1 := 0;

        LVar0 := obj\_carrying\_pid\_obj(self\_obj, 32);

        LVar1 := rm\_mult\_objs\_from\_inven(self\_obj, LVar0, 5);

        destroy\_object(LVar0);

        LVar0 := obj\_carrying\_pid\_obj(self\_obj, 14);

        LVar1 := rm\_mult\_objs\_from\_inven(self\_obj, LVar0, 5);

        destroy\_object(LVar0);

        LVar0 := obj\_carrying\_pid\_obj(self\_obj, 25);

        LVar1 := rm\_mult\_objs\_from\_inven(self\_obj, LVar0, 6);

        destroy\_object(LVar0);

        LVar0 := obj\_carrying\_pid\_obj(self\_obj, 11);

        LVar1 := rm\_mult\_objs\_from\_inven(self\_obj, LVar0, 2);

        destroy\_object(LVar0);

        LVar0 := obj\_carrying\_pid\_obj(self\_obj, 10);

        LVar1 := rm\_mult\_objs\_from\_inven(self\_obj, LVar0, 2);

        destroy\_object(LVar0);

        LVar0 := obj\_carrying\_pid\_obj(self\_obj, 23);

        LVar1 := rm\_mult\_objs\_from\_inven(self\_obj, LVar0, 1);

        destroy\_object(LVar0);

        LVar0 := obj\_carrying\_pid\_obj(self\_obj, 27);

        LVar1 := rm\_mult\_objs\_from\_inven(self\_obj, LVar0, 6);

        destroy\_object(LVar0);

        LVar0 := obj\_carrying\_pid\_obj(self\_obj, 13);

        LVar1 := rm\_mult\_objs\_from\_inven(self\_obj, LVar0, 1);

        destroy\_object(LVar0);

        LVar0 := obj\_carrying\_pid\_obj(self\_obj, 9);

        LVar1 := rm\_mult\_objs\_from\_inven(self\_obj, LVar0, 2);

        destroy\_object(LVar0);

        LVar0 := obj\_carrying\_pid\_obj(self\_obj, 143);

        LVar1 := rm\_mult\_objs\_from\_inven(self\_obj, LVar0, 1);

        destroy\_object(LVar0);

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