AHELDER.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.

\*/

/\*

           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.

\*/

/\* 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\<TownName.h>"

#define NAME SCRIPT\_AHELDER

#define TOWN\_REP\_VAR global\_var(GVAR\_TOWN\_REP\_ARROYO)

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

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

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

/\* Script Specific Procedure Calls \*/

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 Node001;

procedure Node002;

procedure Node003;

procedure Node003a;

procedure Node003b;

procedure Node004;

procedure Node005;

procedure Node006;

procedure Node006a;

procedure Node007;

procedure Node008;

procedure Node009;

procedure Node010;

procedure Node011;

procedure Node012;

procedure Node013;

procedure Node014;

procedure Node015;

procedure Node016;

procedure Node017;

procedure Node018;

procedure Node019;

procedure Node020;

procedure Enc001;

procedure Enc002;

procedure Enc003;

procedure Enc004;

procedure Enc005;

procedure Enc005a;

procedure Enc006;

procedure Enc007;

procedure Enc008;

procedure Enc008a;

procedure Enc009;

procedure Enc010;

procedure Enc011;

procedure Enc012;

procedure Enc013;

procedure Enc013a;

//~~~~~~~~~~~~~~~~ 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\_Vault\_Looking (7)

#define LVAR\_Said\_2 (8)

#define LVAR\_Looked\_Before (9)

#define LVAR\_Said\_9 (10)

#define LVAR\_Enclave\_Herebefore (11)

/\* Imported variables from the Map scripts. These should only be

   pointers and variables that need not be saved. If a variable

   Needs to be saved, make it a map variable (MVAR\_) \*/

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

variable Only\_Once:=0;

procedure start 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\_ELDER);

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 the critter is mad at the player for any reason, it will attack and remember to attack

   the player should the game be saved and loaded repeatedly. Additionally, if any special

   actions need to be taken by the critter based on previous combat, the critter will remember

   this as well. \*/

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

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

       attack(dude\_obj);

   end

   if (REP\_ENEMY\_ARROYO) then begin

       attack(dude\_obj);

   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 the player causes damage to this critter, then he will instantly consider the player

   his personal enemy. In Critter\_Proc or through dialog, actions will be taken against

   the player for his evil acts. \*/

   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

   Evil\_Critter:=0;

   Slavery\_Tolerant:=SLAVE\_INTOLERANT;

   Karma\_Perception:=KARMA\_PERCEPTION1;

   CheckKarma;

   GetReaction;

   set\_global\_var(GVAR\_TALKED\_TO\_ELDER,1);

// in the Village

   if (cur\_map\_index == MAP\_ARROYO\_VILLAGE) then begin

       if (global\_var(GVAR\_FIND\_VIC) == 0) then

           set\_global\_var(GVAR\_FIND\_VIC,1);

       if (local\_var(LVAR\_Hostile)) then begin

           call Node014;

           call Node998;

       end

       else if (GAME\_TIME\_IN\_DAYS > TIME\_LIMIT\_4) then begin

           start\_gdialog(NAME,self\_obj,4,HEAD\_ELDER,BACKGROUND\_TENT);

           gSay\_Start;

               call Node020;

           gSay\_End;

           end\_dialogue;

       end

       else if (GAME\_TIME\_IN\_DAYS > TIME\_LIMIT\_3) then begin

           start\_gdialog(NAME,self\_obj,4,HEAD\_ELDER,BACKGROUND\_TENT);

           gSay\_Start;

               call Node019;

           gSay\_End;

           end\_dialogue;

       end

       else if (GAME\_TIME\_IN\_DAYS > TIME\_LIMIT\_2) then begin

           start\_gdialog(NAME,self\_obj,4,HEAD\_ELDER,BACKGROUND\_TENT);

           gSay\_Start;

               call Node018;

           gSay\_End;

           end\_dialogue;

       end

       else if (GAME\_TIME\_IN\_DAYS > TIME\_LIMIT\_1) then begin

           start\_gdialog(NAME,self\_obj,4,HEAD\_ELDER,BACKGROUND\_TENT);

           gSay\_Start;

               call Node017;

           gSay\_End;

           end\_dialogue;

       end

       else if (dude\_iq < 4) then begin

           start\_gdialog(NAME,self\_obj,4,HEAD\_ELDER,BACKGROUND\_TENT);

           gSay\_Start;

               call Node002;

           gSay\_End;

           end\_dialogue;

       end

       else if (local\_var(LVAR\_reaction\_level) < REACTION\_LEVEL\_NEUTRAL) then begin

           start\_gdialog(NAME,self\_obj,4,HEAD\_ELDER,BACKGROUND\_TENT);

           gSay\_Start;

               call Node003;

           gSay\_End;

           end\_dialogue;

       end

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

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

           start\_gdialog(NAME,self\_obj,4,HEAD\_ELDER,BACKGROUND\_TENT);

           gSay\_Start;

               call Node001;

           gSay\_End;

           end\_dialogue;

       end

       else begin

           start\_gdialog(NAME,self\_obj,4,HEAD\_ELDER,BACKGROUND\_TENT);

           gSay\_Start;

               call Node004;

           gSay\_End;

           end\_dialogue;

       end

   end

// at the Enclave

   else begin

       set\_global\_var(GVAR\_ENCLAVE\_ELDER,1);

       if ((obj\_pid(critter\_inven\_obj(dude\_obj,INVEN\_TYPE\_WORN)) == PID\_ADVANCED\_POWER\_ARMOR\_MK2) or

           (obj\_pid(critter\_inven\_obj(dude\_obj,INVEN\_TYPE\_WORN)) == PID\_HARDENED\_POWER\_ARMOR)) then begin

           start\_gdialog(NAME,self\_obj,4,HEAD\_ELDER,BACKGROUND\_ENCLAVE);

           gSay\_Start;

               call Enc002;

           gSay\_End;

           end\_dialogue;

       end

       else if (local\_var(LVAR\_reaction\_level) < REACTION\_LEVEL\_NEUTRAL) then begin

           start\_gdialog(NAME,self\_obj,4,HEAD\_ELDER,BACKGROUND\_ENCLAVE);

           gSay\_Start;

               call Enc009;

           gSay\_End;

           end\_dialogue;

       end

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

           inc\_local\_var(LVAR\_Enclave\_Herebefore);

           start\_gdialog(NAME,self\_obj,4,HEAD\_ELDER,BACKGROUND\_ENCLAVE);

           gSay\_Start;

               call Enc001;

           gSay\_End;

           end\_dialogue;

       end

       else begin

           start\_gdialog(NAME,self\_obj,4,HEAD\_ELDER,BACKGROUND\_ENCLAVE);

           gSay\_Start;

               call Enc010;

           gSay\_End;

           end\_dialogue;

       end

   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

   set\_global\_var(GVAR\_TOWN\_REP\_ARROYO, global\_var(GVAR\_TOWN\_REP\_ARROYO) - 50);

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

/\* Set global\_variable for Enemy status\*/

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 (local\_var(LVAR\_Looked\_Before) == 0) then begin

       inc\_local\_var(LVAR\_Looked\_Before);

       display\_msg(mstr(100));

   end

   else

       display\_msg(mstr(101));

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(102));

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

end

/\* Should the Player ever cause the NPC too much discomfort that he desires to attack the player,

   this call will be made. Essentially, it stores the Hostile vaule so that the critter remembers

   he was once hostile towards the player.\*/

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

// Not lines are allowed to be added below here

// The Following lines are from the Design Tool

//~~~~~~~~~~~~~~~~ DESIGN TOOL STARTS HERE

procedure Node001 begin

   Reply(103);

   BOption(104,Node006,004);

   GOption(105,Node015,004);

   NOption(106,Node008,004);

end

procedure Node002 begin

   variable item;

   if (local\_var(LVAR\_Said\_2) == 0) then begin

       set\_local\_var(LVAR\_Said\_2,1);

       item:=create\_object(PID\_VIC\_WATER\_FLASK,0,0);

       set\_vic\_known(state\_vic\_known\_name);

       add\_mult\_objs\_to\_inven(dude\_obj,item,1);

       if (global\_var(GVAR\_FIND\_VIC) == 0) then

           set\_global\_var(GVAR\_FIND\_VIC,1);

       Reply(107);

   end

   else begin

       Reply(112);

   end

   NLowOption(113,Node016);

end

procedure Node003 begin

   Reply(114);

   if (local\_var(LVAR\_Vault\_Looking)) then

       GOption(115,Node003a,004);

   BOption(116,Node003b,004);

end

procedure Node003a begin

   if (has\_skill(dude\_obj,SKILL\_CONVERSANT) > 45) then begin

       UpReactModerate;

   end

   else if (dude\_charisma > 7) then begin

       UpReactMinor;

   end

end

procedure Node003b begin

   DownReactMinor;

end

procedure Node004 begin

   Reply(117);

   if (vault\_13\_visible\_on\_map) then

       NOption(118,Node005,004);

   if (local\_var(LVAR\_Vault\_Looking) == 0) then begin

       NOption(119,Node015,004);

       BOption(121,Node013,004);

   end

   else

       NOption(120,Node009,004);

   BOption(122,Node007,004);

   NOption(123,Node999,004);

end

procedure Node005 begin

   DownReactMinor;

   Reply(124);

   NOption(125,Node009,004);

   NOption(126,Node999,004);

end

procedure Node006 begin

   Reply(127);

   NOption(128,Node015,004);

   BOption(129,Node006a,004);

   BOption(130,Node013,004);

end

procedure Node006a begin

   DownReactMinor;

   call Node008;

end

procedure Node007 begin

   DownReactMinor;

   set\_vic\_known(state\_vic\_known\_name);

       if (global\_var(GVAR\_FIND\_VIC) == 0) then

           set\_global\_var(GVAR\_FIND\_VIC,1);

   Reply(131);

   NOption(133,Node009,004);

   NOption(134,Node016,004);

end

procedure Node008 begin

   DownReactMinor;

   Reply(135);

   NOption(136,Node999,004);

end

procedure Node009 begin

   if (local\_var(LVAR\_Said\_9) == 0) then begin

       inc\_local\_var(LVAR\_Said\_9);

       Reply(137);

   end

   else

       Reply(138);

   NOption(139,Node010,004);

   if (local\_var(LVAR\_Vault\_Looking)) then begin

       NOption(140,Node011,004);

       NOption(141,Node012,004);

   end

   NOption(142,Node999,004);

end

procedure Node010 begin

   Reply(143);

   NOption(144,Node009,004);

   NOption(145,Node016,004);

end

procedure Node011 begin

   mark\_klamath\_on\_map

   Reply(146);

   NOption(147,Node009,004);

   NOption(148,Node016,004);

end

procedure Node012 begin

   Reply(149);

   NOption(150,Node009,004);

   NOption(151,Node016,004);

end

procedure Node013 begin

   DownReactModerate;

   Reply(152);

   BOption(153,Node999,004);

   NOption(154,Node015,004);

end

procedure Node014 begin

   floater(random(155,158));

end

procedure Node015 begin

   variable item;

   variable money;

   money:=item\_caps\_total(self\_obj);

   item\_caps\_adjust(self\_obj,-money);

   item\_caps\_adjust(dude\_obj,money);

   item:=create\_object(PID\_VIC\_WATER\_FLASK,0,0);

   add\_mult\_objs\_to\_inven(dude\_obj,item,1);

       if (global\_var(GVAR\_FIND\_VIC) == 0) then

           set\_global\_var(GVAR\_FIND\_VIC,1);

   set\_local\_var(LVAR\_Vault\_Looking,1);

   Reply(159);

   set\_vic\_known(state\_vic\_known\_name);

   BOption(160,Node007,004);

   NOption(161,Node009,004);

   NOption(162,Node016,004);

end

procedure Node016 begin

   set\_vic\_known(state\_vic\_known\_name);

       if (global\_var(GVAR\_FIND\_VIC) == 0) then

           set\_global\_var(GVAR\_FIND\_VIC,1);

   NMessage(163);

end

procedure Node017 begin

   Reply(164);

   NLowOption(165,Node999);

   NOption(166,Node999,004);

   GOption(167,Node999,004);

   BOption(168,Node003,004);

end

procedure Node018 begin

   Reply(169);

   NLowOption(170,Node999);

   NOption(171,Node999,004);

   GOption(172,Node999,004);

   BOption(173,Node003,004);

end

procedure Node019 begin

   Reply(174);

   NLowOption(175,Node999);

   NOption(176,Node999,004);

   GOption(177,Node999,004);

   BOption(178,Node003,004);

end

procedure Node020 begin

   Reply(179);

   NLowOption(180,Node999);

   NOption(181,Node999,004);

   GOption(182,Node999,004);

   BOption(183,Node003,004);

end

// New Enclave dialog

procedure Enc001 begin

   Reply(200);

   NLowOption(201,Enc003);

   NOption(202,Enc004,004);

   NOption(203,Enc005,004);

end

procedure Enc002 begin

   Reply(204);

   NLowOption(205,Enc001);

   NOption(206,Enc001,004);

   BOption(207,Enc008,004);

end

procedure Enc003 begin

   Reply(208);

   NLowOption(209,Node999);

end

procedure Enc004 begin

   Reply(210);

   NOption(211,Enc006,004);

end

procedure Enc005 begin

   Reply(212);

   NOption(213,Enc005a,004);

end

procedure Enc005a begin

   Reply(214);

   NOption(215,Enc013,004);

   NOption(216,Enc007,004);

   NOption(217,Enc007,004);

end

procedure Enc006 begin

   Reply(218);

   NOption(219,Enc005,004);

   NOption(220,Enc007,004);

end

procedure Enc007 begin

   Reply(221);

   NOption(222,Node999,004);

end

procedure Enc008 begin

   Reply(223);

   NOption(224,Enc005,004);

   BOption(225,Enc008a,004);

end

procedure Enc008a begin

   DownReactModerate;

end

procedure Enc009 begin

   NMessage(226);

end

procedure Enc010 begin

   Reply(227);

   NLowOption(228,Enc011,004);

   NOption(229,Enc012,004);

   NOption(230,Node999,004);

end

procedure Enc011 begin

   NMessage(231);

end

procedure Enc012 begin

   Reply(232);

   NOption(233,Node999,004);

end

procedure Enc013 begin

   Reply(234);

   NOption(235,Enc013a,004);

   NOption(236,Enc013a,004);

end

procedure Enc013a begin

   Reply(237);

   NOption(238,Enc007,004);

   NOption(239,Enc004,004);

end

//xxxxxxxxxxxxxxxxxxxx