Fallout Wiki
Advertisement
Fallout Wiki
Details
Type Source file
SCRIPTS.LST comment Bar owner and Tragic player
MSG file N/A
Transcript

/*
        Copyright 1998-2003 Interplay Entertainment Corp. All rights reserved.
*/
/*
        Name: Wooz
        Location: Gecko
        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: January 14, 1998
           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\gecko.h"
#include "..\headers\gecksetl.h"
#define NAME SCRIPT_GCWOOZ
#define TOWN_REP_VAR (GVAR_TOWN_REP_GECKO)
#define floater(x) float_msg(self_obj, message_str(NAME,x),FLOAT_MSG_RED)
#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 combat;
procedure timed_event_p_proc;
/* Script Specific Procedure Calls */
procedure wooz_barter;
procedure Node910;
procedure Node920;
procedure Node922;
procedure Node924;
procedure Node930;
procedure Node995;
procedure Node996;
procedure Node997;
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 Node011;
procedure Node012;
procedure Node013;
procedure Node014;
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;
procedure Node031;
procedure Node032;
procedure Node033;
procedure Node034;
procedure Node035;
procedure Node036;
procedure Node037;
procedure Node038;
procedure Node039;
procedure Node040;
procedure Node041;
procedure Node042;
procedure Node043;
procedure Node044;
procedure Node045;
procedure Node046;
procedure Node047;
procedure Node050;
//~~~~~~~~~~~~~~~~ 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_11_before (7)
#define LVAR_24_before (8)
#define LVAR_25_before (9)
#define LVAR_Wooz_Friend (10)
#define LVAR_drink_round (11)
#define LVAR_deck_init (12)
#define LVAR_total_decks (13)
#define LVAR_days_since_restock (14)
/* 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;
variable k;
variable item;
variable In_Timed_Event:=0;
variable four_before:=0;
variable seven_before:=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
   if (local_var(LVAR_deck_init) == 0) then begin
      set_local_var(LVAR_deck_init,1);
      set_local_var(LVAR_total_decks,14);
      set_local_var(LVAR_days_since_restock, GAME_TIME_IN_DAYS);
   end
   Only_Once:=0;
   critter_add_trait(self_obj,TRAIT_OBJECT,OBJECT_TEAM_NUM,TEAM_GECKO);
   critter_add_trait(self_obj,TRAIT_OBJECT,OBJECT_AI_PACKET,AI_TOUGH_CITIZEN);
end
procedure timed_event_p_proc begin
   if (fixed_param == 1) then begin
       floater(random(700,714));
       In_Timed_Event:=0;
   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 (obj_can_see_obj(self_obj,dude_obj)) then begin
      if (global_var(GVAR_GECKO_MELTDOWN) == 1) then begin
         set_local_var(LVAR_Hostile,1);
         attack(dude_obj);
      end
      else if (local_var(LVAR_Hostile) == 2) then begin
          set_local_var(LVAR_Hostile,1);
          attack(dude_obj);
      end
   end
   else if ((random(0,100) == 1) and (In_Timed_Event == 0)) then begin
       In_Timed_Event:=1;
       if (map_var(MVAR_Round_Of_Drinks) == 0) then
          add_timer_event(self_obj,game_ticks(random(20,40)),1);
       else if (map_var(MVAR_Round_Of_Drinks) == 1) then
          add_timer_event(self_obj,game_ticks(random(18,36)),1);
       else if (map_var(MVAR_Round_Of_Drinks) == 2) then
          add_timer_event(self_obj,game_ticks(random(15,30)),1);
       else if (map_var(MVAR_Round_Of_Drinks) > 2) then
          add_timer_event(self_obj,game_ticks(random(10,20)),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_GECKO,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
   GetReaction;
   //restock Wooz's decks
   if (local_var(LVAR_total_decks) < 1) then begin
      if ((GAME_TIME_IN_DAYS - local_var(LVAR_days_since_restock)) > 7) then begin
         set_local_var(LVAR_total_decks, 7);
         set_local_var(LVAR_days_since_restock, GAME_TIME_IN_DAYS);
      end
   end
   // CHANGE -nbk (Aldo doesn't care if your an enemy of the either side in Klamath)
   // -he just wants a drink
   if (local_var(LVAR_Personal_Enemy) == 1) then begin
       call Node998;
   end
   else if (obj_is_carrying_obj_pid(dude_obj, PID_DECK_OF_TRAGIC_CARDS)) then begin
       if (local_var(LVAR_total_decks) > 0) then begin
          start_gdialog(NAME,self_obj,4,-1,-1);
          gSay_Start;
              call Node027;
          gSay_End;
          end_dialogue;
       end
       else begin
          floater(random(375,377));
       end
   end
   else if (LVAR_reaction_level < -25) then begin
      start_gdialog(NAME,self_obj,4,-1,-1);
      gSay_Start;
         call Node020;
      gSay_End;
      end_dialogue;
   end
   else begin
      start_gdialog(NAME,self_obj,4,-1,-1);
      gSay_Start;
         call Node001;
      gSay_End;
      end_dialogue;
   end
/*
   else if ((get_critter_stat(dude_obj,STAT_iq) <= (0-LOW_IQ))) then begin
       start_gdialog(NAME,self_obj,4,-1,-1);
       gSay_Start;
           call Node018;
       gSay_End;
       end_dialogue;
   end
   else if (local_var(LVAR_Herebefore) == 0) then begin
//else if ((local_var(LVAR_Herebefore) == 0) and (get_critter_stat(dude_obj,STAT_iq) <= (0-LOW_IQ))) then begin
       set_local_var(LVAR_Herebefore,1);
       start_gdialog(NAME,self_obj,4,-1,-1);
       gSay_Start;
           call Node001;
       gSay_End;
       end_dialogue;
   end
   else begin
       start_gdialog(NAME,self_obj,4,-1,-1);
       gSay_Start;
          if (local_var(LVAR_Give) == 1) then
             call Node012;
          else
             call Node011;
       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
   inc_good_critter
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
procedure combat begin
end
procedure Node910 begin
   if (global_var(GVAR_VAULT_PLANT_STATUS) == PLANT_REPAIRED) then
      call Node008;
   else
      call Node007;
end
procedure Node920 begin
//money check
//[if <$5 in inventory then goto 6, else subtract $4 from PC and goto 904(was 4)]
   if (item_caps_total(dude_obj) >= 5) then begin
      item_caps_adjust(dude_obj, -5);
      item:=create_object(PID_GAMMA_GULP_BEER,0,0);
      add_obj_to_inven(dude_obj,item);
      //use_obj_on_obj(create_object(PID_GAMMA_GULP_BEER,0,0), dude_obj);
      call Node999;
   end
   else begin
      call Node008;
   end
end
procedure Node922 begin
//money check
//[if <$5 in inventory then goto 6, else subtract $4 from PC and goto 904(was 4)]
   if (item_caps_total(dude_obj) >= 12) then begin
      item_caps_adjust(dude_obj, -12);
      item:=create_object(PID_ROENTGEN_RUM,0,0);
      add_obj_to_inven(dude_obj,item);
      //use_obj_on_obj(create_object(PID_ROENTGEN_RUM,0,0), dude_obj);
      call Node999;
   end
   else begin
      call Node008;
   end
end
procedure Node924 begin
   if (item_caps_total(dude_obj) >= 35) then begin
      item_caps_adjust(dude_obj, -35);
      item:=create_object(PID_GAMMA_GULP_BEER,0,0);
      add_obj_to_inven(dude_obj,item);
      //use_obj_on_obj(create_object(PID_GAMMA_GULP_BEER,0,0), dude_obj);
      set_local_var(LVAR_drink_round, local_var(LVAR_drink_round) + 1);
      if (local_var(LVAR_drink_round) == 1) then begin
         set_map_var(MVAR_Round_Of_Drinks,1);
         GC_REP_ADJUST(2)
      end
      else if (local_var(LVAR_drink_round) == 2) then begin
         set_map_var(MVAR_Round_Of_Drinks,2);
         GC_REP_ADJUST(4)
      end
      else if (local_var(LVAR_drink_round) == 3) then begin
         //both 3rd round of drinks(8) and wooz friend(3) rep adjust here
         set_map_var(MVAR_Round_Of_Drinks,3);
         GC_REP_ADJUST(11)
         set_local_var(LVAR_Wooz_Friend, 2);
      end
      else begin
         set_local_var(LVAR_drink_round,4);
         //drink_round:=4;
      end
      call Node999;
   end
   else begin
      call Node008;
   end
end
procedure Node930 begin
   k:=random(1,5);
   gfade_out(600);
   game_time_advance(game_ticks(k*3600)); //k hours
   gfade_in(600);
   if (obj_is_carrying_obj_pid(dude_obj, PID_DECK_OF_TRAGIC_CARDS)) then begin
      if (is_success(roll_vs_skill(dude_obj,SKILL_GAMBLING,0))) then
         call Node030;
      else
         call Node031;
   end
   else begin
      call Node031;
   end
end
procedure Node995 begin
   if (get_critter_stat(dude_obj,STAT_ch) >= 7) then begin
       TopReact;
   end
   else begin
       BottomReact;
   end
end
procedure Node996 begin
   BottomReact;
end
procedure Node997 begin
   if (get_critter_stat(dude_obj,STAT_ch) >= 8) then
       call Node004;
   else
       call Node005;
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
procedure wooz_barter begin
  //set_local_var(LVAR_attempted_barter,1);
  gdialog_mod_barter(0);
  call Node015;
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
//Wooz_Friend = 0 , Never met him
//Wooz_Friend = 1 , Met Wooz but not friend yet
//Wooz_Friend = 2 , Friend
if (local_var(LVAR_Wooz_Friend) == 0) then begin
   set_local_var(LVAR_Wooz_Friend, 1);
   Reply(110);
end
else if (local_var(LVAR_Wooz_Friend) == 1) then begin
   Reply(111);
end
else if (local_var(LVAR_Wooz_Friend) == 2) then begin
//Wooz_Friend becomes 2 if reaction 74+
//however since not sure reactions is working...
//I set it if player buys 3 or more round of drinks
   Reply(112);
end
   Reply(110);
   NOption(113,Node007,001);
   NOption(114,Node004,004);
   NOption(115,Node006,004);
   NOption(116,Node003,004);
   NOption(117,Node999,004);
end
procedure Node002 begin
   Reply(120);
   NOption(121,Node017,004);
   BOption(122,Node016,004); //reaction minor
   NOption(123,Node999,004);
end
procedure Node003 begin
   Reply(130);
   NOption(131,Node002,004);
   NOption(132,Node012,004);
end
procedure Node004 begin
   if (four_before == 0) then begin
      four_before:=1;
      Reply(140);
   end
   else begin
      Reply(141);
   end
   NOption(142,Node007,004);
   NOption(143,Node005,004);
   NOption(144,Node010,004);
   NOption(145,Node011,004);
   NOption(146,Node999,004);
end
procedure Node005 begin
   Reply(150);
   NOption(152,Node011,004);
   NOption(153,wooz_barter,004); //barter
   NOption(154,wooz_barter,004); //barter
   NOption(155,Node004,004);
   NOption(156,Node999,004);
end
procedure Node006 begin
   Reply(160);
   NOption(161,Node034,004);
   NOption(162,Node035,004);
end
procedure Node007 begin
   if (seven_before == 0) then begin
      seven_before:=1;
      Reply(170);
   end
   else begin
      Reply(171);
   end
//need first time
   Reply(170);
   NOption(172,Node920,004);
   NOption(173,Node920,004);
   NOption(174,Node922,004);
   NOption(175,Node009,004);
   NOption(176,Node999,004);
end
procedure Node008 begin
   Reply(180);
   NLowOption(181,Node999);
   NOption(182,Node007,004);
   NOption(183,Node001,004);
   GOption(184,Node001,004);
   BOption(185,Node999,004);
   NOption(186,Node999,004);
end
procedure Node009 begin
   Reply(190);
   if (local_var(LVAR_drink_round) == 0) then
      NOption(191,Node924,001);
   if (local_var(LVAR_drink_round) == 1) then
      NOption(192,Node924,004);
   if (local_var(LVAR_drink_round) == 2) then
      NOption(193,Node924,004);
   if (local_var(LVAR_drink_round) > 2) then
      NOption(194,Node924,004);
   BOption(195,Node022,004);
   NOption(196,Node007,004);
end
procedure Node010 begin
   Reply(200);
   NOption(201,Node043,004);
   NOption(202,Node999,004);
end
procedure Node011 begin
   if (local_var(LVAR_11_before) == 0) then begin
      set_local_var(LVAR_11_before,1);
      Reply(210);
      if (local_var(LVAR_25_before) == 0) then
         NOption(213,Node025,004);
   end
   else begin
      Reply(211);
   end
   if (local_var(LVAR_24_before) == 0) then
      NOption(212,Node024,004);
   NOption(214,Node999,004);
end
procedure Node012 begin
   Reply(220);
   NOption(221,Node013,004);
   NOption(222,Node999,004);
end
procedure Node013 begin
   Reply(230);
   NOption(231,Node004,004);
   BOption(232,Node014,004); //reaction tiny
end
procedure Node014 begin
   Reply(240);
   BOption(241,Node004,004); //reaction minor
   GOption(242,Node999,004); //reaction tiny
end
procedure Node015 begin
   Reply(250);
   NOption(251,wooz_barter,004);
   NOption(252,Node004,004);
   NOption(253,Node999,004);
end
procedure Node016 begin
   Reply(260);
   BOption(261,Node018,004); //reaction tiny
   BOption(262,Node999,004); //reaction minor
end
procedure Node017 begin
   Reply(270);
   GOption(271,Node004,001); //reaction moderate
   NOption(272,Node999,004);
end
procedure Node018 begin
   Reply(280);
   GOption(281,Node019,004);
   NOption(282,Node999,004);
end
procedure Node019 begin
   Reply(290);
   GOption(291,Node999,004); //reaction minor
   NOption(292,combat,004);
end
procedure Node020 begin
   Reply(300);
   GOption(301,Node004,004); //reaction moderate
   BOption(302,Node999,004); //reaction tiny
   GOption(303,Node999,004);
   GOption(304,Node021,004); //reaction reset to zero
end
procedure Node021 begin
   Reply(310);
   NOption(311,Node004,004);
end
procedure Node022 begin
   Reply(320);
   NOption(321,Node023,004);
end
procedure Node023 begin
   Reply(330);
   NOption(331,Node999,004); //reaction moderate
end
procedure Node024 begin
   set_local_var(LVAR_24_before,1);
   Reply(340);
   NOption(341,Node026,004);
end
procedure Node025 begin
   set_local_var(LVAR_25_before,1);
   Reply(350);
   NOption(351,Node011,004);
end
procedure Node026 begin
   Reply(360);
   GOption(361,Node028,004);
   BOption(362,Node999,004); //reaction minor
end
procedure Node027 begin
   Reply(370);
   GOption(371,Node032,004); //reaction minor
   NOption(372,Node033,004);
end
procedure Node028 begin
   item:=create_object(PID_DECK_OF_TRAGIC_CARDS,0,0);
   add_obj_to_inven(dude_obj,item);
   Reply(380);
   GOption(381,Node029,004); //reaction moderate
   BOption(382,Node004,004); //reaction tiny
   BOption(383,Node999,004); //reaction minor
end
procedure Node029 begin
   Reply(390);
   GOption(391,Node930,004);
   NOption(392,Node999,004);
end
procedure Node030 begin
   item:=create_object(PID_DECK_OF_TRAGIC_CARDS,0,0);
   add_obj_to_inven(dude_obj,item);
   set_local_var(LVAR_total_decks, local_var(LVAR_total_decks)-1);
   Reply(400);
   BOption(401,Node999,004); //reaction tiny
   NOption(402,Node999,004);
end
procedure Node031 begin
   //really shouldn't get here if pc doesnt have cards
   if (obj_is_carrying_obj_pid(dude_obj, PID_DECK_OF_TRAGIC_CARDS)) then begin
      item:=obj_carrying_pid_obj(dude_obj, PID_DECK_OF_TRAGIC_CARDS);
      rm_obj_from_inven(dude_obj,item);
      add_obj_to_inven(self_obj,item);
      set_local_var(LVAR_total_decks, local_var(LVAR_total_decks)+1);
   end
//move one tragic deck from player to wooz
   Reply(410);
   BOption(411,Node999,004);
   NOption(412,Node999,004); //reaction tiny
end
procedure Node032 begin
   Reply(420);
   BOption(421,Node930,004);
   NOption(422,Node004,004); //reaction tiny
end
procedure Node033 begin
   Reply(430);
   BOption(431,Node004,004);
   NOption(432,Node999,004);
end
procedure Node034 begin
   Reply(440);
   BOption(441,Node036,004);
   NOption(442,Node038,004);
end
procedure Node035 begin
   Reply(450);
   NOption(451,Node037,004);
end
procedure Node036 begin
   Reply(460);
   NOption(461,Node039,004);
   BOption(462,Node999,004); //reaction moderate
end
procedure Node037 begin
   Reply(470);
   NOption(471,Node004,004);
   BOption(472,Node999,004); //reaction major
end
procedure Node038 begin
   Reply(480);
   NOption(481,Node041,004);
   GOption(482,Node004,004); //reaction minor
end
procedure Node039 begin
   Reply(490);
   NOption(491,Node040,004);
end
procedure Node040 begin
   Reply(500);
   NOption(501,Node004,004);
   GOption(502,Node999,004); //reaction moderate
end
procedure Node041 begin
   Reply(510);
   NOption(511,Node042,004);
end
procedure Node042 begin
   Reply(520);
   NOption(521,Node004,004);
end
procedure Node043 begin
   Reply(530);
   NOption(531,Node044,004);
end
procedure Node044 begin
   Reply(540);
   NOption(541,Node045,004);
end
procedure Node045 begin
   Reply(550);
   NOption(551,Node046,004);
end
procedure Node046 begin
   Reply(560);
   NOption(561,Node047,004);
   GOption(562,Node050,004); //reaction major
end
procedure Node047 begin
   Reply(570);
   NOption(571,Node004,004); //reaction minor
   NOption(572,Node999,004);
end
procedure Node050 begin
   set_local_var(LVAR_Wooz_Friend, 2);
   Reply(601);
   NOption(142,Node007,004);
   NOption(143,Node005,004);
   //NOption(144,Node010,004);
   NOption(145,Node011,004);
   NOption(146,Node999,004);
end
//xxxxxxxxxxxxxxxxxxxx

Advertisement