Fallout Wiki
Advertisement
Fallout Wiki
Details
Type Source file
SCRIPTS.LST comment Vault City Council Area Bartender
MSG file N/A
Transcript

/*
        Copyright 1998-2003 Interplay Entertainment Corp. All rights reserved.
*/
/*
        Name: Council Area Bartender
        Location: Vault City Council Area
        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. Thse 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_VCCOUBAR
#define TOWN_REP_VAR (GVAR_TOWN_REP_VAULT_CITY)
#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;
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 Node002;
procedure Node003;
procedure Node004;
procedure Node005;
procedure Node006;
procedure Node007;
procedure Node008;
procedure Node009;
procedure Node010;
procedure Node010a;
procedure Node010b;
procedure Node011;
procedure Node011a;
procedure Node012;
procedure Node013;
procedure Node013a;
procedure Node014;
procedure Node014a;
procedure Node015;
procedure Node016;
procedure Node017;
procedure Node018;
procedure Node019;
procedure Node020;
procedure Node021;
procedure Node022;
procedure Node023;
procedure Node024;
procedure Node025;
procedure Node026;
procedure Node027;
procedure Node028;
procedure Node029;
procedure Node030;
//~~~~~~~~~~~~~~~~ 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_Night_Comment (7)
#define LVAR_Alcohol_Count (8)
variable From_28 := 0;
variable DayPass_KickOutObj  :=0;
variable DayPass_KickOutCount  :=0;
variable CitizenPapers_KickOutObj  :=0;
variable CitizenPapers_KickOutCount  :=0;
variable KickOutTemp  :=0;
// Generic function for kicking the player out of
// Vault City. Sets flags and tried to get rid of
// day passes/citizenship papers.
// ***NOTE*** - This function only removes the items from the PC's
// inventory, not from the companion inventories.
#define kick_out_of_vault_city set_global_var(GVAR_VAULT_CITIZEN,CITIZEN_KICKED_OUT);\
                                    set_global_var(GVAR_VAULT_CITIZENSHIP,0);\
                                    set_global_var(GVAR_DAY_PASS_SHOWN, 0);\
                                    DayPass_KickOutCount := obj_is_carrying_obj_pid(dude_obj, PID_DAY_PASS);\
                                    if( DayPass_KickOutCount > 0 ) then begin\
                                       DayPass_KickOutObj := obj_carrying_pid_obj(dude_obj, PID_DAY_PASS);\
                                       KickOutTemp := rm_mult_objs_from_inven(dude_obj, DayPass_KickOutObj, DayPass_KickOutCount );\
                                    end\
                                    CitizenPapers_KickOutCount := obj_is_carrying_obj_pid(dude_obj, PID_FAKE_CITIZENSHIP);\
                                    if( CitizenPapers_KickOutCount > 0 ) then begin\
                                       CitizenPapers_KickOutObj := obj_carrying_pid_obj(dude_obj, PID_FAKE_CITIZENSHIP);\
                                       KickOutTemp := rm_mult_objs_from_inven(dude_obj, CitizenPapers_KickOutObj, CitizenPapers_KickOutCount );\
                                    end\
                                    set_global_var( GVAR_TOWN_REP_VAULT_CITY, (global_var(GVAR_TOWN_REP_VAULT_CITY) + REP_TOWN_KICKED_OUT ) ); \
                                    load_map( MAP_VAULTCITY_COURTYARD, 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_) */
/* 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;
   From_28 := 0;
   critter_add_trait(self_obj,TRAIT_OBJECT,OBJECT_TEAM_NUM,TEAM_VAULT_CITIZENS);
   critter_add_trait(self_obj,TRAIT_OBJECT,OBJECT_AI_PACKET,AI_COWARD);
   if( not( is_loading_game ) ) then begin
      if( ( game_time_hour > 200 ) and ( game_time_hour < 700 ) ) then begin
         // I'm SLEEPING!!!!
         move_to( self_obj, 25721, 0 );
         critter_attempt_placement( self_obj, 25721, 0 );
         animate_rotation( 3 );
         add_timer_event( self_obj, game_ticks(random(30,40)), 1 );
      end
      else begin
         // I'm WORKING!!!!
         move_to( self_obj, 20717, 0 );
         critter_attempt_placement( self_obj, 20717, 0 );
         animate_rotation( 3 );
         add_timer_event( self_obj, game_ticks(random(30,40)), 1 );
      end
   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_Hostile) == 2) or ( global_var( GVAR_ENEMY_VAULT_CITY ) == 1 ) ) and (obj_can_see_obj(self_obj,dude_obj))) then begin
       set_local_var(LVAR_Hostile,1);
       attack(dude_obj);
   end
end
procedure timed_event_p_proc begin
   if( fixed_param == 1 ) then begin
      if( not( combat_is_initialized ) ) then begin
         if( ( game_time_hour > 200 ) and ( game_time_hour < 700 ) ) then
            floater(245);
         else if( Fallout2_enclave_destroyed ) then
            call Node002;
         else if( (day) and ( global_var(GVAR_VAULT_CITIZEN) == CITIZEN_CAPTAIN_GUARD ) ) then
            call Node003;
         else if( (day) and ( Marcus_Ptr != 0 ) ) then
            call Node005;
         else if( (day) and ( Lenny_Ptr != 0 ) ) then
            call Node006;
         else if( (day) and ( global_var(GVAR_VAULT_CITIZEN) == CITIZEN_REAL_CITIZEN ) ) then
            call Node004;
      end
      add_timer_event( self_obj, game_ticks(random(30, 40)), 1 );
   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_VAULT_CITY, 1 );
      set_global_var( GVAR_VAULT_CITIZEN, CITIZEN_KICKED_OUT );
      set_global_var( GVAR_TOWN_REP_VAULT_CITY, (global_var(GVAR_TOWN_REP_VAULT_CITY) + REP_TOWN_KICKED_OUT ) );
      set_global_var( GVAR_VAULT_CITIZENSHIP, 0 );
   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_TOLERANT;
   Karma_Perception:=KARMA_PERCEPTION1;
   From_28 := 0;
   CheckKarma;
   GetReaction;
   if( ( game_time_hour > 200 ) and ( game_time_hour < 700 ) ) then
      floater(245);
   else if ( Fallout2_enclave_destroyed ) then begin
       start_gdialog(NAME,self_obj,4,-1,-1);
       gSay_Start;
           call Node008;
       gSay_End;
       end_dialogue;
   end
   else if( ( Marcus_Ptr != 0 ) and ( global_var(GVAR_VAULT_CITIZEN) != CITIZEN_CAPTAIN_GUARD ) ) then
      call Node005;
   else if( ( Lenny_Ptr != 0 ) and ( global_var(GVAR_VAULT_CITIZEN) != CITIZEN_CAPTAIN_GUARD ) ) then
      call Node006;
   else if( night ) then
      call Node007;
   else begin
       start_gdialog(NAME,self_obj,4,-1,-1);
       gSay_Start;
           call Node010;
       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*/
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;
   display_msg(mstr(100));
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(101));
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
end
procedure Node002 begin
   floater( random(104, 106) );
end
procedure Node003 begin
   floater( random(107, 108) );
end
procedure Node004 begin
   floater( random(109, 110) );
end
procedure Node005 begin
   floater(111);
   call Node998;
end
procedure Node006 begin
   floater(110);
   call Node998;
end
procedure Node007 begin
   floater( 113 + local_var(LVAR_Night_Comment) );
   if( local_var(LVAR_Night_Comment) < 2 ) then
      inc_local_var( LVAR_Night_Comment );
end
procedure Node008 begin
   Reply(116);
   BLowOption(117, Node009);
   NLowOption(118, Node999);
   NOption(119, Node012, 004);
   NOption(120, Node024, 004);
   NOption(121, Node999, 004);
end
procedure Node009 begin
   Reply(122);
   NLowOption(123, Node999);
   NLowOption(124, Node999);
end
procedure Node010 begin
   if( global_var(GVAR_VAULT_CITIZEN) == CITIZEN_CAPTAIN_GUARD ) then
      Reply(125);
   else if( global_var(GVAR_VAULT_CITIZEN) == CITIZEN_REAL_CITIZEN ) then
      Reply(126);
   else
      Reply(127);
   BLowOption(128, Node010a);
   NLowOption(129, Node999);
   NOption(130, Node012, 004);
   NOption(131, Node010b, 004);
   NOption(132, Node999, 004);
end
procedure Node010a begin
   if( (global_var(GVAR_VAULT_CITIZEN) == CITIZEN_CAPTAIN_GUARD) or (global_var(GVAR_VAULT_CITIZEN) == CITIZEN_REAL_CITIZEN) ) then
      call Node009;
   else
      call Node011;
end
procedure Node010b begin
   if( (global_var(GVAR_VAULT_CITIZEN) == CITIZEN_CAPTAIN_GUARD) or (global_var(GVAR_VAULT_CITIZEN) == CITIZEN_REAL_CITIZEN) or (Fallout2_enclave_destroyed) ) then
      call Node024;
   else
      call Node023;
end
procedure Node011 begin
   Reply(133);
   NLowOption(134, Node011a);
   NLowOption(135, Node999);
end
procedure Node011a begin
   kick_out_of_vault_city
end
procedure Node012 begin
   if( (global_var(GVAR_VAULT_CITIZENSHIP) == 0) and (not(Fallout2_enclave_destroyed)) ) then
      Reply( mstr(136) + " " + mstr(137) );
   else
      Reply(137);
   NOption(138, Node014, 004);
   NOption(139, Node022, 004);
   NOption(140, Node013, 004);
   NOption(141, Node010b, 004);
   NOption(142, Node999, 004);
end
procedure Node013 begin
   if( (global_var(GVAR_VAULT_CITIZEN) == CITIZEN_CAPTAIN_GUARD) or
       (global_var(GVAR_VAULT_CITIZEN) == CITIZEN_REAL_CITIZEN) or
       (Fallout2_enclave_destroyed) and (dude_is_male) ) then
      Reply(mstr(143) + " " + mstr(145));
   else if( (global_var(GVAR_VAULT_CITIZEN) == CITIZEN_CAPTAIN_GUARD) or
            (global_var(GVAR_VAULT_CITIZEN) == CITIZEN_REAL_CITIZEN) or
            (Fallout2_enclave_destroyed) and (dude_is_female) ) then
      Reply(mstr(144) + " " + mstr(145));
   else
      Reply(145);
   if( item_caps_total(dude_obj) >= 5 ) then begin
      NOption(146, Node013a, 004);
      NOption(147, Node013a, 004);
      NOption(148, Node013a, 004);
   end
   NOption(149, Node014, 004);
   NOption(150, Node010b, 004);
   if( item_caps_total(dude_obj) < 5 ) then
      NOption(151, Node999, 004);
   else
      NOption(152, Node999, 004);
end
procedure Node013a begin
   item_caps_adjust( dude_obj, -5 );
   critter_heal( dude_obj, 1 );
   gfade_out(600);
   game_time_advance( ONE_GAME_MINUTE * 3 );
   gfade_in(600);
   call Node015;
end
procedure Node014 begin
   Reply(153);
   if( has_skill( dude_obj, SKILL_SCIENCE ) >= 75 ) then
      NOption(154, Node017, 004);
   NOption(155, Node022, 004);
   NOption(156, Node013, 004);
   if( item_caps_total(dude_obj) >= 20 ) then
      NOption(157, Node014a, 004);
   NOption(158, Node010b, 004);
   if( item_caps_total(dude_obj) < 20 ) then
      NOption(159, Node999, 004);
   else
      NOption(160, Node999, 004);
end
procedure Node014a begin
   item_caps_adjust( dude_obj, -20 );
   critter_heal( dude_obj, 3 );
   gfade_out(600);
   game_time_advance( ONE_GAME_MINUTE * 3 );
   gfade_in(600);
   call Node016;
end
procedure Node015 begin
   Reply(161);
   NOption(162, Node013, 004);
   NOption(163, Node014, 004);
   NOption(164, Node010b, 004);
   NOption(165, Node999, 004);
end
procedure Node016 begin
   inc_local_var( LVAR_Alcohol_Count );
   if( (local_var( LVAR_Alcohol_Count ) == 100) and (dude_luck > 8) ) then begin
      if( dude_luck == 9 ) then begin
         critter_add_trait( dude_obj, TRAIT_PERK, PERK_alcohol_hp_bonus1_perk, 1 );
      end
      else if( dude_luck == 10 ) then begin
         critter_add_trait( dude_obj, TRAIT_PERK, PERK_alcohol_hp_bonus2_perk, 1 );
      end
      Reply(166);
      NOption(170, Node999, 004);
   end
   else if( (local_var( LVAR_Alcohol_Count ) == 100) and (dude_luck < 3) ) then begin
      if( dude_luck == 2 ) then begin
         critter_add_trait( dude_obj, TRAIT_PERK, PERK_alcohol_hp_neg1_perk, 1 );
      end
      else if( dude_luck == 1 ) then begin
         critter_add_trait( dude_obj, TRAIT_PERK, PERK_alcohol_hp_neg2_perk, 1 );
      end
      Reply(167);
      NOption(169, Node999, 004);
   end
   else
      Reply(168);
   NOption(171, Node013, 004);
   if( item_caps_total(dude_obj) >= 20 ) then
      NOption(172, Node014a, 004);
   if( has_skill( dude_obj, SKILL_SCIENCE) >= 75 ) then
      NOption(173, Node017, 004);
   NOption(174, Node010b, 004);
   NOption(175, Node999, 004);
end
procedure Node017 begin
   Reply(176);
   NOption(177, Node018, 004);
   NOption(178, Node022, 004);
   NOption(179, Node013, 004);
   if( item_caps_total(dude_obj) >= 20 ) then
      NOption(180, Node014a, 004);
   NOption(181, Node010b, 004);
   NOption(182, Node999, 004);
end
procedure Node018 begin
   Reply(183);
   if( dude_iq == 4 ) then
      NOption(184, Node019, 004);
   NOption(185, Node020, 004);
   NOption(186, Node010b, 004);
   NOption(187, Node999, 004);
end
procedure Node019 begin
   Reply(188);
   NOption(189, Node020, 004);
   NOption(190, Node010b, 004);
   NOption(191, Node999, 004);
end
procedure Node020 begin
   Reply(192);
   if( dude_iq == 4 ) then
      NOption(193, Node021, 004);
   NOption(194, Node010b, 004);
   NOption(195, Node999, 004);
end
procedure Node021 begin
   Reply(196);
   NOption(197, Node010b, 004);
   NOption(198, Node999, 004);
end
procedure Node022 begin
   if( (global_var(GVAR_VAULT_CITIZENSHIP) == 0) and (not(Fallout2_enclave_destroyed)) ) then
      Reply( mstr(199) + " " + mstr(200) );
   else
      Reply(199);
   NOption(201, Node013, 004);
   NOption(202, Node014, 004);
   NOption(203, Node010b, 004);
   if( (global_var(GVAR_VAULT_CITIZENSHIP) == 0) and (not(Fallout2_enclave_destroyed)) ) then
      NOption(204, Node999, 004);
   else
      NOption(205, Node999, 004);
end
procedure Node023 begin
   Reply(206);
   NOption(207, Node012, 004);
   NOption(208, Node029, 004);
   NOption(209, Node999, 004);
end
procedure Node024 begin
   if( (Fallout2_enclave_destroyed) and (dude_is_male) ) then
      Reply(210);
   else if( (Fallout2_enclave_destroyed) and (dude_is_female) ) then
      Reply(211);
   else if( global_var(GVAR_VAULT_CITIZEN) == CITIZEN_CAPTAIN_GUARD ) then
      Reply(212);
   else if( global_var(GVAR_VAULT_CITIZEN) == CITIZEN_REAL_CITIZEN ) then
      Reply(213);
   NOption(214, Node025, 004);
   NOption(215, Node028, 004);
   NOption(216, Node012, 004);
   NOption(217, Node999, 004);
end
procedure Node025 begin
   Reply(218);
   NOption(219, Node026, 004);
   NOption(220, Node028, 004);
   NOption(221, Node012, 004);
   NOption(222, Node999, 004);
end
procedure Node026 begin
   Reply(223);
   NOption(224, Node027, 004);
   NOption(225, Node028, 004);
   NOption(226, Node012, 004);
   NOption(227, Node999, 004);
end
procedure Node027 begin
   Reply(228);
   NOption(229, Node010b, 004);
   NOption(230, Node012, 004);
   NOption(231, Node999, 004);
end
procedure Node028 begin
   From_28 := 1;
   Reply(232);
   BOption(233, Node029, 004);
   NOption(234, Node030, 004);
   NOption(235, Node012, 004);
   NOption(236, Node999, 004);
end
procedure Node029 begin
   if( dude_is_female ) then
      Reply(237);
   else
      Reply(238);
   if( From_28 == 1 ) then begin
      From_28 := 0;
      NOption(239, Node030, 004);
   end
   NOption(240, Node012, 004);
   NOption(241, Node999, 004);
end
procedure Node030 begin
   Reply(242);
   NOption(243, Node012, 004);
   NOption(244, Node999, 004);
end
//xxxxxxxxxxxxxxxxxxxx

Advertisement