From 609cad18c1d3cfcf75ca7abb3e0fb56e61d32a74 Mon Sep 17 00:00:00 2001 From: NovaRain Date: Mon, 30 Sep 2024 12:11:07 +0800 Subject: [PATCH] Fixed and unified float events for party members * Sulik, Lenny, Goris, Davin, Miria didn't have the event repeating like others. * Now the interval of floats is 60-90 sec for all party members (not spamming but also not too few). --- scripts_src/brokhill/hcmarcus.ssl | 5 +- scripts_src/den/dcvic.ssl | 8 +- scripts_src/gecko/gclenny.ssl | 249 +++--------------------------- scripts_src/klamath/kcsulik.ssl | 13 +- scripts_src/main/nhmyron.ssl | 2 +- scripts_src/modoc/mcdavin.ssl | 3 +- scripts_src/modoc/mcmiria.ssl | 4 +- scripts_src/valtcity/vccasidy.ssl | 5 +- scripts_src/vault13/ocgoris.ssl | 3 +- 9 files changed, 39 insertions(+), 253 deletions(-) diff --git a/scripts_src/brokhill/hcmarcus.ssl b/scripts_src/brokhill/hcmarcus.ssl index bf7f65718..49de32c5d 100644 --- a/scripts_src/brokhill/hcmarcus.ssl +++ b/scripts_src/brokhill/hcmarcus.ssl @@ -263,8 +263,7 @@ procedure map_enter_p_proc begin if (Marcus_In_Party) then begin Perform_Critter_Float := 1; - //rm_timer_event( self_obj ); - comment out by killap - add_timer_event( self_obj, game_ticks( random(40, 50) ), 1); + flush_add_timer_event_sec(self_obj, random(40, 50), 1); end else begin Perform_Critter_Float := 0; @@ -310,7 +309,7 @@ procedure timed_event_p_proc begin call Node2015; end end - add_timer_event( self_obj, game_ticks( random(40, 50) ), 1); + flush_add_timer_event_sec(self_obj, random(60, 90), 1); //edit by killap - was (40,50) end end diff --git a/scripts_src/den/dcvic.ssl b/scripts_src/den/dcvic.ssl index df9e5643d..a4f4ab5d9 100644 --- a/scripts_src/den/dcvic.ssl +++ b/scripts_src/den/dcvic.ssl @@ -215,7 +215,7 @@ procedure timed_event_p_proc begin end end end - flush_add_timer_event_sec(self_obj, random(15, 30), timed_event_float); + flush_add_timer_event_sec(self_obj, random(60, 90), timed_event_float); //edit by killap - was (15,30) end else if (fixed_param == TIMER_ENSURE_ANIM) then begin if not anim_busy(self_obj) then begin @@ -242,7 +242,7 @@ procedure timed_event_p_proc begin end end end - add_timer_event(self_obj, game_ticks(1), TIMER_ENSURE_ANIM); + add_timer_event(self_obj, game_ticks(1), TIMER_ENSURE_ANIM); end end @@ -310,7 +310,6 @@ procedure push_p_proc begin end procedure critter_p_proc begin - //move by killap - would never be run if player was near Vic if (has_joined_party == false) then begin /*if (vic_free) then begin @@ -452,7 +451,6 @@ procedure Node999 begin end procedure Node998 begin // sets up combat - //set_hostile; set_local_var(LVAR_Hostile,2); end procedure Node996 begin @@ -638,8 +636,6 @@ procedure Node010 begin end call Node993; //now Vic will go to Mom's if you don't recruit him end - //NOption(g_grunt,Node994,-003); --commented out by killap - move above - //NOption(195,Node994,004); --commented out by killap - move above end procedure Node011 begin if (node_11) then begin diff --git a/scripts_src/gecko/gclenny.ssl b/scripts_src/gecko/gclenny.ssl index e770c7248..2fb1b39d7 100644 --- a/scripts_src/gecko/gclenny.ssl +++ b/scripts_src/gecko/gclenny.ssl @@ -60,6 +60,7 @@ procedure HealPlayer; procedure PayDude; procedure PartyFree; procedure HowMany; +procedure timed_event_p_proc; /* Script Specific Procedure Calls */ procedure Node901; @@ -145,22 +146,6 @@ procedure Node022; procedure Node023; procedure Node024; procedure Node025; -//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 Node070; procedure Node071; procedure Node072; @@ -240,26 +225,9 @@ procedure map_enter_p_proc begin end //added by killap - add_timer_event(self_obj, random(25, 40), 900); + flush_add_timer_event_sec(self_obj, random(25, 40), 900); end -//added by killap -procedure timed_event_p_proc begin - if (fixed_param == 900) then begin - if (self_visible) then begin - if (Lenny_In_Party) then begin - if (Is_Crippled(self_obj)) then - floater(5000); - else if (self_rads) then - floater(5001); - else if (get_poison(self_obj)) then - floater(5002); - end - end - end -end -//end added - procedure map_update_p_proc begin if (combat_is_initialized == false) then begin if (anim_busy(self_obj) == false) then begin @@ -410,10 +378,6 @@ procedure talk_p_proc begin if (local_var(LVAR_Personal_Enemy) == 1) then begin call Node998; end -// else if (leaving PC's party) then begin -// end -// else if (learning attempt) then begin -// end else if (local_var(LVAR_Herebefore) == 0) then begin start_gdialog(NAME,self_obj,4,-1,-1); gSay_Start; @@ -424,32 +388,6 @@ procedure talk_p_proc begin else if (local_var(LVAR_never_again) > 0) then begin floater(3005); end -/* - else if ( (Lenny_In_Party) and (global_var(GVAR_PLAYER_REPUTATION) < LENNY_BAD_KARMA) ) then begin - call Node070; - ndebug("Bad Karma"); - end - else if ( (Lenny_In_Party) and (has_rep_childkiller) ) then begin - call Node071; - ndebug("Childkiller"); - end - //else if (has_rep_berserker) then begin - // call Node072; - // ndebug("Berserker"); - //end - else if ( (Lenny_In_Party) and (has_rep_slaver) ) then begin - call Node073; - ndebug("Slaver"); - end - else if ( (Lenny_In_Party) and - ( (global_var(GVAR_VAULT_GECKO_PLANT) == PLANT_DESTROYED) or - (global_var(GVAR_GECKO_MELTDOWN) > 0) or - (global_var(GVAR_PLANT_SCHEDULED_FOR_CHANGE) == SCHEDULED_FOR_DESTRUCTION)) ) then begin - //Lenny is mad that you destroyed the power plant - call Node074; - ndebug("Destroyed Plant"); - end -*/ else if ((Lenny_In_Party) or (party_is_waiting)) then begin start_gdialog(NAME,self_obj,4,-1,-1); gSay_Start; @@ -519,15 +457,6 @@ procedure Node910 begin call Node007; end -/* left code here as example of skill roll -procedure Node920 begin - if (is_success(roll_vs_skill(dude_obj,SKILL_SPEECH,0))) then - call Node019; - else - call Node020; -end -*/ - procedure HealPlayer begin Heal_Cost:=30; critter_heal(dude_obj,dude_max_hits-dude_cur_hits); @@ -618,6 +547,24 @@ procedure HowMany begin end end +//added by killap +procedure timed_event_p_proc begin + if (fixed_param == 900) then begin + if (self_visible) then begin + if (Lenny_In_Party) then begin + if (Is_Crippled(self_obj)) then + floater(5000); + else if (self_rads) then + floater(5001); + else if (get_poison(self_obj)) then + floater(5002); + end + end + flush_add_timer_event_sec(self_obj, random(60, 90), 900); + end +end +//end added + procedure PartyFree begin k:=0; Heal_Cost:=30; @@ -1009,15 +956,7 @@ from6:=0; Reply(181); NOption(182,Node015,004); end -/* - if (visit_04_before) then - Reply(141); - else begin - visit_04_before:=1; - Reply(140); - end -*/ NOption(183,Node924,004); NOption(184,Node926,004); NOption(175,Node999,004); @@ -1173,8 +1112,6 @@ end procedure Node022 begin Reply(330); -// if (broken_hills_visible_on_map == false) then -// NOption(221,Node013,004); NOption(333,Node999,004); BOption(334,Node999,004); //moderate,end end @@ -1194,192 +1131,51 @@ end //put these in party interaction/critter proc procedure Node025 begin Reply(360); -//add other replies and conditionals + //add other replies and conditionals NOption(372,Node953,001); //all of these..Lenny leaves party end BOption(373,Node953,001); // " BOption(374,Node953,001); // " NOption(375,Node953,001); // " end -/* -procedure Node030 begin - Reply(380); - NOption(381,Node001,001); //move lenny out of pc's way - NOption(382,Node031,001); - NOption(383,Node035,001); - NOption(384,Node038,001); - NOption(385,Node038,001); - NOption(386,Node038,001); - NOption(387,Node038,001); - NOption(388,Node954,001); //list current hp total hp and any statuses. - NOption(389,Node999,001); -end - -procedure Node031 begin - Reply(400); - NOption(401,Node032,001); - NOption(402,Node036,001); - NOption(403,Node037,001); - NOption(404,Node033,001); - NOption(405,Node030,001); -end - -procedure Node032 begin - Reply(410); - NOption(411,Node040,001); - NOption(412,Node041,001); - NOption(413,Node042,001); - NOption(414,Node039,001); - NOption(415,Node030,001); -end - -procedure Node033 begin - Reply(420); - NOption(421,Node043,001); - NOption(422,Node044,001); - NOption(423,Node045,001); - NOption(424,Node030,001); -end - -procedure Node034 begin -//need conditional replies - Reply(430); - NOption(432,Node999,001); -end - -procedure Node035 begin - Reply(440); - NOption(441,Node030,001); //have lenny wait here - NOption(442,Node030,001); //have lenny wait here - NOption(443,Node030,001); -end - -procedure Node036 begin - Reply(450); - NOption(451,Node999,001); //change readied weapon to best,end - NOption(452,Node030,001); //change readied weapon to best,goto30 - NOption(453,Node030,001); -end - -procedure Node037 begin - Reply(460); - NOption(461,Node999,001); //change worn armor to best,end - NOption(462,Node030,001); //change worn armor to best,goto30 - NOption(463,Node030,001); //goto30 -end - -procedure Node038 begin -//need conditional replies - Reply(470); - NOption(473,Node960,001); - NOption(474,Node961,001); - NOption(475,Node962,001); - NOption(476,Node963,001); - NOption(477,Node964,001); - NOption(478,Node966,001); - NOption(479,Node030,001); -end - -procedure Node039 begin - Reply(480); - NOption(481,Node030,001); -end - -procedure Node040 begin - Reply(490); - NOption(491,Node999,001); //move lenny to short dist,end - NOption(492,Node030,001); //move lenny to short dist,goto30 - NOption(493,Node030,001); -end - -procedure Node041 begin - Reply(500); - NOption(501,Node999,001); //move lenny to med dist,end - NOption(502,Node030,001); //move lenny to med dist,goto30 - NOption(503,Node030,001); -end - -procedure Node042 begin - Reply(510); - NOption(511,Node999,001); //move lenny to long dist,end - NOption(512,Node030,001); //move lenny to long dist,goto30 - NOption(513,Node030,001); -end - -procedure Node043 begin - Reply(520); - NOption(521,Node999,001); //change aggressiveness level to defense,end - NOption(522,Node030,001); //change aggressiveness level to defense,goto30 - NOption(523,Node030,001); //goto30 -end - -procedure Node044 begin - Reply(530); - NOption(531,Node999,001); //change aggressiveness level to normal,end - NOption(532,Node030,001); //change aggressiveness level to normal,goto30 - NOption(533,Node030,001); //goto30 -end - -procedure Node045 begin - Reply(540); - NOption(541,Node030,001); -end -*/ - procedure Node070 begin //BAD KARMA - //set_local_var(LVAR_never_again,1); if (self_visible) then floater(3000); set_self_abandon_party; - //party_remove(self_obj); - //leave party end procedure Node071 begin //CHILDKILLER set_local_var(LVAR_never_again,1); //means this npc wont talk to player after this - //floater(3001); if (self_visible) then floater(370); set_self_abandon_party; set_self_team(TEAM_GECKO); - //party_remove(self_obj); - //leave party end procedure Node072 begin //BERSERKER - //set_local_var(LVAR_never_again,1); if (self_visible) then floater(3002); set_self_abandon_party; - //party_remove(self_obj); - //leave party end procedure Node073 begin //SLAVER - //set_local_var(LVAR_never_again,1); - //floater(3003); if (self_visible) then floater(370); set_self_abandon_party; - //party_remove(self_obj); - //leave party end procedure Node074 begin //DESTROYED POWER PLANT set_local_var(LVAR_never_again,1); //means this npc wont talk to player after this set_local_var(LVAR_Personal_Enemy,1); //means wont ever forgive for this offense - //floater(3004); if (self_visible) then floater(370); set_self_abandon_party; set_self_team(TEAM_GECKO); - //party_remove(self_obj); - //leave party end procedure Node075 begin @@ -1490,12 +1286,10 @@ procedure Node1100 begin end else if (dude_at_max_party_size) then begin set_self_abandon_party; Reply(2000); - //Reply(360); NOption(g_mstr(10007),Node999,001); end else if (town_rep_is_hated) then begin set_self_abandon_party; Reply(2100); - //Reply(370); NOption(g_mstr(10007),Node999,001); end else begin end_party_waiting; @@ -1503,4 +1297,3 @@ procedure Node1100 begin lenny_party_member_options; end end -//xxxxxxxxxxxxxxxxxxxx diff --git a/scripts_src/klamath/kcsulik.ssl b/scripts_src/klamath/kcsulik.ssl index 02cb60f9c..376fe2581 100644 --- a/scripts_src/klamath/kcsulik.ssl +++ b/scripts_src/klamath/kcsulik.ssl @@ -51,6 +51,7 @@ procedure description_p_proc; procedure use_skill_on_p_proc; procedure damage_p_proc; procedure map_enter_p_proc; +procedure timed_event_p_proc; procedure map_update_p_proc; procedure push_p_proc; @@ -225,7 +226,7 @@ procedure Node1100; /* Local variables which do not need to be saved between map changes. */ variable Only_Once:=0; -variable Charisma_Roll; +//variable Charisma_Roll; --comment out by killap - never used variable luk_check; variable k; @@ -247,13 +248,12 @@ procedure map_enter_p_proc begin //critter_add_trait(self_obj,TRAIT_OBJECT,OBJECT_AI_PACKET,AI_PARTY_SULIK_DEFENSIVE); end - //added by killap - add_timer_event(self_obj, random(25, 40), 900); + //added by killap + flush_add_timer_event_sec(self_obj, random(25, 40), 900); end //added by killap procedure timed_event_p_proc begin - if (fixed_param == 900) then begin if( ( not( combat_is_initialized ) ) and ( self_visible ) ) then begin if( Sulik_Ptr != 0 ) then begin @@ -265,8 +265,8 @@ procedure timed_event_p_proc begin floater(3502); end end + flush_add_timer_event_sec(self_obj, random(60, 90), 900); end - end //end added @@ -303,7 +303,6 @@ 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 @@ -377,8 +376,6 @@ end written by designers are placed in here. Additionally, Reactions are generated and stored which affects player interactions. */ procedure talk_p_proc begin - - GetReaction; find_party_background; diff --git a/scripts_src/main/nhmyron.ssl b/scripts_src/main/nhmyron.ssl index bc3827462..cd17cf319 100644 --- a/scripts_src/main/nhmyron.ssl +++ b/scripts_src/main/nhmyron.ssl @@ -450,7 +450,7 @@ procedure timed_event_p_proc begin end end end - nr_add_timer_event_rand(self_obj, 25, 45, float_param); + nr_add_timer_event_rand(self_obj, 60, 90, float_param); //edit by killap - was (25,45) end procedure map_update_p_proc begin diff --git a/scripts_src/modoc/mcdavin.ssl b/scripts_src/modoc/mcdavin.ssl index 11d8b9753..bebe7a7a6 100644 --- a/scripts_src/modoc/mcdavin.ssl +++ b/scripts_src/modoc/mcdavin.ssl @@ -127,6 +127,7 @@ procedure timed_event_p_proc begin floater(2002); end end + flush_add_timer_event_sec(self_obj, random(60, 90), 900); //end added by killap end else if (fixed_param == param_clear_float) then begin float_msg(self_obj, " ", FLOAT_COLOR_NORMAL); @@ -161,7 +162,7 @@ procedure map_enter_p_proc begin end //added by killap - add_timer_event(self_obj, random(25, 40), 900); + flush_add_timer_event_sec(self_obj, random(25, 40), 900); end procedure map_update_p_proc begin diff --git a/scripts_src/modoc/mcmiria.ssl b/scripts_src/modoc/mcmiria.ssl index 3a9663246..9dfac0f22 100644 --- a/scripts_src/modoc/mcmiria.ssl +++ b/scripts_src/modoc/mcmiria.ssl @@ -160,6 +160,7 @@ procedure timed_event_p_proc begin floater(2002); end end + flush_add_timer_event_sec(self_obj, random(60, 90), 900); //end added by killap end else if (fixed_param == param_clear_float) then begin float_msg(self_obj, " ", FLOAT_COLOR_NORMAL); @@ -207,7 +208,6 @@ procedure map_enter_p_proc begin /*end else */ // -comment out by killap //if (Miria_In_Party == false) then begin if not(married_to_miria) then begin // edit by killap - party check doesn't always work when map loads - if (cur_map_index == MAP_MODOC_MAINSTREET) then begin if (map_first_run) then set_local_var(LVAR_Home_Tile, self_tile); //added by killap - moved from above @@ -216,7 +216,7 @@ procedure map_enter_p_proc begin end //added by killap - add_timer_event(self_obj, random(25, 40), 900); + flush_add_timer_event_sec(self_obj, random(25, 40), 900); end procedure critter_p_proc begin diff --git a/scripts_src/valtcity/vccasidy.ssl b/scripts_src/valtcity/vccasidy.ssl index 6ce4886f6..ea17e60a0 100644 --- a/scripts_src/valtcity/vccasidy.ssl +++ b/scripts_src/valtcity/vccasidy.ssl @@ -212,8 +212,7 @@ procedure map_enter_p_proc begin set_self_team(TEAM_SLAVES); //critter_add_trait(self_obj,TRAIT_OBJECT,OBJECT_AI_PACKET,AI_TOUGH_CITIZEN); - //rm_timer_event( self_obj ); - comment out by killap - add_timer_event( self_obj, game_ticks( random(40, 50) ), 1); + flush_add_timer_event_sec(self_obj, random(40, 50), 1); end procedure map_update_p_proc begin @@ -274,7 +273,7 @@ procedure timed_event_p_proc begin call Node2019; end end - add_timer_event( self_obj, game_ticks( random(40, 50) ), 1); + flush_add_timer_event_sec(self_obj, random(60, 90), 1); //edit by killap - was (40,50) end else if( fixed_param == 2 ) then begin kill_critter( self_obj, ANIM_fall_front ); diff --git a/scripts_src/vault13/ocgoris.ssl b/scripts_src/vault13/ocgoris.ssl index c21a851f4..3883c9ad1 100644 --- a/scripts_src/vault13/ocgoris.ssl +++ b/scripts_src/vault13/ocgoris.ssl @@ -216,6 +216,7 @@ procedure timed_event_p_proc begin floater(2002); end end + flush_add_timer_event_sec(self_obj, random(60, 90), 900); //end added by killap end else if (fixed_param == TIMER_DESTROY) then begin if (not obj_on_screen(self_obj)) then @@ -253,7 +254,7 @@ procedure map_enter_p_proc begin // critter_add_trait(self_obj,TRAIT_OBJECT,OBJECT_AI_PACKET,AI_VAULT_DEATHCLAW); //added by killap - add_timer_event(self_obj, random(25, 40), 900); + flush_add_timer_event_sec(self_obj, random(25, 40), 900); end