ACTEMVIL.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\ARCaves.h"

#define NAME SCRIPT\_ACTEMVIL

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

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

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

#define Spear\_Location (20329)

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

procedure timed\_event\_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 Node001a;

procedure Node002;

procedure Node002a;

procedure Node002b;

procedure Node002c;

procedure Node003;

procedure Node004;

procedure Node005;

procedure Node006;

procedure Node007;

procedure Node008;

procedure Node009;

procedure Node010;

procedure Node011;

procedure Node012;

procedure Node013;

procedure Node014;

procedure Node015;

procedure Node015a;

procedure Node012a;

procedure Node016;

procedure Node016a;

procedure Node017;

procedure Node018;

//~~~~~~~~~~~~~~~~ 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\_Asked\_1 (7)

#define LVAR\_Asked\_2 (8)

#define LVAR\_Asked\_3 (9)

#define LVAR\_Looked\_Before (10)

#define LVAR\_Prepared (11)

#define LVAR\_Defeated (12)

#define LVAR\_Start\_Trial (13)

#define LVAR\_Waypoint (14)

#define LVAR\_Talked\_Before (15)

#define LVAR\_Trained (16)

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

import variable temple\_chest\_ptr;

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

   if ((cur\_map\_index == MAP\_ARROYO\_VILLAGE) and (global\_var(GVAR\_DUMAR\_STATUS) == 1) and (not(is\_loading\_game))) then begin

       set\_obj\_visibility(self\_obj,1);

   end

   if ((cur\_map\_index == MAP\_ARROYO\_CAVES) and (global\_var(GVAR\_START\_ARROYO\_TRIAL) > TRIAL\_NONE) and (not(is\_loading\_game))) then

       set\_obj\_visibility(self\_obj,1);

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

   variable door;

/\* 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\_Start\_Trial) == 1) then begin

       attack(dude\_obj);

   end

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

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

       call Node013;

       attack(dude\_obj);

   end

    if ((local\_var(LVAR\_Talked\_Before) == 0) and (tile\_distance\_objs(dude\_obj,self\_obj) < 6) and (cur\_map\_index == MAP\_ARROYO\_CAVES)) then begin

       set\_local\_var(LVAR\_Talked\_Before,1);

       dialogue\_system\_enter;

   end

   if (local\_var(LVAR\_Start\_Trial) == 2) then begin

       if ((local\_var(LVAR\_Waypoint) == 0) and (tile\_num(self\_obj) != 19728)) then begin

           door:=tile\_contains\_pid\_obj(19928,2,PID\_ARROYO\_CAVE\_DOOR);

           obj\_unlock(door);

           animate\_run\_to\_tile(19728);

       end

       else if ((local\_var(LVAR\_Waypoint) == 0) and (tile\_num(self\_obj) == 19728)) then begin

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

           door:=tile\_contains\_pid\_obj(19928,2,PID\_ARROYO\_CAVE\_DOOR);

           obj\_open(door);

           add\_timer\_event(self\_obj,game\_ticks(2),1);

       end

       else if ((local\_var(LVAR\_Waypoint) == 2) and (tile\_num(self\_obj) != 22712)) then

           animate\_run\_to\_tile(22712);

       else if ((local\_var(LVAR\_Waypoint) == 2) and (tile\_num(self\_obj) == 22712)) then

           set\_local\_var(LVAR\_Waypoint,3);

       else if ((local\_var(LVAR\_Waypoint) == 3) and (tile\_num(self\_obj) != 28715)) then

           animate\_run\_to\_tile(28715);

       else if ((local\_var(LVAR\_Waypoint) == 3) and (tile\_num(self\_obj) == 28715)) then begin

           set\_local\_var(LVAR\_Waypoint,4);

           set\_obj\_visibility(self\_obj,1);

       end

   end

end

procedure timed\_event\_p\_proc begin

   if (fixed\_param == 1) then

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

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) and (local\_var(LVAR\_Start\_Trial) != 1)) then begin

       set\_local\_var(LVAR\_Personal\_Enemy,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

procedure combat\_p\_proc begin

   variable item;

   if (fixed\_param == COMBAT\_SUBTYPE\_TURN) then begin

       if ((get\_critter\_stat(self\_obj,STAT\_current\_hp) <= (get\_critter\_stat(self\_obj,STAT\_max\_hit\_points)/2)) and (local\_var(LVAR\_Start\_Trial) == 1)) then begin

           terminate\_combat;

           script\_overrides;

           item:=create\_object(PID\_HEALING\_POWDER,0,0);

           use\_obj\_on\_obj(item,self\_obj);

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

           set\_local\_var(LVAR\_Start\_Trial,2);

           floater(161);

           set\_map\_var(MVAR\_Passed\_Fighting,Fighting\_Finished);

           set\_global\_var(GVAR\_START\_ARROYO\_TRIAL,TRIAL\_FIGHT);

       end

   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\_TOLERANT;

   Karma\_Perception:=KARMA\_PERCEPTION1;

   CheckKarma;

   GetReaction;

   if (local\_var(LVAR\_Start\_Trial) == 2) then begin

       script\_overrides;

   end

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

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

       gSay\_Start;

           call Node010;

       gSay\_End;

       end\_dialogue;

   end

   else if (local\_var(LVAR\_Prepared) == 1) then begin

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

       gSay\_Start;

           call Node008;

       gSay\_End;

       end\_dialogue;

   end

   else begin

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

       gSay\_Start;

           call Node001;

       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

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

   set\_global\_var(GVAR\_DUMAR\_STATUS,1);

   if (map\_var(MVAR\_Passed\_Fighting) != Fighting\_Started) then begin

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

   end

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

       set\_map\_var(MVAR\_Passed\_Fighting,Fighting\_Finished);

       set\_global\_var(GVAR\_START\_ARROYO\_TRIAL,TRIAL\_FIGHT);

   end

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

       set\_local\_var(LVAR\_Looked\_Before,1);

       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(mstr(103)+obj\_name(dude\_obj)+mstr(104));

   NLowOption(105,Node002);

   NLowOption(106,Node006);

   NLowOption(107,Node001a);

   NOption(108,Node002,004);

   NOption(109,Node006,004);

   NOption(110,Node001a,004);

end

procedure Node001a begin

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

   call Node007;

end

procedure Node002 begin

   Reply(111);

   if (local\_var(LVAR\_Asked\_1) == 0) then begin

       NLowOption(112,Node002a);

       NOption(117,Node002a,004);

   end

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

       NLowOption(113,Node002b);

       NOption(118,Node002b,004);

   end

   if (local\_var(LVAR\_Asked\_3) == 0) then begin

       NLowOption(114,Node002c);

       NOption(119,Node002c,004);

   end

   NLowOption(115,Node006);

   NLowOption(116,Node001a);

   NOption(120,Node006,004);

   NOption(121,Node001a,004);

end

procedure Node002a begin

   set\_local\_var(LVAR\_Asked\_1,1);

   call Node003;

end

procedure Node002b begin

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

   call Node004;

end

procedure Node002c begin

   set\_local\_var(LVAR\_Asked\_3,1);

   call Node005;

end

procedure Node003 begin

   Reply(mstr(122)+obj\_name(dude\_obj)+mstr(123));

   NLowOption(124,Node002);

   NOption(125,Node002,004);

   if (is\_skill\_tagged(SKILL\_CONVERSANT)) then

       NOption(165,Node014,004);

end

procedure Node004 begin

   Reply(126);

   NLowOption(127,Node002);

   NOption(128,Node002,004);

end

procedure Node005 begin

   Reply(mstr(129)+obj\_name(dude\_obj)+mstr(130));

   NLowOption(131,Node002);

   NOption(132,Node002,004);

end

procedure Node006 begin

   Reply(133);

   NLowOption(134,Node009);

   NLowOption(135,Node001a);

   NOption(136,Node009,004);

   NOption(137,Node001a,004);

end

procedure Node007 begin

   NMessage(138);

end

procedure Node008 begin

   Reply(mstr(139)+obj\_name(dude\_obj)+mstr(140));

   NLowOption(141,Node009);

   NLowOption(142,Node007);

   NOption(143,Node009,004);

   NOption(144,Node007,004);

end

procedure Node009 begin

   variable door;

   move\_obj\_inven\_to\_obj(dude\_obj,temple\_chest\_ptr);

   door:=tile\_contains\_pid\_obj(19928,2,PID\_ARROYO\_CAVE\_DOOR);

   obj\_close(door);

   obj\_lock(door);

   set\_map\_var(MVAR\_Passed\_Fighting,Fighting\_Started);

   set\_local\_var(LVAR\_Start\_Trial,1);

   NMessage(mstr(145)+obj\_name(dude\_obj)+mstr(146));

   gfade\_out(600);

   gfade\_in(600);

end

procedure Node010 begin

   Reply(147);

   NLowOption(148,Node011);

   NLowOption(149,Node012);

   NLowOption(150,Node999);

   NOption(151,Node011,004);

   NOption(152,Node012,004);

   NOption(153,Node999,004);

end

procedure Node011 begin

   Reply(154);

   NLowOption(155,Node999);

   NOption(156,Node999,004);

end

procedure Node012 begin

   if (global\_var(GVAR\_START\_ARROYO\_TRIAL) == TRIAL\_FIGHT) then

       Reply(157);

   else if (global\_var(GVAR\_START\_ARROYO\_TRIAL) == TRIAL\_TALK) then

       Reply(201);

   else

       Reply(200);

   NLowOption(158,Node012a);

   NOption(159,Node012a,004);

end

procedure Node012a begin

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

       inc\_local\_var(LVAR\_Trained);

       call Node016;

   end

end

procedure Node013 begin

   floater(160);

end

procedure Node014 begin

   Reply(mstr(166)+obj\_name(dude\_obj)+mstr(167));

   NOption(168,Node015,004);

end

procedure Node015 begin

   variable skill;

   skill:=roll\_vs\_skill(dude\_obj,SKILL\_CONVERSANT,0);

   if ((is\_skill\_tagged(SKILL\_CONVERSANT)) or (is\_success(skill))) then begin

       Reply(169);

       NOption(171,Node015a,004);

   end

   else begin

       Reply(170);

       NOption(172,Node002,004);

   end

end

procedure Node015a begin

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

   set\_local\_var(LVAR\_Start\_Trial,2);

   set\_map\_var(MVAR\_Passed\_Fighting,Fighting\_Finished);

   set\_global\_var(GVAR\_START\_ARROYO\_TRIAL,TRIAL\_TALK);

end

procedure Node016 begin

   if ((is\_skill\_tagged(SKILL\_SMALL\_GUNS)) or (is\_skill\_tagged(SKILL\_BIG\_GUNS)) or

       (is\_skill\_tagged(SKILL\_ENERGY\_WEAPONS)) or (is\_skill\_tagged(SKILL\_UNARMED\_COMBAT)) or

       (is\_skill\_tagged(SKILL\_MELEE)) or (is\_skill\_tagged(SKILL\_THROWING)) or (dude\_agility > 6)) then begin

       Reply(300);

       NOption(301,Node999,004);

   end

   else begin

       Reply(302);

       NLowOption(303,Node016a);

       NLowOption(304,Node018);

       NOption(305,Node016a,004);

       NOption(306,Node018,004);

   end

end

procedure Node016a begin

   variable temp;

   gfade\_out(600);

   gfade\_in(600);

   game\_time\_advance(ONE\_GAME\_HOUR);

   critter\_mod\_skill(dude\_obj,SKILL\_UNARMED\_COMBAT,10);

   critter\_mod\_skill(dude\_obj,SKILL\_MELEE,10);

   call Node017;

end

procedure Node017 begin

   Reply(307);

   NLowOption(308,Node999);

   NOption(309,Node999,004);

end

procedure Node018 begin

   Reply(310);

   NLowOption(311,Node999);

   NOption(312,Node999,004);

end

//xxxxxxxxxxxxxxxxxxxx