/*
Copyright 1998-2003 Interplay Entertainment Corp. All rights reserved.
*/
/*
Name: Harold
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"
#define NAME SCRIPT_GCHAROLD
#define TOWN_REP_VAR (GVAR_TOWN_REP_GECKO)
#define floater(x) float_msg(self_obj, message_str(NAME,x),FLOAT_MSG_RED)
#define PID_COOLANT_REPORT 10 //need to change to proper pid
#define PID_REACTOR_REPAIR_PART 20 //need to change to proper pid
#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;
/* Script Specific Procedure Calls */
procedure Node910;
//procedure Node920;
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 Node03a;
procedure Node004;
procedure Node005;
procedure Node006;
procedure Node007;
procedure Node008;
procedure Node009;
procedure Node011;
procedure Node012;
procedure Node013;
procedure Node014;
procedure Node015;
procedure Node016;
procedure Node017;
procedure Node018;
procedure Node019;
procedure Node020;
procedure Node021;
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 Node38a;
procedure Node38b;
procedure Node039;
procedure Node040;
procedure Node041;
procedure Node042;
procedure Node043;
procedure Node044;
procedure Node045;
procedure Node046;
procedure Node048;
procedure Node049;
procedure Node050;
procedure Node051;
procedure Node052;
procedure Node053;
procedure Node054;
//~~~~~~~~~~~~~~~~ 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_Give (7)
#define LVAR_01_before (8)
#define LVAR_02_before (9)
#define LVAR_46_before (10)
#define LVAR_48_before (11)
#define LVAR_3032_visited (12)
#define LVAR_Thanx (13)
#define LVAR_49_before (14)
#define LVAR_50_before (15)
/* 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 coolant;
variable item;
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_GECKO);
critter_add_trait(self_obj,TRAIT_OBJECT,OBJECT_AI_PACKET,AI_TOUGH_CITIZEN);
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 ( (global_var(GVAR_GECKO_MELTDOWN) == 1) and (obj_can_see_obj(self_obj,dude_obj))) then begin
set_local_var(LVAR_Hostile,1);
attack(dude_obj);
end
else if ((local_var(LVAR_Hostile) == 2) and (obj_can_see_obj(self_obj,dude_obj))) then begin
set_local_var(LVAR_Hostile,1);
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);
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;
if (local_var(LVAR_Personal_Enemy) == 1) then begin
call Node998;
end
else if (LVAR_reaction_level < -75) then begin
call Node021; //change to 21 when Mark O'Green writes Node021
end
else if ((get_critter_stat(dude_obj,STAT_iq) <= 3)) then begin
//start_gdialog(NAME,self_obj,4,HEAD_HAROLD,BACKGROUND_HUB);
//start_gdialog(NAME,self_obj,4,-1,-1);
//gSay_Start;
call Node001;
//gSay_End;
//end_dialogue;
end
else if (LVAR_reaction_level < -50) then begin
start_gdialog(NAME,self_obj,4,HEAD_HAROLD,BACKGROUND_HUB);
//start_gdialog(NAME,self_obj,4,-1,-1);
gSay_Start;
call Node018;
gSay_End;
end_dialogue;
end
else begin
start_gdialog(NAME,self_obj,4,HEAD_HAROLD,BACKGROUND_HUB);
//start_gdialog(NAME,self_obj,4,-1,-1);
gSay_Start;
call Node002;
gSay_End;
end_dialogue;
end
/*
if (local_var(LVAR_Herebefore) == 0) then begin
set_local_var(LVAR_Herebefore,1);
start_gdialog(NAME,self_obj,4,HEAD_HAROLD,-1);
gSay_Start;
call Node002;
gSay_End;
end_dialogue;
end
else begin
start_gdialog(NAME,self_obj,4,HEAD_HAROLD,-1);
gSay_Start;
call Node018;
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
procedure Node910 begin
if (global_var(GVAR_VAULT_PLANT_STATUS) == PLANT_REPAIRED) then
call Node008;
else
call Node007;
end
procedure Node920 begin
coolant:=obj_carrying_pid_obj(dude_obj, PID_COOLANT_REPORT);
rm_obj_from_inven(dude_obj, coolant);
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
// 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,105));
end
procedure Node002 begin
if (local_var(LVAR_02_before) == 0) then begin
set_local_var(LVAR_02_before, 1);
if ((global_var(GVAR_VAULT_PLANT_STATUS) == PLANT_REPAIRED) or (global_var(GVAR_VAULT_PLANT_STATUS) == PLANT_OPTIMIZED) ) then begin
set_local_var(LVAR_Thanx,1);
Reply(108);
NOption(112,Node014,004);
end
else begin
Reply(106);
NOption(112,Node014,004);
end
end
else begin //NEXT TIMES
if (local_var(LVAR_3032_visited) == 1) then begin
Reply(107);
NOption(112,Node014,004);
end
else if (local_var(LVAR_Thanx) == 0) then begin
if (global_var(GVAR_GECKO_DESCENDANT_KNOWN) == 0) then begin
if ((global_var(GVAR_VAULT_PLANT_STATUS) == PLANT_REPAIRED) or (global_var(GVAR_VAULT_PLANT_STATUS) == PLANT_OPTIMIZED) ) then begin
set_local_var(LVAR_Thanx,1);
Reply(109);
NOption(112,Node014,004);
end
else begin
Reply(107);
end
end
else begin //descendant known
if ((global_var(GVAR_VAULT_PLANT_STATUS) == PLANT_REPAIRED) or (global_var(GVAR_VAULT_PLANT_STATUS) == PLANT_OPTIMIZED) ) then begin
set_local_var(LVAR_Thanx,1);
Reply(110);
NOption(113,Node012,004);
end
else begin
Reply(107);
end
end //descendant known
end //THANKS was 0
else begin //already thanked the player
Reply(107);
end
end
NOption(114,Node003,004);
NOption(115,Node033,004);
NOption(116,Node034,004);
if (dude_found_geck) then begin
end
else begin //this should check if not found geck
NOption(117,Node035,004);
end
//if (master referenced) then
// NOption(119,Node038b,004);
//NBK waiting for a command to check if anyone wonded
//if (anyone wounded) then
// NOption(120,Node036,004);
NOption(120,Node999,004);
end
procedure Node003 begin
Reply(121);
NOption(122,Node004,004);
NOption(123,Node03a,004);
end
procedure Node03a begin
Reply(124);
NOption(125,Node004,004);
NOption(126,Node002,004);
end
procedure Node004 begin
if (global_var(GVAR_VAULT_PLANT_STATUS) == PLANT_REPAIRED) then begin
Reply(128);
NOption(131,Node011,004);
if (global_var(GVAR_GECKO_ECON_DISK) == ECON_DISK_GIVEN) then
NOption(132,Node026,004);
end
if (global_var(GVAR_VAULT_PLANT_STATUS) == PLANT_OPTIMIZED) then begin
Reply(129);
NOption(134,Node009,004);
if (global_var(GVAR_GECKO_ECON_DISK) == ECON_DISK_GIVEN) then
NOption(133,Node026,004);
end
else begin //reactor untouched
Reply(127);
NOption(130,Node006,004);
end
NOption(135,Node999,004);
end
procedure Node005 begin
Reply(136);
NOption(137,Node048,004);
end
procedure Node006 begin
Reply(138);
NOption(139,Node007,004);
end
procedure Node007 begin
Reply(140);
NOption(141,Node008,004);
end
procedure Node008 begin
Reply(142);
NOption(143,Node005,004);
NOption(144,Node002,004);
NOption(145,Node048,004);
NOption(146,Node999,004);
end
procedure Node009 begin
Reply(147);
NOption(148,Node011,004);
NOption(149,Node002,004);
end
//procedure Node010 begin
// Reply(149);
// NOption(150,Node005,004);
// BOption(151,Node999,004); //minor reaction down
//end
procedure Node011 begin
if (global_var(GVAR_GECKO_DESCENDANT_KNOWN) == 0) then begin
Reply(150);
NOption(152,Node037,004);
NOption(154,Node002,004);
end
else begin
Reply(151);
NOption(153,Node002,004);
end
NOption(157,Node999,004);
end
procedure Node012 begin
Reply(158);
BOption(159,Node013,004); //minor reaction down
NOption(160,Node002,004);
end
procedure Node013 begin
Reply(161);
NOption(162,Node002,004);
NOption(163,Node999,004);
end
procedure Node014 begin
Reply(156);
NOption(157,Node002,008);
NOption(158,Node002,004);
NOption(159,Node015,004);
NOption(160,Node999,004);
end
procedure Node015 begin
Reply(161);
NOption(162,Node017,004);
NOption(163,Node016,004);
end
procedure Node016 begin
Reply(164);
NOption(165,Node002,004);
NOption(166,Node999,004);
end
procedure Node017 begin
Reply(167);
NOption(168,Node002,004);
NOption(169,Node999,004);
end
procedure Node018 begin
Reply(170);
GOption(171,Node019,004); //major up
BOption(172,Node999,004); //moderate down
end
procedure Node019 begin
Reply(173);
GOption(174,Node020,004); //moderate up
BOption(175,Node999,004); //moderate down
end
procedure Node020 begin
if (LVAR_reaction_level >= 0) then
Reply(176);
else
Reply(177);
NOption(178,Node002,004);
NOption(179,Node999,004);
end
procedure Node021 begin
k:=random(1,5);
if (k == 1) then floater(180);
else if (k == 2) then floater(181);
else if (k == 3) then floater(182);
else if (k == 4) then floater(183);
else if (k == 5) then floater(184);
end
procedure Node026 begin
Reply(185);
NOption(186,Node027,004);
NOption(187,Node028,004);
NOption(188,Node029,004);
BOption(189,Node999,004); //reaction tiny
end
procedure Node027 begin
Reply(190);
BOption(191,Node030,004); //reaction minor
NOption(192,Node999,004); //
end
procedure Node028 begin
Reply(193);
NOption(194,Node999,004);
NOption(195,Node999,004);
end
procedure Node029 begin
Reply(196);
BOption(197,Node999,004);
NOption(198,Node999,004);
end
procedure Node030 begin
set_local_var(LVAR_3032_visited, 1);
Reply(199); //reaction major
BOption(200,Node032,004); //reaction minor
NOption(201,Node999,004);
end
procedure Node031 begin
Reply(202);
NOption(203,Node032,004);
NOption(204,Node002,004);
NOption(205,Node999,004); //reaction down minor
end
procedure Node032 begin
set_local_var(LVAR_3032_visited, 1);
Reply(206);
BOption(207,Node999,004); //reaction major
NOption(208,Node999,004);
end
procedure Node033 begin
Reply(209);
NOption(210,Node002,004);
NOption(211,Node999,004);
end
procedure Node034 begin
Reply(212);
NOption(213,Node002,004);
NOption(214,Node999,004);
end
procedure Node035 begin
Reply(215);
NOption(216,Node002,004);
NOption(217,Node999,004);
end
procedure Node036 begin
Reply(218);
NOption(219,Node002,004);
NOption(220,Node999,004);
end
procedure Node037 begin
Reply(221);
NOption(222,Node038,004);
end
procedure Node038 begin
Reply(223);
NOption(224,Node38a,004);
end
procedure Node38a begin
Reply(225);
NOption(226,Node039,004);
NOption(227,Node040,004);
end
procedure Node38b begin
Reply(228);
NOption(229,Node039,004);
NOption(228,Node039,004);
end
procedure Node039 begin
set_global_var(GVAR_GECKO_DESCENDANT_KNOWN,1);
//set ancestor known
Reply(231);
NOption(232,Node041,004);
NOption(233,Node041,004);
end
procedure Node040 begin
Reply(234);
NOption(235,Node039,004);
end
procedure Node041 begin
Reply(236);
NOption(237,Node042,004);
NOption(238,Node999,004);
end
procedure Node042 begin
Reply(239);
NOption(240,Node043,004);
NOption(241,Node999,004);
end
procedure Node043 begin
Reply(242);
NOption(243,Node044,004);
NOption(244,Node002,004); //reaction tiny
end
procedure Node044 begin
Reply(245);
NOption(246,Node045,004); //reaction +
end
procedure Node045 begin
Reply(247);
NOption(248,Node046,004);
NOption(249,Node999,004);
end
procedure Node046 begin
if (local_var(LVAR_46_before) == 0) then begin
//give PC 5 stimpaks and 3 superstims
item:=create_object(PID_STIMPAK,0,0);
add_obj_to_inven(dude_obj,item);
item:=create_object(PID_STIMPAK,0,0);
add_obj_to_inven(dude_obj,item);
item:=create_object(PID_STIMPAK,0,0);
add_obj_to_inven(dude_obj,item);
item:=create_object(PID_STIMPAK,0,0);
add_obj_to_inven(dude_obj,item);
item:=create_object(PID_STIMPAK,0,0);
add_obj_to_inven(dude_obj,item);
item:=create_object(PID_SUPER_STIMPAK,0,0);
add_obj_to_inven(dude_obj,item);
item:=create_object(PID_SUPER_STIMPAK,0,0);
add_obj_to_inven(dude_obj,item);
item:=create_object(PID_SUPER_STIMPAK,0,0);
add_obj_to_inven(dude_obj,item);
set_local_var(LVAR_46_before,1);
Reply(250);
end
else begin
Reply(251);
end
NOption(252,Node002,004);
NOption(253,Node999,004);
end
procedure Node048 begin
if (local_var(LVAR_48_before) == 0) then begin
set_local_var(LVAR_48_before,1);
if ( (global_var(GVAR_VAULT_GECKO_PLANT) == PLANT_DECLINED_QUEST) or (global_var(GVAR_VAULT_GECKO_PLANT) == 0) ) then
set_global_var(GVAR_GECKO_ASSIGNED,1);
if (global_var(GVAR_VAULT_GECKO_PLANT) < PLANT_NEED_PART) then begin
debug_msg("set part needed");
set_global_var(GVAR_VAULT_GECKO_PLANT, PLANT_NEED_PART);
end else begin
debug_msg("DIDN'T SET PART NEEDED");
end
//set problem understood and set need part
//same var -can't set both. This may be all that is necessary
Reply(254);
end
else begin
Reply(255);
end
if (local_var(LVAR_49_before) == 0) then
NOption(256,Node049,004);
if (local_var(LVAR_50_before) == 0) then
NOption(257,Node050,004);
NOption(258,Node051,004);
NOption(259,Node002,004);
NOption(260,Node999,004);
end
procedure Node049 begin
set_local_var(LVAR_49_before,1);
Reply(261);
NOption(262,Node053,004);
NOption(263,Node999,004);
end
procedure Node050 begin
set_local_var(LVAR_50_before,1);
Reply(264);
NOption(265,Node052,004);
end
procedure Node051 begin
Reply(266);
NOption(267,Node049,004);
NOption(268,Node050,004);
NOption(269,Node999,004);
end
procedure Node052 begin
Reply(270);
NOption(271,Node048,004);
NOption(272,Node002,004);
NOption(273,Node999,004);
end
procedure Node053 begin
Reply(274);
NOption(275,Node054,004);
end
procedure Node054 begin
Reply(276);
NOption(277,Node048,004);
NOption(278,Node002,004);
NOption(279,Node999,004);
end
//xxxxxxxxxxxxxxxxxxxx