ACVILLGR.SSL

*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
/\*

        Copyright 1998-2003 Interplay Entertainment Corp. All rights reserved.

\*/

/\*

        Name: Arroyo Villager

        Location: Arroyo

        Description: Generic villager in Arroyo. No weapons, flees if confronted.

        Log:

           Please note any changes that have been made to the file in Updated. Then comment

           the code which you have changed/altered/commented out. Please, do not delete any

           code which was written.

           Created: December 01, 1997

           Updated:

\*/

/\* Include Files \*/

/\* Note, the Following Lines need to be in this order so that

   the script will be compilable. The define Name is referenced

   in a module from define.h and used in command.h. Please do

   not change the ordering.

        -rwh2 11/13/97

\*/

#include "..\headers\define.h"

#include "..\headers\ArVillag.h"

#define NAME SCRIPT\_ACVILLGR

#define TOWN\_REP\_VAR GVAR\_TOWN\_REP\_ARROYO

#include "..\headers\command.h"

#include "..\headers\ModReact.h"

#define MAX\_TRAVEL (30)

/\* Standard Script Procedures \*/

procedure start;

procedure critter\_p\_proc;

procedure pickup\_p\_proc;

procedure talk\_p\_proc;

procedure destroy\_p\_proc;

procedure look\_at\_p\_proc;

procedure description\_p\_proc;

procedure use\_skill\_on\_p\_proc;

procedure damage\_p\_proc;

procedure map\_enter\_p\_proc;

procedure timed\_event\_p\_proc;

procedure push\_p\_proc;

/\* Script Specific Procedure Calls \*/

procedure Node997; // this Node handles the basic START CONDITIONS

procedure Node998; // This Node is Always Combat

procedure Node999; // This Node is Always Ending

// The next lines are added in by the Designer Tool.

// Do NOT add in any lines here.

//~~~~~~~~~~~~~~~~ DESIGNER TOOL STARTS HERE

procedure Node000;

procedure Node001;

procedure Node002;

procedure Node003;

procedure Node004;

procedure Node005;

procedure Node006;

procedure Node007;

procedure Node008;

procedure Node009;

procedure Node010;

//~~~~~~~~~~~~~~~~ DESIGN TOOL ENDS HERE

// The Following lines are for anything that is not needed to be

// seen by the design Tool

/\* Local Variables which are saved. All Local Variables need to be

   prepended by LVAR\_ \*/

#define LVAR\_Herebefore (4)

#define LVAR\_Hostile (5)

#define LVAR\_Personal\_Enemy (6)

#define LVAR\_Home\_Tile (7)

/\* Local variables which do not need to be saved between map changes. \*/

variable Only\_Once:=0;

variable In\_Timed\_Event;

procedure start begin

   if (local\_var(LVAR\_Home\_Tile) == 0) then begin

       set\_local\_var(LVAR\_Home\_Tile,tile\_num(self\_obj));

   end

end

procedure push\_p\_proc begin

end

/\* This procedure will get called each time that the map is first entered. It will

   set up the Team number and AI packet for this critter. This will override the

   default from the prototype, and needs to be set in scripts. \*/

procedure map\_enter\_p\_proc begin

   Only\_Once:=0;

   critter\_add\_trait(self\_obj,TRAIT\_OBJECT,OBJECT\_TEAM\_NUM,TEAM\_ARROYO);

   critter\_add\_trait(self\_obj,TRAIT\_OBJECT,OBJECT\_AI\_PACKET,AI\_ARROYO\_VILLAGER);

end

/\* Every heartbeat that the critter gets, this procedure will be called. Anything from

   Movement to attacking the player on sight can be placed in here.\*/

procedure critter\_p\_proc begin

   if (((local\_var(LVAR\_Hostile) == 2)or(local\_var(LVAR\_Personal\_Enemy) == 1)) and (obj\_can\_see\_obj(self\_obj,dude\_obj))) then begin

      set\_local\_var(LVAR\_Hostile,1);

      Flee\_From\_Dude

   end

   if (REP\_ENEMY\_ARROYO) then begin

       attack(dude\_obj);

   end

   if ((random(0,100) == 1) and (In\_Timed\_Event == 0)) then begin

       In\_Timed\_Event:=1;

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

   end

end

procedure timed\_event\_p\_proc begin

   if (fixed\_param == 1) then begin

       if (tile\_distance(tile\_num(self\_obj),local\_var(LVAR\_Home\_Tile)) < MAX\_TRAVEL) then begin

           animate\_move\_to\_tile(tile\_num\_in\_direction(tile\_num(self\_obj),random(0,5),random(3,7)));

       end

       else begin

           animate\_move\_to\_tile(tile\_num\_in\_direction(local\_var(LVAR\_Home\_Tile),random(0,5),random(3,7)));

       end

       In\_Timed\_Event:=0;

   end

end

/\* Whenever the critter takes damage of any type, this procedure will be called. Things

   like setting ENEMY\_ and LVAR\_Personal\_Enemy can be set here. \*/

procedure damage\_p\_proc begin

   if (source\_obj == dude\_obj) then begin

      set\_local\_var(LVAR\_Personal\_Enemy,1);

      set\_global\_var(GVAR\_ENEMY\_ARROYO,1);

   end

end

/\* Any time that the player is caught stealing from this critter, Pickup\_proc will be called.

   In here, various things can happen. The most common response is instant hostility which

   will be remembered. \*/

procedure pickup\_p\_proc begin

   if (source\_obj == dude\_obj) then begin

      set\_local\_var(LVAR\_Hostile,2);

   end

end

/\* The dialog system is setup and prepares the player to talk to this NPC. Where To Go

   written by designers are placed in here. Additionally, Reactions are generated and

   stored which affects player interactions. \*/

procedure talk\_p\_proc begin

   GetReaction;

   if ((REP\_ENEMY\_ARROYO) or (local\_var(LVAR\_Personal\_Enemy) == 1)) then begin

      call Node009;

   end else begin

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

      gSay\_Start;

// if (map\_var(MVAR\_Talked\_Villager) == 0) then begin

// set\_map\_var(MVAR\_Talked\_Villager,1);

// call Node000;

// end

// else

             call Node997;

      gSay\_End;

      end\_dialogue;

   end

end

/\* This procedure gets called only on the death of this NPC. Special things like

   incrementing the death count for reputation purposes and Enemy Counters are placed

   in here. \*/

procedure destroy\_p\_proc begin

/\* Increment the aligned critter counter\*/

   inc\_good\_critter

end

/\* Look\_at\_p\_proc gets called any time that the player passes the cursor over any object.

   This should only hold the most cursory of glances for the player. \*/

procedure look\_at\_p\_proc begin

   script\_overrides;

   if (critter\_is\_male) then begin

       display\_msg(mstr(100));

   end else begin

       display\_msg(mstr(101));

   end

end

/\* The player will see more indepth descriptions from this procedure. They are actively

   looking at the critter and want more information. Things like names can be added here

   if the critter is known to the player. \*/

procedure description\_p\_proc begin

   script\_overrides;

   display\_msg(mstr(150));

end

/\* Any time a skill is used on a critter this call is made. This can be to give examinations

   for things like Doctor skill or messages for various other skills. \*/

procedure use\_skill\_on\_p\_proc begin

   if (action\_being\_used == SKILL\_STEAL) then begin

      if (is\_success(roll\_vs\_skill(dude\_obj,action\_being\_used,0))) then begin

         inc\_general\_rep(REP\_BONUS\_ARROYO\_MONEY\_THEFT);

      end

   end

end

// nodes

procedure Node000 begin

   Reply(150);

   NOption(151,Node997,001);

end

procedure Node001 begin

// Reply(152);

   if (reached\_tl\_4) then

       Reply(303);

   else if (reached\_tl\_3) then

       Reply(302);

   else if (reached\_tl\_2) then

       Reply(301);

   else if (reached\_tl\_1) then

       Reply(300);

   else

       Reply(mstr(152));

   NOption(153,Node003,004);

   NOption(154,Node004,004);

   NOption(155,Node999,004);

end

procedure Node002 begin

   Reply(156);

   NOption(157,Node004,004);

   NOption(158,Node999,004);

end

procedure Node003 begin

   Reply(159);

   NOption(164,Node006,004);

   NOption(160,Node999,004);

end

procedure Node004 begin

   Reply(161);

   NOption(162,Node999,004);

   NOption(163,Node005,004);

   NOption(164,Node006,004);

end

procedure Node005 begin

   Reply(165);

   NOption(166,Node999,004);

   NOption(167,Node006,004);

end

procedure Node006 begin

   Reply(168);

   NOption(169,Node003,004);

   NOption(170,Node010,004);

   NOption(171,Node999,004);

end

procedure Node007 begin

   Reply(172);

   NLowOption(173,Node008);

end

procedure Node008 begin

   Reply(174);

   NLowOption(175,Node999);

end

procedure Node009 begin

   floater(random(176,182));

end

procedure Node010 begin

   Reply(183);

   NOption(184,Node003,004);

   NOption(186,Node006,004);

   NOption(185,Node999,004);

end

procedure Node997 begin

   if (get\_critter\_stat(dude\_obj,STAT\_iq) <= (0-LOW\_IQ)) then begin

      call Node007;

   end else if (local\_var(LVAR\_Herebefore) == 0) then begin

      call Node001;

   end else begin

      call Node001;

   end

end

procedure Node998 begin

   set\_local\_var(LVAR\_Hostile,2);

end

/\* Anytime that there is a need for an ending to dialog, this node is to be called. It will just

   exit from the dialog system without any reprisals from the NPC. \*/

procedure Node999 begin

end