Fallout Wiki
Advertisement
Fallout Wiki
Details
Type Source file
SCRIPTS.LST comment Tanker Gun Merchant's Table
MSG file N/A
Transcript

/*
        Copyright 1998-2003 Interplay Entertainment Corp. All rights reserved.
*/
/******************************************************************************************
        Item: Tanker Gun Merchants table
        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: September 26, 1997
           Updated:
******************************************************************************************/
/* Include Files */
#include "..\headers\define.h"
#define NAME SCRIPT_FITGUNTB
#define CUR_COMP_SCRIPT SCRIPT_FITGUNTB
#include "..\headers\command.h"
#include "..\headers\sanfran.h"
/* Standard Script Procedures */
procedure start;
procedure use_p_proc;
procedure look_at_p_proc;
procedure description_p_proc;
procedure use_skill_on_p_proc;
procedure use_obj_on_p_proc;
procedure damage_p_proc;
procedure map_enter_p_proc;
procedure map_update_p_proc;
procedure validHandle(variable handle);
/*****************************************************************
   Local Variables which are saved. All Local Variables need to be
   prepended by LVAR_
*****************************************************************/
#define LVAR_Restock_Time (0)
/*******************************************************************
   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 i_tgun_table_swap;
import variable i_tgun_merchant;
#define SETSWAPTABLE(x) i_tgun_table_swap := x
#define MERCHANTOBJ i_tgun_merchant
/*******************************************************************
   Local variables which do not need to be saved between map changes.
*******************************************************************/
/*******************************************************************
******* PROCEDURES *******
*******************************************************************/
#define TABLE_1 16293
/*******************************************************************
   The start procedure is the first procedure called when the map is
   first entered. Any initial information that needs to be set up
   should be placed in here.
*******************************************************************/
procedure start begin
   SETSWAPTABLE(self_obj);
end
procedure timed_event_p_proc begin
end
/********************************************************************
********************************************************************/
procedure use_p_proc begin
   if (validHandle(MERCHANTOBJ)) then begin
      script_overrides;
      SETSWAPTABLE(self_obj);
      add_timer_event(MERCHANTOBJ, 0, TIMER_USE_TABLE);
   end
end
/***************************************************************************
   This is cursory glance description that the player will receive should
   he just pass the Action Cursor over. Examines which give more information
   need to be in the description_p_proc procedure.
***************************************************************************/
procedure look_at_p_proc begin
end
/**********************************************************************************
**********************************************************************************/
procedure description_p_proc begin
end
/**********************************************************************************
   Make sure the door is working.
**********************************************************************************/
procedure use_skill_on_p_proc begin
   if (validHandle(MERCHANTOBJ)) then begin
      call use_p_proc;
   end
end
/**********************************************************************************
   This is called when the player is using an object on the door. When the check is
   made to find out what is being used, obj_pid(obj_being_used_with) will need to
   be checked against a prototype.
**********************************************************************************/
procedure use_obj_on_p_proc begin
   if (validHandle(MERCHANTOBJ)) then begin
      call use_p_proc;
   end
end
/******************************************************************************************
   IF it gets damaged it breaks
******************************************************************************************/
procedure damage_p_proc begin
end
/***************************************************************************************
   Whenever the map is first entered, this procedure will be called.
***************************************************************************************/
procedure map_enter_p_proc begin
   if (validHandle(MERCHANTOBJ)) then begin
      if (local_var(LVAR_Restock_Time) < game_time) then begin
         if (self_tile == TABLE_1) then begin
            check_restock_item(PID_BOTTLE_CAPS, 300, 436, 80)
            check_restock_item(PID_SPIKED_KNUCKLES, 1, 3, 80)
            check_restock_item(PID_MEGA_POWER_FIST, 1, 1, 100)
            check_restock_item(PID_CROWBAR, 1, 1, 100)
            check_restock_item(PID_SHIV, 1, 2, 80)
            check_restock_item(PID_WRENCH, 1, 2, 50)
            check_restock_item(PID_STIMPAK, 3, 7, 80)
            check_restock_item(PID_FIRST_AID_KIT, 1, 2, 60)
            check_restock_item(PID_RADAWAY, 3, 7, 60)
            check_restock_item(PID_MENTATS, 4, 8, 50)
            check_restock_item(PID_MUTATED_FRUIT, 4, 8, 60)
            check_restock_item(PID_BUFFOUT, 4, 8, 50)
            check_restock_item(PID_PSYCHO, 4, 8, 50)
            check_restock_item(PID_SUPER_STIMPAK, 6, 7, 30)
            check_restock_item(PID_JET_ANTIDOTE, 1, 3, 30)
            check_restock_item(PID_MEAT_JERKY, 4, 5, 45)
         end
         set_local_Var(LVAR_Restock_Time, game_time + (ONE_GAME_WEEK * Random(1, 2)));
      end
   end
end
/**************************************************************************************
   This procedure gets called roughly every 30 seconds of real time.
**************************************************************************************/
procedure map_update_p_proc begin
end
procedure validHandle(variable handle) begin
   if (handle != 0 and handle != -1) then begin
      return 1;
   end
   return 0;
end

Advertisement