ALEX.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 critter\_p\_proc;

procedure destroy\_p\_proc;

procedure look\_at\_p\_proc;

procedure talk\_p\_proc;

procedure Alex01;

procedure Alex02;

procedure Alex03;

procedure Alex04;

procedure Alex05;

procedure Alex06;

procedure Alex07;

procedure sleeping;

variable night\_person;

variable wake\_time;

variable sleep\_time;

variable home\_tile;

variable sleep\_tile;

variable hostile;

variable initialized;

procedure start

begin

        if (not(initialized)) then begin

                critter\_add\_trait(self\_obj, 1, 6, 49);

                sleep\_tile := 14275;

                home\_tile := 11300;

                wake\_time := 2030;

                sleep\_time := 730;

                night\_person := 1;

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

                        item\_caps\_adjust(self\_obj, random(0, 20));

                end

                initialized := 1;

        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

                        else begin

                                if (script\_action == 21) then begin

                                        call look\_at\_p\_proc;

                                end

                                else begin

                                        if (script\_action == 11) then begin

                                                call talk\_p\_proc;

                                        end

                                end

                        end

                end

        end

end

procedure critter\_p\_proc

begin

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

                if (hostile) then begin

                        hostile := 0;

                        attack\_complex(dude\_obj, 0, 1, 0, 0, 30000, 0, 0);

                end

                else begin

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

                                if (tile\_distance\_objs(self\_obj, dude\_obj) < 12) then begin

                                        dialogue\_system\_enter;

                                end

                        end

                        if (tile\_distance(tile\_num(dude\_obj), 10700) > tile\_distance(tile\_num(dude\_obj), 11900)) then begin

                                if (global\_var(128) < 2) then begin

                                        hostile := 1;

                                end

                        end

                end

        end

        else begin

                call sleeping;

        end

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

        if (local\_var(0)) then begin

                script\_overrides;

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

        end

end

procedure talk\_p\_proc

begin

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

                float\_msg(self\_obj, message\_str(670, 101) + proto\_data(obj\_pid(dude\_obj), 1), 0);

        end

        else begin

                if (local\_var(0)) then begin

                        call Alex01;

                end

                else begin

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

                        gsay\_start;

                        call Alex02;

                        gsay\_end;

                        end\_dialogue;

                end

        end

end

procedure Alex01

begin

        float\_msg(self\_obj, message\_str(670, 102), 0);

end

procedure Alex02

begin

        set\_local\_var(0, 1);

        gsay\_reply(670, 103);

        giq\_option(4, 670, 104, Alex03, 50);

        giq\_option(4, 670, 105, Alex05, 51);

        giq\_option(4, 670, 106, Alex06, 50);

        giq\_option(-3, 670, 114, Alex06, 50);

end

procedure Alex03

begin

        gsay\_reply(670, 107);

        giq\_option(4, 670, 108, Alex04, 50);

        giq\_option(4, 670, 106, Alex06, 50);

end

procedure Alex04

begin

        gsay\_message(670, 109, 50);

end

procedure Alex05

begin

        gsay\_reply(670, 110);

        giq\_option(4, 670, 106, Alex06, 50);

        giq\_option(4, 670, 111, Alex07, 50);

end

procedure Alex06

begin

        gsay\_message(670, 112, 50);

end

procedure Alex07

begin

        hostile := 1;

        gsay\_message(670, 113, 51);

end

procedure sleeping

begin

        if (local\_var(1) == 1) then begin

                if (not(night\_person) and (game\_time\_hour >= wake\_time) and (game\_time\_hour < sleep\_time) or (night\_person and ((game\_time\_hour >= wake\_time) or (game\_time\_hour < sleep\_time)))) then begin

                        if (((game\_time\_hour - wake\_time) < 10) and ((game\_time\_hour - wake\_time) > 0)) then begin

                                if (tile\_num(self\_obj) != home\_tile) then begin

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

                                end

                                else begin

                                        set\_local\_var(1, 0);

                                end

                        end

                        else begin

                                move\_to(self\_obj, home\_tile, elevation(self\_obj));

                                if (tile\_num(self\_obj) == home\_tile) then begin

                                        set\_local\_var(1, 0);

                                end

                        end

                end

        end

        else begin

                if (night\_person and (game\_time\_hour >= sleep\_time) and (game\_time\_hour < wake\_time) or (not(night\_person) and ((game\_time\_hour >= sleep\_time) or (game\_time\_hour < wake\_time)))) then begin

                        if (((game\_time\_hour - sleep\_time) < 10) and ((game\_time\_hour - sleep\_time) > 0)) then begin

                                if (tile\_num(self\_obj) != sleep\_tile) then begin

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

                                end

                                else begin

                                        set\_local\_var(1, 1);

                                end

                        end

                        else begin

                                if (tile\_num(self\_obj) != sleep\_tile) then begin

                                        move\_to(self\_obj, sleep\_tile, elevation(self\_obj));

                                end

                                else begin

                                        set\_local\_var(1, 1);

                                end

                        end

                end

        end

end