Fallout Wiki
Advertisement
Fallout Wiki
Details
Type Source file
SCRIPTS.LST comment Secret Service Agent Frank (End Boss)
MSG file N/A
Transcript

/*
        Copyright 1998-2003 Interplay Entertainment Corp. All rights reserved.
*/
/*
        Name:
        Location:
        Description:
        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:
           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\den.h"
#define NAME SCRIPT_QCFRANK
#define TOWN_REP_VAR (GVAR_TOWN_REP_ENCLAVE)
#include "..\headers\command.h"
#include "..\headers\ModReact.h"
#include "..\headers\NewReno.h"
#include "..\headers\v13.h"
#define ENCLAVE_DOOR_PID1 (33556008)
#define ENCLAVE_DOOR_PID2 (33556007)
#define ENCLAVE_DOOR_TILE1 (19280)
#define ENCLAVE_DOOR_TILE2 (16719)
#define BOSS_LEGS_PID (33556234)
#define BOSS_TORSO_PID (16777699)
/* 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;
/* 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 Node004;
procedure Node005;
procedure Node007;
procedure Endgame_Info;
procedure NewReno_Endgame_Info;
//~~~~~~~~~~~~~~~~ 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_Looked_Before (7)
#define LVAR_Talked_Before (8)
/* 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 Frank_Ptr;
/* Local variables which do not need to be saved between map changes. */
variable Only_Once:=0;
procedure start begin
   if (global_var(GVAR_ENCLAVE_FRANK_DEAD) == 0) then begin
       Frank_Ptr:=self_obj;
   end
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
   variable door;
   Only_Once:=0;
   critter_add_trait(self_obj,TRAIT_OBJECT,OBJECT_TEAM_NUM,TEAM_ENCLAVE);
   critter_add_trait(self_obj,TRAIT_OBJECT,OBJECT_AI_PACKET,AI_END_BOSS);
   if (global_var(GVAR_ENCLAVE_REACTOR) == ENCLAVE_REACTOR_OFF) then begin
       set_obj_visibility(self_obj,0);
       if (not(is_loading_game)) then begin
           door:=tile_contains_pid_obj(ENCLAVE_DOOR_TILE2,elevation(self_obj),ENCLAVE_DOOR_PID2);
           debug_msg("Locking Door 2. "+door);
           obj_close(door);
           obj_lock(door);
       end
   end
   else begin
       set_obj_visibility(self_obj,1);
   end
end
procedure combat_p_proc begin
   if (fixed_param == COMBAT_SUBTYPE_HIT_SUCCEEDED) then begin
       if (global_var(GVAR_ENCLAVE_FRANK_DEAD) != 0) then
           script_overrides;
   end
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_Talked_Before) == 0) and (obj_can_see_obj(self_obj,dude_obj)) and (global_var(GVAR_ENCLAVE_REACTOR) == ENCLAVE_REACTOR_OFF)) then begin
       dialogue_system_enter;
   end
   else if ((local_var(LVAR_Hostile) == 2) and (obj_can_see_obj(self_obj,dude_obj))) 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);
   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
   variable door;
   Evil_Critter:=1;
   Slavery_Tolerant:=SLAVE_TOLERANT;
   Karma_Perception:=KARMA_PERCEPTION1;
   CheckKarma;
   GetReaction;
   if (global_var(GVAR_ENCLAVE_FRANK_DEAD) == 1) then begin
       start_gdialog(NAME,self_obj,4,HEAD_BOSS,BACKGROUND_BOSS);
       gSay_Start;
           call Node002;
       gSay_End;
       end_dialogue;
       critter_damage(self_obj,2);
   end
   else if (dude_iq < 4) then begin
       inc_local_var(LVAR_Talked_Before);
       door:=tile_contains_pid_obj(ENCLAVE_DOOR_TILE1,elevation(self_obj),ENCLAVE_DOOR_PID1);
       obj_close(door);
       obj_lock(door);
       call Node001;
       set_local_var(LVAR_Hostile,2);
   end
   else begin
       inc_local_var(LVAR_Talked_Before);
       door:=tile_contains_pid_obj(ENCLAVE_DOOR_TILE1,elevation(self_obj),ENCLAVE_DOOR_PID1);
       obj_close(door);
       obj_lock(door);
       start_gdialog(NAME,self_obj,4,HEAD_BOSS,BACKGROUND_BOSS);
       gSay_Start;
           call Node003;
       gSay_End;
       end_dialogue;
       set_local_var(LVAR_Hostile,2);
   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
   variable door;
   variable Boss_Torso_Ptr;
   variable Boss_Legs;
   variable tile;
/* Increment the aligned critter counter*/
   inc_evil_critter
   set_exit_grids(0,MAP_SAN_FRAN_DOCK,0,13908,2);
   call Endgame_Info;
   door:=tile_contains_pid_obj(ENCLAVE_DOOR_TILE2,elevation(self_obj),ENCLAVE_DOOR_PID2);
   obj_unlock(door);
   if ((global_var(GVAR_ENCLAVE_FRANK_DEAD) == 0) and (violence_filter_setting >= VLNCLVL_NORMAL)) then begin
// obj_open(door);
       animate_rotation(2);
       tile:=tile_num_in_direction(tile_num(self_obj),2,0);
       Boss_Legs:=create_object(BOSS_LEGS_PID,tile_num(self_obj),elevation(self_obj));
       tile:=tile_num_in_direction(tile_num(self_obj),2,1);
       tile:=tile_num_in_direction(tile,0,2);
       Boss_Torso_Ptr:=create_object_sid(BOSS_TORSO_PID,tile,elevation(self_obj),SCRIPT_QCFRANK);
       set_obj_visibility(self_obj,1);
   end
   set_global_var(GVAR_ENCLAVE_FRANK_DEAD,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
   floater(random(103,107));
end
procedure Node002 begin
   NMessage(108);
   call Endgame_Info;
end
procedure Node003 begin
   Reply(112);
   BOption(113,Node004,004);
   NOption(114,Node005,004);
   NOption(134,Node007,004);
end
procedure Node004 begin
   if (global_var(GVAR_ENCLAVE_ALARM) == ALARM_TOXIN) then
       Reply(115);
   else
       Reply(116);
   BOption(117,Node998,004);
   GOption(118,Node998,004);
   BOption(135,Node998,004);
end
procedure Node005 begin
   Reply(119);
   BOption(120,Node998,004);
   GOption(121,Node998,004);
end
procedure Node007 begin
   Reply(130);
   GOption(131,Node004,004);
   GOption(132,Node005,004);
   NOption(133,Node998,004);
end
procedure Endgame_Info begin
   set_f2(f2_state_enclave_destroyed);
// Arroyo Endgame
   set_global_var(GVAR_ENDGAME_MOVIE_ARROYO,1);
// Modoc Endgame
   if (modoc_visible_on_map) then begin
       if (global_var(GVAR_MODOC_ENDINGS) == 2) then
           set_global_var(GVAR_ENDGAME_MOVIE_MODOC,2);
       else if (global_var(GVAR_MODOC_ENDINGS) == 3) then
           set_global_var(GVAR_ENDGAME_MOVIE_MODOC,3);
       else if (global_var(GVAR_MODOC_ENDINGS) == 4) then
           set_global_var(GVAR_ENDGAME_MOVIE_MODOC,4);
       else
           set_global_var(GVAR_ENDGAME_MOVIE_MODOC,1);
   end
// Den Endgame
   if (den_visible_on_map) then begin
      if (metzger_dead) then begin
         if (becky_dead) then begin
            set_global_var(GVAR_ENDGAME_MOVIE_DEN,1);
         end else begin
            set_global_var(GVAR_ENDGAME_MOVIE_DEN,2);
         end
      end else begin
         if ((big_jesus_dead) or (mordino_power < 0)) then begin
            set_global_var(GVAR_ENDGAME_MOVIE_DEN,3);
         end else begin
            set_global_var(GVAR_ENDGAME_MOVIE_DEN,4);
         end
      end
   end
// Vault City Endgame
   if (vault_city_visible_on_map) then begin
       // if (Vault_City_Population < 5) then begin
          // if ((global_var(GVAR_VAULT_GECKO_PLANT) == PLANT_GHOULS_DEAD) or (global_var(GVAR_VAULT_GECKO_PLANT) == PLANT_DESTROYED))) then
              // set_global_var(GVAR_ENDGAME_MOVIE_VAULT_CITY,10);
          // else
              // set_global_var(GVAR_ENDGAME_MOVIE_VAULT_CITY,11);
       // end
       /* else */ if (global_var(GVAR_VAULT_GECKO_PLANT) < PLANT_REPAIRED) then
           set_global_var(GVAR_ENDGAME_MOVIE_VAULT_CITY,2);
       else if ((global_var(GVAR_VAULT_LYNETTE_STATUS) == 0) and (not(get_westin_flag(WESTIN_DEAD))) and (global_var(GVAR_VAULT_RAIDERS) == RAIDERS_GIVE_REWARD)) then
           set_global_var(GVAR_ENDGAME_MOVIE_VAULT_CITY,3);
       else if (global_var(GVAR_VAULT_RAIDERS) < RAIDERS_PLANS_KNOWN_RENO) then
           set_global_var(GVAR_ENDGAME_MOVIE_VAULT_CITY,4);
       else
           set_global_var(GVAR_ENDGAME_MOVIE_VAULT_CITY,5);
   end
// New Reno Endgame
   if (new_reno_visible_on_map) then begin
       call NewReno_Endgame_Info;
   end
// Gecko Endgame
   if (gecko_visible_on_map) then begin
       if ((global_var(GVAR_VAULT_GECKO_PLANT) == PLANT_GHOULS_DEAD) or (global_var(GVAR_VAULT_GECKO_PLANT) == PLANT_DESTROYED)) then
           set_global_var(GVAR_ENDGAME_MOVIE_GECKO,1);
       else if (global_var(GVAR_VAULT_GECKO_PLANT) == PLANT_REPAIRED) then
           set_global_var(GVAR_ENDGAME_MOVIE_GECKO,2);
       else if (global_var(GVAR_VAULT_GECKO_PLANT) == PLANT_OPTIMIZED) then
           set_global_var(GVAR_ENDGAME_MOVIE_GECKO,3);
       else if ((global_var(GVAR_VAULT_GECKO_PLANT) == PLANT_OPTIMIZED) and (global_var(GVAR_GECKO_ECON_DISK) == ECON_DISK_GIVEN)) then
           set_global_var(GVAR_ENDGAME_MOVIE_GECKO,4);
   end
// Redding Endgame
   if (redding_visible_on_map) then begin
       if ((global_var(GVAR_DOC_JOHNSON_STATUS) == 0) and (global_var(GVAR_REDDING_JET_LEVEL) == JET_CURED)) then
           set_global_var(GVAR_ENDGAME_MOVIE_REDDING,1);
       else if (global_var(GVAR_REDDING_EXCAVATOR_CHIP) == CHIP_DELIVERED_DAN) then
           set_global_var(GVAR_ENDGAME_MOVIE_REDDING,2);
       else if (global_var(GVAR_REDDING_EXCAVATOR_CHIP) == CHIP_DELIVERED_MARGE) then
           set_global_var(GVAR_ENDGAME_MOVIE_REDDING,3);
       else
           set_global_var(GVAR_ENDGAME_MOVIE_REDDING,4);
   end
// Broken Hills Endgame
   if (broken_hills_visible_on_map) then begin
       if ((global_var(GVAR_BH_CONSPIRACY) == CONSPIRACY_SUCCESSFUL) or (global_var(GVAR_BH_FTM) == FTM_SUCCESSFUL)) then
           set_global_var(GVAR_ENDGAME_MOVIE_BROKEN_HILLS,1);
       else if (((global_var(GVAR_BH_CONSPIRACY) == CONSPIRACY_BROKEN_DOUBLECROSS) or (global_var(GVAR_BH_CONSPIRACY) == CONSPIRACY_BROKEN_HERO) or (global_var(GVAR_BH_JAIL) == JAIL_DOUBLECROSS)) and ((global_var(GVAR_BH_FTM) == FTM_EXPOSED) or (global_var(GVAR_BH_FTM) == 0))) then
           set_global_var(GVAR_ENDGAME_MOVIE_BROKEN_HILLS,2);
       else
           set_global_var(GVAR_ENDGAME_MOVIE_BROKEN_HILLS,3);
   end
// NCR Endgame
   if (new_CA_republic_visible_on_map) then begin
       if ((global_var(GVAR_V15_NCR_DEAL) == 2) and (global_var(GVAR_NCR_V15_DARION_DEAD) == 1)) then
           set_global_var(GVAR_ENDGAME_MOVIE_NCR,1);
       else if (not(get_westin_flag(WESTIN_DEAD))) then
           set_global_var(GVAR_ENDGAME_MOVIE_NCR,2);
       else if (not(get_carlson_flag(CARLSON_DEAD))) then
           set_global_var(GVAR_ENDGAME_MOVIE_NCR,3);
       else if (get_carlson_flag(CARLSON_DEAD)) then
           set_global_var(GVAR_ENDGAME_MOVIE_NCR,4);
   end
// Vault 15 Endgame
   if (vault_15_visible_on_map) then begin
       if ((global_var(GVAR_V15_NCR_DEAL) == 2) and (global_var(GVAR_NCR_V15_DARION_DEAD) == 1)) then
           set_global_var(GVAR_ENDGAME_MOVIE_VAULT_15,1);
       else
           set_global_var(GVAR_ENDGAME_MOVIE_VAULT_15,2);
   end
// Vault 13 Endgame
   if (vault_13_visible_on_map) then begin
      if (gvar_bit(GVAR_V13_STATUS_FLAGS, FLG_GRUTHAR_DEAD)) then
           set_global_var(GVAR_ENDGAME_MOVIE_VAULT_13,2);
// There is no more good ending.
   end
// San Francisco Endgame
   if (san_francisco_visible_on_map) then begin
       if (global_var(GVAR_SAN_FRAN_FLAGS) bwand bit_1) then //Enemy of the shi
           set_global_var(GVAR_ENDGAME_MOVIE_SAN_FRAN_SHI,1);
       else if (gvar_bit(GVAR_SAN_FRAN_FLAGS, bit_6)) then //Dr Wong Dead
           set_global_var(GVAR_ENDGAME_MOVIE_SAN_FRAN_SHI,2);
       else
           set_global_var(GVAR_ENDGAME_MOVIE_SAN_FRAN_SHI,3);
       set_global_var(GVAR_ENDGAME_MOVIE_SAN_FRAN_ELRON,1);
       set_global_var(GVAR_ENDGAME_MOVIE_SAN_FRAN_PUNKS,1);
   end
end
procedure NewReno_Endgame_Info begin
      if (((mrs_bishop_dead == false) and (mrs_bishop_pregnant)) or ((angela_dead == false) and (angela_pregnant))) then begin
         if (mrs_bishop_win) then begin
            set_global_var(GVAR_ENDGAME_MOVIE_RENO, 2);
         end else begin
            set_global_var(GVAR_ENDGAME_MOVIE_RENO, 3);
         end
      end else if ((mordino_power > 0) and (mordino_power >= salvatore_power) and (mordino_power >= bishop_power) and (mordino_power >= wright_power)) then begin
         if ((get_jet_source(jet_source_cure_made)) or (global_var(GVAR_VAULT_JET_QUEST) == REDDING_PROBLEM_DELIVERED_ANTIDOTE)) then begin
            set_global_var(GVAR_ENDGAME_MOVIE_RENO, 7);
         end else begin
            set_global_var(GVAR_ENDGAME_MOVIE_RENO, 6);
         end
      end else if ((bishop_power > 0) and (bishop_power >= mordino_power) and (bishop_power >= salvatore_power) and (bishop_power >= wright_power)) then begin
         set_global_var(GVAR_ENDGAME_MOVIE_RENO, 4);
      end else if ((salvatore_power > 0) and (salvatore_power >= mordino_power) and (salvatore_power >= bishop_power) and (salvatore_power >= wright_power)) then begin
         set_global_var(GVAR_ENDGAME_MOVIE_RENO, 5);
      end else if ((wright_power > 0) and (wright_power >= mordino_power) and (wright_power >= bishop_power) and (wright_power >= salvatore_power)) then begin
         if (sad_got_in) then begin
            set_global_var(GVAR_ENDGAME_MOVIE_RENO, 8);
         end else if (get_mystery_flag(MYSTERY_STATE_ASSIGNED)) then begin
            set_global_var(GVAR_ENDGAME_MOVIE_RENO, 9);
         end else begin
            set_global_var(GVAR_ENDGAME_MOVIE_RENO, 10);
         end
      end else begin
         set_global_var(GVAR_ENDGAME_MOVIE_RENO, 1);
      end
      if (get_mystery_flag(MYSTERY_STATE_BAD_SOLVED)) then begin
         set_global_var(GVAR_ENDGAME_MOVIE_RENO_ADD2, 1);
      end else if (get_mystery_flag(MYSTERY_STATE_SOLVED)) then begin
         set_global_var(GVAR_ENDGAME_MOVIE_RENO_ADD1, 1);
      end
      if ((myron_dead == false) and (know_myron)) then begin
         set_global_var(GVAR_ENDGAME_MOVIE_RENO_ADD3, 1);
      end
      if (dude_has_porn_star_rep) then begin
         set_global_var(GVAR_ENDGAME_MOVIE_RENO_ADD4, 1);
      end
end
//xxxxxxxxxxxxxxxxxxxx

Advertisement