ADYTOWNR.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 look\_at\_p\_proc;

procedure description\_p\_proc;

procedure talk\_p\_proc;

procedure critter\_p\_proc;

procedure damage\_p\_proc;

procedure destroy\_p\_proc;

procedure timed\_event\_p\_proc;

variable Initialize := 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 pickup\_p\_proc;

procedure FleeDude;

procedure Start

begin

        if (Initialize) then begin

                if (obj\_is\_carrying\_obj\_pid(self\_obj, 41) == 0) then begin

                        item\_caps\_adjust(self\_obj, random(1, 10));

                end

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

                add\_timer\_event(self\_obj, game\_ticks(random(3, 5)), 1);

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

                        set\_local\_var(4, tile\_num(self\_obj));

                end

                Initialize := 0;

        end

end

procedure look\_at\_p\_proc

begin

        script\_overrides;

        display\_msg(message\_str(251, 100));

end

procedure description\_p\_proc

begin

        script\_overrides;

        display\_msg(message\_str(251, 100));

end

procedure talk\_p\_proc

begin

        if (global\_var(251) == 1) then begin

                float\_msg(self\_obj, message\_str(669, random(100, 105)), 2);

        end

        else begin

                if (global\_var(613) == 2) then begin

                        float\_msg(self\_obj, message\_str(251, random(113, 119)), 0);

                end

                else begin

                        float\_msg(self\_obj, message\_str(251, random(101, 112)), 0);

                end

        end

end

procedure critter\_p\_proc

begin

        variable LVar0 := 0;

        LVar0 := global\_var(340);

        if ((((game\_time / 10) - LVar0) >= 10) and (tile\_distance\_objs(self\_obj, dude\_obj) <= 4) and (global\_var(251) == 0)) then begin

                if (global\_var(613) == 2) then begin

                        float\_msg(self\_obj, message\_str(251, random(113, 119)), 0);

                end

                else begin

                        float\_msg(self\_obj, message\_str(251, random(101, 112)), 0);

                end

                LVar0 := game\_time / 10;

                set\_global\_var(340, LVar0);

        end

        if (obj\_can\_see\_obj(self\_obj, dude\_obj)) then begin

                if (global\_var(251) == 1) then begin

                        attack\_complex(dude\_obj, 0, 1, 0, 0, 30000, 0, 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 timed\_event\_p\_proc

begin

        variable LVar0 := 0;

        LVar0 := tile\_num\_in\_direction(local\_var(4), random(0, 5), random(1, 5));

        animate\_move\_obj\_to\_tile(self\_obj, LVar0, 0);

        add\_timer\_event(self\_obj, game\_ticks(random(3, 5)), 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

procedure pickup\_p\_proc

begin

        set\_global\_var(251, 1);

end

procedure FleeDude

begin

        variable LVar0 := 0;

        variable LVar1 := 0;

        variable LVar2 := 0;

        variable LVar3 := 0;

        variable LVar4 := 1;

        LVar0 := random(0, 5);

        LVar1 := LVar0;

        while(LVar4 == 1) do begin

                LVar2 := tile\_num\_in\_direction(tile\_num(self\_obj), LVar0, 3);

                if (tile\_distance(tile\_num(dude\_obj), LVar2) > LVar3) then begin

                        LVar3 := tile\_distance(tile\_num(dude\_obj), LVar2);

                end

                LVar0 := LVar0 + 1;

                if (LVar0 == 5) then begin

                        LVar0 := 0;

                end

                if (LVar0 == LVar1) then begin

                        LVar4 := 0;

                end

        end

        animate\_move\_obj\_to\_tile(self\_obj, LVar2, 1);

end