diff -urN sourceold/scripts/Doxyfile source/scripts/Doxyfile --- sourceold/scripts/Doxyfile 2022-11-19 19:00:12.000000000 +0300 +++ source/scripts/Doxyfile 2023-02-22 21:16:48.702417000 +0300 @@ -32,7 +32,7 @@ # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 4.7 +PROJECT_NUMBER = 4.8 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer # a quick idea about the purpose of the project. Keep the description short. diff -urN sourceold/scripts/anticheat.ini source/scripts/anticheat.ini --- sourceold/scripts/anticheat.ini 2022-11-19 19:00:12.000000000 +0300 +++ source/scripts/anticheat.ini 2022-10-20 12:36:38.299334700 +0300 @@ -134,6 +134,9 @@ 185315cb0070e52ab9c89d95d06f05e5=C&C_Complex.ldd 11fc8b1d6d70fbacbb18181618fc3964=c&c_field.mix b94a4486508afdc014c1ff3ea4f3d455=c&c_field.ldd +b3b5a7faa502f747d3bc8ff5c63a99cb=M00_Tutorial.mix +5da07b82073c698031b3bacdf286709c=M02.mix +ceb5f647bec120fedffc9d9fc70f9ae6=M04.mix 77e35ed03742c2a3916cae9baf6b119a=M07.mix 72d92296beb9b14c1cd227e8ee592e19=M08.mix b3a1e43b578cd1f1899d920d9502b4e3=always.dat diff -urN sourceold/scripts/dllmain.cpp source/scripts/dllmain.cpp --- sourceold/scripts/dllmain.cpp 2022-11-19 19:00:12.000000000 +0300 +++ source/scripts/dllmain.cpp 2023-02-01 02:01:35.490960600 +0300 @@ -435,6 +435,8 @@ Set_Gameplay_Allowed = (sga)Address(tt, "Set_Gameplay_Allowed"); Print_Client_Console = (pcc)Address(tt, "Print_Client_Console"); Print_Client_Console_Player = (pccp)Address(tt, "Print_Client_Console_Player"); + Reload_Level = (rl)Address(tt, "Reload_Level"); + Force_Client_Reload = (fcr)Address(tt, "Force_Client_Reload"); #ifdef SSGM SSGMGameManager::Init(); diff -urN sourceold/scripts/engine_common.h source/scripts/engine_common.h --- sourceold/scripts/engine_common.h 2022-11-19 19:00:12.000000000 +0300 +++ source/scripts/engine_common.h 2023-02-22 14:50:35.861076700 +0300 @@ -15,7 +15,7 @@ // (float) is merely there to make sure that it uses the float overloads to send the version over network. // and to make sure we do not forget the f suffix on the version number. #define TT_VERSION_MAGIC '!TT!' -#define TT_VERSION ((float)4.7f) +#define TT_VERSION ((float)4.8f) #define SAFE_DELETE_ARRAY(p) { delete[] p; p = NULL; } #define SAFE_DELETE(p) { delete p; p = NULL; } diff -urN sourceold/scripts/engine_tt.cpp source/scripts/engine_tt.cpp --- sourceold/scripts/engine_tt.cpp 2022-11-19 19:00:12.000000000 +0300 +++ source/scripts/engine_tt.cpp 2023-02-01 02:01:35.490960600 +0300 @@ -286,6 +286,8 @@ SCRIPTS_API sga Set_Gameplay_Allowed; SCRIPTS_API pcc Print_Client_Console; SCRIPTS_API pccp Print_Client_Console_Player; +SCRIPTS_API rl Reload_Level; +SCRIPTS_API fcr Force_Client_Reload; SCRIPTS_API bool Can_Team_Build_Vehicle(int Team) { diff -urN sourceold/scripts/engine_tt.h source/scripts/engine_tt.h --- sourceold/scripts/engine_tt.h 2022-11-19 19:00:12.000000000 +0300 +++ source/scripts/engine_tt.h 2023-02-01 02:01:35.492476000 +0300 @@ -238,6 +238,8 @@ typedef void (*sga) (bool allowed); typedef void (*pcc) (const char* text, Vector4 argb_color); typedef void (*pccp) (GameObject* player, const char* text, Vector4 argb_color); +typedef void (*rl) (); +typedef void (*fcr) (int playerID); SCRIPTS_API extern gpl Get_Player_List; SCRIPTS_API extern gcmi Get_Current_Map_Index; SCRIPTS_API extern gm Get_Map; @@ -481,6 +483,8 @@ SCRIPTS_API extern sga Set_Gameplay_Allowed; SCRIPTS_API extern pcc Print_Client_Console; SCRIPTS_API extern pccp Print_Client_Console_Player; +SCRIPTS_API extern rl Reload_Level; +SCRIPTS_API extern fcr Force_Client_Reload; class SCRIPTS_API JFW_Key_Hook_Base : public ScriptImpClass { public: diff -urN sourceold/scripts/gmplugin.h source/scripts/gmplugin.h --- sourceold/scripts/gmplugin.h 2022-11-19 19:00:12.000000000 +0300 +++ source/scripts/gmplugin.h 2023-02-22 14:51:06.191148300 +0300 @@ -13,7 +13,7 @@ #define TT_INCLUDE_GMPLUGIN_H #include "scripts.h" #include "engine.h" -#define INTERFACE_VERSION 4.7f +#define INTERFACE_VERSION 4.8f enum EventType { EVENT_GLOBAL_INI = 0, diff -urN sourceold/scripts/jmgUtility.cpp source/scripts/jmgUtility.cpp --- sourceold/scripts/jmgUtility.cpp 2022-11-19 19:00:12.000000000 +0300 +++ source/scripts/jmgUtility.cpp 2023-02-22 21:26:07.076573300 +0300 @@ -18167,6 +18167,133 @@ Commands->Start_Timer(obj,this,0.25,23453451); } } +void JMG_Utility_Set_Animation_Frame_To_Match_Ammo::Created(GameObject *obj) +{ + sprintf(animation,"%s",Get_Parameter("Animation")); + lastFrame = Get_Current_Bullets(obj); + Commands->Set_Animation(obj,animation,false,NULL,(float)lastFrame,(float)lastFrame,false); + Commands->Start_Timer(obj,this,0.1f,1); +} +void JMG_Utility_Set_Animation_Frame_To_Match_Ammo::Timer_Expired(GameObject *obj,int number) +{ + if (number == 1) + { + int currentFrame = Get_Current_Bullets(obj); + if (lastFrame != currentFrame) + { + lastFrame = currentFrame; + Commands->Set_Animation(obj,animation,false,NULL,(float)lastFrame,(float)lastFrame,false); + } + Commands->Start_Timer(obj,this,0.1f,1); + } +} +void JMG_Utility_Poke_Grant_Weapon::Created(GameObject *obj) +{ + Commands->Enable_HUD_Pokable_Indicator(obj,true); +} +void JMG_Utility_Poke_Grant_Weapon::Poked(GameObject *obj, GameObject *poker) +{ + if (Commands->Get_Player_Type(poker) == -4) + return; + Grant_Weapon(poker,Get_Parameter("Weapon"),true,Get_Int_Parameter("Rounds"),Get_Int_Parameter("Backpack") ? true : false); +} +void JMG_Utility_Zone_Create_Object_While_Occupied::Created(GameObject *obj) +{ + id = 0; + objectsInZone = 0; + sprintf(preset,"%s",Get_Parameter("Preset")); + location = Get_Vector3_Parameter("Location"); + facing = Get_Float_Parameter("Facing"); + enableCustom = Get_Int_Parameter("EnableCustom"); + reCreateOnDeath = Get_Int_Parameter("ReCreateOnDeath") ? true : false; + if (enableCustom) + enabled = false; + else + enabled = true; +} +void JMG_Utility_Zone_Create_Object_While_Occupied::Custom(GameObject *obj,int message,int param,GameObject *sender) +{ + if (enableCustom && message == enableCustom) + { + enabled = param ? true : false; + } + if (message == Get_ID() && param == Get_ID()) + {// Object occupying zone died + Exited(obj,sender); + } + if (message == Get_ID() && param == Get_ID()+1) + { + id = 0; + if (!reCreateOnDeath) + { + Destroy_Script(); + return; + } + if (!objectsInZone) + return; + TriggerCreate(obj); + } +} +void JMG_Utility_Zone_Create_Object_While_Occupied::Entered(GameObject *obj,GameObject *enterer) +{ + objectsInZone++; + char params[256]; + sprintf(params,"%d,%d",Commands->Get_ID(obj),Get_ID()); + Commands->Attach_Script(enterer,"JMG_Utility_Zone_Create_Object_While_Occupied_Attached",params); + TriggerCreate(obj); +} +void JMG_Utility_Zone_Create_Object_While_Occupied::TriggerCreate(GameObject *obj) +{ + if (id || !enabled) + return; + char params[256]; + GameObject *object = Commands->Create_Object(preset,location); + Commands->Set_Facing(object,facing); + id = Commands->Get_ID(object); + sprintf(params,"%d,%d",Commands->Get_ID(obj),Get_ID()); + Commands->Attach_Script(object,"JMG_Utility_Zone_Create_Object_While_Occupied_Object_Attached",params); +} +void JMG_Utility_Zone_Create_Object_While_Occupied::Exited(GameObject *obj,GameObject *exiter) +{ + objectsInZone--; + Remove_Script(exiter,"JMG_Utility_Zone_Create_Object_While_Occupied_Attached"); + if (!id || !enabled || objectsInZone) + return; + Commands->Send_Custom_Event(obj,Commands->Find_Object(id),Get_ID(),Get_ID(),0); + id = 0; +} +void JMG_Utility_Zone_Create_Object_While_Occupied_Attached::Killed(GameObject *obj,GameObject *killer) +{ + Destroyed(obj); +} +void JMG_Utility_Zone_Create_Object_While_Occupied_Attached::Destroyed(GameObject *obj) +{ + if (Exe == 4) + return; + int scriptId = Get_Int_Parameter("ScriptId"); + Commands->Send_Custom_Event(obj,Commands->Find_Object(Get_Int_Parameter("ScriptZoneId")),scriptId,scriptId,0); + Destroy_Script(); +} +void JMG_Utility_Zone_Create_Object_While_Occupied_Object_Attached::Created(GameObject *obj) +{ + deathByScript = false; + ownerScriptId = Get_Int_Parameter("ScriptId"); +} +void JMG_Utility_Zone_Create_Object_While_Occupied_Object_Attached::Custom(GameObject *obj,int message,int param,GameObject *sender) +{ + if (message == ownerScriptId && param == ownerScriptId) + { + deathByScript = true; + Commands->Destroy_Object(obj); + } +} +void JMG_Utility_Zone_Create_Object_While_Occupied_Object_Attached::Destroyed(GameObject *obj) +{ + if (Exe == 4 || deathByScript) + return; + Commands->Send_Custom_Event(obj,Commands->Find_Object(Get_Int_Parameter("ScriptZoneId")),ownerScriptId,ownerScriptId+1,0); + Destroy_Script(); +} ScriptRegistrant JMG_Utility_Check_If_Script_Is_In_Library_Registrant("JMG_Utility_Check_If_Script_Is_In_Library","ScriptName:string,CppName:string"); ScriptRegistrant JMG_Send_Custom_When_Custom_Sequence_Matched_Registrant("JMG_Send_Custom_When_Custom_Sequence_Matched","Success_Custom=0:int,Correct_Step_Custom=0:int,Partial_Failure_Custom=0:int,Failure_Custom=0:int,Send_To_ID=0:int,Custom_0=0:int,Custom_1=0:int,Custom_2=0:int,Custom_3=0:int,Custom_4=0:int,Custom_5=0:int,Custom_6=0:int,Custom_7=0:int,Custom_8=0:int,Custom_9=0:int,Disable_On_Success=1:int,Disable_On_Failure=0:int,Starts_Enabled=1:int,Enable_Custom=0:int,Correct_Step_Saftey=0:int,Failure_Saftey=1:int,Max_Failures=1:int"); ScriptRegistrant JMG_Utility_Change_Model_On_Timer_Registrant("JMG_Utility_Change_Model_On_Timer","Model=null:string,Time=0:float"); @@ -18605,4 +18732,9 @@ ScriptRegistrant JMG_Utility_Killed_By_Player_Send_Custom_From_Player_Registrant("JMG_Utility_Killed_By_Player_Send_Custom_From_Player","ID:int,Custom:int,Param:int,Delay:float"); ScriptRegistrant JMG_Utility_Sync_Fog_Controller_Registrant("JMG_Utility_Sync_Fog_Controller","MinRange:float,MaxRange:float"); ScriptRegistrant JMG_Utility_Sync_Fog_Custom_Update_Registrant("JMG_Utility_Sync_Fog_Custom_Update","Custom:int,MinRange:float,MaxRange:float,Transition:float"); -ScriptRegistrant JMG_Utility_Sync_Animation_On_Join_Registrant("JMG_Utility_Sync_Animation_On_Join",""); \ No newline at end of file +ScriptRegistrant JMG_Utility_Sync_Animation_On_Join_Registrant("JMG_Utility_Sync_Animation_On_Join",""); +ScriptRegistrant JMG_Utility_Set_Animation_Frame_To_Match_Ammo_Registrant("JMG_Utility_Set_Animation_Frame_To_Match_Ammo","Animation:string"); +ScriptRegistrant JMG_Utility_Poke_Grant_Weapon_Registrant("JMG_Utility_Poke_Grant_Weapon","Weapon:string,Rounds:int,Backpack:int"); +ScriptRegistrant JMG_Utility_Zone_Create_Object_While_Occupied_Registrant("JMG_Utility_Zone_Create_Object_While_Occupied","Preset:string,Location:Vector3,Facing:float,EnableCustom:int,ReCreateOnDeath:int"); +ScriptRegistrant JMG_Utility_Zone_Create_Object_While_Occupied_Attached_Registrant("JMG_Utility_Zone_Create_Object_While_Occupied_Attached","ScriptZoneId:int,ScriptId:int"); +ScriptRegistrant JMG_Utility_Zone_Create_Object_While_Occupied_Object_Attached_Registrant("JMG_Utility_Zone_Create_Object_While_Occupied_Object_Attached","ScriptZoneId:int,ScriptId:int"); diff -urN sourceold/scripts/jmgUtility.h source/scripts/jmgUtility.h --- sourceold/scripts/jmgUtility.h 2022-11-19 19:00:12.000000000 +0300 +++ source/scripts/jmgUtility.h 2023-02-22 21:26:15.492703500 +0300 @@ -12098,4 +12098,77 @@ bool synced[128]; void Created(GameObject *obj); void Timer_Expired(GameObject *obj,int number); +}; + +/*! +* \brief Makes the attached object sync its animation frame to the object's clip count +* \author jgray +* \ingroup JmgUtility +*/ +class JMG_Utility_Set_Animation_Frame_To_Match_Ammo : public ScriptImpClass { + char animation[32]; + int lastFrame; + void Created(GameObject *obj); + void Timer_Expired(GameObject *obj,int number); +}; + +/*! +* \brief Grants a weapon on poke +* \Weapon - Weapon to grant +* \Rounds - Rounds in the gun, -1 = infinite +* \Backpack - Should it fill the backpack +* \author jgray +* \ingroup JmgUtility +*/ +class JMG_Utility_Poke_Grant_Weapon : public ScriptImpClass { + void Created(GameObject *obj); + void Poked(GameObject *obj, GameObject *poker); +}; + +/*! +* \brief Creates an object while at least object is in a zone +* \Preset - Preset to create +* \Location - Spot to create the object +* \Facing - Direction the object should face +* \EnableCustom - Custom that enables the script, a param of non-zero enables, if the custom is 0 then the script is always enabled. +* \RecreateOnDeath - Can the script zone trigger re-creation if the object was killed +* \author jgray +* \ingroup JmgUtility +*/ +class JMG_Utility_Zone_Create_Object_While_Occupied : public ScriptImpClass { + char preset[128]; + int enableCustom; + bool enabled; + int id; + Vector3 location; + float facing; + int objectsInZone; + bool reCreateOnDeath; + void Created(GameObject *obj); + void Custom(GameObject *obj,int message,int param,GameObject *sender); + void Entered(GameObject *obj,GameObject *enterer); + void Exited(GameObject *obj,GameObject *exiter); + void TriggerCreate(GameObject *obj); +}; +/*! +* \brief Used by JMG_Utility_Zone_Create_Object_While_Occupied, ignore otherwise +* \author jgray +* \ingroup JmgUtility +*/ +class JMG_Utility_Zone_Create_Object_While_Occupied_Attached : public ScriptImpClass { + void Killed(GameObject *obj,GameObject *killer); + void Destroyed(GameObject *obj); +}; + +/*! +* \brief Used by JMG_Utility_Zone_Create_Object_While_Occupied, ignore otherwise +* \author jgray +* \ingroup JmgUtility +*/ +class JMG_Utility_Zone_Create_Object_While_Occupied_Object_Attached : public ScriptImpClass { + int ownerScriptId; + bool deathByScript; + void Created(GameObject *obj); + void Custom(GameObject *obj,int message,int param,GameObject *sender); + void Destroyed(GameObject *obj); }; \ No newline at end of file