diff -uwr sourceold/AntiSpawnKill/AntiSpawnKill.cpp source/AntiSpawnKill/AntiSpawnKill.cpp --- sourceold/AntiSpawnKill/AntiSpawnKill.cpp 2011-10-11 21:31:00.611328100 +0800 +++ source/AntiSpawnKill/AntiSpawnKill.cpp 2012-01-11 22:18:59.639648400 +0800 @@ -15,6 +15,11 @@ bool waskilled[128]; +void* HookupAT3x(void* a, void* b, void* c, void* patch_start, void* patch_end, int (*version_selector)()) +{ + return HookupAT3(a,b,c,patch_start,patch_end,version_selector); +} + class ANTISPAWNKILL : public Plugin { public: diff -uwr sourceold/CTF/CTF.cpp source/CTF/CTF.cpp --- sourceold/CTF/CTF.cpp 2011-12-07 11:55:00.500000000 +0800 +++ source/CTF/CTF.cpp 2012-01-11 22:13:42.196289000 +0800 @@ -20,6 +20,11 @@ #include "PowerupGameObjDef.h" GameObject *CTFController = 0; +void* HookupAT3x(void* a, void* b, void* c, void* patch_start, void* patch_end, int (*version_selector)()) +{ + return HookupAT3(a,b,c,patch_start,patch_end,version_selector); +} + char *CTFIcons[4][2] = { //{Model,Animation}, {"",""}, diff -uwr sourceold/CharacterRefund/CharacterRefund.cpp source/CharacterRefund/CharacterRefund.cpp --- sourceold/CharacterRefund/CharacterRefund.cpp 2011-10-11 21:32:22.065429600 +0800 +++ source/CharacterRefund/CharacterRefund.cpp 2012-01-11 22:19:11.657226500 +0800 @@ -14,6 +14,11 @@ #include "gmgame.h" +void* HookupAT3x(void* a, void* b, void* c, void* patch_start, void* patch_end, int (*version_selector)()) +{ + return HookupAT3(a,b,c,patch_start,patch_end,version_selector); +} + bool waskilled[128]; int currval[128]; diff -uwr sourceold/ExtraConsoleCommands/ExtraConsoleCommands.cpp source/ExtraConsoleCommands/ExtraConsoleCommands.cpp --- sourceold/ExtraConsoleCommands/ExtraConsoleCommands.cpp 2011-11-07 20:10:56.345703100 +0800 +++ source/ExtraConsoleCommands/ExtraConsoleCommands.cpp 2012-01-11 22:14:43.544921800 +0800 @@ -18,6 +18,11 @@ #include "gmlog.h" #include "engine_tt.h" +void* HookupAT3x(void* a, void* b, void* c, void* patch_start, void* patch_end, int (*version_selector)()) +{ + return HookupAT3(a,b,c,patch_start,patch_end,version_selector); +} + static int getClientIdByIdentifier(const char* clientIdentifier) { assert(clientIdentifier); diff -uwr sourceold/FirstBlood/FirstBlood.cpp source/FirstBlood/FirstBlood.cpp --- sourceold/FirstBlood/FirstBlood.cpp 2011-10-11 21:34:04.078125000 +0800 +++ source/FirstBlood/FirstBlood.cpp 2012-01-11 22:19:59.439453100 +0800 @@ -13,6 +13,11 @@ #include "FirstBlood.h" #include "gmgame.h" +void* HookupAT3x(void* a, void* b, void* c, void* patch_start, void* patch_end, int (*version_selector)()) +{ + return HookupAT3(a,b,c,patch_start,patch_end,version_selector); +} + bool first = false; class FIRSTBLOOD : public Plugin diff -uwr sourceold/Mute/Mute.cpp source/Mute/Mute.cpp --- sourceold/Mute/Mute.cpp 2011-11-07 20:10:56.260742100 +0800 +++ source/Mute/Mute.cpp 2012-01-11 22:15:17.976562500 +0800 @@ -18,6 +18,11 @@ bool MutedPlayers[128]; +void* HookupAT3x(void* a, void* b, void* c, void* patch_start, void* patch_end, int (*version_selector)()) +{ + return HookupAT3(a,b,c,patch_start,patch_end,version_selector); +} + static int getClientIdByIdentifier(const char* clientIdentifier) { assert(clientIdentifier); diff -uwr sourceold/NoPoints/NoPoints.cpp source/NoPoints/NoPoints.cpp --- sourceold/NoPoints/NoPoints.cpp 2011-10-11 21:35:52.521484300 +0800 +++ source/NoPoints/NoPoints.cpp 2012-01-11 22:20:33.491210900 +0800 @@ -14,6 +14,10 @@ #include "gmgame.h" #include "GameObjManager.h" +void* HookupAT3x(void* a, void* b, void* c, void* patch_start, void* patch_end, int (*version_selector)()) +{ + return HookupAT3(a,b,c,patch_start,patch_end,version_selector); +} class NOPOINTS : public Plugin diff -uwr sourceold/PointsDistribution/PointsDistribution.cpp source/PointsDistribution/PointsDistribution.cpp --- sourceold/PointsDistribution/PointsDistribution.cpp 2011-11-26 08:54:08.823242100 +0800 +++ source/PointsDistribution/PointsDistribution.cpp 2012-01-11 22:20:50.635742100 +0800 @@ -15,6 +15,10 @@ #include "gmgame.h" #include "Iterator.h" +void* HookupAT3x(void* a, void* b, void* c, void* patch_start, void* patch_end, int (*version_selector)()) +{ + return HookupAT3(a,b,c,patch_start,patch_end,version_selector); +} class POINTSDISTRIBUTION : public Plugin diff -uwr sourceold/Spectate/Spectate.cpp source/Spectate/Spectate.cpp --- sourceold/Spectate/Spectate.cpp 2011-11-07 20:10:56.307617100 +0800 +++ source/Spectate/Spectate.cpp 2012-01-11 22:21:06.802734300 +0800 @@ -20,6 +20,11 @@ #include "engine_weap.h" #include "engine_obj2.h" +void* HookupAT3x(void* a, void* b, void* c, void* patch_start, void* patch_end, int (*version_selector)()) +{ + return HookupAT3(a,b,c,patch_start,patch_end,version_selector); +} + static int getClientIdByIdentifier(const char* clientIdentifier) { assert(clientIdentifier); diff -uwr sourceold/SuddenDeath/SuddenDeath.cpp source/SuddenDeath/SuddenDeath.cpp --- sourceold/SuddenDeath/SuddenDeath.cpp 2011-11-07 20:10:56.581054600 +0800 +++ source/SuddenDeath/SuddenDeath.cpp 2012-01-11 22:16:29.383789000 +0800 @@ -18,6 +18,11 @@ #include "VehicleGameObj.h" #include "engine_tt.h" +void* HookupAT3x(void* a, void* b, void* c, void* patch_start, void* patch_end, int (*version_selector)()) +{ + return HookupAT3(a,b,c,patch_start,patch_end,version_selector); +} + static int getClientIdByIdentifier(const char* clientIdentifier) { assert(clientIdentifier); diff -uwr sourceold/bansystem/bansystem.cpp source/bansystem/bansystem.cpp --- sourceold/bansystem/bansystem.cpp 2011-11-07 20:10:56.543945300 +0800 +++ source/bansystem/bansystem.cpp 2012-01-11 22:16:48.831054600 +0800 @@ -17,6 +17,11 @@ #include "engine_tt.h" #include "gmgame.h" +void* HookupAT3x(void* a, void* b, void* c, void* patch_start, void* patch_end, int (*version_selector)()) +{ + return HookupAT3(a,b,c,patch_start,patch_end,version_selector); +} + static int getClientIdByIdentifier(const char* clientIdentifier) { assert(clientIdentifier); Files sourceold/bin/Debug/shaders.lib and source/bin/Debug/shaders.lib differ Files sourceold/bin/Release/shaders.lib and source/bin/Release/shaders.lib differ diff -uwr sourceold/crates/crates.cpp source/crates/crates.cpp --- sourceold/crates/crates.cpp 2011-12-05 15:38:18.435078100 +0800 +++ source/crates/crates.cpp 2012-01-11 22:29:04.188476500 +0800 @@ -18,6 +18,10 @@ #include "PurchaseSettingsDefClass.h" #include "PowerupGameObj.h" #include "PowerupGameObjDef.h" +void* HookupAT3x(void* a, void* b, void* c, void* patch_start, void* patch_end, int (*version_selector)()) +{ + return HookupAT3(a,b,c,patch_start,patch_end,version_selector); +} class Crate : public Plugin { @@ -324,8 +328,8 @@ if (RandomWeapon[Index][2][0] != '\0') { Create_2D_WAV_Sound_Player(sender,RandomWeapon[Index][2]); } - message1.Format("ppage %d [Crate] You just got a %s from the Random Weapon crate.mapConfiguration.",Get_Player_ID(sender),RandomWeapon[Index][0]); - message2.Format("%ls picked up a Random Weapon crate.mapConfiguration.",Get_Wide_Player_Name(sender)); + message1.Format("ppage %d [Crate] You just got a %s from the Random Weapon crate.",Get_Player_ID(sender),RandomWeapon[Index][0]); + message2.Format("%ls picked up a Random Weapon crate.",Get_Wide_Player_Name(sender)); Vector3 pos = Commands->Get_Position(sender); message3.Format("CRATE;WEAPON;%s;%d;%s;%f;%f;%f;%f;%f;%f;%d",RandomWeapon[Index][0],Commands->Get_ID(sender),Commands->Get_Preset_Name(sender),pos.Y,pos.X,pos.Z,Commands->Get_Facing(sender),Commands->Get_Max_Health(sender),Commands->Get_Max_Shield_Strength(sender),Get_Object_Type(sender)); } @@ -342,13 +346,13 @@ } if (RndGood == 1) { message1.Format("ppage %d [Crate] You just got the Money Crate, you have gained %d credits.",Get_Player_ID(sender),(int)Amount); - message2.Format("%ls picked up a Money crate.mapConfiguration.",Get_Wide_Player_Name(sender)); + message2.Format("%ls picked up a Money crate.",Get_Wide_Player_Name(sender)); Vector3 pos = Commands->Get_Position(obj); message3.Format("CRATE;MONEY;%d;%d;%s;%f;%f;%f;%f;%f;%f;%d", int(Amount), Commands->Get_ID(sender), Commands->Get_Preset_Name(sender), pos.Y,pos.X,pos.Z, Commands->Get_Facing(sender), Commands->Get_Max_Health(sender),Commands->Get_Max_Shield_Strength(sender),Get_Object_Type(sender)); } else { message1.Format("ppage %d [Crate] You just got the Demoney Crate, you have lost %d credits.",Get_Player_ID(sender),(int)Amount); - message2.Format("%ls picked up a Demoney crate.mapConfiguration.",Get_Wide_Player_Name(sender)); + message2.Format("%ls picked up a Demoney crate.",Get_Wide_Player_Name(sender)); Vector3 pos = Commands->Get_Position(obj); message3.Format("CRATE;MONEY;%d;%d;%s;%f;%f;%f;%f;%f;%f;%d", int(Amount) * -1, Commands->Get_ID(sender), Commands->Get_Preset_Name(sender), pos.Y,pos.X,pos.Z, Commands->Get_Facing(sender), Commands->Get_Max_Health(sender),Commands->Get_Max_Shield_Strength(sender),Get_Object_Type(sender)); } @@ -364,7 +368,7 @@ } if (RndGood == 1) { - message2.Format("%ls picked up a Points crate.mapConfiguration.",Get_Wide_Player_Name(sender)); + message2.Format("%ls picked up a Points crate.",Get_Wide_Player_Name(sender)); message1.Format("ppage %d [Crate] You just got the Points Crate, you have gained %d points.",Get_Player_ID(sender),(int)Amount); StringClass msg; const char *str = Get_Team_Name(Team); @@ -375,7 +379,7 @@ message3.Format("CRATE;POINTS;%d;%d;%s;%f;%f;%f;%f;%f;%f;%d",int(Amount), Commands->Get_ID(sender), Commands->Get_Preset_Name(sender), pos.Y,pos.X,pos.Z, Commands->Get_Facing(sender), Commands->Get_Max_Health(sender),Commands->Get_Max_Shield_Strength(sender),Get_Object_Type(sender)); } else { - message2.Format("%ls picked up a Depoints crate.mapConfiguration.",Get_Wide_Player_Name(sender)); + message2.Format("%ls picked up a Depoints crate.",Get_Wide_Player_Name(sender)); message1.Format("ppage %d [Crate] You just got the Depoints Crate, you lost %d points.",Get_Player_ID(sender),(int)Amount); StringClass msg; const char *str = Get_Team_Name(Team); @@ -411,10 +415,10 @@ else if (Rnd <= 190) Index = 10; else Index = 11; if (IsPresetDisabled(Get_Definition_ID(RandomVehicle[Index][2]))) goto Reselect2; - message2.Format("%ls picked up a Random Vehicle crate.mapConfiguration.",Get_Wide_Player_Name(sender)); - message1.Format("ppage %d [Crate] You got a %s from the Random Vehicle crate.mapConfiguration.",Get_Player_ID(sender), RandomVehicle[Index][0]); + message2.Format("%ls picked up a Random Vehicle crate.",Get_Wide_Player_Name(sender)); + message1.Format("ppage %d [Crate] You got a %s from the Random Vehicle crate.",Get_Player_ID(sender), RandomVehicle[Index][0]); StringClass cine; - cine.Format("%scrate.mapConfiguration.txt",Commands->Get_Player_Type(sender) == 0?"Nod":"GDI"); + cine.Format("%scrate.txt",Commands->Get_Player_Type(sender) == 0?"Nod":"GDI"); Commands->Attach_Script(Temp,"Test_Cinematic",cine); GameObject *veh = Commands->Create_Object(RandomVehicle[Index][3],Vector3(0,0,0)); Commands->Send_Custom_Event(Temp,Temp,CUSTOM_EVENT_CINEMATIC_SET_FIRST_SLOT+4,Commands->Get_Preset_ID(veh),0); @@ -427,7 +431,7 @@ message3.Format("CRATE;VEHICLE;%s;%d;%s;%f;%f;%f;%f;%f;%f;%d", RandomVehicle[Index][0], Commands->Get_ID(sender), Commands->Get_Preset_Name(sender), pos.Y,pos.X,pos.Z, Commands->Get_Facing(sender), Commands->Get_Max_Health(sender),Commands->Get_Max_Shield_Strength(sender),Get_Object_Type(sender)); } else if ((RandomIntCrate <= (percent+=crate.mapConfiguration.CrateDeath)) && (crate.mapConfiguration.CrateDeath > 0)) { - message2.Format("%ls picked up a Death crate.mapConfiguration.",Get_Wide_Player_Name(sender)); + message2.Format("%ls picked up a Death crate.",Get_Wide_Player_Name(sender)); Commands->Apply_Damage(Get_Vehicle(sender),99999,"Shrapnel",0); Commands->Apply_Damage(sender,99999,"Shrapnel",0); Commands->Create_Explosion("Explosion_Mine_Proximity_01",Commands->Get_Position(obj),0); @@ -442,7 +446,7 @@ message3.Format("CRATE;DEATH;;%d;%s;%f;%f;%f;%f;%f;%f;%d", Commands->Get_ID(sender), Commands->Get_Preset_Name(sender), pos.Y,pos.X,pos.Z, Commands->Get_Facing(sender), Commands->Get_Max_Health(sender),Commands->Get_Max_Shield_Strength(sender),Get_Object_Type(sender)); } else if ((RandomIntCrate <= (percent+=crate.mapConfiguration.CrateTiberium)) && (crate.mapConfiguration.CrateTiberium > 0)) { - message2.Format("%ls picked up a Tiberium Death crate.mapConfiguration.",Get_Wide_Player_Name(sender)); + message2.Format("%ls picked up a Tiberium Death crate.",Get_Wide_Player_Name(sender)); Commands->Apply_Damage(Get_Vehicle(sender),99999,"Shrapnel",0); Commands->Apply_Damage(sender,99999,"TiberiumRaw",false); Commands->Create_Object("CnC_Visceroid",Commands->Get_Position(sender)); @@ -456,7 +460,7 @@ Commands->Give_PowerUp(sender,"CnC_POW_Ammo_ClipMax",false); Commands->Give_PowerUp(sender,"CnC_POW_Ammo_ClipMax",false); Commands->Give_PowerUp(sender,"CnC_POW_Ammo_ClipMax",false); - message2.Format("%ls picked up a Full Ammo crate.mapConfiguration.",Get_Wide_Player_Name(sender)); + message2.Format("%ls picked up a Full Ammo crate.",Get_Wide_Player_Name(sender)); message1.Format("ppage %d [Crate] You just got the Full Ammo Crate, your ammo has been refilled.",Get_Player_ID(sender)); Create_2D_WAV_Sound_Player(sender,"m00puar_aqob0002i1evag_snd.wav"); Vector3 pos = Commands->Get_Position(sender); @@ -467,14 +471,14 @@ if (Commands->Get_Shield_Strength(sender) < 2) RndGood = 1; if (RndGood == 1) { Commands->Give_PowerUp(sender,"POW_Medal_Armor",true); - message2.Format("%ls picked up an Armor crate.mapConfiguration.",Get_Wide_Player_Name(sender)); + message2.Format("%ls picked up an Armor crate.",Get_Wide_Player_Name(sender)); message1.Format("ppage %d [Crate] You just got the Armor Crate, your max armor has been increased!",Get_Player_ID(sender)); Vector3 pos = Commands->Get_Position(sender); message3.Format("CRATE;ARMORINCREASE;;%d;%s;%f;%f;%f;%f;%f;%f;%d", Commands->Get_ID(sender), Commands->Get_Preset_Name(sender), pos.Y,pos.X,pos.Z, Commands->Get_Facing(sender), Commands->Get_Max_Health(sender),Commands->Get_Max_Shield_Strength(sender),Get_Object_Type(sender)); } else { Commands->Set_Shield_Strength(sender,1); - message2.Format("%ls picked up a Dearmor crate.mapConfiguration.",Get_Wide_Player_Name(sender)); + message2.Format("%ls picked up a Dearmor crate.",Get_Wide_Player_Name(sender)); message1.Format("ppage %d [Crate] You just got the Dearmor Crate, your armor has been set to 1.",Get_Player_ID(sender)); Vector3 pos = Commands->Get_Position(sender); message3.Format("CRATE;ARMORLOST;;%d;%s;%f;%f;%f;%f;%f;%f;%d", Commands->Get_ID(sender), Commands->Get_Preset_Name(sender), pos.Y,pos.X,pos.Z, Commands->Get_Facing(sender), Commands->Get_Max_Health(sender),Commands->Get_Max_Shield_Strength(sender),Get_Object_Type(sender)); @@ -485,14 +489,14 @@ if (Commands->Get_Health(sender) == 1) RndGood = 1; if (RndGood == 1) { Commands->Give_PowerUp(sender,"POW_Medal_Health",true); - message2.Format("%ls picked up a Health crate.mapConfiguration.",Get_Wide_Player_Name(sender)); + message2.Format("%ls picked up a Health crate.",Get_Wide_Player_Name(sender)); message1.Format("ppage %d [Crate] You just got the Health Crate, your max health has been increased!",Get_Player_ID(sender)); Vector3 pos = Commands->Get_Position(sender); message3.Format("CRATE;HEALTHUPGRADE;;%d;%s;%f;%f;%f;%f;%f;%f;%d", Commands->Get_ID(sender), Commands->Get_Preset_Name(sender), pos.Y,pos.X,pos.Z, Commands->Get_Facing(sender), Commands->Get_Max_Health(sender),Commands->Get_Max_Shield_Strength(sender),Get_Object_Type(sender)); } else { Commands->Set_Health(sender,1); - message2.Format("%ls picked up a Dehealth crate.mapConfiguration.",Get_Wide_Player_Name(sender)); + message2.Format("%ls picked up a Dehealth crate.",Get_Wide_Player_Name(sender)); message1.Format("ppage %d [Crate] You just got the Dehealth Crate, your health has been set to 1.",Get_Player_ID(sender)); Create_2D_WAV_Sound_Player(sender,"m00evag_dsgn0026i1evag_snd.wav"); Vector3 pos = Commands->Get_Position(sender); @@ -522,16 +526,16 @@ else if (Team == 0 && IsPresetDisabled(Get_Definition_ID(RandomNodChar[Index][1]))) { goto Reselect3; } - message2.Format("%ls picked up a Random Character crate.mapConfiguration.",Get_Wide_Player_Name(sender)); + message2.Format("%ls picked up a Random Character crate.",Get_Wide_Player_Name(sender)); if (Commands->Get_Player_Type(sender) == 1) { Change_Character(sender,RandomGDIChar[Index][1]); - message1.Format("ppage %d [Crate] You have been transformed into a %s by the Random Character crate.mapConfiguration.",Get_Player_ID(sender),RandomGDIChar[Index][0]); + message1.Format("ppage %d [Crate] You have been transformed into a %s by the Random Character crate.",Get_Player_ID(sender),RandomGDIChar[Index][0]); Vector3 pos = Commands->Get_Position(sender); message3.Format("CRATE;CHARACTER;%s;%d;%s;%f;%f;%f;%f;%f;%f;%d", RandomGDIChar[Index][0], Commands->Get_ID(sender), Commands->Get_Preset_Name(sender), pos.Y,pos.X,pos.Z, Commands->Get_Facing(sender), Commands->Get_Max_Health(sender),Commands->Get_Max_Shield_Strength(sender),Get_Object_Type(sender)); } else { Change_Character(sender,RandomNodChar[Index][1]); - message1.Format("ppage %d [Crate] You have been transformed into a %s by the Random Character crate.mapConfiguration.",Get_Player_ID(sender),RandomNodChar[Index][0]); + message1.Format("ppage %d [Crate] You have been transformed into a %s by the Random Character crate.",Get_Player_ID(sender),RandomNodChar[Index][0]); Vector3 pos = Commands->Get_Position(sender); message3.Format("CRATE;CHARACTER;%s;%d;%s;%f;%f;%f;%f;%f;%f;%d", RandomNodChar[Index][0], Commands->Get_ID(sender), Commands->Get_Preset_Name(sender), pos.Y,pos.X,pos.Z, Commands->Get_Facing(sender), Commands->Get_Max_Health(sender),Commands->Get_Max_Shield_Strength(sender),Get_Object_Type(sender)); } @@ -547,14 +551,14 @@ Commands->Give_PowerUp(sender,"CnC_POW_MineTimed_Player_01",false); Commands->Select_Weapon(sender,"CnC_Weapon_MineTimed_Player"); } - message2.Format("%ls picked up the Butter Fingers crate.mapConfiguration.",Get_Wide_Player_Name(sender)); + message2.Format("%ls picked up the Butter Fingers crate.",Get_Wide_Player_Name(sender)); message1.Format("ppage %d [Crate] You picked up the Butter Fingers Crate, you have dropped most of your weapons.",Get_Player_ID(sender)); Vector3 pos = Commands->Get_Position(sender); message3.Format("CRATE;BUTTERFINGER;;%d;%s;%f;%f;%f;%f;%f;%f;%d",Commands->Get_ID(sender), Commands->Get_Preset_Name(sender), pos.Y,pos.X,pos.Z, Commands->Get_Facing(sender), Commands->Get_Max_Health(sender),Commands->Get_Max_Shield_Strength(sender),Get_Object_Type(sender)); } else if ((RandomIntCrate <= (percent+=crate.mapConfiguration.CrateRefill)) && (crate.mapConfiguration.CrateRefill > 0)) { Grant_Refill(sender); - message2.Format("%ls picked up the Refill crate.mapConfiguration.",Get_Wide_Player_Name(sender)); + message2.Format("%ls picked up the Refill crate.",Get_Wide_Player_Name(sender)); message1.Format("ppage %d [Crate] You just got the Refill Crate, your health, armor, and ammo have all been refilled.",Get_Player_ID(sender)); Create_2D_WAV_Sound_Player(sender,"m00puar_aqob0002i1evag_snd.wav"); Vector3 pos = Commands->Get_Position(sender); @@ -566,7 +570,7 @@ } int RndGood = Commands->Get_Random_Int(1,3); if (RndGood == 1) { - message2.Format("%ls picked up a Beacon crate.mapConfiguration.",Get_Wide_Player_Name(sender)); + message2.Format("%ls picked up a Beacon crate.",Get_Wide_Player_Name(sender)); if (Commands->Get_Player_Type(sender) == 1) { TeamPurchaseSettingsDefClass *PT = TeamPurchaseSettingsDefClass::Get_Definition(TeamPurchaseSettingsDefClass::TEAM_GDI); Commands->Give_PowerUp(sender,Get_Definition_Name(PT->Get_Beacon_Definition()),true); @@ -586,7 +590,7 @@ Commands->Create_Object("Beacon_Nuke_Strike_Anim_Post",Commands->Get_Position(obj)); Commands->Create_Explosion("Explosion_NukeBeacon",Commands->Get_Position(obj),0); Damage_All_Objects_Area(2500.0f,"None",Commands->Get_Position(obj),15.0f,obj,0); - message2.Format("%ls picked up a Nuclear Bomb crate.mapConfiguration.",Get_Wide_Player_Name(sender)); + message2.Format("%ls picked up a Nuclear Bomb crate.",Get_Wide_Player_Name(sender)); message1.Format("ppage %d [Crate] You just got a Nuclear Bomb Crate, you have been killed. Sorry :(",Get_Player_ID(sender)); StringClass msg; const char *str = Get_Team_Name(Team); @@ -601,7 +605,7 @@ Change_Character(sender,"CnC_Nod_FlameThrower_2SF"); Commands->Set_Is_Visible(sender,false); const char *str3 = Get_Team_Name(Team); - message2.Format("A %s player picked up a Spy crate.mapConfiguration.",str3); + message2.Format("A %s player picked up a Spy crate.",str3); delete[] str3; message1.Format("ppage %d [Crate] You got the Spy Crate, base defenses will ignore you until you die, buy a new character or destroy a building.",Get_Player_ID(sender)); StringClass msg; @@ -616,14 +620,14 @@ } else if ((RandomIntCrate <= (percent+=crate.mapConfiguration.CrateStealth)) && (crate.mapConfiguration.CrateStealth > 0)) { Commands->Enable_Stealth(sender,true); - message2.Format("%ls picked up a Stealth crate.mapConfiguration.",Get_Wide_Player_Name(sender)); + message2.Format("%ls picked up a Stealth crate.",Get_Wide_Player_Name(sender)); message1.Format("ppage %d [Crate] You got the stealth crate! You have been given a stealth suit.",Get_Player_ID(sender)); Vector3 pos = Commands->Get_Position(sender); message3.Format("CRATE;STEALTH;;%d;%s;%f;%f;%f;%f;%f;%f;%d", Commands->Get_ID(sender), Commands->Get_Preset_Name(sender), pos.Y,pos.X,pos.Z, Commands->Get_Facing(sender), Commands->Get_Max_Health(sender),Commands->Get_Max_Shield_Strength(sender),Get_Object_Type(sender)); } else if ((RandomIntCrate <= (percent+=crate.mapConfiguration.CrateThief)) && (crate.mapConfiguration.CrateThief > 0)) { Commands->Give_Money(sender,(Commands->Get_Money(sender) * -1),false); - message2.Format("%ls picked up a Thief crate.mapConfiguration.",Get_Wide_Player_Name(sender)); + message2.Format("%ls picked up a Thief crate.",Get_Wide_Player_Name(sender)); message1.Format("ppage %d [Crate] You got the Thief Crate, you have lost all of your credits.",Get_Player_ID(sender)); Create_2D_Sound_Player(sender,"m00evag_dsgn0028i1evag_snd.wav"); Vector3 pos = Commands->Get_Position(sender); @@ -631,7 +635,7 @@ } else if ((RandomIntCrate <= (percent+=crate.mapConfiguration.CrateAmmoRegen)) && (crate.mapConfiguration.CrateAmmoRegen > 0)) { Commands->Send_Custom_Event(obj,sender,100100,1,1);//enable regeneration of ammo on player - message2.Format("%ls picked up a Ammo Regeneration crate.mapConfiguration.",Get_Wide_Player_Name(sender)); + message2.Format("%ls picked up a Ammo Regeneration crate.",Get_Wide_Player_Name(sender)); message1.Format("ppage %d [Crate] You got the Ammo Reneration Crate, your ammo will be refilled every minute.",Get_Player_ID(sender)); Create_2D_Sound_Player(sender,"m00puar_aqob0002i1evag_snd.wav");//ammo regen sound Vector3 pos = Commands->Get_Position(sender); @@ -640,7 +644,7 @@ else if ((RandomIntCrate <= (percent+=crate.mapConfiguration.CrateHumanSilo)) && (crate.mapConfiguration.CrateHumanSilo > 0)) { int team = Commands->Get_Player_Type(sender); Commands->Send_Custom_Event(obj,sender,100101,1,1);//enable generating of money on player - message2.Format("%ls picked up a Human Silo crate.mapConfiguration.",Get_Wide_Player_Name(sender)); + message2.Format("%ls picked up a Human Silo crate.",Get_Wide_Player_Name(sender)); message1.Format("ppage %d [Crate] You got the Human Silo Crate, your entier team will be granted an additional $1 credit a second until you die or change character.",Get_Player_ID(sender)); Create_2D_WAV_Sound_Team("m00pc$$_aqob0002i1evag_snd.wav",team);//credits acquired Vector3 pos = Commands->Get_Position(sender); @@ -648,8 +652,8 @@ } else if ((RandomIntCrate <= (percent+=crate.mapConfiguration.CrateUberWire)) && (crate.mapConfiguration.CrateUberWire > 0)) { char ubermsg[250]; sprintf(ubermsg,"[CRATE] %s got the UberWire crate! Beware!",Get_Player_Name(sender)); Send_Message(255,255,255,ubermsg); - message2.Format("%ls picked up a UberWire crate.mapConfiguration.",Get_Wide_Player_Name(sender)); - message1.Format("ppage %d [Crate] You got the UberWire crate.mapConfiguration.",Get_Player_ID(sender)); + message2.Format("%ls picked up a UberWire crate.",Get_Wide_Player_Name(sender)); + message1.Format("ppage %d [Crate] You got the UberWire crate.",Get_Player_ID(sender)); Vector3 pos = Commands->Get_Position(sender); message3.Format("CRATE;UBERWIRE;;%d;%s;%f;%f;%f;%f;%f;%f;%d", Commands->Get_ID(sender), Commands->Get_Preset_Name(sender), pos.Y,pos.X,pos.Z, Commands->Get_Facing(sender), Commands->Get_Max_Health(sender),Commands->Get_Max_Shield_Strength(sender),Get_Object_Type(sender)); Change_Character(sender,"GDI_Engineer_2SF"); diff -uwr sourceold/example-plugin/ExamplePlugin.cpp source/example-plugin/ExamplePlugin.cpp --- sourceold/example-plugin/ExamplePlugin.cpp 2011-10-11 21:33:27.709960900 +0800 +++ source/example-plugin/ExamplePlugin.cpp 2012-01-11 22:19:43.840820300 +0800 @@ -15,6 +15,11 @@ #include "engine_io.h" #include "gmgame.h" +void* HookupAT3x(void* a, void* b, void* c, void* patch_start, void* patch_end, int (*version_selector)()) +{ + return HookupAT3(a,b,c,patch_start,patch_end,version_selector); +} + ExamplePlugin::ExamplePlugin() { Console_Output(__FUNCTION__ "\n"); diff -uwr sourceold/randomstartingcredits/RandomStartingCredits.cpp source/randomstartingcredits/RandomStartingCredits.cpp --- sourceold/randomstartingcredits/RandomStartingCredits.cpp 2011-10-11 21:36:29.291015600 +0800 +++ source/randomstartingcredits/RandomStartingCredits.cpp 2012-01-11 22:20:56.575195300 +0800 @@ -13,6 +13,10 @@ #include "RandomStartingCredits.h" #include "gmgame.h" +void* HookupAT3x(void* a, void* b, void* c, void* patch_start, void* patch_end, int (*version_selector)()) +{ + return HookupAT3(a,b,c,patch_start,patch_end,version_selector); +} class RANDOMSTARTINGCREDITS : public Plugin { diff -uwr sourceold/scripts/AudibleSoundClass.h source/scripts/AudibleSoundClass.h --- sourceold/scripts/AudibleSoundClass.h 2011-12-08 11:43:52.666992100 +0800 +++ source/scripts/AudibleSoundClass.h 2012-02-21 10:03:50.199218700 +0800 @@ -62,7 +62,7 @@ float volume; // 132 84 float pan; // 136 88 uint32 loopCount; // 140 8C - uint32 remainingLoops; // 144 90 + int32 remainingLoops; // 144 90 uint32 duration; // 148 94 uint32 playPosition; // 152 98 float startPosition; // 156 9C @@ -165,7 +165,7 @@ AudibleSoundClass& operator = (const AudibleSoundClass& sound); -}; // 328 144 +}; // 328 148 #endif diff -uwr sourceold/scripts/BeaconGameObjDef.h source/scripts/BeaconGameObjDef.h --- sourceold/scripts/BeaconGameObjDef.h 2011-10-11 21:57:34.518554600 +0800 +++ source/scripts/BeaconGameObjDef.h 2012-01-13 08:30:18.359375000 +0800 @@ -40,7 +40,7 @@ int DisarmingInterruptedTextID; // 00D8 int PreDetonateCinematicObjDef; // 00DC int PostDetonateCinematicObjDef; // 00E0 - uint32 ExplosionObjDef; // 00E4 + int ExplosionObjDef; // 00E4 int IsNuke; // 00E8 StringClass ArmingAnimationName; // 00EC friend class BeaconGameObj; diff -uwr sourceold/scripts/Defines.h source/scripts/Defines.h --- sourceold/scripts/Defines.h 2011-10-14 19:58:40.176757800 +0800 +++ source/scripts/Defines.h 2012-01-11 22:17:29.541992100 +0800 @@ -223,6 +223,7 @@ SCRIPTS_API void InitEngine(); SCRIPTS_API int RenegadeAT3VersionSelector(); // Default implementation, used by AT1/AT2 SCRIPTS_API void* HookupAT3(void* a, void* b, void* c, void* patch_start, void* patch_end, int (*function_selector)()); +void* HookupAT3x(void* a, void* b, void* c, void* patch_start, void* patch_end, int (*version_selector)()); #define RENEGADE_FUNCTION __declspec(naked) #ifndef TTLE_EXPORTS #define AT1(client) AT2(client, 0) @@ -243,7 +244,7 @@ __asm push c \ __asm push b \ __asm push a \ - __asm call HookupAT3 \ + __asm call HookupAT3x \ __asm AT3PatchEnd: \ __asm add esp, 24 \ __asm pop edx \ diff -uwr sourceold/scripts/GameData.h source/scripts/GameData.h --- sourceold/scripts/GameData.h 2011-10-11 21:53:00.882812500 +0800 +++ source/scripts/GameData.h 2012-02-13 16:27:27.384187500 +0800 @@ -188,6 +188,8 @@ void Swap_Team_Sides(); void Remix_Team_Sides(); void Rebalance_Team_Sides(); + int Choose_Available_Team(int type); + int Choose_Smallest_Team(); void Reset_Time_Remaining_Seconds() { TimeRemaining_Seconds = (float)(TimeLimit_Minutes * 60); } void Set_Time_Remaining_Seconds(float time) {TimeRemaining_Seconds = time;} diff -uwr sourceold/scripts/GameObjManager.h source/scripts/GameObjManager.h --- sourceold/scripts/GameObjManager.h 2011-10-11 21:52:57.000976500 +0800 +++ source/scripts/GameObjManager.h 2012-02-13 13:28:20.240632800 +0800 @@ -40,6 +40,8 @@ static SCRIPTS_API REF_DECL3(SmartGameObjList, SList); static SHADERS_API SList C4GameObjList; static SHADERS_API SList BeaconGameObjList; + static SHADERS_API SList SoldierGameObjList; + static SHADERS_API SList VehicleGameObjList; #ifndef TTLE_EXPORTS static REF_DECL2(CinematicFreezeActive, bool); #endif diff -uwr sourceold/scripts/MeshClass.h source/scripts/MeshClass.h --- sourceold/scripts/MeshClass.h 2011-10-11 21:50:03.804687500 +0800 +++ source/scripts/MeshClass.h 2012-01-11 20:59:06.600585900 +0800 @@ -91,8 +91,6 @@ void Set_Base_Vertex_Offset(int base) { BaseVertexOffset = base; } int Get_Base_Vertex_Offset(void) { return BaseVertexOffset; } static bool Legacy_Meshes_Fogged; - void Replace_Texture(TextureClass* texture,TextureClass* new_texture); - void Replace_VertexMaterial(VertexMaterialClass* vmat,VertexMaterialClass* new_vmat); SHADERS_API void Make_Unique(); unsigned Get_Debug_Id() const { return MeshDebugId; } void Set_Debugger_Disable(bool b) { IsDisabledByDebugger=b; } diff -uwr sourceold/scripts/PhysicalGameObj.h source/scripts/PhysicalGameObj.h --- sourceold/scripts/PhysicalGameObj.h 2011-10-11 21:49:03.425781200 +0800 +++ source/scripts/PhysicalGameObj.h 2012-02-17 16:57:48.055664000 +0800 @@ -109,7 +109,7 @@ bool Is_HUD_Pokable_Indicator_Enabled( void ) { return HUDPokableIndicatorEnabled; } virtual void Set_Player_Type(int type); virtual void Object_Shattered_Something(PhysClass * observed_obj, PhysClass * shattered_obj, int surface_type); - void Clear_Animation() {AnimControl->Set_Mode(ANIM_MODE_STOP,0);ClearAnimation = true;Set_Object_Dirty_Bit(NetworkObjectClass::BIT_RARE,true);} + void Clear_Animation() {if (AnimControl) {AnimControl->Set_Mode(ANIM_MODE_STOP,0);ClearAnimation = true;Set_Object_Dirty_Bit(NetworkObjectClass::BIT_RARE,true);}} protected: ActiveConversationClass *ActiveConversation; private: diff -uwr sourceold/scripts/RawFileClass.h source/scripts/RawFileClass.h --- sourceold/scripts/RawFileClass.h 2011-10-11 21:48:07.639648400 +0800 +++ source/scripts/RawFileClass.h 2012-01-01 06:32:39.293953200 +0800 @@ -129,18 +129,9 @@ Close(); return true; } - else - { - Handle = CreateFileA(Filename,GENERIC_READ,FILE_SHARE_READ,0,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,0); - if (Handle == INVALID_HANDLE_VALUE) - return false; - - if (!CloseHandle(Handle)) - Error(GetLastError(),0,Filename); - Handle = INVALID_HANDLE_VALUE; - } - return true; + int attr = GetFileAttributesA(Filename); + return attr != INVALID_FILE_ATTRIBUTES && !(attr & FILE_ATTRIBUTE_DIRECTORY); } bool Is_Open() { @@ -169,7 +160,7 @@ Handle = CreateFileA(Filename,GENERIC_WRITE,0,0,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,0); break; case 1: - Handle = CreateFileA(Filename,GENERIC_READ,FILE_SHARE_READ,0,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,0); + Handle = CreateFileA(Filename,GENERIC_READ,FILE_SHARE_READ,0,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN,0); break; case 0: Handle = CreateFileA(Filename,GENERIC_READ|GENERIC_WRITE,0,0,OPEN_ALWAYS,FILE_ATTRIBUTE_NORMAL,0); diff -uwr sourceold/scripts/SimpleFileFactoryClass.cpp source/scripts/SimpleFileFactoryClass.cpp --- sourceold/scripts/SimpleFileFactoryClass.cpp 2011-10-11 23:06:14.933593700 +0800 +++ source/scripts/SimpleFileFactoryClass.cpp 2012-01-01 06:32:39.259773500 +0800 @@ -105,11 +105,7 @@ { new_name.Format("%s%s", token, stripped_name); file->Set_Name(new_name); - if (file->Open(1)) - { - file->Close(); - break; - } + if (file->Is_Available(0)) break; } } else diff -uwr sourceold/scripts/SoldierGameObj.h source/scripts/SoldierGameObj.h --- sourceold/scripts/SoldierGameObj.h 2011-10-13 11:34:11.870117100 +0800 +++ source/scripts/SoldierGameObj.h 2012-02-23 16:37:06.592773400 +0800 @@ -179,6 +179,8 @@ bool Can_Steal_Vehicles() { return CanStealVehicles; } void Set_Can_Drive_Vehicles(bool onoff) { CanDriveVehicles = onoff; Set_Object_Dirty_Bit(BIT_RARE, true); } bool Can_Drive_Vehicles() { return CanDriveVehicles; } + void Set_Block_Action_Key(bool onoff) { BlockActionKey = onoff; Set_Object_Dirty_Bit(BIT_RARE, true); } + bool Block_Action_Key() { return BlockActionKey; } protected: RenderObjClass * WeaponRenderModel; //2416 RenderObjClass * BackWeaponRenderModel; //2420 @@ -234,6 +236,7 @@ bool CanDriveVehicles; // padding PersistantSurfaceEmitterClass * WaterWake; //3376 DynamicVectorClass RenderObjList; //3380 + bool BlockActionKey; void Add_RenderObj( RenderObjClass * obj ); RenderObjClass * Find_RenderObj( const char * name ); void Reset_RenderObjs( void ); diff -uwr sourceold/scripts/SoldierGameObjDef.h source/scripts/SoldierGameObjDef.h --- sourceold/scripts/SoldierGameObjDef.h 2011-10-11 21:43:34.199218700 +0800 +++ source/scripts/SoldierGameObjDef.h 2012-02-13 17:49:26.127351500 +0800 @@ -33,6 +33,7 @@ DECLARE_EDITABLE( SoldierGameObjDef, SmartGameObjDef ); float Get_Skeleton_Height() {return SkeletonHeight;}; float Get_Skeleton_Width() {return SkeletonWidth;}; + bool Is_Spy() const {return IsSpy;} protected: float TurnRate; float JumpVelocity; @@ -47,6 +48,9 @@ int HumanAnimOverrideDefID; int HumanLoiterCollectionDefID; int DeathSoundPresetID; + bool CanStealVehicles; + bool CanDriveVehicles; + bool IsSpy; friend class SoldierGameObj; friend class SoldierObserverClass; friend class PresetDump; diff -uwr sourceold/scripts/Sound3DClass.h source/scripts/Sound3DClass.h --- sourceold/scripts/Sound3DClass.h 2011-10-11 21:43:32.148437500 +0800 +++ source/scripts/Sound3DClass.h 2012-02-17 15:02:45.628906200 +0800 @@ -62,6 +62,7 @@ virtual void Set_Max_Vol_Radius (float); virtual float Get_Max_Vol_Radius (); virtual float Get_DropOff_Radius (); + virtual unsigned long Get_Class_ID () const { return CLASSID_3D; } void Update_Edge_Volume(); }; diff -uwr sourceold/scripts/TranslateDBClass.cpp source/scripts/TranslateDBClass.cpp --- sourceold/scripts/TranslateDBClass.cpp 2011-12-02 08:44:42.934570300 +0800 +++ source/scripts/TranslateDBClass.cpp 2012-01-11 20:59:06.598632800 +0800 @@ -222,6 +222,25 @@ obj->Set_String(TranslateDBClass::Get_Current_Language(), L"High Resolution Shadows"); Add_Object(obj); } + + TDBObjClass* texture_filter = Find_Object("IDS_TEXTURE_FILTER"); + if (texture_filter) + { + char* en_string = (char*)texture_filter->Get_English_String().Peek_Buffer(); + if (char* en_star = strrchr(en_string, '*')) *en_star = ' '; + + wchar_t* lang_string = (wchar_t*)texture_filter->Get_String().Peek_Buffer(); + if (wchar_t* lang_star = wcsrchr(lang_string, L'*')) *lang_star = L' '; + } + + if (!Find_Object("IDS_ANTIALIAS_MODE")) + { + TDBObjClass* obj = new TDBObjClass(); + obj->Set_ID_Desc("IDS_ANTIALIAS_MODE"); + obj->Set_English_String("Anti-aliasing Mode:"); + obj->Set_String(TranslateDBClass::Get_Current_Language(), L"Anti-aliasing Mode:"); + Add_Object(obj); + } if (!Find_Object("IDS_STRUCT_GUARD_TOWER")) { TDBObjClass* obj = new TDBObjClass(); diff -uwr sourceold/scripts/VehicleGameObj.h source/scripts/VehicleGameObj.h --- sourceold/scripts/VehicleGameObj.h 2011-10-13 16:09:05.123046800 +0800 +++ source/scripts/VehicleGameObj.h 2012-02-13 17:13:11.633210900 +0800 @@ -52,7 +52,7 @@ virtual Matrix3D Get_Look_Transform(void); bool Has_Turret( void) { return TurretBone != 0; } virtual VehicleGameObj * As_VehicleGameObj() { return this; } - virtual bool Is_Aircraft( void ) { return Get_Definition().Type == VEHICLE_TYPE_FLYING; } + virtual bool Is_Aircraft( void ) { return Get_Definition().Type == VEHICLE_TYPE_FLYING || Get_Definition().Type == VEHICLE_TYPE_SUB; } virtual bool Is_Turret( void ) { return Get_Definition().Type == VEHICLE_TYPE_TURRET; } virtual int Get_Player_Type(void) const; virtual void Apply_Damage_Extended( const OffenseObjectClass & offense, float scale = 1.0f, @@ -113,20 +113,20 @@ void Ignore_Occupants( void ); void Unignore_Occupants( void ); SoldierGameObj *Get_Occupant(int seat) {return SeatOccupants[seat];} - void Set_Is_Scripts_Visible(bool b) {SCRIPTS_visible = b;} - bool Get_Is_Scripts_Visible() {return SCRIPTS_visible;} - void Set_Scripts_Last_Team(char c) {SCRIPTS_LastTeam = c;} - void Set_Scripts_Can_Fire(bool b) {SCRIPTS_CanFire = b;Set_Object_Dirty_Bit(NetworkObjectClass::BIT_FREQUENT,true);} - bool Get_Scripts_Can_Fire() { return SCRIPTS_CanFire; }; - void Set_Allow_Stealth_While_Empty(bool onoff) { SCRIPTS_AllowStealthWhileEmpty = onoff; Set_Object_Dirty_Bit(BIT_RARE, true); }; - bool Get_Allow_Stealth_While_Empty() const { return SCRIPTS_AllowStealthWhileEmpty; }; - void Damage_Meshes_Update() {SCRIPTS_DamageMeshesUpdate = true; Set_Object_Dirty_Bit(NetworkObjectClass::BIT_FREQUENT,true);} + void Set_Is_Scripts_Visible(bool b) {visible = b;} + bool Get_Is_Scripts_Visible() {return visible;} + void Set_Scripts_Last_Team(char c) {LastTeam = c;} + void Set_Scripts_Can_Fire(bool b) {CanFire = b;Set_Object_Dirty_Bit(NetworkObjectClass::BIT_FREQUENT,true);} + bool Get_Scripts_Can_Fire() { return CanFire; }; + void Set_Allow_Stealth_While_Empty(bool onoff) { AllowStealthWhileEmpty = onoff; Set_Object_Dirty_Bit(BIT_RARE, true); }; + bool Get_Allow_Stealth_While_Empty() const { return AllowStealthWhileEmpty; }; + void Damage_Meshes_Update() {DamageMeshesUpdate = true; Set_Object_Dirty_Bit(NetworkObjectClass::BIT_FREQUENT,true);} void Set_Occupant(int seat, SoldierGameObj *occupant) {SeatOccupants[seat] = occupant;} bool Is_Underground() {return Peek_Physical_Object()->Get_Collision_Group() == UNDERGROUND_COLLISION_GROUP;} void Set_Immovable(bool b) {Peek_Physical_Object()->Set_Immovable(b);Set_Object_Dirty_Bit(NetworkObjectClass::BIT_FREQUENT,true);} bool Is_Immovable() {return Peek_Physical_Object()->Is_Immovable();} - void Set_Lock_Team(int team) {SCRIPTS_LockTeam = (char)team;Set_Object_Dirty_Bit(BIT_RARE,true);} //0 = nod, 1 = gdi, 2 = both - int Get_Lock_Team() {return SCRIPTS_LockTeam;} + void Set_Lock_Team(int team) {LockTeam = (char)team;Set_Object_Dirty_Bit(BIT_RARE,true);} //0 = nod, 1 = gdi, 2 = both + int Get_Lock_Team() {return LockTeam;} void Set_Can_Be_Stolen(bool onoff) { CanBeStolen = onoff; Set_Object_Dirty_Bit(BIT_RARE, true); } bool Can_Be_Stolen() const { return CanBeStolen; } void Set_Owner(SoldierGameObj *obj) {Owner = obj;} @@ -146,8 +146,8 @@ bool enemy = false; if (obj != this) { - int sTeamID1 = SCRIPTS_LastTeam; - if (SCRIPTS_LastTeam == -2) + int sTeamID1 = LastTeam; + if (LastTeam == -2) { sTeamID1 = Get_Player_Type(); } @@ -173,8 +173,8 @@ bool Scripts_Is_Teammate(const DamageableGameObj* oObject); bool Scripts_Is_Team_Player() { - int team = SCRIPTS_LastTeam; - if (SCRIPTS_LastTeam == -2) + int team = LastTeam; + if (LastTeam == -2) { team = Get_Player_Type(); } @@ -202,9 +202,9 @@ bool HasExitTransitions; //2450 bool VehicleDelivered; //2451 bool DriverIsGunner; //2452 - bool SCRIPTS_visible; //2453 - char SCRIPTS_LastTeam; //2454 - bool SCRIPTS_DamageMeshesUpdate; //2455 + bool visible; //2453 + char LastTeam; //2454 + bool DamageMeshesUpdate; //2455 VectorClass WheelSurfaceEmitters; //2456 PersistantSurfaceSoundClass * WheelSurfaceSound; //2472 enum { @@ -216,9 +216,9 @@ DynamicVectorClass TransitionInstances; //2496 ReferencerClass LockOwner; //2520 float LockTimer; //2536 - bool SCRIPTS_CanFire; - bool SCRIPTS_AllowStealthWhileEmpty; - char SCRIPTS_LockTeam; + bool CanFire; + bool AllowStealthWhileEmpty; + char LockTeam; bool CanBeStolen; UndergroundEffectClass *UndergroundEffect; ReferencerClass Owner; //Owner for SSGM vehicle locking. When this is set, only this player can enter the vehicle. diff -uwr sourceold/scripts/VehicleGameObjDef.h source/scripts/VehicleGameObjDef.h --- sourceold/scripts/VehicleGameObjDef.h 2011-10-11 21:40:51.412109300 +0800 +++ source/scripts/VehicleGameObjDef.h 2012-02-13 17:16:25.394929700 +0800 @@ -31,6 +31,8 @@ VEHICLE_TYPE_BIKE, VEHICLE_TYPE_FLYING, VEHICLE_TYPE_TURRET, + VEHICLE_TYPE_BOAT, + VEHICLE_TYPE_SUB, } VehicleType; class VehicleGameObjDef : public SmartGameObjDef { @@ -72,6 +74,8 @@ int NodDamageReportID; int GDIDestroyReportID; int NodDestroyReportID; + bool CanBeStolen; + bool AllowStealthWhileEmpty; friend class VehicleGameObj; friend class PresetDump; }; // size: 324 diff -uwr sourceold/scripts/WWAudioClass.h source/scripts/WWAudioClass.h --- sourceold/scripts/WWAudioClass.h 2011-12-08 11:43:52.664062500 +0800 +++ source/scripts/WWAudioClass.h 2012-02-17 15:02:45.624023400 +0800 @@ -176,9 +176,9 @@ AudibleSoundClass * Create_Sound_Effect (FileClass &file, const char *string_id); SHADERS_API AudibleSoundClass * Create_Sound_Effect (const char *filename); AudibleSoundClass * Create_Sound_Effect (const char *string_id, unsigned char *raw_wave_data, unsigned long bytes); - Sound3DClass * Create_3D_Sound (FileClass &file, const char *string_id, int classid_hint = CLASSID_3D); + SHADERS_API Sound3DClass * Create_3D_Sound (FileClass &file, const char *string_id, int classid_hint = CLASSID_3D); SHADERS_API Sound3DClass * Create_3D_Sound (const char *filename, int classid_hint = CLASSID_3D); - Sound3DClass * Create_3D_Sound (const char *string_id, unsigned char *raw_wave_data, unsigned long bytes, int classid_hint = CLASSID_3D); + SHADERS_API Sound3DClass * Create_3D_Sound (const char *string_id, unsigned char *raw_wave_data, unsigned long bytes, int classid_hint = CLASSID_3D); SHADERS_API void Set_Background_Music (const char *filename); SHADERS_API void Fade_Background_Music (const char *filename, int fade_out_time, int fade_in_time); const char * Get_Background_Music_Name (void) { return m_BackgroundMusicName; } @@ -200,7 +200,7 @@ bool Set_Cache_Size (int kbytes = DEF_CACHE_SIZE) { m_MaxCacheSize = (kbytes * 1024); } int Get_Cache_Size (void) const { return m_MaxCacheSize / 1024; } int Get_Current_Cache_Size (void) const { return m_CurrentCacheSize; } - void Flush_Cache (void); + SHADERS_API void Flush_Cache (void); void Set_Max_2D_Sound_Buffer (int bytes = DEF_MAX_2D_BUFFER_SIZE) { m_Max2DBufferSize = bytes; } void Set_Max_3D_Sound_Buffer (int bytes = DEF_MAX_3D_BUFFER_SIZE) { m_Max3DBufferSize = bytes; } SHADERS_API bool Simple_Play_2D_Sound_Effect (const char *filename, float priority = 1.0F, float volume = DEF_SFX_VOL); @@ -229,13 +229,13 @@ AudibleSoundClass * Peek_2D_Sample (int index); AudibleSoundClass * Peek_3D_Sample (int index); void Free_Completed_Sounds (void); -protected: +public: void Build_3D_Driver_List (void); void Free_3D_Driver_List (void); void Reprioritize_Playlist (void); bool Validate_3D_Sound_Buffer (SoundBufferClass *buffer); - FileClass * Get_File (LPCTSTR filename); - void Return_File (FileClass *file); + SHADERS_API FileClass * Get_File (LPCTSTR filename); + SHADERS_API void Return_File (FileClass *file); void Allocate_2D_Handles (void); void Release_2D_Handles (void); void Allocate_3D_Handles (void); @@ -256,7 +256,7 @@ SoundBufferClass * Find_Cached_Buffer (const char *string_id); SoundBufferClass * Create_Sound_Buffer (FileClass &file, const char *string_id, bool is_3d); SoundBufferClass * Create_Sound_Buffer (unsigned char *file_image, unsigned long bytes, const char *string_id, bool is_3d); - bool Cache_Buffer (SoundBufferClass *buffer, const char *string_id); + SHADERS_API bool Cache_Buffer (SoundBufferClass *buffer, const char *string_id); bool Free_Cache_Space (int bytes); static unsigned int AILCALLBACK File_Open_Callback (char const *filename, unsigned int *file_handle); static void AILCALLBACK File_Close_Callback (unsigned int file_handle); @@ -267,7 +267,7 @@ static HANDLE _TimerSyncEvent; typedef struct _CACHE_ENTRY_STRUCT { - char * string_id; + const char * string_id; SoundBufferClass * buffer; _CACHE_ENTRY_STRUCT (void) : string_id (0), buffer (NULL) {} diff -uwr sourceold/scripts/anticheat.ini source/scripts/anticheat.ini --- sourceold/scripts/anticheat.ini 2011-12-05 15:24:43.332539100 +0800 +++ source/scripts/anticheat.ini 2012-02-18 13:32:47.225585900 +0800 @@ -51,3 +51,65 @@ cbc396725a03305b6b6f5ce7ea699b17=always3.dat fc9931e6588e44d620ba233caf4004c8=mnatr_mct.w3d 5bc57e1d26b07fd553a703c18616f405=mnatr_mct.w3d +27a4e37ebdd5989ecc6c2febeb41a815=C&C_city.ldd +f522b6e776d66f1af982be51a188bf0b=C&C_city.lsd +8b46187317e1631c5ed2b8008614efdf=C&C_city_flying.ldd +e8d4b43aa05dcfa36b7e0fe40bfa1eee=C&C_complex.ldd +708e3e537949b222ea535523cf28cd3c=C&C_complex.lsd +e1ec1e2f15cbc0c77ab774213340d593=C&C_field.ldd +8894e0982c621148e49bcec0e811b44d=C&C_field.lsd +7cff234cc5770145c048f76ab04cae4f=C&C_hourglass.ldd +051eac32f238cfca12b09b329984817e=C&C_hourglass.lsd +a6e38a8c403e64ef045f54c837ecd703=C&C_islands.ldd +95aaf1f05560d799626e3ecc7a94ca00=C&C_islands.lsd +62fcaa2c128c739cd858ee724a8b7318=C&C_mesa.ldd +9d318a4c494e3b2a83d2156b9e59eb0f=C&C_mesa.lsd +4ed16fa604eb023fb6434d5ae463ae31=C&C_under.ldd +bd8961e3368ed6f90c3588d09c3356be=C&C_under.lsd +94b910a88765391f2244e1213cca4a78=C&C_volcano.ldd +a1e1547777f69d68a6cd2e0756584345=C&C_volcano.lsd +21ae0b50c5a03a2b63d4519254864225=C&C_walls.ldd +b5a5cd52300c492756b2209cf384adad=C&C_walls.lsd +91ba633531aab87fdf7d165eb528b496=C&C_walls_flying.ldd +a916c2f47497773d345baf8c31ec03ef=mp_field.w3d +e299223ff777fde6d508bff2593ffd81=mp_mesa_lm.w3d +3f9cdcd5576519d0437bf341d88a92f9=tunnels_lm.w3d +7bfafa8c50b1795d2b68fecb75f7cda9=C&C_City.mix +5ca54f39d7df2585638e9277cfa4e16a=C&C_City_Flying.mix +9cd91d03f98eea3ba462b142aaf5d065=C&C_Complex.mix +62c97bd41d190db869a920371cdf1640=C&C_Field.mix +6c2b667b0a2a127bc65f9c4c5ca8cefb=C&C_Hourglass.mix +73d3084febd0c16eb205e5466c7d575d=C&C_Islands.mix +e401d506bc1adb522f502a62e7dc549c=C&C_Mesa.mix +3a53501d162216aefc3f9d32821d83e0=C&C_Under.mix +988d9deef7ff334f820babf5d65e6206=C&C_Volcano.mix +9781e5da5947c6330d69a014c7210b25=C&C_Walls.mix +b42b40e536d8b017b73f165dbb20a3b8=C&C_Walls_Flying.mix +0433e1a057ab4ca3ec65faa85ed2a948=C&C_city.ldd +11e8091c3e8c90c181efd256b8806400=C&C_city.lsd +fc1ab2a0d9d3be3092d79f0d94ca4206=C&C_city_flying.ldd +aa78fd99f6ff9229822c6aba4fb207bb=C&C_complex.ldd +0916776a78095929f9c145e57d2b7c76=C&C_complex.lsd +c76f552fd199226efd0c01c460ca25a0=C&C_field.ldd +7be222a0de09fd7ac58421b0664a4442=C&C_field.lsd +edf001f39f301b4224e38bbde383a0db=C&C_hourglass.ldd +7d0d0804644c9a2e46203de975198294=C&C_hourglass.lsd +7841b23042a2df76ec951568ca3bbb94=C&C_islands.ldd +049cfb804de44740c9267cde3a2f5956=C&C_islands.lsd +40b33a3fbe1ee1d2bc8135565a8dea62=C&C_mesa.ldd +1230513b03ebf712244ee7ef18ae6a79=C&C_mesa.lsd +71e812b99b1b8b91c2d6726ff013922d=C&C_under.ldd +f7722090212438fb9284f3b9ec13ea2f=C&C_under.lsd +942a8f4613bad737d6b22f38300eb35b=C&C_volcano.ldd +191c8d5e89adab3203caab54851fcc31=C&C_volcano.lsd +9abb0a7bfdd4d879546361207df58b97=C&C_walls.ldd +00ff9e4b60e98424a33c85ab849a190e=C&C_walls.lsd +c10e1e6df79683fdd954273b1bfa4858=C&C_walls_flying.ldd +0ea282c6c570845ad5a39ec7c82ad553=mp_field.w3d +357ba78da453e6811ddefb805bbf939a=mp_mesa_lm.w3d +fd8a854fe08761d16fa429595b322780=tunnels_lm.w3d +07fcfef552d405ff768299c5ef7d6ee5=always3.dat +4531ac11b7fe2566aace69763da0689e=builtin.shd +909e932deec23ec75da3744306051b83=builtin_fxaa_sm3_hq.fxo +1e7fca47542d374462af2fb81ec8a87c=builtin_fxaa_sm3_mq.fxo +96d98d3a8dc579e76d9b57798a093936=builtin_fxaa_sm3_lq.fxo Only in source/scripts: d3dx9.h diff -uwr sourceold/scripts/dllmain.cpp source/scripts/dllmain.cpp --- sourceold/scripts/dllmain.cpp 2011-11-07 21:18:01.975585900 +0800 +++ source/scripts/dllmain.cpp 2012-02-27 12:49:54.797328100 +0800 @@ -297,6 +297,8 @@ AddThinkHook = (allh)Address(tt,"AddThinkHook"); AddPlayerJoinHook = (apjh)Address(tt,"AddPlayerJoinHook"); AddRadioHook = (arch)Address(tt,"AddRadioHook"); + AddStockDamageHook = (asdh)Address(tt,"AddStockDamageHook"); + AddTtDamageHook = (atdh)Address(tt,"AddTtDamageHook"); GetCurrentMusicTrack = (gcmt)Address(tt,"GetCurrentMusicTrack"); Set_Info_Texture = (sit)Address(tt,"Set_Info_Texture"); Clear_Info_Texture = (cit)Address(tt,"Clear_Info_Texture"); @@ -344,6 +346,7 @@ AddPlayerLeaveHook = (aplh)Address(tt,"AddPlayerLeaveHook"); GetExplosionObj = (geo)Address(tt,"GetExplosionObj"); SetExplosionObj = (seo)Address(tt,"SetExplosionObj"); + Update_Network_Object = (uno)Address(tt,"Update_Network_Object"); gttv GetTTVersion = (gttv)Address(tt,"GetTTVersion"); Commands->Control_Enable = (void(*)( GameObject * obj, bool enable ))Address(tt,"New_Control_Enable"); AddShaderNotify = (asn)Address(tt,"AddShaderNotify"); @@ -386,13 +389,13 @@ Send_Custom_All_Players = (scap)Address(tt,"Send_Custom_All_Players"); Steal_Team_Credits = (stc)Address(tt,"Steal_Team_Credits"); Get_Team_Credits = (gtc)Address(tt,"Get_Team_Credits"); - Set_Objects_Filename = (ssn)Address(tt,"Set_Objects_Filename"); addConnectionAcceptanceFilter = (addConnectionAcceptanceFilterType)Address(tt, "addConnectionAcceptanceFilter"); removeConnectionAcceptanceFilter = (removeConnectionAcceptanceFilterType)Address(tt, "removeConnectionAcceptanceFilter"); Evict_Client = (ec)Address(tt,"Evict_Client"); Get_Current_Map_Index = (gcmi)Address(tt,"Get_Current_Map_Index"); Get_Player_List = (gpl)Address(tt,"Get_Player_List"); Get_Map = (gm)Address(tt,"Get_Map"); + Get_Map_Count = (gmc)Address(tt,"Get_Map_Count"); Set_Map = (smx)Address(tt,"Set_Map"); Get_Game_Definitions = (ggd)Address(tt,"Get_Game_Definitions"); Get_Client_Serial_Hash = (gcsh)Address(tt,"Get_Client_Serial_Hash"); diff -uwr sourceold/scripts/dp88_ar.cpp source/scripts/dp88_ar.cpp --- sourceold/scripts/dp88_ar.cpp 2011-12-01 12:13:35.659179600 +0800 +++ source/scripts/dp88_ar.cpp 2012-02-23 12:06:21.704101500 +0800 @@ -1320,7 +1320,7 @@ // If AI miner health drops below the emergency chronoshift health threshold and we are driving to // the ore field or collecting ore then begin an emergency chronoshift if ( useAI && Commands->Get_Health(obj) < (Commands->Get_Max_Health(obj)*(Get_Float_Parameter("emergencyChronoshiftHealthThreshold")/100.0f)) - && (aiState == MINER_AISTATE_DRIVE_TO_ORE || aiState == MINER_AISTATE_COLLECTING_ORE) ) + && (aiState == MINER_AISTATE_COLLECTING_ORE && oreLoadLevel > 0) ) { // Attempt to start a chronoshift - if it fails don't bother // with anything else, driving away won't help... @@ -1822,18 +1822,23 @@ switch(animstate) { case 0: + obj->As_PhysicalGameObj()->Clear_Animation(); Commands->Set_Animation(obj, Get_Parameter("animationName"), false, NULL, (float)Get_Int_Parameter("animFrameCharging1"), (float)Get_Int_Parameter("animFrameCharging2"), false ); break; case 1: + obj->As_PhysicalGameObj()->Clear_Animation(); Commands->Set_Animation(obj, Get_Parameter("animationName"), false, NULL, (float)Get_Int_Parameter("animFrameAvailable1"), (float)Get_Int_Parameter("animFrameAvailable2"), false ); break; case 2: + obj->As_PhysicalGameObj()->Clear_Animation(); Commands->Set_Animation(obj, Get_Parameter("animationName"), false, NULL, (float)Get_Int_Parameter("animFrameActive1"), (float)Get_Int_Parameter("animFrameActive2"), false ); break; case 3: + obj->As_PhysicalGameObj()->Clear_Animation(); Commands->Set_Animation(obj, Get_Parameter("animationName"), false, NULL, (float)Get_Int_Parameter("animFrameDisabled1"), (float)Get_Int_Parameter("animFrameDisabled2"), false ); break; case 4: + obj->As_PhysicalGameObj()->Clear_Animation(); Commands->Set_Animation(obj, Get_Parameter("animFrameIdle1"), false, NULL, (float)Get_Int_Parameter("animFrameIdle2"), (float)Get_Int_Parameter("animFrameActive2"), false ); break; } @@ -2017,8 +2022,8 @@ GameObject* pilot = Commands->Find_Object(pilotID); if ( pilot ) { - Commands->Control_Enable ( Commands->Find_Object ( pilotID ), true ); - Commands->Give_Money( Commands->Find_Object( pilotID ), (float)(Get_Int_Parameter ( "cost" )), 0 ); + Commands->Control_Enable ( pilot, true ); + Commands->Give_Money( pilot, (float)(Get_Int_Parameter ( "cost" )), 0 ); } pilotID = NULL; diff -uwr sourceold/scripts/dp88_ar_unitScripts.cpp source/scripts/dp88_ar_unitScripts.cpp --- sourceold/scripts/dp88_ar_unitScripts.cpp 2011-10-22 21:53:45.732421800 +0800 +++ source/scripts/dp88_ar_unitScripts.cpp 2012-02-02 17:58:48.974609300 +0800 @@ -616,13 +616,15 @@ void dp88_AR_Tesla_Coil::Timer_Expired ( GameObject* obj, int number ) { + if (number == TIMER_TESLACOIL_DECREMENT_CHARGE) + { if ( m_chargeLevel > 0 ) m_chargeLevel--; // Have we dropped out of supercharged status? if ( m_isSupercharged && !((Is_Base_Powered(Get_Object_Type(obj)) && m_chargeLevel >= m_chargesSupercharge) || m_chargeLevel >= m_chargesPowerOn + m_chargesSupercharge) ) setSuperchargedState(obj, false); - + } // Call base class timer expired dp88_AI_Turret::Timer_Expired(obj, number); diff -uwr sourceold/scripts/dp88_buildingScripts.cpp source/scripts/dp88_buildingScripts.cpp --- sourceold/scripts/dp88_buildingScripts.cpp 2011-12-01 12:48:42.641601500 +0800 +++ source/scripts/dp88_buildingScripts.cpp 2012-02-23 12:06:21.652343700 +0800 @@ -21,6 +21,7 @@ #include "AirFactoryGameObj.h" #include "RefineryGameObj.h" #include "PurchaseSettingsDefClass.h" +#include "PhysicalGameObj.h" /*------------------------ Building Controller Script @@ -551,10 +552,12 @@ { if (animstate == 0 && Get_Int_Parameter("animLoop")) { + obj->As_PhysicalGameObj()->Clear_Animation(); Commands->Set_Animation ( obj, Get_Parameter("animName"), false, NULL, (float)Get_Int_Parameter("animStartFrame"), (float)Get_Int_Parameter("animEndFrame"), false ); } if (animstate == 1 && Get_Int_Parameter("destroyedAnimLoop")) { + obj->As_PhysicalGameObj()->Clear_Animation(); Commands->Set_Animation ( obj, Get_Parameter("destroyedAnimName"), false, NULL, (float)Get_Int_Parameter("destroyedAnimStartFrame"), (float)Get_Int_Parameter("destroyedAnimEndFrame"), false ); } } diff -uwr sourceold/scripts/dp88_misc.cpp source/scripts/dp88_misc.cpp --- sourceold/scripts/dp88_misc.cpp 2011-12-01 11:52:12.948242100 +0800 +++ source/scripts/dp88_misc.cpp 2012-02-23 12:06:21.224609300 +0800 @@ -14,7 +14,8 @@ #include "dp88_custom_timer_defines.h" #include "definition.h" #include "VehicleGameObj.h" - +#include "SoldierGameObj.h" +#include "SoldierGameObjDef.h" /*------------------------ @@ -383,8 +384,8 @@ void dp88_unitSounds::Created ( GameObject* obj ) { + Update_Network_Object(obj); healAmount = 0; - if ( strcmp ( Get_Parameter ( "createdSound" ), "null" ) != 0 && Is_Valid_Preset ( Get_Parameter ( "createdSound" ) ) ) Commands->Create_3D_Sound_At_Bone( Get_Parameter ( "createdSound" ), obj, "origin" ); @@ -693,6 +694,7 @@ void dp88_damageAnimation::SetDamageAnimation ( GameObject* obj ) { + obj->As_PhysicalGameObj()->Clear_Animation(); if ( basePowerState || damageLevelLowPowerStartFrames[currentDamageLevel] < 0 ) Commands->Set_Animation(obj, Get_Parameter("animationName"), false, NULL, (float)damageLevelStartFrames[currentDamageLevel], (float)damageLevelEndFrames[currentDamageLevel], false ); else @@ -1340,7 +1342,7 @@ float money = ((bRepair) ? repairMoney : damageMoney) * amount; // Is this player an APB spy? - bool bSpy = ( Find_Script_On_Object(damager, "RA_Infantry_Spy") != NULL ); + bool bSpy = Is_Spy(damager); // Repaired other team or damaged own team? That would be negative points and no // money for you then... unless your spy, then the logic is inverted... diff -uwr sourceold/scripts/engine_3dre.h source/scripts/engine_3dre.h --- sourceold/scripts/engine_3dre.h 2011-11-07 15:17:05.800781200 +0800 +++ source/scripts/engine_3dre.h 2012-01-01 06:32:39.324226700 +0800 @@ -552,16 +552,19 @@ void _DebugEventEnd(); //End a debug event void _DebugEventMarker(D3DCOLOR color, wchar_t *message,...); //Add a debug marker int _DebugGetStatus(); //Get debug status +void _DebugNameObject(IDirect3DResource9* object, const char* name); // Name a D3D object #ifdef DEBUG #define DebugEventStart(...) _DebugEventStart(__VA_ARGS__) #define DebugEventMarker(...) _DebugEventMarker(__VA_ARGS__) #define DebugEventEnd() _DebugEventEnd() #define DebugGetStatus() _DebugGetStatus() +#define DebugNameObject(object, name) _DebugNameObject(object, name) #else #define DebugEventStart(...) #define DebugEventMarker(...) #define DebugEventEnd() #define DebugGetStatus() +#define DebugNameObject(object, name) #endif Vector4 GetColorVector4(D3DCOLOR color); //Converts a D3DCOLOR into a Vector4 Vector3 GetColorVector3(D3DCOLOR color); //Converts a D3DCOLOR into a Vector3 diff -uwr sourceold/scripts/engine_common.cpp source/scripts/engine_common.cpp --- sourceold/scripts/engine_common.cpp 2011-10-11 23:03:34.733398400 +0800 +++ source/scripts/engine_common.cpp 2012-01-11 22:18:19.132812500 +0800 @@ -171,6 +171,11 @@ return Exe; }; +void* HookupAT3x(void* a, void* b, void* c, void* patch_start, void* patch_end, int (*version_selector)()) +{ + return HookupAT3(a,b,c,patch_start,patch_end,version_selector); +} + SCRIPTS_API void* HookupAT3(void* a, void* b, void* c, void* patch_start, void* patch_end, int (*version_selector)()) { static const char relJumpOp = '\xE9'; diff -uwr sourceold/scripts/engine_io.cpp source/scripts/engine_io.cpp --- sourceold/scripts/engine_io.cpp 2011-10-13 01:39:18.449218700 +0800 +++ source/scripts/engine_io.cpp 2012-01-01 06:32:39.322273500 +0800 @@ -70,7 +70,7 @@ ini->Get_String("paths","RegFDS","RenegadeFDS",RegFDS,MAX_PATH); ini->Get_String("paths","FileBase","Renegade",FileBase,MAX_PATH); ini->Get_String("paths","FileClient","Client",FileClient,MAX_PATH); - ini->Get_String("paths","","FDS",FileFDS,MAX_PATH); + ini->Get_String("paths","FileFDS","FDS",FileFDS,MAX_PATH); UseRenFolder = ini->Get_Bool("paths","UseRenFolder",UseRenFolder); Release_INI(ini); } diff -uwr sourceold/scripts/engine_io.h source/scripts/engine_io.h --- sourceold/scripts/engine_io.h 2011-10-12 09:16:50.970703100 +0800 +++ source/scripts/engine_io.h 2012-01-01 06:32:39.285164200 +0800 @@ -147,7 +147,7 @@ csave.End_Micro_Chunk(); #define WRITE_MICRO_CHUNK_WWSTRING(csave,id,string) \ csave.Begin_Micro_Chunk(id); \ -csave.Write(string.Peek_Buffer(),string.Get_Length() + 1); \ +csave.Write(string.Peek_Buffer(),sizeof(*string.Peek_Buffer())*(string.Get_Length() + 1)); \ csave.End_Micro_Chunk(); #define WRITE_WWSTRING_CHUNK(csave,id,string) \ csave.Begin_Chunk(id); \ diff -uwr sourceold/scripts/engine_obj.cpp source/scripts/engine_obj.cpp --- sourceold/scripts/engine_obj.cpp 2011-10-14 22:25:11.520507800 +0800 +++ source/scripts/engine_obj.cpp 2012-02-17 21:03:32.721679600 +0800 @@ -224,6 +224,8 @@ #ifdef SHADERS_EXPORTS SHADERS_API SList GameObjManager::C4GameObjList; SHADERS_API SList GameObjManager::BeaconGameObjList; +SHADERS_API SList GameObjManager::SoldierGameObjList; +SHADERS_API SList GameObjManager::VehicleGameObjList; #endif const BaseGameObjDef & BaseGameObj::Get_Definition( void ) const @@ -1482,12 +1484,6 @@ PhysObj->Set_Transform(tm); } -RENEGADE_FUNCTION -void PhysicalGameObj::Post_Think() -AT2(0x006A5770, 0x006A5010); - - - bool DamageableGameObj::Is_Teammate(DamageableGameObj * p_obj) { return ((p_obj == this) || (Is_Team_Player() && Get_Player_Type() == p_obj->Get_Player_Type())); diff -uwr sourceold/scripts/engine_obj2.cpp source/scripts/engine_obj2.cpp --- sourceold/scripts/engine_obj2.cpp 2011-10-22 13:31:31.273437500 +0800 +++ source/scripts/engine_obj2.cpp 2012-02-13 18:26:42.375398400 +0800 @@ -660,4 +660,13 @@ return ( ActionCode != NULL ); } +bool SCRIPTS_API Is_Spy(GameObject *obj) +{ + if (obj->As_SoldierGameObj()) + { + return obj->As_SoldierGameObj()->Get_Definition().Is_Spy(); + } + return false; +} + REF_DEF2(SmartGameObj::GlobalSightRangeScale,float,0x00811E64,0x0081103C); diff -uwr sourceold/scripts/engine_obj2.h source/scripts/engine_obj2.h --- sourceold/scripts/engine_obj2.h 2011-10-20 22:21:42.989257800 +0800 +++ source/scripts/engine_obj2.h 2012-02-13 18:26:42.432039000 +0800 @@ -47,4 +47,5 @@ GameObject SCRIPTS_API *Get_Vehicle_Gunner_Pos(GameObject *obj); //Get the vehicle gunner, returns zero if there is no gunner void SCRIPTS_API Set_Vehicle_Is_Visible(GameObject *obj,bool visible); //works like Set_Is_Visible but for vehicles, makes them be ignored by Enemy_Seen void SCRIPTS_API Set_Vehicle_Gunner(GameObject *obj,int seat); //set gunner for this vehicle +bool SCRIPTS_API Is_Spy(GameObject *obj); //Is this soldier object a spy #endif diff -uwr sourceold/scripts/engine_player.cpp source/scripts/engine_player.cpp --- sourceold/scripts/engine_player.cpp 2011-10-11 23:03:20.238281200 +0800 +++ source/scripts/engine_player.cpp 2012-01-18 06:45:15.295898400 +0800 @@ -418,7 +418,7 @@ if (o && As_SoldierGameObj(o)) { const char *name = Get_Player_Name(o); - if (!stristr(name,name1)) + if (stristr(name,name1)) { current = o; count++; @@ -447,7 +447,7 @@ if (o && As_SoldierGameObj(o)) { const char *name = Get_Player_Name(o); - if (!stristr(name,name1)) + if (stristr(name,name1)) { count++; } diff -uwr sourceold/scripts/engine_string.h source/scripts/engine_string.h --- sourceold/scripts/engine_string.h 2011-10-11 21:53:52.137695300 +0800 +++ source/scripts/engine_string.h 2012-01-11 20:59:06.570312500 +0800 @@ -594,6 +594,7 @@ SHADERS_API bool Is_ANSI(void); wchar_t * Get_Buffer (int new_length); wchar_t * Peek_Buffer (void); + const wchar_t* Peek_Buffer() const; SHADERS_API static void Release_Resources (void); void TruncateLeft(uint truncateLength) @@ -907,6 +908,11 @@ { return m_Buffer; } + +inline const wchar_t* WideStringClass::Peek_Buffer() const +{ + return m_Buffer; +} inline const WideStringClass &WideStringClass::operator+= (const WideStringClass &string) { diff -uwr sourceold/scripts/engine_tt.cpp source/scripts/engine_tt.cpp --- sourceold/scripts/engine_tt.cpp 2011-11-07 20:07:04.130859300 +0800 +++ source/scripts/engine_tt.cpp 2012-02-27 12:46:32.940882800 +0800 @@ -24,6 +24,7 @@ #include "SmartGameObjDef.h" #include "VehicleGameObj.h" #include "SoldierGameObj.h" +#include "SoldierGameObjDef.h" #include "VehicleFactoryGameObj.h" #include "VehicleFactoryGameObjDef.h" #include "AirFactoryGameObj.h" @@ -34,6 +35,7 @@ SCRIPTS_API gpl Get_Player_List; SCRIPTS_API gcmi Get_Current_Map_Index; SCRIPTS_API gm Get_Map; +SCRIPTS_API gmc Get_Map_Count; SCRIPTS_API smx Set_Map; SCRIPTS_API ggd Get_Game_Definitions; SCRIPTS_API _Enable_Stealth_Player Enable_Stealth_Player; @@ -70,6 +72,8 @@ SCRIPTS_API allh AddThinkHook; SCRIPTS_API apjh AddPlayerJoinHook; SCRIPTS_API arch AddRadioHook; +SCRIPTS_API asdh AddStockDamageHook; +SCRIPTS_API atdh AddTtDamageHook; SCRIPTS_API aplh AddPlayerLeaveHook; SCRIPTS_API aph AddPowerupPurchaseHook; SCRIPTS_API aph AddVehiclePurchaseHook; @@ -113,6 +117,7 @@ SCRIPTS_API dps Display_Security_Dialog; SCRIPTS_API geo GetExplosionObj; SCRIPTS_API seo SetExplosionObj; +SCRIPTS_API uno Update_Network_Object; SCRIPTS_API dod Do_Objectives_Dlg; SCRIPTS_API sl Set_Player_Limit; SCRIPTS_API gl Get_Player_Limit; @@ -148,7 +153,6 @@ SCRIPTS_API scap Send_Custom_All_Players; SCRIPTS_API stc Steal_Team_Credits; SCRIPTS_API gtc Get_Team_Credits; -SCRIPTS_API ssn Set_Objects_Filename; SCRIPTS_API addConnectionAcceptanceFilterType addConnectionAcceptanceFilter; SCRIPTS_API removeConnectionAcceptanceFilterType removeConnectionAcceptanceFilter; SCRIPTS_API ec Evict_Client; @@ -371,68 +375,158 @@ SCRIPTS_API void Ranged_Stealth_On_Team(Gap_ListNode* FirstNode) { - SLNode *x = GameObjManager::SmartGameObjList.Head(); + SLNode *x = GameObjManager::VehicleGameObjList.Head(); if (FirstNode) { while (x) { - GameObject *o = x->Data(); + VehicleGameObj *o = x->Data(); if (o) { - bool tested = false; + bool stealth = false; Gap_ListNode *current = FirstNode; int test = Commands->Get_Player_Type(o); - if (o->As_VehicleGameObj() && o->As_VehicleGameObj()->Get_Lock_Team() != 2) + if (o->Get_Lock_Team() != 2) { - test = o->As_VehicleGameObj()->Get_Lock_Team(); + test = o->Get_Lock_Team(); } - SmartGameObjDef *d = (SmartGameObjDef *)Get_Definition(o); + const VehicleGameObjDef *d = &o->Get_Definition(); if (!d->Is_Stealthed()) { - if (Is_Vehicle(o) || Is_Soldier(o)) - { - while (!tested) - { - if (current) + while (current) { if (current->active) { + if (test == current->teamID) + { Vector3 GenPos = Commands->Get_Position(Commands->Find_Object(current->unitID)); Vector3 TargetPos = Commands->Get_Position(o); - float distance = Commands->Get_Distance(GenPos, TargetPos); - if (distance <= current->range) + float distance2 = (GenPos - TargetPos).Length2(); + if (distance2 <= current->range * current->range) { - if (test == current->teamID) - { - Commands->Enable_Stealth(o, true); - current = NULL; - tested = true; + stealth = true; + } + } } - else - { current = current->Next; } + Commands->Enable_Stealth(o, stealth); + current = NULL; + } + } + x = x->Next(); + } } else { - current = current->Next; + while (x) + { + VehicleGameObj *o = x->Data(); + if (o) + { + const VehicleGameObjDef *d = &o->Get_Definition(); + if (!d->Is_Stealthed()) + { + Commands->Enable_Stealth(o, false); } } - else + x = x->Next(); + } + } + + SLNode *x2 = GameObjManager::SoldierGameObjList.Head(); + if (FirstNode) + { + while (x2) + { + SoldierGameObj *o = x2->Data(); + if (o) + { + bool stealth = false; + Gap_ListNode *current = FirstNode; + int test = Commands->Get_Player_Type(o); + const SoldierGameObjDef *d = &o->Get_Definition(); + if (!d->Is_Stealthed()) { + while (current) + { + if (current->active) + { + if (test == current->teamID) + { + Vector3 GenPos = Commands->Get_Position(Commands->Find_Object(current->unitID)); + Vector3 TargetPos = Commands->Get_Position(o); + float distance2 = (GenPos - TargetPos).Length2(); + if (distance2 <= current->range * current->range) + { + stealth = true; + } + } + } current = current->Next; } + Commands->Enable_Stealth(o, stealth); + current = NULL; + } + } + x2 = x2->Next(); + } } else { + while (x2) + { + SoldierGameObj *o = x2->Data(); + if (o) + { + const SoldierGameObjDef *d = &o->Get_Definition(); + if (!d->Is_Stealthed()) + { Commands->Enable_Stealth(o, false); - current = NULL; - tested = true; } } + x2 = x2->Next(); } } } + +SCRIPTS_API void Ranged_Gap_Effect(Gap_ListNode* FirstNode) +{ + SLNode *x = GameObjManager::VehicleGameObjList.Head(); + if (FirstNode) + { + while (x) + { + VehicleGameObj *o = x->Data(); + if (o) + { + bool stealth = false; + Gap_ListNode *current = FirstNode; + int test = Commands->Get_Player_Type(o); + const VehicleGameObjDef *d = &o->Get_Definition(); + if (!d->Is_Stealthed() && d->Get_Type() != VEHICLE_TYPE_SUB) + { + while (current) + { + if (current->active) + { + Vector3 GenPos = Commands->Get_Position(Commands->Find_Object(current->unitID)); + Vector3 TargetPos = Commands->Get_Position(o); + float distance2 = (GenPos - TargetPos).Length2(); + if (distance2 <= current->range * current->range) + { + if (test == current->teamID) + { + stealth = true; + } + } + } + current = current->Next; + } + Commands->Enable_Stealth(o, stealth); + current = NULL; + } + } x = x->Next(); } } @@ -440,41 +534,33 @@ { while (x) { - GameObject *o = x->Data(); + VehicleGameObj *o = x->Data(); if (o) { - SmartGameObjDef *d = (SmartGameObjDef *)Get_Definition(o); + const VehicleGameObjDef *d = &o->Get_Definition(); if (!d->Is_Stealthed()) { - if (Is_Vehicle(o) || Is_Soldier(o)) - { Commands->Enable_Stealth(o, false); } } - } x = x->Next(); } } -} -SCRIPTS_API void Ranged_Gap_Effect(Gap_ListNode* FirstNode) -{ - SLNode *x = GameObjManager::SmartGameObjList.Head(); + SLNode *x2 = GameObjManager::SoldierGameObjList.Head(); if (FirstNode) { - while (x) + while (x2) { - GameObject *o = x->Data(); + SoldierGameObj *o = x2->Data(); if (o) { bool stealth = false; bool blackout = false; Gap_ListNode *current = FirstNode; int test = Commands->Get_Player_Type(o); - SmartGameObjDef *d = (SmartGameObjDef *)Get_Definition(o); - if (!d->Is_Stealthed() && !Is_Script_Attached(o,"JFW_Submarine")) - { - if (Is_Vehicle(o) || Is_Soldier(o)) + const SoldierGameObjDef *d = &o->Get_Definition(); + if (!d->Is_Stealthed()) { while (current) { @@ -482,8 +568,8 @@ { Vector3 GenPos = Commands->Get_Position(Commands->Find_Object(current->unitID)); Vector3 TargetPos = Commands->Get_Position(o); - float distance = Commands->Get_Distance(GenPos, TargetPos); - if (distance <= current->range) + float distance2 = (GenPos - TargetPos).Length2(); + if (distance2 <= current->range * current->range) { if (test == current->teamID) { @@ -512,22 +598,19 @@ current = NULL; } } - } - x = x->Next(); + x2 = x2->Next(); } } else { - while (x) + while (x2) { - GameObject *o = x->Data(); + SoldierGameObj *o = x2->Data(); if (o) { - SmartGameObjDef *d = (SmartGameObjDef *)Get_Definition(o); + const SoldierGameObjDef *d = &o->Get_Definition(); if (!d->Is_Stealthed()) { - if (Is_Vehicle(o) || Is_Soldier(o)) - { Commands->Enable_Stealth(o, false); if (Commands->Is_A_Star(o)) { @@ -535,8 +618,7 @@ } } } - } - x = x->Next(); + x2 = x2->Next(); } } } diff -uwr sourceold/scripts/engine_tt.h source/scripts/engine_tt.h --- sourceold/scripts/engine_tt.h 2011-11-07 20:07:04.007812500 +0800 +++ source/scripts/engine_tt.h 2012-02-27 12:46:32.867640600 +0800 @@ -58,6 +58,8 @@ typedef void (*apjh) (PlayerJoin h); typedef void (*aplh) (PlayerLeave h); typedef void (*arch) (RadioHook h); +typedef void (*asdh) (StockDamageHook h); +typedef void (*atdh) (TtDamageHook h); typedef const char *(*gcmt) (); typedef double (*gttv) (); typedef void (*sit) (GameObject *obj,const char *texture); @@ -126,12 +128,15 @@ typedef const char * (*gcsh) (int clientId); typedef int (*gcmi) (); typedef const char * (*gm) (int index); +typedef const int (*gmc) (); typedef bool (*smx) (const char *map,int index); typedef void (*ggd) (HashTemplateClass &definitions); typedef SList *(*gpl) (); +typedef void (*uno) (NetworkObjectClass *obj); SCRIPTS_API extern gpl Get_Player_List; SCRIPTS_API extern gcmi Get_Current_Map_Index; SCRIPTS_API extern gm Get_Map; +SCRIPTS_API extern gmc Get_Map_Count; SCRIPTS_API extern smx Set_Map; SCRIPTS_API extern ggd Get_Game_Definitions; SCRIPTS_API extern ec Evict_Client; @@ -164,6 +169,8 @@ SCRIPTS_API extern allh AddThinkHook; SCRIPTS_API extern apjh AddPlayerJoinHook; SCRIPTS_API extern arch AddRadioHook; +SCRIPTS_API extern asdh AddStockDamageHook; +SCRIPTS_API extern atdh AddTtDamageHook; SCRIPTS_API extern aplh AddPlayerLeaveHook; SCRIPTS_API extern aph AddPowerupPurchaseHook; SCRIPTS_API extern aph AddVehiclePurchaseHook; @@ -226,6 +233,7 @@ SCRIPTS_API extern shn Send_HUD_Number; SCRIPTS_API extern geo GetExplosionObj; SCRIPTS_API extern seo SetExplosionObj; +SCRIPTS_API extern uno Update_Network_Object; SCRIPTS_API extern dod Do_Objectives_Dlg; SCRIPTS_API extern sl Set_Player_Limit; SCRIPTS_API extern gl Get_Player_Limit; @@ -249,7 +257,6 @@ SCRIPTS_API extern sbd Set_Special_Base_Destruction; SCRIPTS_API extern gpv Get_Client_Version; SCRIPTS_API extern gdw Get_Damage_Warhead; -SCRIPTS_API extern ssn Set_Objects_Filename; SCRIPTS_API extern addConnectionAcceptanceFilterType addConnectionAcceptanceFilter; SCRIPTS_API extern removeConnectionAcceptanceFilterType removeConnectionAcceptanceFilter; diff -uwr sourceold/scripts/engine_ttdef.h source/scripts/engine_ttdef.h --- sourceold/scripts/engine_ttdef.h 2011-10-11 21:53:21.451171800 +0800 +++ source/scripts/engine_ttdef.h 2012-02-18 09:50:34.036132800 +0800 @@ -14,7 +14,8 @@ #include "scripts.h" class BaseControllerClass; - +class PhysicalGameObj; +class AmmoDefinitionClass; enum TextMessageEnum { @@ -34,6 +35,8 @@ typedef void (*PurchaseMonHook) (BaseControllerClass *base,GameObject *purchaser,unsigned int cost,unsigned int preset,unsigned int purchaseret,const char *data); typedef bool (*RefillHook) (GameObject *purchaser); typedef bool (*RadioHook) (int PlayerType, int PlayerID, int AnnouncementID, int IconID, uint8 AnnouncementType); +typedef bool (*StockDamageHook) (PhysicalGameObj* damager, PhysicalGameObj* target, float damage, uint warheadId); +typedef bool (*TtDamageHook) (PhysicalGameObj* damager, PhysicalGameObj* target, const AmmoDefinitionClass* ammo, const char* bone); struct ObjectCreateHookStruct { ObjectCreateHook hook; diff -uwr sourceold/scripts/gmgame.cpp source/scripts/gmgame.cpp --- sourceold/scripts/gmgame.cpp 2011-11-07 20:41:54.807617100 +0800 +++ source/scripts/gmgame.cpp 2012-02-18 09:50:34.050781200 +0800 @@ -38,7 +38,6 @@ HashTemplateClass *> WeaponDrops; char *GDISpawnChar; char *NodSpawnChar; -char *ObjectsFilename; DynamicVectorClass DisablePresets; DynamicVectorClass MapDisablePresets; HashTemplateClass VehicleWreckages; @@ -102,21 +101,6 @@ { return newstr("None"); } - if (Is_C4(obj)) - { - if (Get_C4_Mode(obj) == 1) - { - return newstr("Remote C4"); - } - else if (Get_C4_Mode(obj) == 3) - { - return newstr("Proximity C4"); - } - else if (Get_C4_Mode(obj) == 2) - { - return newstr("Timed C4"); - } - } const char *preset = Get_Translated_Preset_Name_Ini(obj); StringClass preset2 = preset; if (Is_Building(obj) || Is_DecorationPhys(obj) || Is_Harvester_Preset(obj)) @@ -136,6 +120,21 @@ SCRIPTS_API const char *Get_Translated_Preset_Name_Ini(GameObject *obj) { + if (Is_C4(obj)) + { + if (Get_C4_Mode(obj) == 1) + { + return newstr("Remote C4"); + } + else if (Get_C4_Mode(obj) == 3) + { + return newstr("Proximity C4"); + } + else if (Get_C4_Mode(obj) == 2) + { + return newstr("Timed C4"); + } + } if (!Translation_Overrides.Get(Commands->Get_Preset_Name(obj),0).Is_Empty()) { return newstr(Translation_Overrides.Get(Commands->Get_Preset_Name(obj),0).Peek_Buffer()); @@ -239,6 +238,8 @@ } AddChatHook(ChatHook); AddRadioHook(RadioHook); + AddStockDamageHook(StockDamageHook); + AddTtDamageHook(TtDamageHook); ObjectCreateHookStruct *h = new ObjectCreateHookStruct; h->data = 0; h->hook = ObjectCreateHook; @@ -436,6 +437,30 @@ } } +bool SSGMGameManager::StockDamageHook(PhysicalGameObj* damager, PhysicalGameObj* target, float damage, uint warheadId) +{ + for (int i = 0;i < RegisteredEvents[EVENT_STOCK_DAMAGE_HOOK].Count();i++) + { + if (!RegisteredEvents[EVENT_STOCK_DAMAGE_HOOK][i]->OnStockDamage(damager, target, damage, warheadId)) + { + return false; + } + } + return true; +} + +bool SSGMGameManager::TtDamageHook(PhysicalGameObj* damager, PhysicalGameObj* target, const AmmoDefinitionClass* ammo, const char* bone) +{ + for (int i = 0;i < RegisteredEvents[EVENT_TT_DAMAGE_HOOK].Count();i++) + { + if (!RegisteredEvents[EVENT_TT_DAMAGE_HOOK][i]->OnTtDamage(damager, target, ammo, bone)) + { + return false; + } + } + return true; +} + void SSGMGameManager::FreeMapData() { DisablePresets.Clear(); @@ -462,7 +487,6 @@ VehicleWreckages.Remove_All(); delete[] GDISpawnChar; delete[] NodSpawnChar; - delete[] ObjectsFilename; for (int i = 0;i < RegisteredEvents[EVENT_GLOBAL_INI].Count();i++) { RegisteredEvents[EVENT_GLOBAL_INI][i]->OnFreeData(); @@ -488,13 +512,10 @@ { StringClass GDISpawnCharx; StringClass NodSpawnCharx; - StringClass ObjectsFilenamex; SSGMIni->Get_String(GDISpawnCharx,"General","GDISpawnChar","CnC_GDI_MiniGunner_0"); SSGMIni->Get_String(NodSpawnCharx,"General","NodSpawnChar","CnC_Nod_Minigunner_0"); - SSGMIni->Get_String(ObjectsFilenamex,"General","ObjectsFilename","Objects.ddb"); GDISpawnChar = newstr(GDISpawnCharx); NodSpawnChar = newstr(NodSpawnCharx); - ObjectsFilename = newstr(ObjectsFilenamex); InvincibleBuildings = SSGMIni->Get_Bool("General","InvincibleBuildings",false); ForceTeam = SSGMIni->Get_Int("General","ForceTeam",-1); RefillLimit = SSGMIni->Get_Int("General","RefillLimit",0); @@ -594,9 +615,7 @@ { GDISpawnChar = newstr("CnC_GDI_MiniGunner_0"); NodSpawnChar = newstr("CnC_Nod_MiniGunner_0"); - ObjectsFilename = newstr("Objects.ddb"); } - Set_Objects_Filename(ObjectsFilename); if ( freeIni ) Release_INI(SSGMIni); } diff -uwr sourceold/scripts/gmgame.h source/scripts/gmgame.h --- sourceold/scripts/gmgame.h 2011-10-11 21:52:45.681640600 +0800 +++ source/scripts/gmgame.h 2012-02-18 09:50:34.061523400 +0800 @@ -34,6 +34,8 @@ static void FreeData(); static void FreeMapData(); static void ThinkHook(); + static bool StockDamageHook(PhysicalGameObj* damager, PhysicalGameObj* target, float damage, uint warheadId); + static bool TtDamageHook(PhysicalGameObj* damager, PhysicalGameObj* target, const AmmoDefinitionClass* ammo, const char* bone); }; class SSGM_Random_Weather : public ScriptImpClass { diff -uwr sourceold/scripts/gmplugin.h source/scripts/gmplugin.h --- sourceold/scripts/gmplugin.h 2011-10-11 21:52:40.915039000 +0800 +++ source/scripts/gmplugin.h 2012-02-18 09:50:34.054687500 +0800 @@ -30,6 +30,8 @@ EVENT_CHARACTER_PURCHASE_HOOK, EVENT_THINK_HOOK, EVENT_RADIO_HOOK, + EVENT_STOCK_DAMAGE_HOOK, + EVENT_TT_DAMAGE_HOOK, EVENT_COUNT }; @@ -53,6 +55,8 @@ virtual int OnCharacterPurchase(BaseControllerClass *base,GameObject *purchaser,unsigned int cost,unsigned int preset,const char *data) {return -1;}; //called on character purchase virtual void OnThink() {}; //called once per frame virtual bool OnRadioCommand(int PlayerType, int PlayerID, int AnnouncementID, int IconID, uint8 AnnouncementType) {return true;} //called on radio command + virtual bool OnStockDamage(PhysicalGameObj* damager, PhysicalGameObj* target, float damage, uint warheadId) { return true; } //called on damage from clients with version <4.0 + virtual bool OnTtDamage(PhysicalGameObj* damager, PhysicalGameObj* target, const AmmoDefinitionClass* ammo, const char* bone) { return true; } //called on damage from clients with version >=4.0 }; typedef Plugin *(*Plugin_Init_Type) (); diff -uwr sourceold/scripts/gmvehicle.cpp source/scripts/gmvehicle.cpp --- sourceold/scripts/gmvehicle.cpp 2011-10-11 23:04:32.766601500 +0800 +++ source/scripts/gmvehicle.cpp 2012-02-17 17:47:52.633789000 +0800 @@ -491,6 +491,8 @@ Commands->Start_Timer(obj,this,WreckDestroySelfTime,1001);//destroy the wreck after timer expires Set_Skin(obj,"Blamo");//needed to avoid destruction of the wreck on vehicle Killed Commands->Start_Timer(obj,this,2.0f,1000);//set skin to CNCVehicleHeavy again + Set_Max_Health(obj,Commands->Get_Health(obj) + Commands->Get_Shield_Strength(obj)); + Set_Max_Shield_Strength(obj,0); Commands->Set_Health(obj,100); Commands->Disable_Physical_Collisions(obj); Commands->Set_Player_Type(obj,-2); diff -uwr sourceold/scripts/iran_scripts.cpp source/scripts/iran_scripts.cpp --- sourceold/scripts/iran_scripts.cpp 2011-11-22 14:49:49.201171800 +0800 +++ source/scripts/iran_scripts.cpp 2012-01-05 21:21:34.000000000 +0800 @@ -34,6 +34,7 @@ { Commands->Select_Weapon(checkplayerobj,""); Commands->Select_Weapon(checkplayerobj,"CnC_Weapon_NukeBeacon_Player"); + } Commands->Start_Timer(obj,this,0.5,number); } @@ -76,7 +77,13 @@ void Iran_Vehicle_All_Kill_Zone::Entered(GameObject *obj,GameObject *enter) { - if (Is_Vehicle(enter)) + + if (stristr(Commands->Get_Preset_Name(enter),"Destroyed")) + { + saved = Commands->Get_ID(enter); + Commands->Start_Timer(obj,this,2.5f,1); + } + else if (Is_Vehicle(enter)) { int type = Commands->Get_Player_Type(enter); if ( type < 0 || type > 1 ) @@ -98,14 +105,27 @@ void Iran_All_Kill_Zone::Entered(GameObject *obj,GameObject *enter) { + if (stristr(Commands->Get_Preset_Name(enter),"Destroyed")) + { + saved = Commands->Get_ID(enter); + Commands->Start_Timer(obj,this,2.5f,1); + } + + else if (enter) + { int type = Commands->Get_Player_Type(enter); if ( type < 0 || type > 1 ) { return; } + if (Get_Fly_Mode(enter)) + { + return; + } saved = Commands->Get_ID(enter); Commands->Start_Timer(obj,this,Get_Float_Parameter("Time"),1); } +} void Iran_All_Kill_Zone::Timer_Expired(GameObject *obj,int number) { @@ -122,6 +142,11 @@ { return; } + + if (Get_Fly_Mode(enter)) + { + return; + } saved = Commands->Get_ID(enter); Commands->Start_Timer(obj,this,Get_Float_Parameter("Time"),1); } @@ -136,15 +161,16 @@ void Iran_Vehicle_Ground_Kill_Zone::Entered(GameObject *obj,GameObject *enter) { - if (Is_Vehicle(enter)) + if (stristr(Commands->Get_Preset_Name(enter),"_Destroyed")) { - if (Get_Vehicle_Mode(enter) != VEHICLE_TYPE_FLYING) + saved = Commands->Get_ID(enter); + Commands->Start_Timer(obj,this,2.5f,1); + } + + else if (Is_Vehicle(enter)) { - int type = Commands->Get_Player_Type(enter); - if ( type < 0 || type > 1 ) + if (Get_Vehicle_Mode(enter) != VEHICLE_TYPE_FLYING) { - return; - } saved = Commands->Get_ID(enter); Commands->Start_Timer(obj,this,Get_Float_Parameter("Time"),1); } @@ -184,9 +210,48 @@ } } +void Iran_Invisible_Blocker::Created(GameObject *obj) +{ + Vector3 Position = Commands->Get_Position(obj); + float Facing = Commands->Get_Facing(obj); + + Commands->Destroy_Object(obj); + + GameObject* Blocker = Commands->Create_Object("GDI_Ceiling_Gun_AGT", Position); + Commands->Set_Facing(Blocker, Facing); + Commands->Set_Model(Blocker,"dsp_torture_wal"); + + Commands->Set_Player_Type(Blocker, -2); + + Commands->Set_Is_Visible(Blocker, false); + Commands->Set_Is_Rendered(Blocker, false); + Commands->Display_Health_Bar(Blocker, false); +} + +void Iran_Invisible_Blocker_Visible::Created(GameObject *obj) +{ + Vector3 Position = Commands->Get_Position(obj); + float Facing = Commands->Get_Facing(obj); + + Commands->Destroy_Object(obj); + + GameObject* Blocker = Commands->Create_Object("GDI_Ceiling_Gun_AGT", Position); + Commands->Set_Facing(Blocker, Facing); + Commands->Set_Model(Blocker,"dsp_torture_wal"); + + Commands->Set_Player_Type(Blocker, -2); + +} + ScriptRegistrant Iran_Beaconing_Prevention_Zone_Registrant("Iran_Beaconing_Prevention_Zone", ""); -ScriptRegistrant Iran_Vehicle_All_Kill_Zone_Registrant("Iran_Vehicle_All_Kill_Zone", "Time:float"); -ScriptRegistrant Iran_All_Kill_Zone_Registrant("Iran_All_Kill_Zone", "Time:float"); + ScriptRegistrant Iran_Star_Kill_Zone_Registrant("Iran_Star_Kill_Zone", "Time:float"); +ScriptRegistrant Iran_All_Kill_Zone_Registrant("Iran_All_Kill_Zone", "Time:float"); + +ScriptRegistrant Iran_Vehicle_All_Kill_Zone_Registrant("Iran_Vehicle_All_Kill_Zone", "Time:float"); ScriptRegistrant Iran_Vehicle_Ground_Kill_Zone_Registrant("Iran_Vehicle_Ground_Kill_Zone", "Time:float"); ScriptRegistrant Iran_Vehicle_Flying_Kill_Zone_Registrant("Iran_Vehicle_Flying_Kill_Zone", "Time:float"); + +ScriptRegistrant Iran_Invisible_Blocker_Registrant("Iran_Invisible_Blocker", ""); +ScriptRegistrant Iran_Invisible_Blocker_Visible_Registrant("Iran_Invisible_Blocker_Visible", ""); + diff -uwr sourceold/scripts/iran_scripts.h source/scripts/iran_scripts.h --- sourceold/scripts/iran_scripts.h 2011-11-22 14:49:49.208007800 +0800 +++ source/scripts/iran_scripts.h 2012-01-05 21:16:28.000000000 +0800 @@ -49,3 +49,14 @@ void Entered(GameObject *obj,GameObject *enter); void Timer_Expired(GameObject *obj,int number); }; + +// Destroys the object it's attached to and crates an invisible laser fence blocker +// at the same position and facing +class Iran_Invisible_Blocker : public ScriptImpClass { + void Created(GameObject *obj); +}; + +// Same as above but shows the laser fence, for placing purposes +class Iran_Invisible_Blocker_Visible : public ScriptImpClass { + void Created(GameObject *obj); +}; \ No newline at end of file diff -uwr sourceold/scripts/jfwcine.cpp source/scripts/jfwcine.cpp --- sourceold/scripts/jfwcine.cpp 2011-10-11 23:05:22.311523400 +0800 +++ source/scripts/jfwcine.cpp 2012-02-13 19:12:33.892000000 +0800 @@ -1338,6 +1338,7 @@ void JFW_Cinematic_Kill_Object::Created(GameObject *obj) { Commands->Apply_Damage(obj,10000,"BlamoKiller",0); + Destroy_Script(); } ScriptRegistrant JFW_Zone_Play_Cinematic_Registrant("JFW_Zone_Play_Cinematic","Script_Name:string,location:vector3,Player_Type:int,Facing:float"); diff -uwr sourceold/scripts/jfwcust.cpp source/scripts/jfwcust.cpp --- sourceold/scripts/jfwcust.cpp 2011-12-01 12:26:58.960937500 +0800 +++ source/scripts/jfwcust.cpp 2012-02-13 19:32:56.754304700 +0800 @@ -72,6 +72,7 @@ param = Get_Int_Parameter("Param"); object = Commands->Find_Object(ID); Commands->Send_Custom_Event(obj,object,type,param,0); + Destroy_Script(); } void JFW_Custom_Destroy_Building::Custom(GameObject *obj,int type,int param,GameObject *sender) @@ -255,6 +256,7 @@ int msg = Get_Int_Parameter("Message"); int ID = Get_Int_Parameter("ID"); Commands->Send_Custom_Event(obj,Commands->Find_Object(ID),msg,0,0); + Destroy_Script(); } void JFW_Teleport_Custom::Custom(GameObject *obj,int type,int param,GameObject *sender) @@ -389,6 +391,7 @@ void JFW_Created_Send_Custom::Created(GameObject *obj) { Commands->Send_Custom_Event(obj,Commands->Find_Object(Get_Int_Parameter("ID")),Get_Int_Parameter("Message"),0,0); + Destroy_Script(); } void JFW_Damaged_Send_Custom::Damaged(GameObject *obj,GameObject *damager,float amount) @@ -1179,6 +1182,7 @@ param = Commands->Get_ID(obj); object = Commands->Find_Object(ID); Commands->Send_Custom_Event(obj,object,type,param,0); + Destroy_Script(); } void JFW_Death_Send_Custom_Driver_ID::Killed(GameObject *obj,GameObject *killer) @@ -1192,6 +1196,7 @@ param = DriverID; object = Commands->Find_Object(ID); Commands->Send_Custom_Event(obj,object,type,param,0); + Destroy_Script(); } void JFW_Death_Send_Custom_Driver_ID::Created(GameObject *obj) @@ -1592,6 +1597,7 @@ { int msg = Get_Int_Parameter("Message"); Commands->Send_Custom_Event(obj,obj,msg,0,0); + Destroy_Script(); } ScriptRegistrant JFW_Send_Custom_Distance_Objects_Timer_Registrant("JFW_Send_Custom_Distance_Objects_Timer","Distance:float,Message:int,Time:float,TimerNum:int,Player_Type:int"); diff -uwr sourceold/scripts/jfwdmg.cpp source/scripts/jfwdmg.cpp --- sourceold/scripts/jfwdmg.cpp 2011-10-11 23:05:17.557617100 +0800 +++ source/scripts/jfwdmg.cpp 2012-02-13 19:32:56.397859400 +0800 @@ -30,6 +30,7 @@ spawn_location.Z = spawn_location.Z + f; object = Commands->Create_Object (c,spawn_location); Commands->Set_Facing(object,facing); + Destroy_Script(); } void JFW_Timer_Destroy_Building::Created(GameObject *obj) @@ -77,6 +78,7 @@ c = Get_Parameter("Explosion"); v = Commands->Get_Position(obj); Commands->Create_Explosion (c,v,0); + Destroy_Script(); } void JFW_Give_Points_On_Death::Killed(GameObject *obj,GameObject *killer) @@ -88,6 +90,7 @@ return; } Commands->Give_Points(killer,Get_Float_Parameter("Points"),Get_Int_Parameter("Whole_Team")); + Destroy_Script(); } void JFW_Armour_Regen::Created(GameObject *obj) @@ -157,6 +160,7 @@ void JFW_Death_Destroy_Object::Killed(GameObject *obj,GameObject *killer) { Commands->Destroy_Object(Commands->Find_Object(Get_Int_Parameter("ID"))); + Destroy_Script(); } void JFW_Invulnerability_Timer::Created(GameObject *obj) @@ -227,6 +231,7 @@ object = Commands->Create_Object (c,spawn_location); Commands->Set_Facing(object,facing); } + Destroy_Script(); } void JFW_Spawn_Object_Death_Enable::Register_Auto_Save_Variables() @@ -252,6 +257,7 @@ object = Commands->Create_Object (c,spawn_location); Commands->Set_Facing(object,facing); } + Destroy_Script(); } void JFW_Spawn_Object_Death_Enable_Random::Created(GameObject *obj) @@ -292,6 +298,7 @@ Commands->Set_Facing(object,facing); } } + Destroy_Script(); } void JFW_Spawn_Object_Death_Enable_Random::Register_Auto_Save_Variables() @@ -629,6 +636,7 @@ c = Get_Parameter("Explosion"); v = Commands->Get_Position(obj); Commands->Create_Explosion (c,v,Commands->Find_Object(DriverID)); + Destroy_Script(); } void JFW_Random_DriverDeath::Created(GameObject *obj) @@ -849,6 +857,7 @@ object = Commands->Create_Object (c,spawn_location); Commands->Set_Facing(object,facing); } + Destroy_Script(); } void JFW_Spawn_Object_Death_Team::Killed(GameObject *obj,GameObject *killer) @@ -872,6 +881,7 @@ spawn_location.Z = spawn_location.Z + f; object = Commands->Create_Object (c,spawn_location); Commands->Set_Facing(object,facing); + Destroy_Script(); } void JFW_Pilot_Repair::Created(GameObject *obj) @@ -906,6 +916,7 @@ void JFW_Damage_Occupants_Death::Killed(GameObject *obj,GameObject *killer) { Damage_Occupants(obj,Get_Float_Parameter("Damage"),Get_Parameter("Warhead")); + Destroy_Script(); } void JFW_Engineer_Target_2::Register_Auto_Save_Variables() @@ -1212,6 +1223,7 @@ { Commands->Send_Custom_Event(obj,Find_Object_With_Script("JFW_Kill_Message_Display"),Get_Int_Parameter("Message"),0,0); } + Destroy_Script(); } void JFW_C4_Explode::Created(GameObject *obj) @@ -1221,6 +1233,7 @@ { Commands->Create_Explosion(Get_Parameter("Explosion"),Commands->Get_Position(obj),0); } + Destroy_Script(); } void JFW_Beacon_Building::Created(GameObject *obj) diff -uwr sourceold/scripts/jfwgame.cpp source/scripts/jfwgame.cpp --- sourceold/scripts/jfwgame.cpp 2011-10-22 20:22:09.983398400 +0800 +++ source/scripts/jfwgame.cpp 2012-02-13 19:32:56.856843700 +0800 @@ -1030,6 +1030,7 @@ void JFW_Flying_Infantry::Created(GameObject *obj) { Toggle_Fly_Mode(obj); + Destroy_Script(); } void JFW_Flying_Infantry_Custom::Custom(GameObject *obj,int type,int param,GameObject *sender) @@ -2748,6 +2749,7 @@ { Commands->Create_2D_Sound(Get_Parameter("Sound")); Send_Message(Get_Int_Parameter("Red"),Get_Int_Parameter("Green"),Get_Int_Parameter("Blue"),Get_Parameter("Message")); + Destroy_Script(); } void JFW_Message_Send_Death_Team::Killed(GameObject *obj, GameObject *killer) @@ -2755,6 +2757,7 @@ int team = Get_Int_Parameter("Player_Type"); Create_2D_Sound_Team(Get_Parameter("Sound"),team); Send_Message_Team(team,Get_Int_Parameter("Red"),Get_Int_Parameter("Green"),Get_Int_Parameter("Blue"),Get_Parameter("Message")); + Destroy_Script(); } void JFW_Message_Send_Custom::Custom(GameObject *obj,int type,int param,GameObject *sender) @@ -2796,6 +2799,7 @@ void JFW_Spy_Switch_Team::Created(GameObject *obj) { Change_Team_2(obj,PTTEAM(Commands->Get_Player_Type(obj))); + Commands->Set_Is_Visible(obj,false); } void JFW_Spy_Switch_Team::Killed(GameObject *obj, GameObject *killer) @@ -2857,6 +2861,46 @@ } } +void JFW_Spy_Vehicle_Ignore_New::Created(GameObject *obj) +{ + spycount = 0; + nonspycount = 0; +} + +void JFW_Spy_Vehicle_Ignore_New::Custom(GameObject *obj,int type,int param,GameObject *sender) +{ + if (type == CUSTOM_EVENT_VEHICLE_ENTERED) + { + if (!Is_Spy(sender)) + { + nonspycount++; + } + else + { + spycount++; + } + } + if (type == CUSTOM_EVENT_VEHICLE_EXITED) + { + if (!Is_Spy(sender)) + { + nonspycount--; + } + else + { + spycount--; + } + } + if ((spycount) && (!nonspycount)) + { + Set_Vehicle_Is_Visible(obj,false); + } + else + { + Set_Vehicle_Is_Visible(obj,true); + } +} + void JFW_Message_Send_Zone_Player_Vehicle::Entered(GameObject *obj,GameObject *enterer) { int team = Get_Int_Parameter("Player_Type"); @@ -3142,6 +3186,7 @@ ScriptRegistrant JFW_Message_Send_Custom_Team_Registrant("JFW_Message_Send_Custom_Team","Player_Type:int,Display_Message:string,Red:int,Blue:int,Green:int,Sound:string,Message:int,Delete:int"); ScriptRegistrant JFW_Spy_Switch_Team_Registrant("JFW_Spy_Switch_Team",""); ScriptRegistrant JFW_Spy_Vehicle_Ignore_Registrant("JFW_Spy_Vehicle_Ignore","Spy_Script:string"); +ScriptRegistrant JFW_Spy_Vehicle_Ignore_New_Registrant("JFW_Spy_Vehicle_Ignore_New",""); ScriptRegistrant JFW_Message_Send_Zone_Player_Vehicle_Registrant("JFW_Message_Send_Zone_Player_Vehicle","Player_Type:int,Message:string,Red:int,Blue:int,Green:int,Sound:string,Delete:int"); ScriptRegistrant JFW_Water_Level_Registrant("JFW_Water_Level","Message:int"); ScriptRegistrant JFW_Submarine_Registrant("JFW_Submarine","Message:int,Submerge_Armor:string,Surface_Armor:string,Block_Weapon:int,Ping_Sound:string,Surface_Sound:string,Ping_Time:float,Surface_Z_Offset:float,Dive_Z_Offset:float,Powerup:string,Weapon:string"); diff -uwr sourceold/scripts/jfwgame.h source/scripts/jfwgame.h --- sourceold/scripts/jfwgame.h 2011-10-14 22:27:32.040039000 +0800 +++ source/scripts/jfwgame.h 2012-02-13 18:26:32.682039000 +0800 @@ -388,6 +388,13 @@ int nonspycount; }; +class JFW_Spy_Vehicle_Ignore_New : public ScriptImpClass { + void Created(GameObject *obj); + void Custom(GameObject *obj,int type,int param,GameObject *sender); + int spycount; + int nonspycount; +}; + class JFW_Message_Send_Zone_Player_Vehicle : public ScriptImpClass { void Entered(GameObject *obj,GameObject *enterer); }; diff -uwr sourceold/scripts/jfwmisc.cpp source/scripts/jfwmisc.cpp --- sourceold/scripts/jfwmisc.cpp 2011-11-22 15:22:13.707031200 +0800 +++ source/scripts/jfwmisc.cpp 2012-02-13 19:32:56.703523400 +0800 @@ -256,6 +256,7 @@ params.AttackActive = false; params.AttackCheckBlocked = false; Commands->Action_Goto(obj,params); + Destroy_Script(); } void JFW_Follow_Waypath_Zone::Entered(GameObject *obj,GameObject *enterer) @@ -436,6 +437,7 @@ char *anim = new char[(strlen(model) * 2) + 2]; sprintf(anim,"%s.%s",model,model); Commands->Set_Animation(obj,anim,false,0,0,-1,false); + Destroy_Script(); } void JFW_Play_Animation_Destroy_Object::Animation_Complete(GameObject *obj,const char *animation_name) @@ -620,6 +622,7 @@ params.Set_Basic(this,100,2); params.Set_Movement(Commands->Find_Object(Get_Int_Parameter("ID")),Get_Float_Parameter("Speed"),Get_Float_Parameter("Arrivedistance")); Commands->Action_Goto(obj,params); + Destroy_Script(); } void JFW_Scope::Created(GameObject *obj) @@ -655,6 +658,7 @@ void JFW_BHS_DLL::Created(GameObject *obj) { Console_Output("TT.DLL is required for this map"); + Destroy_Script(); } void JFW_Screen_Fade_Custom_Timer::Custom(GameObject *obj,int type,int param,GameObject *sender) @@ -738,6 +742,7 @@ { Set_GDI_Soldier_Name(Get_Parameter("Character")); } + Destroy_Script(); } void JFW_Show_Info_Texture::Created(GameObject *obj) @@ -757,16 +762,19 @@ void JFW_Wireframe_Mode::Created(GameObject *obj) { Set_Wireframe_Mode(Get_Int_Parameter("Mode")); + Destroy_Script(); } void JFW_PT_Hide::Created(GameObject *obj) { Hide_Preset_By_Name(Get_Int_Parameter("Player_Type"),Get_Parameter("Preset"),true); + Destroy_Script(); } void JFW_PT_Hide_Death::Killed(GameObject *obj,GameObject *killer) { Hide_Preset_By_Name(Get_Int_Parameter("Player_Type"),Get_Parameter("Preset"),true); + Destroy_Script(); } void JFW_PT_Hide_Custom::Custom(GameObject *obj,int type,int param,GameObject *sender) @@ -785,16 +793,19 @@ void JFW_PT_Hide_Timer::Timer_Expired(GameObject *obj,int number) { Hide_Preset_By_Name(Get_Int_Parameter("Player_Type"),Get_Parameter("Preset"),true); + Destroy_Script(); } void JFW_PT_Show::Created(GameObject *obj) { Hide_Preset_By_Name(Get_Int_Parameter("Player_Type"),Get_Parameter("Preset"),false); + Destroy_Script(); } void JFW_PT_Show_Death::Killed(GameObject *obj,GameObject *killer) { Hide_Preset_By_Name(Get_Int_Parameter("Player_Type"),Get_Parameter("Preset"),false); + Destroy_Script(); } void JFW_PT_Show_Custom::Custom(GameObject *obj,int type,int param,GameObject *sender) @@ -813,11 +824,13 @@ void JFW_PT_Show_Timer::Timer_Expired(GameObject *obj,int number) { Hide_Preset_By_Name(Get_Int_Parameter("Player_Type"),Get_Parameter("Preset"),false); + Destroy_Script(); } void JFW_Change_Radar_Map::Created(GameObject *obj) { Change_Radar_Map(Get_Float_Parameter("Scale"),Get_Float_Parameter("OffsetX"),Get_Float_Parameter("OffsetY"),Get_Parameter("Texture")); + Destroy_Script(); } void JFW_Goto_Player_Timer::Created(GameObject *obj) @@ -906,6 +919,7 @@ { Enable_Base_Radar(Get_Object_Type(obj),false); } + Destroy_Script(); } void JFW_Game_Hint_Soldier::Created(GameObject *obj) @@ -979,6 +993,7 @@ void JFW_Moon_Is_Earth::Created(GameObject *obj) { Set_Moon_Is_Earth(true); + Destroy_Script(); } void JFW_Points_Custom::Custom(GameObject *obj,int type,int param,GameObject *sender) @@ -1410,6 +1425,7 @@ void JFW_Radar_Disable_Death::Killed(GameObject *obj,GameObject *killer) { Enable_Base_Radar(Get_Object_Type(obj),false); + Destroy_Script(); } void JFW_Cyborg_Reaper::Created(GameObject *obj) @@ -1463,6 +1479,7 @@ void JFW_Death_Send_Custom_Self::Killed(GameObject *obj,GameObject *killer) { Commands->Send_Custom_Event(obj,obj,Get_Int_Parameter("Message"),0,0); + Destroy_Script(); } void JFW_Hunter_Seeker::Created(GameObject *obj) diff -uwr sourceold/scripts/jfwpoke.cpp source/scripts/jfwpoke.cpp --- sourceold/scripts/jfwpoke.cpp 2011-10-11 23:05:08.540039000 +0800 +++ source/scripts/jfwpoke.cpp 2012-02-13 19:32:56.450593700 +0800 @@ -84,6 +84,7 @@ void JFW_Pokeable_Item::Created(GameObject *obj) { Commands->Enable_HUD_Pokable_Indicator(obj,1); + Destroy_Script(); } void JFW_Preset_Buy_Poke::Poked(GameObject *obj,GameObject *poker) diff -uwr sourceold/scripts/jfwpow.cpp source/scripts/jfwpow.cpp --- sourceold/scripts/jfwpow.cpp 2011-12-01 12:52:17.931640600 +0800 +++ source/scripts/jfwpow.cpp 2012-02-13 19:12:33.689851500 +0800 @@ -101,6 +101,7 @@ void JFW_Give_Powerup_Create::Created(GameObject *obj) { Commands->Give_PowerUp(obj,Get_Parameter("Powerup"),false); + Destroy_Script(); } void JFW_Change_Character_Powerup::Custom(GameObject *obj,int type,int param,GameObject *sender) @@ -129,6 +130,7 @@ void JFW_Clear_Money_Create::Created(GameObject *obj) { Commands->Give_Money(obj,-Commands->Get_Money(obj),false); + Destroy_Script(); } void JFW_Give_Money::Custom(GameObject *obj,int type,int param,GameObject *sender) diff -uwr sourceold/scripts/jfwscr.cpp source/scripts/jfwscr.cpp --- sourceold/scripts/jfwscr.cpp 2011-10-11 23:05:07.345703100 +0800 +++ source/scripts/jfwscr.cpp 2012-02-13 19:12:33.589265600 +0800 @@ -246,6 +246,7 @@ void JFW_Remove_Script_Death::Killed(GameObject *obj,GameObject *killer) { Remove_Script(obj,Get_Parameter("Script")); + Destroy_Script(); } void JFW_Attach_Script_Custom::Custom(GameObject *obj,int type,int param,GameObject *sender) @@ -376,6 +377,7 @@ } Attach_Script_Preset(script,params,Get_Parameter("Preset"),Get_Int_Parameter("Player_Type")); delete[] params; + Destroy_Script(); } void JFW_Attach_Script_Building_Startup::Created(GameObject *obj) @@ -398,6 +400,7 @@ } Attach_Script_Building(script,params,Get_Int_Parameter("Player_Type")); delete[] params; + Destroy_Script(); } void JFW_Attach_Script_Type_Startup::Created(GameObject *obj) @@ -420,6 +423,7 @@ } Attach_Script_Type(script,params,Get_Int_Parameter("Type"),Get_Int_Parameter("Player_Type")); delete[] params; + Destroy_Script(); } void JFW_Attach_Script_Collector::Custom(GameObject *obj,int type,int param,GameObject *sender) diff -uwr sourceold/scripts/jfwsnd.cpp source/scripts/jfwsnd.cpp --- sourceold/scripts/jfwsnd.cpp 2011-10-11 23:05:06.098632800 +0800 +++ source/scripts/jfwsnd.cpp 2012-02-13 19:12:33.200593700 +0800 @@ -344,6 +344,7 @@ void JFW_2D_Sound_Startup::Created(GameObject *obj) { Commands->Create_2D_Sound(Get_Parameter("Sound")); + Destroy_Script(); } void JFW_Time_Remaining_Sounds::Created(GameObject *obj) @@ -406,6 +407,7 @@ void JFW_2D_Sound_Death_Team::Killed(GameObject *obj,GameObject *killer) { Create_2D_Sound_Team(Get_Parameter("Sound"),Get_Object_Type(obj)); + Destroy_Script(); } void JFW_Vehicle_Full_Sound::Created(GameObject *obj) @@ -482,6 +484,7 @@ { Commands->Create_2D_Sound(Get_Parameter("Sound")); } + Destroy_Script(); } void JFW_C4_Sound_2::Created(GameObject *obj) @@ -501,6 +504,7 @@ { Commands->Create_2D_Sound(Get_Parameter("Sound")); } + Destroy_Script(); } ScriptRegistrant JFW_Set_Background_Music_On_Custom_Registrant("JFW_Set_Background_Music_On_Custom","Message:int,Music:string"); diff -uwr sourceold/scripts/jfwveh.cpp source/scripts/jfwveh.cpp --- sourceold/scripts/jfwveh.cpp 2011-12-01 12:47:58.142578100 +0800 +++ source/scripts/jfwveh.cpp 2012-02-23 12:06:21.760742100 +0800 @@ -100,6 +100,7 @@ params.Set_Basic(this,100,777); params.Set_Movement(Commands->Get_A_Star(Commands->Get_Position(obj)),Get_Float_Parameter("Speed"),Get_Float_Parameter("Arrive_Distance")); Commands->Action_Goto(obj,params); + Destroy_Script(); } void JFW_Vechicle_Animation::Timer_Expired(GameObject *obj,int number) @@ -144,6 +145,7 @@ { if (!_stricmp(animation_name,Get_Parameter("Animation"))) { + obj->As_PhysicalGameObj()->Clear_Animation(); const char *subobject = Get_Parameter("Subobject"); if (!_stricmp(subobject,"0")) { @@ -180,7 +182,7 @@ if (type == CUSTOM_EVENT_VEHICLE_ENTERED) { Vector3 position = Commands->Get_Bone_Position(obj,Get_Parameter("BoneName")); - GameObject *object = Commands->Create_Object("Generic_Cinematic",position); + GameObject *object = Commands->Create_Object("Invisible_Object",position); Commands->Attach_To_Object_Bone(object,obj,Get_Parameter("BoneName")); Commands->Set_Model(object,Get_Parameter("ModelName")); modelid = Commands->Get_ID(object); @@ -228,7 +230,7 @@ if (!modelid1) { Vector3 position = Commands->Get_Bone_Position(obj,Get_Parameter("BoneName1")); - GameObject *object = Commands->Create_Object("Generic_Cinematic",position); + GameObject *object = Commands->Create_Object("Invisible_Object",position); Commands->Attach_To_Object_Bone(object,obj,Get_Parameter("BoneName1")); Commands->Set_Model(object,Get_Parameter("ModelName1")); modelid1 = Commands->Get_ID(object); @@ -249,7 +251,7 @@ if (!modelid2) { Vector3 position = Commands->Get_Bone_Position(obj,Get_Parameter("BoneName2")); - GameObject *object = Commands->Create_Object("Generic_Cinematic",position); + GameObject *object = Commands->Create_Object("Invisible_Object",position); Commands->Attach_To_Object_Bone(object,obj,Get_Parameter("BoneName2")); Commands->Set_Model(object,Get_Parameter("ModelName2")); modelid2 = Commands->Get_ID(object); @@ -321,7 +323,7 @@ //End Code added by NeoSaber Vector3 position = Commands->Get_Bone_Position(obj,Get_Parameter("BoneName")); - GameObject *object = Commands->Create_Object("Generic_Cinematic",position); + GameObject *object = Commands->Create_Object("Invisible_Object",position); Commands->Attach_To_Object_Bone(object,obj,Get_Parameter("BoneName")); Commands->Send_Custom_Event(obj,sender,Get_Int_Parameter("Message"),Commands->Get_ID(object),0); modelid = Commands->Get_ID(object); @@ -358,7 +360,7 @@ if (!modelid1) { Vector3 position = Commands->Get_Bone_Position(obj,Get_Parameter("BoneName1")); - GameObject *object = Commands->Create_Object("Generic_Cinematic",position); + GameObject *object = Commands->Create_Object("Invisible_Object",position); Commands->Attach_To_Object_Bone(object,obj,Get_Parameter("BoneName1")); Commands->Send_Custom_Event(obj,sender,Get_Int_Parameter("Message1"),Commands->Get_ID(object),0); modelid1 = Commands->Get_ID(object); @@ -368,7 +370,7 @@ if (!modelid2) { Vector3 position = Commands->Get_Bone_Position(obj,Get_Parameter("BoneName2")); - GameObject *object = Commands->Create_Object("Generic_Cinematic",position); + GameObject *object = Commands->Create_Object("Invisible_Object",position); Commands->Attach_To_Object_Bone(object,obj,Get_Parameter("BoneName2")); Commands->Send_Custom_Event(obj,sender,Get_Int_Parameter("Message2"),Commands->Get_ID(object),0); modelid2 = Commands->Get_ID(object); @@ -506,9 +508,10 @@ float firstframe = Get_Float_Parameter("FirstFrame"); if (firstframe == -1) { - firstframe = Get_Animation_Frame(Commands->Find_Object(ID)); + firstframe = Get_Animation_Frame(obj); } - Commands->Set_Animation(Commands->Find_Object(ID),Get_Parameter("Animation"),false,subobject,firstframe,Get_Float_Parameter("LastFrame"),Get_Int_Parameter("Blended")); + obj->As_PhysicalGameObj()->Clear_Animation(); + Commands->Set_Animation(obj,Get_Parameter("Animation"),false,subobject,firstframe,Get_Float_Parameter("LastFrame"),Get_Int_Parameter("Blended")); } } @@ -598,6 +601,7 @@ { firstframe = Get_Animation_Frame(obj); } + obj->As_PhysicalGameObj()->Clear_Animation(); Commands->Set_Animation(obj,Get_Parameter("Animation"),false,subobject,firstframe,Get_Float_Parameter("LastFrame"),Get_Int_Parameter("Blended")); } } @@ -830,6 +834,7 @@ { firstframe = Get_Animation_Frame(obj); } + obj->As_PhysicalGameObj()->Clear_Animation(); Commands->Set_Animation(obj,Get_Parameter("Animation"),false,subobject,firstframe,Get_Float_Parameter("LastFrame"),Get_Int_Parameter("Blended")); } } diff -uwr sourceold/scripts/jfwws.cpp source/scripts/jfwws.cpp --- sourceold/scripts/jfwws.cpp 2011-11-07 20:33:46.811523400 +0800 +++ source/scripts/jfwws.cpp 2012-02-13 19:32:56.805085900 +0800 @@ -18,6 +18,7 @@ { Vector3 pos = Commands->Get_Position(obj); Commands->Shake_Camera(pos,(float)25.0,(float)0.1,(float)4.0); + Destroy_Script(); } void JFW_Viceroid_Innate::Created(GameObject *obj) @@ -34,6 +35,7 @@ void JFW_No_Innate::Created(GameObject *obj) { Commands->Innate_Disable(obj); + Destroy_Script(); } void JFW_Credit_Trickle::Created(GameObject *obj) @@ -94,6 +96,7 @@ void JFW_Disable_Transition::Created(GameObject *obj) { Commands->Enable_Vehicle_Transitions(obj,false); + Destroy_Script(); } void JFW_Permanent_No_Falling_Damage::Created(GameObject *obj) @@ -133,6 +136,7 @@ void JFW_GrantPowerup_Created::Created(GameObject *obj) { Commands->Give_PowerUp(obj,Get_Parameter("WeaponDef"),false); + Destroy_Script(); } void JFW_CnC_Crate::Custom(GameObject *obj,int type,int param,GameObject *sender) @@ -193,11 +197,13 @@ void JFW_Disable_Physical_Collision::Created(GameObject *obj) { Commands->Disable_Physical_Collisions(obj); + Destroy_Script(); } void JFW_Enable_Physical_Collision::Created(GameObject *obj) { Commands->Enable_Collisions(obj); + Destroy_Script(); } void JFW_DestroyedStateObject::Destroyed(GameObject *obj) @@ -331,12 +337,13 @@ void JFW_Send_Object_ID::Created(GameObject *obj) { int recieverid = Get_Int_Parameter("Receiver_ID"); - int param = Get_Int_Parameter("Receiver_ID"); - float delay = Get_Float_Parameter("Receiver_ID"); + int param = Get_Int_Parameter("Param"); + float delay = Get_Float_Parameter("Delay"); if (Commands->Find_Object(recieverid)) { Commands->Send_Custom_Event(obj,Commands->Find_Object(recieverid),9035,param,delay); } + Destroy_Script(); } void JFW_Ion_Cannon_Sound::Created(GameObject *obj) @@ -351,6 +358,7 @@ { Commands->Create_Sound("Ion_Cannon_Fire",v,obj); } + Destroy_Script(); } void JFW_NukeStrike_Anim::Created(GameObject *obj) @@ -550,6 +558,7 @@ Commands->Send_Custom_Event(obj,object,9026,1,0); Commands->Send_Custom_Event(obj,object,9027,1,0); } + Destroy_Script(); } void JFW_BuildingStateSoundController::Custom(GameObject *obj,int type,int param,GameObject *sender) @@ -661,6 +670,7 @@ void JFW_InnateIsStationary::Created(GameObject *obj) { Commands->Set_Innate_Is_Stationary(obj,true); + Destroy_Script(); } void JFW_Generic_Conv::Created(GameObject *obj) @@ -669,11 +679,13 @@ Commands->Join_Conversation(obj,convid,true,true,true); Commands->Start_Conversation(convid,100000); Commands->Monitor_Conversation(obj,convid); + Destroy_Script(); } void JFW_Disable_Hibernation::Created(GameObject *obj) { Commands->Enable_Hibernation(obj,0); + Destroy_Script(); } ScriptRegistrant JFW_Building_Explode_No_Damage_Registrant("JFW_Building_Explode_No_Damage",""); diff -uwr sourceold/scripts/jfwzone.cpp source/scripts/jfwzone.cpp --- sourceold/scripts/jfwzone.cpp 2011-12-01 12:21:47.211914000 +0800 +++ source/scripts/jfwzone.cpp 2012-02-23 12:11:58.802734300 +0800 @@ -22,6 +22,7 @@ #include "VehicleGameObjDef.h" #include "BuildingGameObjDef.h" #include "dp88_custom_timer_defines.h" +#include "PhysicalGameObj.h" void JFW_3D_Sound_Zone::Entered(GameObject *obj,GameObject *enterer) { @@ -1186,6 +1187,7 @@ { firstframe = Get_Animation_Frame(Commands->Find_Object(ID)); } + obj->As_PhysicalGameObj()->Clear_Animation(); Commands->Set_Animation(Commands->Find_Object(ID),Get_Parameter("Animation"),false,subobject,firstframe,Get_Float_Parameter("LastFrame"),Get_Int_Parameter("Blended")); } } @@ -1909,6 +1911,7 @@ { firstframe = Get_Animation_Frame(Commands->Find_Object(ID)); } + obj->As_PhysicalGameObj()->Clear_Animation(); Commands->Set_Animation(Commands->Find_Object(ID),Get_Parameter("Animation"),false,subobject,firstframe,Get_Float_Parameter("LastFrame"),Get_Int_Parameter("Blended")); } } @@ -2098,6 +2101,29 @@ } } +void JFW_Radar_Spy_Zone_New::Created(GameObject *obj) +{ + reset = false; +} + +void JFW_Radar_Spy_Zone_New::Entered(GameObject *obj,GameObject *enterer) +{ + if (Get_Vehicle(enterer) || reset) + { + return; + } + if (!Is_Spy(enterer)) + { + return; + } + if ((Is_Building_Dead(Find_Com_Center(Commands->Get_Player_Type(enterer))) && (Is_Radar_Enabled(PTTEAM(Commands->Get_Player_Type(enterer)))))) + { + Create_2D_Sound_Team(Get_Parameter("Sound"),Commands->Get_Player_Type(enterer)); + Enable_Base_Radar(Get_Object_Type(enterer),true); + reset = true; + } +} + void JFW_2D_Sound_Zone_Team::Entered(GameObject *obj,GameObject *enterer) { int team; @@ -2509,8 +2535,9 @@ Commands->Give_Money(Get_Vehicle_Driver(Commands->Find_Object(ID)),cost,false); Commands->Send_Custom_Event(Owner(),Commands->Find_Object(ID),CUSTOM_ENTERED_VTOL_LAND_ZONE,0,0); Force_Occupants_Exit(Commands->Find_Object(ID)); - Commands->Start_Timer(Owner(),this,1,1); + Commands->Start_Timer(Owner(),this,1,ID); RemoveHook(); + ID = 0; } } } @@ -2527,8 +2554,7 @@ void JFW_Sell_Zone::Timer_Expired(GameObject *obj,int number) { - Commands->Destroy_Object(Commands->Find_Object(ID)); - ID = 0; + Commands->Destroy_Object(Commands->Find_Object(number)); } void JFW_Infantry_Force_Composition_Zone::Created(GameObject *obj) @@ -2763,6 +2789,238 @@ SAFE_DELETE_ARRAY(IDs); } +void JFW_Infantry_Force_Composition_Zone_New::Created(GameObject *obj) +{ + reset = false; + count = 0; + TeamPurchaseSettingsDefClass *teamdefs[2]; + teamdefs[0] = TeamPurchaseSettingsDefClass::Get_Definition(TeamPurchaseSettingsDefClass::TEAM_GDI); + teamdefs[1] = TeamPurchaseSettingsDefClass::Get_Definition(TeamPurchaseSettingsDefClass::TEAM_NOD); + PurchaseSettingsDefClass *defs[4]; + defs[0] = PurchaseSettingsDefClass::Find_Definition(PurchaseSettingsDefClass::TYPE_CLASSES,PurchaseSettingsDefClass::TEAM_GDI); + defs[1] = PurchaseSettingsDefClass::Find_Definition(PurchaseSettingsDefClass::TYPE_CLASSES,PurchaseSettingsDefClass::TEAM_NOD); + defs[2] = PurchaseSettingsDefClass::Find_Definition(PurchaseSettingsDefClass::TYPE_SECRET_CLASSES,PurchaseSettingsDefClass::TEAM_GDI); + defs[3] = PurchaseSettingsDefClass::Find_Definition(PurchaseSettingsDefClass::TYPE_SECRET_CLASSES,PurchaseSettingsDefClass::TEAM_NOD); + for (unsigned int d = 0;d < 2;d++) + { + for (unsigned int i = 0;i < 4;i++) + { + if (teamdefs[d]->Get_Enlisted_Definition(i)) + { + count++; + } + } + } + for (unsigned int d = 0;d < 4;d++) + { + for (unsigned int i = 0;i < 10;i++) + { + if ((defs[d]) && (defs[d]->Get_Definition(i))) + { + count++; + if (defs[d]->Get_Alt_Definition(i,0)) + { + count++; + if (defs[d]->Get_Alt_Definition(i,1)) + { + count++; + if (defs[d]->Get_Alt_Definition(i,2)) + { + count++; + } + } + } + } + } + } + IDs = new unsigned int[count]; + int pos = 0; + for (unsigned int d = 0;d < 2;d++) + { + for (unsigned int i = 0;i < 4;i++) + { + if (teamdefs[d]->Get_Enlisted_Definition(i)) + { + IDs[pos] = teamdefs[d]->Get_Enlisted_Definition(i); + pos++; + } + } + } + for (unsigned int d = 0;d < 4;d++) + { + for (unsigned int i = 0;i < 10;i++) + { + if ((defs[d]) && (defs[d]->Get_Definition(i))) + { + IDs[pos] = defs[d]->Get_Definition(i); + pos++; + if (defs[d]->Get_Alt_Definition(i,0)) + { + IDs[pos] = defs[d]->Get_Alt_Definition(i,0); + pos++; + if (defs[d]->Get_Alt_Definition(i,1)) + { + IDs[pos] = defs[d]->Get_Alt_Definition(i,1); + pos++; + if (defs[d]->Get_Alt_Definition(i,2)) + { + IDs[pos] = defs[d]->Get_Alt_Definition(i,2); + pos++; + } + } + } + } + } + } +} + +void JFW_Infantry_Force_Composition_Zone_New::Entered(GameObject *obj,GameObject *enterer) +{ + if (Get_Vehicle(enterer) || reset) + { + return; + } + if (!Is_Spy(enterer)) + { + return; + } + int Player_Type = Commands->Get_Player_Type(enterer); + int Count_Player_Type = PTTEAM(Player_Type); + Create_2D_Sound_Team(Get_Parameter("Sound"),Player_Type); + Send_Message_Team(Player_Type,255,255,255,"Current Enemy Infantry Strength:\n"); + reset = true; + Commands->Start_Timer(obj,this,Get_Float_Parameter("ResetTime"),1); + for (unsigned int i = 0;i < count;i++) + { + const char *name = Get_Definition_Name(IDs[i]); + unsigned int count = Get_Object_Count(Count_Player_Type,name); + if (count) + { + char str[100]; + const char *str2 = Get_Translated_Definition_Name(name); + sprintf(str,"%s: %d\n",str2,count); + delete[] str2; + Send_Message_Team(Player_Type,255,255,255,str); + } + } +} + +void JFW_Infantry_Force_Composition_Zone_New::Timer_Expired(GameObject *obj,int number) +{ + reset = false; +} + +JFW_Infantry_Force_Composition_Zone_New::~JFW_Infantry_Force_Composition_Zone_New() +{ + SAFE_DELETE_ARRAY(IDs); +} + +void JFW_Vehicle_Force_Composition_Zone_New::Created(GameObject *obj) +{ + reset = false; + count = 0; + PurchaseSettingsDefClass *defs[8]; + defs[0] = PurchaseSettingsDefClass::Find_Definition(PurchaseSettingsDefClass::TYPE_VEHICLES,PurchaseSettingsDefClass::TEAM_GDI); + defs[1] = PurchaseSettingsDefClass::Find_Definition(PurchaseSettingsDefClass::TYPE_VEHICLES,PurchaseSettingsDefClass::TEAM_NOD); + defs[2] = PurchaseSettingsDefClass::Find_Definition(PurchaseSettingsDefClass::TYPE_SECRET_VEHICLES,PurchaseSettingsDefClass::TEAM_GDI); + defs[3] = PurchaseSettingsDefClass::Find_Definition(PurchaseSettingsDefClass::TYPE_SECRET_VEHICLES,PurchaseSettingsDefClass::TEAM_NOD); + defs[4] = PurchaseSettingsDefClass::Find_Definition(PurchaseSettingsDefClass::TYPE_AIR,PurchaseSettingsDefClass::TEAM_GDI); + defs[5] = PurchaseSettingsDefClass::Find_Definition(PurchaseSettingsDefClass::TYPE_NAVAL,PurchaseSettingsDefClass::TEAM_NOD); + defs[6] = PurchaseSettingsDefClass::Find_Definition(PurchaseSettingsDefClass::TYPE_AIR,PurchaseSettingsDefClass::TEAM_GDI); + defs[7] = PurchaseSettingsDefClass::Find_Definition(PurchaseSettingsDefClass::TYPE_NAVAL,PurchaseSettingsDefClass::TEAM_NOD); + for (unsigned int d = 0;d < 7;d++) + { + for (unsigned int i = 0;i < 10;i++) + { + if ((defs[d]) && (defs[d]->Get_Definition(i))) + { + count++; + if (defs[d]->Get_Alt_Definition(i,0)) + { + count++; + if (defs[d]->Get_Alt_Definition(i,1)) + { + count++; + if (defs[d]->Get_Alt_Definition(i,2)) + { + count++; + } + } + } + } + } + } + IDs = new unsigned int[count]; + int pos = 0; + for (unsigned int d = 0;d < 7;d++) + { + for (unsigned int i = 0;i < 10;i++) + { + if ((defs[d]) && (defs[d]->Get_Definition(i))) + { + IDs[pos] = defs[d]->Get_Definition(i); + pos++; + if (defs[d]->Get_Alt_Definition(i,0)) + { + IDs[pos] = defs[d]->Get_Alt_Definition(i,0); + pos++; + if (defs[d]->Get_Alt_Definition(i,1)) + { + IDs[pos] = defs[d]->Get_Alt_Definition(i,1); + pos++; + if (defs[d]->Get_Alt_Definition(i,2)) + { + IDs[pos] = defs[d]->Get_Alt_Definition(i,2); + pos++; + } + } + } + } + } + } +} + +void JFW_Vehicle_Force_Composition_Zone_New::Entered(GameObject *obj,GameObject *enterer) +{ + if (Get_Vehicle(enterer) || reset) + { + return; + } + if (!Is_Spy(enterer)) + { + return; + } + int Player_Type = Commands->Get_Player_Type(enterer); + int Count_Player_Type = PTTEAM(Player_Type); + Create_2D_Sound_Team(Get_Parameter("Sound"),Player_Type); + Send_Message_Team(Player_Type,255,255,255,"Current Enemy Vehicle Strength:\n"); + reset = true; + Commands->Start_Timer(obj,this,Get_Float_Parameter("ResetTime"),1); + for (unsigned int i = 0;i < count;i++) + { + const char *name = Get_Definition_Name(IDs[i]); + unsigned int count = Get_Object_Count(Count_Player_Type,name); + if (count) + { + char str[100]; + const char *str2 = Get_Translated_Definition_Name(name); + sprintf(str,"%s: %d\n",str2,count); + delete[] str2; + Send_Message_Team(Player_Type,255,255,255,str); + } + } +} + +void JFW_Vehicle_Force_Composition_Zone_New::Timer_Expired(GameObject *obj,int number) +{ + reset = false; +} + +JFW_Vehicle_Force_Composition_Zone_New::~JFW_Vehicle_Force_Composition_Zone_New() +{ + SAFE_DELETE_ARRAY(IDs); +} + void JFW_Resize_Zone::Created(GameObject *obj) { ScriptZoneGameObj *object = ((ScriptableGameObj *)obj)->As_ScriptZoneGameObj(); @@ -2785,6 +3043,7 @@ object->Get_Bounding_Box().Basis[2].Y = 0; object->Get_Bounding_Box().Basis[2].Z = 1; } + Destroy_Script(); } void JFW_Custom_Spawn_Zone::Created(GameObject *obj) @@ -2910,6 +3169,80 @@ } } +void JFW_Cash_Spy_Zone_New::Created(GameObject *obj) +{ + reset = false; +} + +void JFW_Cash_Spy_Zone_New::Entered(GameObject *obj,GameObject *enterer) +{ + if (Get_Vehicle(enterer) || reset) + { + return; + } + if (!Is_Spy(enterer)) + { + return; + } + int team = Commands->Get_Player_Type(enterer); + char str[100]; + reset = true; + Commands->Start_Timer(obj,this,Get_Float_Parameter("ResetTime"),1); + Create_2D_Sound_Team(Get_Parameter("Sound"),team); + sprintf(str,"Current Enemy Credits: %.0f\n",Get_Team_Credits(PTTEAM(team))); + Send_Message_Team(team,255,255,255,str); +} + +void JFW_Cash_Spy_Zone_New::Timer_Expired(GameObject *obj,int number) +{ + reset = false; +} + +void JFW_Power_Spy_Zone_New::Created(GameObject *obj) +{ + reset = false; +} + +void JFW_Power_Spy_Zone_New::Entered(GameObject *obj,GameObject *enterer) +{ + if (!Is_Spy(enterer)) + { + return; + } + team = Commands->Get_Player_Type(enterer); + if (Is_Base_Powered(PTTEAM(team)) && !reset && (!Is_Building_Dead(Find_Building(PTTEAM(team),BuildingConstants::TYPE_POWER_PLANT)))) + { + Create_2D_Sound_Team(Get_Parameter("Sound"),team); + Power_Base(PTTEAM(team),false); + GameObject *o = Find_Building(PTTEAM(team),BuildingConstants::TYPE_COM_CENTER); + if (o && !Is_Building_Dead(o)) + { + Enable_Base_Radar(PTTEAM(team),false); + } + Commands->Start_Timer(obj,this,Get_Float_Parameter("Power_Time"),1); + } +} + +void JFW_Power_Spy_Zone_New::Timer_Expired(GameObject *obj,int number) +{ + if ((number == 1) && (!Is_Building_Dead(Find_Building(PTTEAM(team),BuildingConstants::TYPE_POWER_PLANT)))) + { + Create_2D_Sound_Team(Get_Parameter("Sound2"),PTTEAM(team)); + Power_Base(PTTEAM(team),true); + GameObject *o = Find_Building(PTTEAM(team),BuildingConstants::TYPE_COM_CENTER); + if (o && !Is_Building_Dead(o)) + { + Enable_Base_Radar(PTTEAM(team),true); + } + reset = true; + Commands->Start_Timer(obj,this,Get_Float_Parameter("Reset_Time"),2); + } + if (number == 2) + { + reset = false; + } +} + void JFW_Conyard_Spy_Zone::Created(GameObject *obj) { reset = false; @@ -2988,6 +3321,46 @@ } } +void JFW_Conyard_Spy_Zone_2_New::Created(GameObject *obj) +{ + reset = false; + cydisabled = false; +} + +void JFW_Conyard_Spy_Zone_2_New::Entered(GameObject *obj,GameObject *enterer) +{ + if (!Is_Spy(enterer)) + { + return; + } + int team = Commands->Get_Player_Type(enterer); + if (!cydisabled && !reset && (!Is_Building_Dead(Find_Construction_Yard(PTTEAM(team))))) + { + Create_2D_Sound_Team(Get_Parameter("Sound"),team); + cydisabled = true; + ConstructionYardGameObj *obj2 = (ConstructionYardGameObj *)Find_Construction_Yard(PTTEAM(team)); + obj2->Set_Spy(true); + Commands->Start_Timer(obj,this,Get_Float_Parameter("Power_Time"),1); + } +} + +void JFW_Conyard_Spy_Zone_2_New::Timer_Expired(GameObject *obj,int number) +{ + if ((number == 1) && (!Is_Building_Dead(Find_Building(PTTEAM(team),BuildingConstants::TYPE_CONYARD)))) + { + Create_2D_Sound_Team(Get_Parameter("Sound2"),PTTEAM(team)); + cydisabled = false; + ConstructionYardGameObj *obj2 = (ConstructionYardGameObj *)Find_Construction_Yard(PTTEAM(team)); + obj2->Set_Spy(false); + reset = true; + Commands->Start_Timer(obj,this,Get_Float_Parameter("Reset_Time"),2); + } + if (number == 2) + { + reset = false; + } +} + ScriptRegistrant JFW_Look_At_Location_Entry("JFW_Look_At_Location_Entry","Player_Type:int,Location:vector3"); ScriptRegistrant JFW_Look_At_Object_Entry("JFW_Look_At_Object_Entry","Player_Type:int,ObjectID:int"); ScriptRegistrant JFW_Zone_PCT_Registrant("JFW_Zone_PCT","Player_Type:int"); @@ -3057,19 +3430,25 @@ ScriptRegistrant JFW_Send_Driver_Custom_On_Enter("JFW_Send_Driver_Custom_On_Enter","EnterMessage:int,ExitMessage:int"); ScriptRegistrant JFW_Teleport_Zone_Enable_Registrant("JFW_Teleport_Zone_Enable","Location:vector3,Object_ID=0:int,Player_Type:int,EnableCustom:int,DisableCustom:int"); ScriptRegistrant JFW_Radar_Spy_Zone_Registrant("JFW_Radar_Spy_Zone","Spy_Script:string,Sound:string"); +ScriptRegistrant JFW_Radar_Spy_Zone_New_Registrant("JFW_Radar_Spy_Zone_New","Sound:string"); ScriptRegistrant JFW_2D_Sound_Zone_Team_Registrant("JFW_2D_Sound_Zone_Team","Player_Type:int,Sound:string,Time:float,TimerNum:int,Sound_Player_Type:int"); ScriptRegistrant JFW_Repair_Zone_2_Registrant("JFW_Repair_Zone_2","Player_Type:int,Repair_Distance:float,Repair_Health:float,Sound:string,Credits:float,RepairSound:string,RepairStopSound:string"); ScriptRegistrant JFW_Repair_Zone_No_Boats_Registrant("JFW_Repair_Zone_No_Boats","Player_Type:int,Repair_Distance:float,Repair_Health:float,Sound:string,Credits:float,RepairSound:string,RepairStopSound:string"); ScriptRegistrant JFW_Repair_Zone_Boats_Registrant("JFW_Repair_Zone_Boats","Player_Type:int,Repair_Distance:float,Repair_Health:float,Sound:string,Credits:float,RepairSound:string,RepairStopSound:string"); ScriptRegistrant JFW_Infantry_Force_Composition_Zone_Registrant("JFW_Infantry_Force_Composition_Zone","Spy_Script:string,Sound:string,ResetTime:float"); ScriptRegistrant JFW_Vehicle_Force_Composition_Zone_Registrant("JFW_Vehicle_Force_Composition_Zone","Spy_Script:string,Sound:string,ResetTime:float"); +ScriptRegistrant JFW_Infantry_Force_Composition_Zone_New_Registrant("JFW_Infantry_Force_Composition_Zone_New","Sound:string,ResetTime:float"); +ScriptRegistrant JFW_Vehicle_Force_Composition_Zone_New_Registrant("JFW_Vehicle_Force_Composition_Zone_New","Sound:string,ResetTime:float"); ScriptRegistrant JFW_Sell_Zone_Registrant("JFW_Sell_Zone","Player_Type:int,Sound:string,SellSound:string"); ScriptRegistrant JFW_Resize_Zone_Registrant("JFW_Resize_Zone","Size:vector3,ZRotate:float"); ScriptRegistrant JFW_Cash_Spy_Zone_Registrant("JFW_Cash_Spy_Zone","Spy_Script:string,Sound:string,ResetTime:float"); ScriptRegistrant JFW_Power_Spy_Zone_Registrant("JFW_Power_Spy_Zone","Spy_Script:string,Power_Time:float,Reset_Time:float,Sound:string,Sound2:string"); +ScriptRegistrant JFW_Cash_Spy_Zone_New_Registrant("JFW_Cash_Spy_Zone_New","Sound:string,ResetTime:float"); +ScriptRegistrant JFW_Power_Spy_Zone_New_Registrant("JFW_Power_Spy_Zone_New","Power_Time:float,Reset_Time:float,Sound:string,Sound2:string"); ScriptRegistrant JFW_Blow_Up_On_Enter_Delay_Registrant("JFW_Blow_Up_On_Enter_Delay","Player_Type:int,Time:float,TimerNum:int,Explosion:string"); ScriptRegistrant JFW_Conyard_Spy_Zone_Registrant("JFW_Conyard_Spy_Zone","Spy_Script:string,Power_Time:float,Reset_Time:float,Sound:string,Sound2:string"); ScriptRegistrant JFW_Conyard_Spy_Zone_2_Registrant("JFW_Conyard_Spy_Zone_2","Spy_Script:string,Power_Time:float,Reset_Time:float,Sound:string,Sound2:string"); +ScriptRegistrant JFW_Conyard_Spy_Zone_2_New_Registrant("JFW_Conyard_Spy_Zone_2_New","Power_Time:float,Reset_Time:float,Sound:string,Sound2:string"); ScriptRegistrant JFW_Custom_Spawn_Zone_Registrant("JFW_Custom_Spawn_Zone","Position:vector3,Size:vector3,ZRotate:float,SpawnCustom:int,DestroyCustom:int,Preset:string"); ScriptRegistrant JFW_Spawn_Zone_Created_Registrant("JFW_Spawn_Zone_Created","Offset:vector3,Size:vector3,ZRotate:float,Preset:string"); ScriptRegistrant JFW_Boat_Registrant("JFW_Boat",""); diff -uwr sourceold/scripts/jfwzone.h source/scripts/jfwzone.h --- sourceold/scripts/jfwzone.h 2011-10-23 10:40:52.437500200 +0800 +++ source/scripts/jfwzone.h 2012-02-13 18:44:52.651765600 +0800 @@ -368,6 +368,12 @@ void Entered(GameObject *obj,GameObject *enterer); }; +class JFW_Radar_Spy_Zone_New : public ScriptImpClass { + bool reset; + void Created(GameObject *obj); + void Entered(GameObject *obj,GameObject *enterer); +}; + class JFW_2D_Sound_Zone_Team : public ScriptImpClass { void Entered(GameObject *obj,GameObject *enterer); void Timer_Expired(GameObject *obj,int number); @@ -437,6 +443,30 @@ ~JFW_Vehicle_Force_Composition_Zone(); }; +class JFW_Infantry_Force_Composition_Zone_New : public ScriptImpClass { + unsigned int *IDs; + unsigned int count; + bool reset; + void Created(GameObject *obj); + void Entered(GameObject *obj,GameObject *enterer); + void Timer_Expired(GameObject *obj,int number); +public: + JFW_Infantry_Force_Composition_Zone_New() {IDs = 0;} + ~JFW_Infantry_Force_Composition_Zone_New(); +}; + +class JFW_Vehicle_Force_Composition_Zone_New : public ScriptImpClass { + unsigned int *IDs; + unsigned int count; + bool reset; + void Created(GameObject *obj); + void Entered(GameObject *obj,GameObject *enterer); + void Timer_Expired(GameObject *obj,int number); +public: + JFW_Vehicle_Force_Composition_Zone_New() {IDs = 0;} + ~JFW_Vehicle_Force_Composition_Zone_New(); +}; + class JFW_Resize_Zone : public ScriptImpClass { void Created(GameObject *obj); }; @@ -456,6 +486,21 @@ void Timer_Expired(GameObject *obj,int number); }; +class JFW_Cash_Spy_Zone_New : public ScriptImpClass { + bool reset; + void Created(GameObject *obj); + void Entered(GameObject *obj,GameObject *enterer); + void Timer_Expired(GameObject *obj,int number); +}; + +class JFW_Power_Spy_Zone_New : public ScriptImpClass { + bool reset; + int team; + void Created(GameObject *obj); + void Entered(GameObject *obj,GameObject *enterer); + void Timer_Expired(GameObject *obj,int number); +}; + class JFW_Conyard_Spy_Zone : public ScriptImpClass { bool reset; bool cydisabled; @@ -469,6 +514,15 @@ bool reset; bool cydisabled; int team; + void Created(GameObject *obj); + void Entered(GameObject *obj,GameObject *enterer); + void Timer_Expired(GameObject *obj,int number); +}; + +class JFW_Conyard_Spy_Zone_2_New : public ScriptImpClass { + bool reset; + bool cydisabled; + int team; void Created(GameObject *obj); void Entered(GameObject *obj,GameObject *enterer); void Timer_Expired(GameObject *obj,int number); diff -uwr sourceold/scripts/mdb.cpp source/scripts/mdb.cpp --- sourceold/scripts/mdb.cpp 2011-10-11 23:05:49.406250000 +0800 +++ source/scripts/mdb.cpp 2012-02-13 19:12:33.842195300 +0800 @@ -159,6 +159,7 @@ char Limit[20]; sprintf(Limit,"vlimit %d",Get_Int_Parameter("Limit")); Console_Input(Limit); + Destroy_Script(); } void MDB_Mine_Limit::Created(GameObject *obj) @@ -168,6 +169,7 @@ if (Num > 127) Num = 127; sprintf(Limit,"mlimit %d",Num); Console_Input(Limit); + Destroy_Script(); } void MDB_Unit_Limit::Created(GameObject *obj) diff -uwr sourceold/scripts/ra2.cpp source/scripts/ra2.cpp --- sourceold/scripts/ra2.cpp 2011-10-11 23:06:35.896484300 +0800 +++ source/scripts/ra2.cpp 2012-02-13 19:12:33.791414000 +0800 @@ -359,6 +359,7 @@ tree = Commands->Create_Object(preset,TreePos); Commands->Attach_To_Object_Bone(tree,obj,"origin"); } + Destroy_Script(); } void Ra2Ven_TurretSound::Created(GameObject *obj) diff -uwr sourceold/scripts/reborn.cpp source/scripts/reborn.cpp --- sourceold/scripts/reborn.cpp 2011-10-11 23:06:34.511718700 +0800 +++ source/scripts/reborn.cpp 2012-02-13 19:12:33.738679700 +0800 @@ -289,6 +289,7 @@ void Reborn_PlaySound_OnCreate::Created(GameObject *obj) { Commands->Create_2D_Sound(Get_Parameter("Sound_Preset_Name")); + Destroy_Script(); } //Reborn Diggable Vehicle Animated diff -uwr sourceold/scripts/renalert.cpp source/scripts/renalert.cpp --- sourceold/scripts/renalert.cpp 2011-10-21 21:50:39.677734300 +0800 +++ source/scripts/renalert.cpp 2012-02-13 19:12:33.152742200 +0800 @@ -21,6 +21,8 @@ #include "SmartGameObj.h" #include "VehicleGameObjDef.h" #include "ArmorWarheadManager.h" +#include "SoldierGameObjDef.h" +#include "SoldierGameObj.h" #ifdef SSGM #include "gmlog.h" #endif @@ -396,6 +398,7 @@ c = Get_Parameter("Object"); v = Commands->Get_Position(obj); Commands->Apply_Damage(Commands->Create_Object(c,v),100,war,0); + Destroy_Script(); } //////////////RA_Naval_Yard////////////// @@ -702,6 +705,7 @@ GameObject *BoomBox; BoomBox = Commands->Create_Object(Get_Parameter("Preset"),Commands->Get_Position(obj)); Commands->Apply_Damage(BoomBox, 100, "BlamoKiller", 0); + Destroy_Script(); } //////////////RA_Demolition_Truck_Improved////////////// @@ -956,7 +960,7 @@ if (driverID == testID) { //Create Object to jam MAD Tank in place - GameObject *newobj = Commands->Create_Object_At_Bone(obj, "Generic_Cinematic", Get_Parameter("Bone")); + GameObject *newobj = Commands->Create_Object_At_Bone(obj, "Invisible_Object", Get_Parameter("Bone")); Commands->Set_Model(newobj, Get_Parameter("Attach_Model")); Commands->Attach_To_Object_Bone(newobj, obj, Get_Parameter("Bone")); newobjID = Commands->Get_ID(newobj); @@ -3263,7 +3267,7 @@ Commands->Destroy_Object(Commands->Find_Object(modelID)); } Vector3 position = Commands->Get_Bone_Position(obj,Get_Parameter("BoneName")); - GameObject *object = Commands->Create_Object("Generic_Cinematic", position); + GameObject *object = Commands->Create_Object("Invisible_Object", position); Commands->Attach_To_Object_Bone(object, obj, Get_Parameter("BoneName")); Commands->Send_Custom_Event(obj, sender, Get_Int_Parameter("Message"), Commands->Get_ID(object), 0); modelID = Commands->Get_ID(object); @@ -3303,7 +3307,7 @@ if (!modelID) { Vector3 position = Commands->Get_Bone_Position(obj, Get_Parameter("BoneName")); - GameObject *object = Commands->Create_Object("Generic_Cinematic", position); + GameObject *object = Commands->Create_Object("Invisible_Object", position); Commands->Attach_To_Object_Bone(object, obj, Get_Parameter("BoneName")); Commands->Send_Custom_Event(obj, Commands->Find_Object(driverID), Get_Int_Parameter("Message"), Commands->Get_ID(object), 0); modelID = Commands->Get_ID(object); @@ -3432,6 +3436,106 @@ Auto_Save_Variable(&blackout,4,4); } +//////////////RA_Vision_Control_2////////////// + +void RA_Vision_Control_2::Created(GameObject *obj) +{ + allowed = true; + underwater = false; + driving = false; + blackout = false; + //Revert the screen incase player died while underwater + Set_Screen_Fade_Color_Player(obj, 0, 0, 0, 0); //revert color + Set_Screen_Fade_Opacity_Player(obj,0, 0); //revert opacity + Set_Fog_Color_Player(obj, 256, 256, 256); + Clear_Fog_Override_Player(obj); +} + +void RA_Vision_Control_2::Custom(GameObject *obj, int type, int param, GameObject *sender) +{ + switch(type) + { + case 852852: //Disabling type, will cause 'underwater' messages to be ignored + allowed = false; + break; + case 258258: //Enabling type, will allow 'underwater' messages + allowed = true; + break; + case 789789: //Diving type, will activate underwater effect (overrides other effects) + if (allowed) + { + if (!driving) //oops, did I go overboard? + { + Commands->Apply_Damage(obj, 100, "Death", 0); //I drowned + } + if (blackout)//if blackout in effect, deactivate + { + Set_Fog_Color_Player(obj, 256, 256, 256); + Clear_Fog_Override_Player(obj); + blackout = false; + } + Set_Screen_Fade_Color_Player(obj, 0, 0, 1, 0); + Set_Screen_Fade_Opacity_Player(obj, 150, 0); + underwater = true; + } + break; + case 987987: //Surfacing type, will deactivate underwater effect + Set_Screen_Fade_Color_Player(obj, 0, 0, 0, 0); + Set_Screen_Fade_Opacity_Player(obj, 0, 0); + underwater = false; + break; + case 325523: //Blackout type, param 0 = blackout off, param 1 = blackout on + if (!underwater) //Underwater takes priority + { + if (param == 1) //turn on effect + { + if (!blackout) + { + Set_Screen_Fade_Color_Player(obj, 0, 0, 0, 0); + Set_Screen_Fade_Opacity_Player(obj, 150, 0); + if (Get_Vehicle(obj)) + { + Set_Fog_Override_Player(obj, Get_Float_Parameter("VehicleFogStart"), Get_Float_Parameter("VehicleFogEnd")); + } + else + { + Set_Fog_Override_Player(obj, Get_Float_Parameter("InfantryFogStart"), Get_Float_Parameter("InfantryFogEnd")); + } + Set_Fog_Color_Player(obj, 0, 0, 0); + blackout = true; + } + } + else if (!param) //turn off effect + { + if (blackout) + { + Set_Screen_Fade_Color_Player(obj, 0, 0, 0, 0); + Set_Screen_Fade_Opacity_Player(obj, 0, 0); + Clear_Fog_Override_Player(obj); + blackout = false; + } + } + } + break; + case 310013: //Exited Vehicle Message + driving = false; + if (underwater) + Commands->Apply_Damage(obj, 100, "Death", 0); + break; + case 103301: //Entered Vehicle Message + driving = true; + break; + } +} + +void RA_Vision_Control_2::Register_Auto_Save_Variables() +{ + Auto_Save_Variable(&allowed,4,1); + Auto_Save_Variable(&underwater,4,2); + Auto_Save_Variable(&driving,4,3); + Auto_Save_Variable(&blackout,4,4); +} + //////////////RA_Fog_Level_Settings////////////// void RA_Fog_Level_Settings::Custom(GameObject *obj, int type, int param, GameObject *sender) @@ -3444,6 +3548,7 @@ { GameObject *silo = Find_Object_By_Preset(2, Get_Parameter("SiloPresetName")); Commands->Send_Custom_Event(obj, silo, 269269, 0, 0.0); + Destroy_Script(); } //////////////RA_Beacon_Terminal////////////// @@ -3487,7 +3592,7 @@ Create_2D_Sound_Team(Get_Parameter("BeaconTakenSound"), Commands->Get_Player_Type(obj)); } } - else if(Is_Script_Attached(poker, "RA_Infantry_Spy")) + else if (Is_Spy(poker)) { if(!reset) { @@ -3764,7 +3869,7 @@ if (!ownerID) { //Create Object to jam MAD Tank in place - GameObject *newobj = Commands->Create_Object_At_Bone(obj, "Generic_Cinematic", Get_Parameter("Bone")); + GameObject *newobj = Commands->Create_Object_At_Bone(obj, "Invisible_Object", Get_Parameter("Bone")); Commands->Set_Model(newobj, Get_Parameter("Attach_Model")); Commands->Attach_To_Object_Bone(newobj, obj, Get_Parameter("Bone")); newobjID = Commands->Get_ID(newobj); @@ -3879,6 +3984,7 @@ ScriptRegistrant RA_Vehicle_Team_Timer_Registrant("RA_Vehicle_Team_Timer",""); ScriptRegistrant RA_Visible_Driver_Registrant("RA_Visible_Driver","BoneName=seat0:string,Message=471174:int"); ScriptRegistrant RA_Vision_Control_Registrant("RA_Vision_Control","FogController=RA_Game_Manager:string"); +ScriptRegistrant RA_Vision_Control_2_Registrant("RA_Vision_Control_2","FogController=RA_Game_Manager:string,InfantryFogStart=0:float,InfantryFogEnd=9:float,VehicleFogStart=0:float,VehicleFogEnd=9:float"); ScriptRegistrant RA_Fog_Level_Settings_Registrant("RA_Fog_Level_Settings", "FogEnable=1:int,FogMin=200.0:float,FogMax=300.0:float"); ScriptRegistrant RA_Missile_Beacon_Registrant("RA_Missile_Beacon", "SiloPresetName:string"); ScriptRegistrant RA_Beacon_Terminal_Registrant("RA_Beacon_Terminal", "BeaconPowerup:string,BeaconReadySound:string,BeaconTakenSound:string,SiloDisableSound:string,SpyNotifySound:string"); diff -uwr sourceold/scripts/renalert.h source/scripts/renalert.h --- sourceold/scripts/renalert.h 2011-10-21 21:50:39.739257800 +0800 +++ source/scripts/renalert.h 2012-02-08 08:49:58.555664000 +0800 @@ -337,6 +337,16 @@ public: void Register_Auto_Save_Variables(); }; +class RA_Vision_Control_2 : public ScriptImpClass { + bool allowed; + bool underwater; + bool driving; + bool blackout; + void Created(GameObject *obj); + void Custom(GameObject *obj, int type, int param, GameObject *sender); + public: void Register_Auto_Save_Variables(); +}; + class RA_Fog_Level_Settings : public ScriptImpClass { void Custom(GameObject *obj, int type, int param, GameObject *sender); }; diff -uwr sourceold/scripts/scripts.vcxproj source/scripts/scripts.vcxproj --- sourceold/scripts/scripts.vcxproj 2011-11-26 13:18:44.188476500 +0800 +++ source/scripts/scripts.vcxproj 2012-03-06 21:47:37.583984300 +0800 @@ -496,6 +496,7 @@ + @@ -510,6 +511,7 @@ + @@ -766,6 +768,7 @@ + @@ -796,6 +799,7 @@ + diff -uwr sourceold/scripts/scripts.vcxproj.filters source/scripts/scripts.vcxproj.filters --- sourceold/scripts/scripts.vcxproj.filters 2011-11-22 14:49:49.159179600 +0800 +++ source/scripts/scripts.vcxproj.filters 2012-03-06 21:47:37.586914000 +0800 @@ -467,6 +467,12 @@ 01. Sources + + 01. Sources\Tib. Crystal War + + + 01. Sources + @@ -1419,6 +1425,12 @@ 02. Headers + + 02. Headers\Tib. Crystal War + + + 02. Headers + diff -uwr sourceold/scripts/shawk.cpp source/scripts/shawk.cpp --- sourceold/scripts/shawk.cpp 2011-10-11 23:06:16.314453100 +0800 +++ source/scripts/shawk.cpp 2012-02-13 19:12:33.955476500 +0800 @@ -120,6 +120,7 @@ token = strtok (NULL, ";"); } delete[] presets; + Destroy_Script(); }; }; @@ -130,6 +131,7 @@ VehicleGameObj* vehicle_obj = obj->As_VehicleGameObj(); if (!vehicle_obj) return; vehicle_obj->Set_Allow_Stealth_While_Empty(true); + Destroy_Script(); } }; @@ -138,6 +140,7 @@ void Created(GameObject* obj) { if (VehicleGameObj* vobj = obj->As_VehicleGameObj()) vobj->Set_Can_Be_Stolen(true); + Destroy_Script(); } }; @@ -146,6 +149,7 @@ void Created(GameObject* obj) { if (SoldierGameObj* sobj = obj->As_SoldierGameObj()) sobj->Set_Can_Steal_Vehicles(true); + Destroy_Script(); } }; @@ -154,6 +158,7 @@ void Created(GameObject* obj) { if (SoldierGameObj* sobj = obj->As_SoldierGameObj()) sobj->Set_Can_Drive_Vehicles(false); + Destroy_Script(); } }; diff -uwr sourceold/scripts/tcw_building.cpp source/scripts/tcw_building.cpp --- sourceold/scripts/tcw_building.cpp 2011-10-14 22:25:11.481445300 +0800 +++ source/scripts/tcw_building.cpp 2012-02-02 09:44:43.142578100 +0800 @@ -1,6 +1,6 @@ /* Renegade Scripts.dll - Scripts by zunnie - http://dev.mp-gaming.com - Copyright 2011-2012 MP-Gaming + Scripts by zunnie - http://www.tiberiumcrystalwar.com + Copyright 2011-2012 MPF This file is part of the Renegade scripts.dll The Renegade scripts.dll is free software; you can redistribute it and/or modify it @@ -74,15 +74,25 @@ { Create_2D_WAV_Sound_Team("nod_powerplant_destroyed_gdi.wav",1); Create_2D_WAV_Sound_Team("nod_powerplant_destroyed_nod.wav",0); - Send_Message_Team(1,255,255,255,"Nod Power Plant destroyed. Nod base power offline."); - Send_Message_Team(0,255,255,255,"Nod Power Plant destroyed. Low Power."); + Send_Message_Team(1,255,255,255,"Nod Power Plant destroyed."); + Send_Message_Team(0,255,255,255,"Nod Power Plant destroyed."); + if (Find_Building_By_Name(0,"TCW_Nod_Oper_Centre")) + { + Enable_Base_Radar(0,false); + Create_2D_WAV_Sound_Team("radar_off.wav",0); + } } else if (strcmp(Commands->Get_Preset_Name(obj),"TCW_GDI_Power_Plant") == 0) { Create_2D_WAV_Sound_Team("gdi_powerplant_destroyed_gdi.wav",1); Create_2D_WAV_Sound_Team("gdi_powerplant_destroyed_nod.wav",0); - Send_Message_Team(1,255,255,255,"GDI Power Plant destroyed. Low power."); - Send_Message_Team(0,255,255,255,"GDI Power Plant destroyed. GDI base power offline."); + Send_Message_Team(1,255,255,255,"GDI Power Plant destroyed."); + Send_Message_Team(0,255,255,255,"GDI Power Plant destroyed."); + if (Find_Building_By_Name(1,"TCW_GDI_Command_Post")) + { + Enable_Base_Radar(1,false); + Create_2D_WAV_Sound_Team("radar_off.wav",1); + } } else if (strcmp(Commands->Get_Preset_Name(obj),"TCW_Nod_Airfield") == 0) { @@ -93,18 +103,42 @@ } else if (strcmp(Commands->Get_Preset_Name(obj),"TCW_GDI_Command_Post") == 0) { - Create_2D_WAV_Sound_Team("gdi_operctr_destroyed_gdi.wav",1); - Create_2D_WAV_Sound_Team("nod_operctr_destroyed_nod.wav",0); Send_Message(255,255,255,"GDI Command Post destroyed."); Commands->Set_Animation(obj,"V_GDI_CPOST.V_GDI_CPOST",true,0,1,1,0); Enable_Base_Radar(1,false); + Create_2D_WAV_Sound_Team("radar_off.wav",1); } - else if (strcmp(Commands->Get_Preset_Name(obj),"TCW_Nod_Oper_Centre") == 0) + else if (strcmp(Commands->Get_Preset_Name(obj),"TCW_VehBld_Nod_OpCtr") == 0) { - Create_2D_WAV_Sound_Team("gdi_operctr_destroyed_gdi.wav",1); - Create_2D_WAV_Sound_Team("nod_operctr_destroyed_nod.wav",0); - Send_Message(255,255,255,"GDI Command Post destroyed."); + Create_2D_WAV_Sound_Team("nod_operations_centre_destroyed_gdi.wav",1); + Send_Message(255,255,255,"Nod Operations Centre destroyed."); Enable_Base_Radar(0,false); + Create_2D_WAV_Sound_Team("radar_off.wav",0); + } + else if (strcmp(Commands->Get_Preset_Name(obj),"TCW_VehBld_GDI_Armory") == 0) + { + Send_Message(255,255,255,"GDI Armory destroyed."); + } + else if (strcmp(Commands->Get_Preset_Name(obj),"TCW_VehBld_Nod_Silo") == 0) + { + Create_2D_WAV_Sound_Team("nod_tiberium_silo_destroyed_nod.wav",0); + Send_Message(255,255,255,"Nod Tiberium Silo destroyed."); + } + else if (strcmp(Commands->Get_Preset_Name(obj),"TCW_VehBld_GDI_Silo") == 0) + { + Send_Message(255,255,255,"GDI Tiberium Silo destroyed."); + } + else if (strcmp(Commands->Get_Preset_Name(obj),"TCW_VehBld_GDI_IonCtr") == 0) + { + Send_Message(255,255,255,"GDI Ion Cannon Control Center destroyed."); + Create_2D_WAV_Sound_Team("gdi_ion_center_destroyed_gdi.wav",1); + Create_2D_WAV_Sound_Team("gdi_ion_center_destroyed_nod.wav",0); + } + else if (strcmp(Commands->Get_Preset_Name(obj),"TCW_VehBld_Nod_Tmpl") == 0) + { + Send_Message(255,255,255,"Temple of Nod destroyed."); + Create_2D_WAV_Sound_Team("nod_temple_destroyed_nod.wav",0); + Create_2D_WAV_Sound_Team("nod_temple_destroyed_gdi.wav",1); } } void tcw_building::Damaged(GameObject *obj, GameObject *damager, float damage) @@ -195,18 +229,48 @@ Send_Message_Team(1,255,255,255,"Nod Airfield under attack."); } else if ( (strcmp(Commands->Get_Preset_Name(obj),"TCW_VehBld_GDI_Armory") == 0) || - (strcmp(Commands->Get_Preset_Name(obj),"TCW_VehBld_GDI_Silo") == 0) || - (strcmp(Commands->Get_Preset_Name(obj),"TCW_VehBld_GDI_CmdPost") == 0) ) + (strcmp(Commands->Get_Preset_Name(obj),"TCW_VehBld_GDI_Silo") == 0) ) { Create_2D_WAV_Sound_Team("gdi_our_base_under_attack.wav",1); Send_Message_Team(1,255,255,255,"Our Base is under attack."); } - else if ( (strcmp(Commands->Get_Preset_Name(obj),"TCW_VehBld_Nod_Shrine") == 0) || - (strcmp(Commands->Get_Preset_Name(obj),"TCW_VehBld_Nod_Silo") == 0) || - (strcmp(Commands->Get_Preset_Name(obj),"TCW_VehBld_Nod_OpCtr") == 0) ) + else if (strcmp(Commands->Get_Preset_Name(obj),"TCW_VehBld_GDI_CmdPost") == 0) + { + Create_2D_WAV_Sound_Team("gdi_command_post_under_attack_gdi.wav",1); + Send_Message_Team(1,255,255,255,"Warning GDI Command Post under attack."); + } + else if (strcmp(Commands->Get_Preset_Name(obj),"TCW_VehBld_Nod_OpCtr") == 0) + { + Create_2D_WAV_Sound_Team("nod_operations_centre_under_attack_gdi.wav",1); + Send_Message_Team(1,255,255,255,"Nod Operations Centre under attack."); + Create_2D_WAV_Sound_Team("nod_our_base_under_attack.wav",0); + Send_Message_Team(0,255,255,255,"Our Base is under attack."); + } + else if (strcmp(Commands->Get_Preset_Name(obj),"TCW_VehBld_Nod_Shrine") == 0) { Create_2D_WAV_Sound_Team("nod_our_base_under_attack.wav",0); Send_Message_Team(0,255,255,255,"Our Base is under attack."); + Create_2D_WAV_Sound_Team("nod_shrine_under_attack_gdi.wav",1); + Send_Message_Team(1,255,255,255,"Shrine of Nod under attack."); + } + else if (strcmp(Commands->Get_Preset_Name(obj),"TCW_VehBld_Nod_Silo") == 0) + { + Create_2D_WAV_Sound_Team("nod_tiberium_silo_under_attack_nod.wav",0); + Send_Message_Team(0,255,255,255,"Warning Nod Tiberium Silo under attack."); + } + else if (strcmp(Commands->Get_Preset_Name(obj),"TCW_VehBld_GDI_IonCtr") == 0) + { + Create_2D_WAV_Sound_Team("gdi_ion_center_under_attack_nod.wav",0); + Send_Message_Team(0,255,255,255,"GDI Ion Cannon Control Center under attack."); + Create_2D_WAV_Sound_Team("gdi_ion_center_under_attack_gdi.wav",1); + Send_Message_Team(1,255,255,255,"Warning GDI Ion Cannon Control Center under attack."); + } + else if (strcmp(Commands->Get_Preset_Name(obj),"TCW_VehBld_Nod_Tmpl") == 0) + { + Create_2D_WAV_Sound_Team("nod_temple_under_attack_nod.wav",0); + Send_Message_Team(0,255,255,255,"Warning Temple of Nod under attack."); + Create_2D_WAV_Sound_Team("nod_temple_under_attack_gdi.wav",1); + Send_Message_Team(1,255,255,255,"Temple of Nod under attack."); } } } diff -uwr sourceold/scripts/tcw_building.h source/scripts/tcw_building.h --- sourceold/scripts/tcw_building.h 2011-10-14 22:27:32.042968700 +0800 +++ source/scripts/tcw_building.h 2012-02-02 09:44:43.155273400 +0800 @@ -1,6 +1,6 @@ /* Renegade Scripts.dll - Scripts by zunnie - http://dev.mp-gaming.com - Copyright 2011-2012 MP-Gaming + Scripts by zunnie - http://www.tiberiumcrystalwar.com + Copyright 2011-2012 MPF This file is part of the Renegade scripts.dll The Renegade scripts.dll is free software; you can redistribute it and/or modify it diff -uwr sourceold/scripts/tcw_center_point.cpp source/scripts/tcw_center_point.cpp --- sourceold/scripts/tcw_center_point.cpp 2011-10-14 22:25:11.539062500 +0800 +++ source/scripts/tcw_center_point.cpp 2012-02-02 09:44:43.169921800 +0800 @@ -1,6 +1,6 @@ /* Renegade Scripts.dll - Scripts by zunnie - http://dev.mp-gaming.com - Copyright 2011-2012 MP-Gaming + Scripts by zunnie - http://www.tiberiumcrystalwar.com + Copyright 2011-2012 MPF This file is part of the Renegade scripts.dll The Renegade scripts.dll is free software; you can redistribute it and/or modify it @@ -44,7 +44,7 @@ { if (create_cruiser_countdown_object)//if the cruisercountdown object may be created { - Send_Message(255,255,255,"Nod has captured the Countdown Point. 1 Minute for Cruiser Attacks."); + Send_Message(255,255,255,"Nod has captured the Countdown Control Point. One Minute for Cruiser Attacks."); create_cruiser_countdown_object = false;//its being created here so we set it to false so it doesnt get made a 2nd time Vector3 countdown_object_pos; countdown_object_pos.X = 0.0f; countdown_object_pos.Y = 0.0f; countdown_object_pos.Z = 0.0f; @@ -54,6 +54,14 @@ sprintf(prms,"%d,%d,%d,%d,%d",0,nod_bar_turret_id,nod_ref_turret_id,gdi_hand_turret_id,gdi_ref_turret_id); Attach_Script_Once(countdown_object,"tcw_cp_cruiser_countdown",prms); + Create_2D_WAV_Sound_Team("ControlPointCaptured_Nod.wav",0); + Create_2D_WAV_Sound_Team("ControlPointLost_GDI.wav",1); + + if (Commands->Get_Player_Type(damager) == Commands->Get_Player_Type(obj)) + { + Commands->Give_Money(damager,500.0f,true); + } + if (!Commands->Find_Object(nodveh1id)) { if (strcmp(Get_Parameter("NodVeh1"), "0") != 0) @@ -87,7 +95,7 @@ { if (create_cruiser_countdown_object) { - Send_Message(255,255,255,"GDI has captured the Countdown Point. 1 Minute for Cruiser Attacks."); + Send_Message(255,255,255,"GDI has captured the Countdown Control Point. One Minute for Cruiser Attacks."); create_cruiser_countdown_object = false; Vector3 countdown_object_pos; countdown_object_pos.X = 0.0f; countdown_object_pos.Y = 0.0f; countdown_object_pos.Z = 0.0f; @@ -97,6 +105,14 @@ sprintf(prms,"%d,%d,%d,%d,%d",1,nod_bar_turret_id,nod_ref_turret_id,gdi_hand_turret_id,gdi_ref_turret_id); Attach_Script_Once(countdown_object,"tcw_cp_cruiser_countdown",prms); + Create_2D_WAV_Sound_Team("ControlPointLost_Nod.wav",0); + Create_2D_WAV_Sound_Team("ControlPointCaptured_GDI.wav",1); + + if (Commands->Get_Player_Type(damager) == Commands->Get_Player_Type(obj)) + { + Commands->Give_Money(damager,500.0f,true); + } + if (!Commands->Find_Object(nodveh1id)) { if (strcmp(Get_Parameter("GDIVeh1"), "0") != 0) @@ -191,11 +207,11 @@ //destroy the spawned vehicles if ( (Commands->Find_Object(gdiveh1id)) && (!Get_Vehicle_Driver(Commands->Find_Object(gdiveh1id))) ) { - Commands->Apply_Damage(Commands->Find_Object(gdiveh1id),999999.0f,"Steel",obj); gdiveh1id = 0; + Commands->Apply_Damage(Commands->Find_Object(gdiveh1id),999999.0f,"Death",obj); gdiveh1id = 0; } if ( (Commands->Find_Object(gdiveh2id)) && (!Get_Vehicle_Driver(Commands->Find_Object(gdiveh2id))) ) { - Commands->Apply_Damage(Commands->Find_Object(gdiveh2id),999999.0f,"Steel",obj); gdiveh2id = 0; + Commands->Apply_Damage(Commands->Find_Object(gdiveh2id),999999.0f,"Death",obj); gdiveh2id = 0; } } } diff -uwr sourceold/scripts/tcw_center_point.h source/scripts/tcw_center_point.h --- sourceold/scripts/tcw_center_point.h 2011-10-15 12:39:38.261718700 +0800 +++ source/scripts/tcw_center_point.h 2012-02-02 09:44:43.139648400 +0800 @@ -1,6 +1,6 @@ /* Renegade Scripts.dll - Scripts by zunnie - http://dev.mp-gaming.com - Copyright 2011-2012 MP-Gaming + Scripts by zunnie - http://www.tiberiumcrystalwar.com + Copyright 2011-2012 MPF This file is part of the Renegade scripts.dll The Renegade scripts.dll is free software; you can redistribute it and/or modify it diff -uwr sourceold/scripts/tcw_coop.cpp source/scripts/tcw_coop.cpp --- sourceold/scripts/tcw_coop.cpp 2011-10-14 22:25:11.445312500 +0800 +++ source/scripts/tcw_coop.cpp 2012-02-02 09:44:43.115234300 +0800 @@ -1,6 +1,6 @@ /* Renegade Scripts.dll - Scripts by zunnie - http://dev.mp-gaming.com - Copyright 2011-2012 MP-Gaming + Scripts by zunnie - http://www.tiberiumcrystalwar.com + Copyright 2011-2012 MPF This file is part of the Renegade scripts.dll The Renegade scripts.dll is free software; you can redistribute it and/or modify it @@ -97,7 +97,20 @@ Commands->Enable_Spawner(Get_Int_Parameter("Spawner10"),Get_Int_Parameter("Enable")); } +void tcw_midlight_eva1::Created(GameObject *obj) +{ + Commands->Start_Timer(obj,this,17.0f,123123123);//skip over the map intro +} +void tcw_midlight_eva1::Timer_Expired(GameObject *obj, int number) +{ + if (number == 123123123) + { + Send_Message(255,204,0,"Lt. Sandra Telfair: Remember Commanders that by destroying the enemy Hand of Nod you stop infantry reinforcements."); + Commands->Create_2D_WAV_Sound("midlight_destroy_hand_stop_reinf.wav"); + } +} +ScriptRegistrant tcw_midlight_eva1_Registrant("tcw_midlight_eva1",""); ScriptRegistrant tcw_enable_spawners_killed_Registrant("tcw_enable_spawners_killed","Enable=0:int,Spawner01=0:int,Spawner02=0:int,Spawner03=0:int,Spawner04=0:int,Spawner05=0:int,Spawner06=0:int,Spawner07=0:int,Spawner08=0:int,Spawner09=0:int,Spawner10=0:int,"); ScriptRegistrant tcw_attach_script_simple_timer_Registrant("tcw_attach_script_simple_timer","Time=0:float,TimerID=100:int,Scriptname=bla:string"); ScriptRegistrant tcw_i_am_a_bot_Registrant("tcw_i_am_a_bot",""); diff -uwr sourceold/scripts/tcw_coop.h source/scripts/tcw_coop.h --- sourceold/scripts/tcw_coop.h 2011-10-15 12:39:38.276367100 +0800 +++ source/scripts/tcw_coop.h 2012-02-02 09:44:43.180664000 +0800 @@ -1,6 +1,6 @@ /* Renegade Scripts.dll - Scripts by zunnie - http://dev.mp-gaming.com - Copyright 2011-2012 MP-Gaming + Scripts by zunnie - http://www.tiberiumcrystalwar.com + Copyright 2011-2012 MPF This file is part of the Renegade scripts.dll The Renegade scripts.dll is free software; you can redistribute it and/or modify it @@ -26,3 +26,8 @@ class tcw_enable_spawners_killed : public ScriptImpClass { void Killed(GameObject *obj, GameObject *shooter); }; + +class tcw_midlight_eva1 : public ScriptImpClass { + void Created(GameObject *obj); + void Timer_Expired(GameObject *obj, int number); +}; diff -uwr sourceold/scripts/tcw_coop_cruising.cpp source/scripts/tcw_coop_cruising.cpp --- sourceold/scripts/tcw_coop_cruising.cpp 2011-10-14 22:25:11.524414000 +0800 +++ source/scripts/tcw_coop_cruising.cpp 2012-02-02 09:44:43.161132800 +0800 @@ -1,6 +1,6 @@ /* Renegade Scripts.dll - Scripts by zunnie - http://dev.mp-gaming.com - Copyright 2011-2012 MP-Gaming + Scripts by zunnie - http://www.tiberiumcrystalwar.com + Copyright 2011-2012 MPF This file is part of the Renegade scripts.dll The Renegade scripts.dll is free software; you can redistribute it and/or modify it diff -uwr sourceold/scripts/tcw_coop_cruising.h source/scripts/tcw_coop_cruising.h --- sourceold/scripts/tcw_coop_cruising.h 2011-10-15 12:39:38.278320300 +0800 +++ source/scripts/tcw_coop_cruising.h 2012-02-02 09:44:43.183593700 +0800 @@ -1,6 +1,6 @@ /* Renegade Scripts.dll - Scripts by zunnie - http://dev.mp-gaming.com - Copyright 2011-2012 MP-Gaming + Scripts by zunnie - http://www.tiberiumcrystalwar.com + Copyright 2011-2012 MPF This file is part of the Renegade scripts.dll The Renegade scripts.dll is free software; you can redistribute it and/or modify it diff -uwr sourceold/scripts/tcw_defence.cpp source/scripts/tcw_defence.cpp --- sourceold/scripts/tcw_defence.cpp 2011-10-14 22:25:11.495117100 +0800 +++ source/scripts/tcw_defence.cpp 2012-02-02 09:44:43.149414000 +0800 @@ -1,6 +1,6 @@ /* Renegade Scripts.dll - Scripts by zunnie - http://dev.mp-gaming.com - Copyright 2011-2012 MP-Gaming + Scripts by zunnie - http://www.tiberiumcrystalwar.com + Copyright 2011-2012 MPF This file is part of the Renegade scripts.dll The Renegade scripts.dll is free software; you can redistribute it and/or modify it diff -uwr sourceold/scripts/tcw_defence.h source/scripts/tcw_defence.h --- sourceold/scripts/tcw_defence.h 2011-10-15 12:39:38.285156200 +0800 +++ source/scripts/tcw_defence.h 2012-02-02 09:44:43.190429600 +0800 @@ -1,6 +1,6 @@ /* Renegade Scripts.dll - Scripts by zunnie - http://dev.mp-gaming.com - Copyright 2011-2012 MP-Gaming + Scripts by zunnie - http://www.tiberiumcrystalwar.com + Copyright 2011-2012 MPF This file is part of the Renegade scripts.dll The Renegade scripts.dll is free software; you can redistribute it and/or modify it diff -uwr sourceold/scripts/tcw_domination.cpp source/scripts/tcw_domination.cpp --- sourceold/scripts/tcw_domination.cpp 2011-10-15 12:39:38.263671800 +0800 +++ source/scripts/tcw_domination.cpp 2012-02-02 09:44:43.144531200 +0800 @@ -1,6 +1,6 @@ /* Renegade Scripts.dll - Scripts by zunnie - http://dev.mp-gaming.com - Copyright 2011-2012 MP-Gaming + Scripts by zunnie - http://www.tiberiumcrystalwar.com + Copyright 2011-2012 MPF This file is part of the Renegade scripts.dll The Renegade scripts.dll is free software; you can redistribute it and/or modify it @@ -65,24 +65,24 @@ if (points_gdi > points_nod) { char status[250]; char lead[250]; - sprintf(status,"GDI: %d points -- Nod: %d points -- Required: %d points",points_gdi,points_nod,points_max); - sprintf(lead,"GDI leads the game with a %d points lead",points_gdi-points_nod); - Send_Message(255,255,255,status); - Send_Message(255,255,255,lead); + sprintf(status,"msg GDI: %d points -- Nod: %d points -- Required: %d points",points_gdi,points_nod,points_max); + sprintf(lead,"msg GDI leads the game with a %d points lead",points_gdi-points_nod); + Console_Input(status); + Console_Input(lead); } else if (points_nod > points_gdi) { char status[250]; char lead[250]; - sprintf(status,"GDI: %d points -- Nod: %d points -- Required: %d points",points_gdi,points_nod,points_max); - sprintf(lead,"Nod leads the game with a %d points lead",points_nod-points_gdi); - Send_Message(255,255,255,status); - Send_Message(255,255,255,lead); + sprintf(status,"msg GDI: %d points -- Nod: %d points -- Required: %d points",points_gdi,points_nod,points_max); + sprintf(lead,"msg Nod leads the game with a %d points lead",points_nod-points_gdi); + Console_Input(status); + Console_Input(lead); } else { char status[250]; - sprintf(status,"GDI: %d points ----- Nod: %d points",points_gdi,points_nod); - Send_Message(255,255,255,status); + sprintf(status,"msg GDI: %d points ----- Nod: %d points",points_gdi,points_nod); + Console_Input(status); } } } @@ -94,24 +94,24 @@ if (points_gdi > points_nod) { char status[250]; char lead[250]; - sprintf(status,"GDI: %d points -- Nod: %d points -- Required: %d points",points_gdi,points_nod,points_max); - sprintf(lead,"GDI leads the game with a %d points lead",points_gdi-points_nod); - Send_Message(255,255,255,status); - Send_Message(255,255,255,lead); + sprintf(status,"msg GDI: %d points -- Nod: %d points -- Required: %d points",points_gdi,points_nod,points_max); + sprintf(lead,"msg GDI leads the game with a %d points lead",points_gdi-points_nod); + Console_Input(status); + Console_Input(lead); } else if (points_nod > points_gdi) { char status[250]; char lead[250]; - sprintf(status,"GDI: %d points -- Nod: %d points -- Required: %d points",points_gdi,points_nod,points_max); - sprintf(lead,"Nod leads the game with a %d points lead",points_nod-points_gdi); - Send_Message(255,255,255,status); - Send_Message(255,255,255,lead); + sprintf(status,"msg GDI: %d points -- Nod: %d points -- Required: %d points",points_gdi,points_nod,points_max); + sprintf(lead,"msg Nod leads the game with a %d points lead",points_nod-points_gdi); + Console_Input(status); + Console_Input(lead); } else { char status[250]; - sprintf(status,"GDI: %d points ----- Nod: %d points",points_gdi,points_nod); - Send_Message(255,255,255,status); + sprintf(status,"msg GDI: %d points ----- Nod: %d points",points_gdi,points_nod); + Console_Input(status); } Commands->Start_Timer(obj,this,120.0f,123439348); } @@ -233,7 +233,13 @@ } } - char capturemsg[250]; sprintf(capturemsg,"Nod captured the %s node.",nodename); Send_Message(255,255,255,capturemsg); + char capturemsg[250]; sprintf(capturemsg,"Nod captured the %s Control Point.",nodename); Send_Message(255,255,255,capturemsg); + Create_2D_WAV_Sound_Team("ControlPointCaptured_Nod.wav",0); + Create_2D_WAV_Sound_Team("ControlPointLost_GDI.wav",1); + if (Commands->Get_Player_Type(damager) == Commands->Get_Player_Type(obj)) + { + Commands->Give_Money(damager,500.0f,true); + } } } else if (owner == 1) @@ -304,7 +310,13 @@ } } - char capturemsg[250]; sprintf(capturemsg,"GDI captured the %s node.",nodename); Send_Message(255,255,255,capturemsg); + char capturemsg[250]; sprintf(capturemsg,"GDI captured the %s Control Point.",nodename); Send_Message(255,255,255,capturemsg); + Create_2D_WAV_Sound_Team("ControlPointCaptured_GDI.wav",1); + Create_2D_WAV_Sound_Team("ControlPointLost_Nod.wav",0); + if (Commands->Get_Player_Type(damager) == Commands->Get_Player_Type(obj)) + { + Commands->Give_Money(damager,500.0f,true); + } } } } diff -uwr sourceold/scripts/tcw_domination.h source/scripts/tcw_domination.h --- sourceold/scripts/tcw_domination.h 2011-10-15 12:39:38.281250000 +0800 +++ source/scripts/tcw_domination.h 2012-02-02 09:44:43.185546800 +0800 @@ -1,6 +1,6 @@ /* Renegade Scripts.dll - Scripts by zunnie - http://dev.mp-gaming.com - Copyright 2011-2012 MP-Gaming + Scripts by zunnie - http://www.tiberiumcrystalwar.com + Copyright 2011-2012 MPF This file is part of the Renegade scripts.dll The Renegade scripts.dll is free software; you can redistribute it and/or modify it diff -uwr sourceold/scripts/tcw_game.cpp source/scripts/tcw_game.cpp --- sourceold/scripts/tcw_game.cpp 2011-10-14 22:25:11.459960900 +0800 +++ source/scripts/tcw_game.cpp 2012-02-08 00:15:43.935546800 +0800 @@ -1,6 +1,6 @@ /* Renegade Scripts.dll - Scripts by zunnie - http://dev.mp-gaming.com - Copyright 2011-2012 MP-Gaming + Scripts by zunnie - http://www.tiberiumcrystalwar.com + Copyright 2011-2012 MPF This file is part of the Renegade scripts.dll The Renegade scripts.dll is free software; you can redistribute it and/or modify it @@ -133,7 +133,21 @@ void tcw_tiberium_spike::Created(GameObject *obj) { firstcapture = true; - Commands->Set_Animation(obj,"V_NEU_SPIKE.V_NEU_SPIKE",true,0,1,-1,0); + Commands->Set_Health(obj,1.0f); + //Commands->Set_Animation(obj,"V_NEU_SPIKE.V_NEU_SPIKE",true,0,1,-1,0); //unteamed spikes dont animate +} +void tcw_tiberium_spike::Damaged(GameObject *obj, GameObject *damager, float damage) +{ + if (damage > 0.0f) + { + if (damage > Commands->Get_Health(obj))//destroyed + { + Commands->Set_Health(obj,1.0f); + Remove_Script(obj,"tcw_Credit_Trickle"); + Commands->Set_Player_Type(obj,-2);//unteam it again + Commands->Set_Animation(obj,"V_NEU_SPIKE.V_NEU_SPIKE",true,0,1,1,0); //stop animate when uncaptured + } + } } void tcw_tiberium_spike::Custom(GameObject *obj, int message, int param, GameObject *sender) { @@ -147,10 +161,14 @@ firstcapture = false; Commands->Give_Money(obj,250.0f,1); Attach_Script_Once(obj,"tcw_Credit_Trickle","5,1"); + Commands->Set_Animation(obj,"V_NEU_SPIKE.V_NEU_SPIKE",true,0,1,-1,0); //start animate when captured + Commands->Set_Health(obj,Commands->Get_Max_Health(obj)); //captured repair it } else { Attach_Script_Once(obj,"tcw_Credit_Trickle","5,1"); + Commands->Set_Animation(obj,"V_NEU_SPIKE.V_NEU_SPIKE",true,0,1,-1,0); //start animate when captured + Commands->Set_Health(obj,Commands->Get_Max_Health(obj)); //captured repair it } } else if (param == 1) @@ -161,10 +179,14 @@ firstcapture = false; Commands->Give_Money(obj,250.0f,1); Attach_Script_Once(obj,"tcw_Credit_Trickle","5,1"); + Commands->Set_Animation(obj,"V_NEU_SPIKE.V_NEU_SPIKE",true,0,1,-1,0); //start animate when captured + Commands->Set_Health(obj,Commands->Get_Max_Health(obj)); //captured repair it } else { Attach_Script_Once(obj,"tcw_Credit_Trickle","5,1"); + Commands->Set_Animation(obj,"V_NEU_SPIKE.V_NEU_SPIKE",true,0,1,-1,0); //start animate when captured + Commands->Set_Health(obj,Commands->Get_Max_Health(obj)); //captured repair it } } } @@ -177,10 +199,14 @@ { firstcapture = false; Attach_Script_Once(obj,"tcw_Credit_Trickle","5,1"); + Commands->Set_Health(obj,Commands->Get_Max_Health(obj)); //captured repair it + Commands->Set_Animation(obj,"V_NEU_SPIKE.V_NEU_SPIKE",true,0,1,-1,0); //start animate when captured } else { Attach_Script_Once(obj,"tcw_Credit_Trickle","5,1"); + Commands->Set_Health(obj,Commands->Get_Max_Health(obj)); //captured repair it + Commands->Set_Animation(obj,"V_NEU_SPIKE.V_NEU_SPIKE",true,0,1,-1,0); //start animate when captured } } else if (param == 1) @@ -190,10 +216,14 @@ { firstcapture = false; Attach_Script_Once(obj,"tcw_Credit_Trickle","5,1"); + Commands->Set_Health(obj,Commands->Get_Max_Health(obj)); //captured repair it + Commands->Set_Animation(obj,"V_NEU_SPIKE.V_NEU_SPIKE",true,0,1,-1,0); //start animate when captured } else { Attach_Script_Once(obj,"tcw_Credit_Trickle","5,1"); + Commands->Set_Health(obj,Commands->Get_Max_Health(obj)); //captured repair it + Commands->Set_Animation(obj,"V_NEU_SPIKE.V_NEU_SPIKE",true,0,1,-1,0); //start animate when captured } } } @@ -741,7 +771,14 @@ if (!Is_Building_Dead(Find_Building(team,BuildingConstants::TYPE_REFINERY))) { Commands->Give_Money(Commands->Find_Object(driverid),tiberiumvalue,true); + if (hasgreen) + { Commands->Give_Points(Commands->Find_Object(driverid),50.0f,0); + } + if (hasblue) + { + Commands->Give_Points(Commands->Find_Object(driverid),75.0f,0); + } if (team == 0) { char dumpmsg[250]; @@ -771,7 +808,7 @@ { if (harvesting) { - if (tiberiumvalue < 1400.0f) + if (tiberiumvalue < 800.0f) { Commands->Start_Timer(obj,this,1.0f,10500); tiberiumvalue = tiberiumvalue+100.0f; @@ -789,7 +826,7 @@ Send_Message_Player(Commands->Find_Object(driverid),255,204,0,amount); } - if (tiberiumvalue == 1400.0f) + if (tiberiumvalue == 800.0f) { if (team == 0) { @@ -810,7 +847,7 @@ { if (harvesting) { - if (tiberiumvalue < 2800.0f) + if (tiberiumvalue < 1600.0f) { Commands->Start_Timer(obj,this,1.0f,10501); tiberiumvalue = tiberiumvalue+200.0f; @@ -828,7 +865,7 @@ Send_Message_Player(Commands->Find_Object(driverid),255,204,0,amount); } - if (tiberiumvalue == 2800.0f) + if (tiberiumvalue == 1600.0f) { if (team == 0) { diff -uwr sourceold/scripts/tcw_game.h source/scripts/tcw_game.h --- sourceold/scripts/tcw_game.h 2011-10-15 12:39:38.274414000 +0800 +++ source/scripts/tcw_game.h 2012-02-08 00:15:44.309570300 +0800 @@ -1,6 +1,6 @@ /* Renegade Scripts.dll - Scripts by zunnie - http://dev.mp-gaming.com - Copyright 2011-2012 MP-Gaming + Scripts by zunnie - http://www.tiberiumcrystalwar.com + Copyright 2011-2012 MPF This file is part of the Renegade scripts.dll The Renegade scripts.dll is free software; you can redistribute it and/or modify it @@ -27,6 +27,7 @@ void Created(GameObject *obj); void Custom(GameObject *obj,int type,int param,GameObject *sender); public: void Register_Auto_Save_Variables(); + void Damaged(GameObject *obj, GameObject *damager, float damage); bool firstcapture; }; @@ -190,4 +191,8 @@ + + + + diff -uwr sourceold/scripts/tcw_player.cpp source/scripts/tcw_player.cpp --- sourceold/scripts/tcw_player.cpp 2011-10-15 12:39:38.266601500 +0800 +++ source/scripts/tcw_player.cpp 2012-02-02 09:44:43.153320300 +0800 @@ -1,6 +1,6 @@ /* Renegade Scripts.dll - Scripts by zunnie - http://dev.mp-gaming.com - Copyright 2011-2012 MP-Gaming + Scripts by zunnie - http://www.tiberiumcrystalwar.com + Copyright 2011-2012 MPF This file is part of the Renegade scripts.dll The Renegade scripts.dll is free software; you can redistribute it and/or modify it @@ -250,11 +250,11 @@ //unit purchase sounds int random = Commands->Get_Random_Int(1,3);//used by char purchase playsound - if (Commands->Get_Player_Type(obj) == 1) - { if ( (_stricmp(Commands->Get_Preset_Name(obj),"TCW_GDI_Commando") == 0) || (_stricmp(Commands->Get_Preset_Name(obj),"TCW_GDI_Commando_Low") == 0) ) { - if ( (Get_Object_Count(1,"TCW_GDI_Commando") > 1) || (Get_Object_Count(1,"TCW_GDI_Commando_Low") > 1) ) + if (Commands->Get_Player_Type(obj) == 1) + { + if ( (Get_Object_Count(1,"TCW_GDI_Commando") > 1) || (Get_Object_Count(1,"TCW_GDI_Commando_Low") > 1) || (Get_Object_Count(1,"TCW_Nod_Commando") > 1) || (Get_Object_Count(1,"TCW_Nod_Commando_Low") > 1) ) { Commands->Give_Money(obj,2000.0f,false); Change_Character(obj,"CnC_GDI_MiniGunner_0"); @@ -279,8 +279,8 @@ } else if (rnd == 3) { - Create_2D_WAV_Sound_Team("purchase_gdi_commando_3.wav",1); - char player[250]; sprintf(player,"%s: Let's get this party started.",Get_Player_Name(obj)); + Create_2D_WAV_Sound_Team("purchase_gdi_commando_5.wav",1); + char player[250]; sprintf(player,"%s: Let's load and lock and roll and rock.",Get_Player_Name(obj)); Send_Message_Team(1,255,204,0,player); } else if (rnd == 4) @@ -297,9 +297,57 @@ } } } + else if (Commands->Get_Player_Type(obj) == 0) + { + if ( (Get_Object_Count(0,"TCW_GDI_Commando") > 1) || (Get_Object_Count(0,"TCW_GDI_Commando_Low") > 1) || (Get_Object_Count(0,"TCW_Nod_Commando") > 1) || (Get_Object_Count(0,"TCW_Nod_Commando_Low") > 1) ) + { + Commands->Give_Money(obj,2000.0f,false); + Change_Character(obj,"CnC_Nod_Minigunner_0"); + } + else + { + Create_2D_WAV_Sound_Team("gdi_commandodetected.wav",1); + Send_Message_Team(1,255,204,0,"Warning, enemy commando detected."); + + int rnd = Commands->Get_Random_Int(1,5); + if (rnd == 1) + { + Create_2D_WAV_Sound_Team("purchase_gdi_commando_1.wav",0); + char player[250]; sprintf(player,"%s: Got a present for ya.",Get_Player_Name(obj)); + Send_Message_Team(0,255,0,0,player); + } + else if (rnd == 2) + { + Create_2D_WAV_Sound_Team("purchase_gdi_commando_2.wav",0); + char player[250]; sprintf(player,"%s: Okay boss let's hear the plan.",Get_Player_Name(obj)); + Send_Message_Team(0,255,0,0,player); + } + else if (rnd == 3) + { + Create_2D_WAV_Sound_Team("purchase_gdi_commando_5.wav",0); + char player[250]; sprintf(player,"%s: Let's load and lock and roll and rock.",Get_Player_Name(obj)); + Send_Message_Team(0,255,0,0,player); + } + else if (rnd == 4) + { + Create_2D_WAV_Sound_Team("purchase_gdi_commando_4.wav",0); + char player[250]; sprintf(player,"%s: Didn't miss anything, did i?.",Get_Player_Name(obj)); + Send_Message_Team(0,255,0,0,player); + } + else if (rnd == 5) + { + Create_2D_WAV_Sound_Team("purchase_gdi_commando_5.wav",0); + char player[250]; sprintf(player,"%s: Let's load and lock and roll and rock.",Get_Player_Name(obj)); + Send_Message_Team(0,255,0,0,player); + } + } + } + } else if (_stricmp(Commands->Get_Preset_Name(obj),"TCW_GDI_Rifle_Squad") == 0) { + if (Commands->Get_Player_Type(obj) == 1) + { if (random == 1) { Create_2D_WAV_Sound_Team("purchase_gdi_rifle_squad_1.wav",1); @@ -323,6 +371,28 @@ Change_Character(obj,"TCW_GDI_Rifle_Upgrade"); } } + else if (Commands->Get_Player_Type(obj) == 0) + { + if (random == 1) + { + Create_2D_WAV_Sound_Team("purchase_gdi_rifle_squad_1.wav",0); + char player[250]; sprintf(player,"%s: Keep your weapon ready.",Get_Player_Name(obj)); + Send_Message_Team(0,255,0,0,player); + } + else if (random == 2) + { + Create_2D_WAV_Sound_Team("purchase_gdi_rifle_squad_2.wav",0); + char player[250]; sprintf(player,"%s: Rifle squad ready.",Get_Player_Name(obj)); + Send_Message_Team(0,255,0,0,player); + } + else if (random == 3) + { + Create_2D_WAV_Sound_Team("purchase_gdi_rifle_squad_3.wav",0); + char player[250]; sprintf(player,"%s: Rifleman awaiting orders.",Get_Player_Name(obj)); + Send_Message_Team(0,255,0,0,player); + } + } + } else if (_stricmp(Commands->Get_Preset_Name(obj),"TCW_GDI_Rifle_Squad_Low") == 0) { @@ -350,7 +420,9 @@ } } - else if ( (_stricmp(Commands->Get_Preset_Name(obj),"TCW_GDI_Engineer") == 0) || (_stricmp(Commands->Get_Preset_Name(obj),"TCW_GDI_Engineer_Low") == 0) ) + else if ( (_stricmp(Commands->Get_Preset_Name(obj),"TCW_GDI_Engineer") == 0) || (_stricmp(Commands->Get_Preset_Name(obj),"TCW_GDI_Engineer_Low") == 0) || (_stricmp(Commands->Get_Preset_Name(obj),"TCW_GDI_Engineer_Coop") == 0) ) + { + if (Commands->Get_Player_Type(obj) == 1) { if (random == 1) { @@ -371,8 +443,32 @@ Send_Message_Team(1,255,204,0,player); } } + else if (Commands->Get_Player_Type(obj) == 0) + { + if (random == 1) + { + Create_2D_WAV_Sound_Team("purchase_gdi_engineer_1.wav",0); + char player[250]; sprintf(player,"%s: I got their codes.",Get_Player_Name(obj)); + Send_Message_Team(0,255,0,0,player); + } + else if (random == 2) + { + Create_2D_WAV_Sound_Team("purchase_gdi_engineer_2.wav",0); + char player[250]; sprintf(player,"%s: Engineer clocking in.",Get_Player_Name(obj)); + Send_Message_Team(0,255,0,0,player); + } + else if (random == 3) + { + Create_2D_WAV_Sound_Team("purchase_gdi_engineer_3.wav",0); + char player[250]; sprintf(player,"%s: Engineer reporting in.",Get_Player_Name(obj)); + Send_Message_Team(0,255,0,0,player); + } + } + } else if (_stricmp(Commands->Get_Preset_Name(obj),"TCW_GDI_Grenadier") == 0) { + if (Commands->Get_Player_Type(obj) == 1) + { if (random == 1) { Create_2D_WAV_Sound_Team("purchase_gdi_grenadier_1.wav",1); @@ -396,6 +492,28 @@ Change_Character(obj,"TCW_GDI_Grenadier_Upgrade"); } } + else if (Commands->Get_Player_Type(obj) == 0) + { + if (random == 1) + { + Create_2D_WAV_Sound_Team("purchase_gdi_grenadier_1.wav",0); + char player[250]; sprintf(player,"%s: They won't be coming back out.",Get_Player_Name(obj)); + Send_Message_Team(0,255,0,0,player); + } + else if (random == 2) + { + Create_2D_WAV_Sound_Team("purchase_gdi_grenadier_2.wav",0); + char player[250]; sprintf(player,"%s: Somebody call for some blasting?",Get_Player_Name(obj)); + Send_Message_Team(0,255,0,0,player); + } + else if (random == 3) + { + Create_2D_WAV_Sound_Team("purchase_gdi_grenadier_3.wav",0); + char player[250]; sprintf(player,"%s: Grenade squad all ready.",Get_Player_Name(obj)); + Send_Message_Team(0,255,0,0,player); + } + } + } else if (_stricmp(Commands->Get_Preset_Name(obj),"TCW_GDI_Grenadier_Low") == 0) { if (random == 1) @@ -424,6 +542,8 @@ else if (_stricmp(Commands->Get_Preset_Name(obj),"TCW_GDI_Missile_Squad") == 0) { + if (Commands->Get_Player_Type(obj) == 1) + { if (random == 1) { Create_2D_WAV_Sound_Team("purchase_gdi_missile_squad_1.wav",1); @@ -447,6 +567,28 @@ Change_Character(obj,"TCW_GDI_Missile_Squad_Upgrade"); } } + else if (Commands->Get_Player_Type(obj) == 0) + { + if (random == 1) + { + Create_2D_WAV_Sound_Team("purchase_gdi_missile_squad_1.wav",0); + char player[250]; sprintf(player,"%s: Launcher's ready.",Get_Player_Name(obj)); + Send_Message_Team(0,255,0,0,player); + } + else if (random == 2) + { + Create_2D_WAV_Sound_Team("purchase_gdi_missile_squad_1.wav",0); + char player[250]; sprintf(player,"%s: Launcher's ready.",Get_Player_Name(obj)); + Send_Message_Team(0,255,0,0,player); + } + else if (random == 3) + { + Create_2D_WAV_Sound_Team("purchase_gdi_missile_squad_1.wav",0); + char player[250]; sprintf(player,"%s: Launcher's ready.",Get_Player_Name(obj)); + Send_Message_Team(0,255,0,0,player); + } + } + } else if (_stricmp(Commands->Get_Preset_Name(obj),"TCW_GDI_Missile_Squad_Low") == 0) { if (random == 1) @@ -475,9 +617,9 @@ else if ( (_stricmp(Commands->Get_Preset_Name(obj),"TCW_GDI_Sniper") == 0) || (_stricmp(Commands->Get_Preset_Name(obj),"TCW_GDI_Sniper_Low") == 0) ) { - if ( (Get_Object_Count(1,"TCW_GDI_Sniper") > sniperlimit) || (Get_Object_Count(1,"TCW_GDI_Sniper_Low") > sniperlimit) ) + if (Commands->Get_Player_Type(obj) == 1) { - if (Is_Base_Powered(1)) + if ( (Get_Object_Count(1,"TCW_GDI_Sniper") > sniperlimit) || (Get_Object_Count(1,"TCW_GDI_Sniper_Low") > sniperlimit) ) { Commands->Give_Money(obj,1000.0f,false); Send_Message_Player(obj,255,204,0,"Sniper limit reached, try again later."); @@ -486,14 +628,6 @@ } else { - Commands->Give_Money(obj,2000.0f,false); - Send_Message_Player(obj,255,204,0,"Sniper limit reached, try again later."); - Create_2D_WAV_Sound_Player(obj,"incmsg.wav"); - Change_Character(obj,"CnC_GDI_MiniGunner_0"); - } - } - else - { if (random == 1) { Create_2D_WAV_Sound_Team("purchase_gdi_sniper_1.wav",1); @@ -514,8 +648,42 @@ } } } + else if (Commands->Get_Player_Type(obj) == 0) + { + if ( (Get_Object_Count(0,"TCW_GDI_Sniper") > sniperlimit) || (Get_Object_Count(1,"TCW_GDI_Sniper_Low") > sniperlimit) ) + { + Commands->Give_Money(obj,1000.0f,false); + Send_Message_Player(obj,255,0,0,"Sniper limit reached, try again later."); + Create_2D_WAV_Sound_Player(obj,"incmsg.wav"); + Change_Character(obj,"CnC_Nod_Minigunner_0"); + } + else + { + if (random == 1) + { + Create_2D_WAV_Sound_Team("purchase_gdi_sniper_1.wav",0); + char player[250]; sprintf(player,"%s: Take 'em out one by one.",Get_Player_Name(obj)); + Send_Message_Team(0,255,0,0,player); + } + else if (random == 2) + { + Create_2D_WAV_Sound_Team("purchase_gdi_sniper_2.wav",0); + char player[250]; sprintf(player,"%s: Sniper team ready.",Get_Player_Name(obj)); + Send_Message_Team(0,255,0,0,player); + } + else if (random == 3) + { + Create_2D_WAV_Sound_Team("purchase_gdi_sniper_3.wav",0); + char player[250]; sprintf(player,"%s: Sniper team, where do you need us?",Get_Player_Name(obj)); + Send_Message_Team(0,255,0,0,player); + } + } + } + } else if ( (_stricmp(Commands->Get_Preset_Name(obj),"TCW_GDI_Zonetrooper") == 0) || (_stricmp(Commands->Get_Preset_Name(obj),"TCW_GDI_Zonetrooper_Low") == 0) ) { + if (Commands->Get_Player_Type(obj) == 1) + { if (random == 1) { Create_2D_WAV_Sound_Team("purchase_gdi_zonetrooper_1.wav",1); @@ -535,12 +703,33 @@ Send_Message_Team(1,255,204,0,player); } } - } else if (Commands->Get_Player_Type(obj) == 0) { - if ( (_stricmp(Commands->Get_Preset_Name(obj),"TCW_Nod_Commando") == 0) || (_stricmp(Commands->Get_Preset_Name(obj),"TCW_Nod_Commando_Low") == 0) ) + if (random == 1) { - if ( (Get_Object_Count(0,"TCW_Nod_Commando") > 1) || (Get_Object_Count(0,"TCW_Nod_Commando_Low") > 1) ) + Create_2D_WAV_Sound_Team("purchase_gdi_zonetrooper_1.wav",0); + char player[250]; sprintf(player,"%s: Keep 'em coming.",Get_Player_Name(obj)); + Send_Message_Team(0,255,0,0,player); + } + else if (random == 2) + { + Create_2D_WAV_Sound_Team("purchase_gdi_zonetrooper_2.wav",0); + char player[250]; sprintf(player,"%s: Troopers ready for action.",Get_Player_Name(obj)); + Send_Message_Team(0,255,0,0,player); + } + else if (random == 3) + { + Create_2D_WAV_Sound_Team("purchase_gdi_zonetrooper_3.wav",0); + char player[250]; sprintf(player,"%s: Troopers in the field.",Get_Player_Name(obj)); + Send_Message_Team(0,255,0,0,player); + } + } + } + else if ( (_stricmp(Commands->Get_Preset_Name(obj),"TCW_Nod_Commando") == 0) || (_stricmp(Commands->Get_Preset_Name(obj),"TCW_Nod_Commando_Low") == 0) ) + { + if (Commands->Get_Player_Type(obj) == 0) + { + if ( (Get_Object_Count(0,"TCW_Nod_Commando") > 1) || (Get_Object_Count(0,"TCW_Nod_Commando_Low") > 1) || (Get_Object_Count(0,"TCW_GDI_Commando") > 1) || (Get_Object_Count(0,"TCW_GDI_Commando_Low") > 1) ) { Commands->Give_Money(obj,2000.0f,false); Change_Character(obj,"CnC_Nod_Minigunner_0"); @@ -548,7 +737,7 @@ else { Create_2D_WAV_Sound_Team("gdi_commandodetected.wav",1); - Send_Message_Team(1,248,195,4,"Warning, enemy commando detected."); + Send_Message_Team(1,255,204,0,"Warning, enemy commando detected."); if (random == 1) { @@ -570,7 +759,42 @@ } } } - if ( (_stricmp(Commands->Get_Preset_Name(obj),"TCW_Nod_Militant_Infantry") == 0) || (_stricmp(Commands->Get_Preset_Name(obj),"TCW_Nod_Militant_Infantry_Low") == 0) ) + else if (Commands->Get_Player_Type(obj) == 1) + { + if ( (Get_Object_Count(1,"TCW_Nod_Commando") > 1) || (Get_Object_Count(1,"TCW_Nod_Commando_Low") > 1) || (Get_Object_Count(1,"TCW_GDI_Commando") > 1) || (Get_Object_Count(1,"TCW_GDI_Commando_Low") > 1) ) + { + Commands->Give_Money(obj,2000.0f,false); + Change_Character(obj,"CnC_GDI_MiniGunner_0"); + } + else + { + Create_2D_WAV_Sound_Team("nod_commandodetected.wav",0); + Send_Message_Team(0,255,0,0,"Warning, enemy commando detected."); + + if (random == 1) + { + Create_2D_WAV_Sound_Team("purchase_nod_commando_1.wav",1); + char player[250]; sprintf(player,"%s: Nice day for a kill.",Get_Player_Name(obj)); + Send_Message_Team(1,255,204,0,player); + } + else if (random == 2) + { + Create_2D_WAV_Sound_Team("purchase_nod_commando_2.wav",1); + char player[250]; sprintf(player,"%s: Ready for assignment.",Get_Player_Name(obj)); + Send_Message_Team(1,255,204,0,player); + } + else if (random == 3) + { + Create_2D_WAV_Sound_Team("purchase_nod_commando_2.wav",1); + char player[250]; sprintf(player,"%s: Ready for assignment.",Get_Player_Name(obj)); + Send_Message_Team(1,255,204,0,player); + } + } + } + } + else if ( (_stricmp(Commands->Get_Preset_Name(obj),"TCW_Nod_Militant_Infantry") == 0) || (_stricmp(Commands->Get_Preset_Name(obj),"TCW_Nod_Militant_Infantry_Low") == 0) ) + { + if (Commands->Get_Player_Type(obj) == 0) { if (random == 1) { @@ -591,7 +815,29 @@ Send_Message_Team(0,255,0,0,player); } } - if ( (_stricmp(Commands->Get_Preset_Name(obj),"TCW_Nod_Black_Hand_Chem") == 0) || (_stricmp(Commands->Get_Preset_Name(obj),"TCW_Nod_Black_Hand_Chem_Low") == 0) ) + else if (Commands->Get_Player_Type(obj) == 1) + { + if (random == 1) + { + Create_2D_WAV_Sound_Team("purchase_nod_militant_squad_1.wav",1); + char player[250]; sprintf(player,"%s: Rise up.",Get_Player_Name(obj)); + Send_Message_Team(0,255,204,0,player); + } + else if (random == 2) + { + Create_2D_WAV_Sound_Team("purchase_nod_militant_squad_2.wav",1); + char player[250]; sprintf(player,"%s: The time has come warrior of Nod.",Get_Player_Name(obj)); + Send_Message_Team(0,255,204,0,player); + } + else if (random == 3) + { + Create_2D_WAV_Sound_Team("purchase_nod_militant_squad_3.wav",1); + char player[250]; sprintf(player,"%s: Fighters arm up.",Get_Player_Name(obj)); + Send_Message_Team(0,255,204,0,player); + } + } + } + else if ( (_stricmp(Commands->Get_Preset_Name(obj),"TCW_Nod_Black_Hand_Chem") == 0) || (_stricmp(Commands->Get_Preset_Name(obj),"TCW_Nod_Black_Hand_Chem_Low") == 0) ) { if (random == 1) { @@ -612,7 +858,9 @@ Send_Message_Team(0,255,0,0,player); } } - if ( (_stricmp(Commands->Get_Preset_Name(obj),"TCW_Nod_Black_Hand_Flame") == 0) || (_stricmp(Commands->Get_Preset_Name(obj),"TCW_Nod_Black_Hand_Low") == 0) ) + else if ( (_stricmp(Commands->Get_Preset_Name(obj),"TCW_Nod_Black_Hand_Flame") == 0) || (_stricmp(Commands->Get_Preset_Name(obj),"TCW_Black_Hand_Low") == 0) ) + { + if (Commands->Get_Player_Type(obj) == 0) { int rnd = Commands->Get_Random_Int(1,4); if (rnd == 1) @@ -624,7 +872,7 @@ else if (rnd == 2) { Create_2D_WAV_Sound_Team("purchase_nod_blackhand_flame_2.wav",0); - char player[250]; sprintf(player,"%s: Pure fire ready.",Get_Player_Name(obj)); + char player[250]; sprintf(player,"%s: Purifier ready.",Get_Player_Name(obj)); Send_Message_Team(0,255,0,0,player); } else if (rnd == 3) @@ -640,7 +888,38 @@ Send_Message_Team(0,255,0,0,player); } } - if ( (_stricmp(Commands->Get_Preset_Name(obj),"TCW_Nod_RocketGuy") == 0) || (_stricmp(Commands->Get_Preset_Name(obj),"TCW_Nod_RocketGuy_Low") == 0) ) + else if (Commands->Get_Player_Type(obj) == 1) + { + int rnd = Commands->Get_Random_Int(1,4); + if (rnd == 1) + { + Create_2D_WAV_Sound_Team("purchase_nod_blackhand_flame_1.wav",1); + char player[250]; sprintf(player,"%s: One mission. One purpose.",Get_Player_Name(obj)); + Send_Message_Team(1,255,204,0,player); + } + else if (rnd == 2) + { + Create_2D_WAV_Sound_Team("purchase_nod_blackhand_flame_2.wav",1); + char player[250]; sprintf(player,"%s: Purifier ready.",Get_Player_Name(obj)); + Send_Message_Team(1,255,204,0,player); + } + else if (rnd == 3) + { + Create_2D_WAV_Sound_Team("purchase_nod_blackhand_flame_3.wav",1); + char player[250]; sprintf(player,"%s: The flame shall purify.",Get_Player_Name(obj)); + Send_Message_Team(1,255,204,0,player); + } + else if (rnd == 4) + { + Create_2D_WAV_Sound_Team("purchase_nod_blackhand_flame_4.wav",1); + char player[250]; sprintf(player,"%s: And then there was fire.",Get_Player_Name(obj)); + Send_Message_Team(1,255,204,0,player); + } + } + } + else if ( (_stricmp(Commands->Get_Preset_Name(obj),"TCW_Nod_RocketGuy") == 0) || (_stricmp(Commands->Get_Preset_Name(obj),"TCW_Nod_RocketGuy_Low") == 0) ) + { + if (Commands->Get_Player_Type(obj) == 0) { if (random == 1) { @@ -661,7 +940,31 @@ Send_Message_Team(0,255,0,0,player); } } - if ( (_stricmp(Commands->Get_Preset_Name(obj),"TCW_Nod_Saboteur") == 0) || (_stricmp(Commands->Get_Preset_Name(obj),"TCW_Nod_Saboteur_Low") == 0) ) + else if (Commands->Get_Player_Type(obj) == 1) + { + if (random == 1) + { + Create_2D_WAV_Sound_Team("purchase_nod_militant_rocket_squad_1.wav",1); + char player[250]; sprintf(player,"%s: If it moves: Kill it.",Get_Player_Name(obj)); + Send_Message_Team(1,255,204,0,player); + } + else if (random == 2) + { + Create_2D_WAV_Sound_Team("purchase_nod_militant_rocket_squad_2.wav",1); + char player[250]; sprintf(player,"%s: Rockets ready.",Get_Player_Name(obj)); + Send_Message_Team(1,255,204,0,player); + } + else if (random == 3) + { + Create_2D_WAV_Sound_Team("purchase_nod_militant_rocket_squad_3.wav",1); + char player[250]; sprintf(player,"%s: We got the rockets.",Get_Player_Name(obj)); + Send_Message_Team(1,255,204,0,player); + } + } + } + else if ( (_stricmp(Commands->Get_Preset_Name(obj),"TCW_Nod_Saboteur") == 0) || (_stricmp(Commands->Get_Preset_Name(obj),"TCW_Nod_Saboteur_Low") == 0) ) + { + if (Commands->Get_Player_Type(obj) == 0) { if (random == 1) { @@ -682,7 +985,31 @@ Send_Message_Team(0,255,0,0,player); } } - if ( (_stricmp(Commands->Get_Preset_Name(obj),"TCW_Nod_Shadow") == 0) || (_stricmp(Commands->Get_Preset_Name(obj),"TCW_Nod_Shadow_Low") == 0) ) + if (Commands->Get_Player_Type(obj) == 1) + { + if (random == 1) + { + Create_2D_WAV_Sound_Team("purchase_nod_saboteur_1.wav",1); + char player[250]; sprintf(player,"%s: The Brotherhood has entrusted me.",Get_Player_Name(obj)); + Send_Message_Team(1,255,204,0,player); + } + else if (random == 2) + { + Create_2D_WAV_Sound_Team("purchase_nod_saboteur_2.wav",1); + char player[250]; sprintf(player,"%s: Need help with anything?",Get_Player_Name(obj)); + Send_Message_Team(1,255,204,0,player); + } + else if (random == 3) + { + Create_2D_WAV_Sound_Team("purchase_nod_saboteur_1.wav",1); + char player[250]; sprintf(player,"%s: The Brotherhood has entrusted me.",Get_Player_Name(obj)); + Send_Message_Team(1,255,204,0,player); + } + } + } + else if ( (_stricmp(Commands->Get_Preset_Name(obj),"TCW_Nod_Shadow") == 0) || (_stricmp(Commands->Get_Preset_Name(obj),"TCW_Nod_Shadow_Low") == 0) ) + { + if (Commands->Get_Player_Type(obj) == 0) { if (random == 1) { @@ -703,18 +1030,32 @@ Send_Message_Team(0,255,0,0,player); } } + else if (Commands->Get_Player_Type(obj) == 1) + { + if (random == 1) + { + Create_2D_WAV_Sound_Team("purchase_nod_shadow_1.wav",1); + char player[250]; sprintf(player,"%s: Quietly.",Get_Player_Name(obj)); + Send_Message_Team(1,255,204,0,player); } -} -void tcw_Grant_Powerup_Created::Timer_Expired(GameObject *obj, int number) + else if (random == 2) { - if (number == 1003) + Create_2D_WAV_Sound_Team("purchase_nod_shadow_2.wav",1); + char player[250]; sprintf(player,"%s: Shadow team at your command.",Get_Player_Name(obj)); + Send_Message_Team(1,255,204,0,player); + } + else if (random == 3) { -/*#ifdef SSGM - float cmoney = Commands->Get_Money(obj); - if (cmoney < MapCredits) { Commands->Give_Money(obj,MapCredits-cmoney,false); } //give the spawn credits everytime they spawn -#endif*/ + Create_2D_WAV_Sound_Team("purchase_nod_shadow_2.wav",1); + char player[250]; sprintf(player,"%s: Shadow team at your command.",Get_Player_Name(obj)); + Send_Message_Team(1,255,204,0,player); + } + } } - else if (number == 1004)//enable stealth again after distance check +} +void tcw_Grant_Powerup_Created::Timer_Expired(GameObject *obj, int number) +{ + if (number == 1004)//enable stealth again after distance check { Commands->Enable_Stealth(obj, true); revealed = false; @@ -750,6 +1091,8 @@ { if (param == 1) { + if (Commands->Get_ID(sender) != Commands->Get_ID(obj)) + { kills++; if (kills == 2) { @@ -809,6 +1152,7 @@ } } } + } else if (message == 1004)//destealth unit { if (param == 1) @@ -854,10 +1198,10 @@ float maxap = Commands->Get_Max_Shield_Strength(obj); float curhp = Commands->Get_Health(obj); float curap = Commands->Get_Shield_Strength(obj); - float maxhpnew = maxhp + 15.0f; Set_Max_Health(obj, maxhpnew); - float maxapnew = maxap + 15.0f; Set_Max_Shield_Strength(obj, maxapnew); - float newhp = curhp + 15.0f; Commands->Set_Health(obj, newhp); - float newap = curap + 15.0f; Commands->Set_Shield_Strength(obj, newap); + float maxhpnew = maxhp + 30.0f; Set_Max_Health(obj, maxhpnew); + float maxapnew = maxap + 30.0f; Set_Max_Shield_Strength(obj, maxapnew); + float newhp = curhp + 30.0f; Commands->Set_Health(obj, newhp); + float newap = curap + 30.0f; Commands->Set_Shield_Strength(obj, newap); Create_2D_WAV_Sound_Player(obj,"gdi_tech_unit_upgraded.wav"); Send_Message_Player(obj,255,204,0,"Unit Upgraded: Composite Armor."); } diff -uwr sourceold/scripts/tcw_player.h source/scripts/tcw_player.h --- sourceold/scripts/tcw_player.h 2011-10-15 12:39:38.271484300 +0800 +++ source/scripts/tcw_player.h 2012-02-02 09:44:43.163085900 +0800 @@ -1,6 +1,6 @@ /* Renegade Scripts.dll - Scripts by zunnie - http://dev.mp-gaming.com - Copyright 2011-2012 MP-Gaming + Scripts by zunnie - http://www.tiberiumcrystalwar.com + Copyright 2011-2012 MPF This file is part of the Renegade scripts.dll The Renegade scripts.dll is free software; you can redistribute it and/or modify it diff -uwr sourceold/scripts/tcw_powerup.cpp source/scripts/tcw_powerup.cpp --- sourceold/scripts/tcw_powerup.cpp 2011-10-14 22:25:11.421875000 +0800 +++ source/scripts/tcw_powerup.cpp 2012-02-02 09:44:43.112304600 +0800 @@ -1,6 +1,6 @@ /* Renegade Scripts.dll - Scripts by zunnie - http://dev.mp-gaming.com - Copyright 2011-2012 MP-Gaming + Scripts by zunnie - http://www.tiberiumcrystalwar.com + Copyright 2011-2012 MPF This file is part of the Renegade scripts.dll The Renegade scripts.dll is free software; you can redistribute it and/or modify it diff -uwr sourceold/scripts/tcw_powerup.h source/scripts/tcw_powerup.h --- sourceold/scripts/tcw_powerup.h 2011-10-14 22:27:32.081054600 +0800 +++ source/scripts/tcw_powerup.h 2012-02-02 09:44:43.167968700 +0800 @@ -1,6 +1,6 @@ /* Renegade Scripts.dll - Scripts by zunnie - http://dev.mp-gaming.com - Copyright 2011-2012 MP-Gaming + Scripts by zunnie - http://www.tiberiumcrystalwar.com + Copyright 2011-2012 MPF This file is part of the Renegade scripts.dll The Renegade scripts.dll is free software; you can redistribute it and/or modify it diff -uwr sourceold/scripts/tcw_readme.txt source/scripts/tcw_readme.txt --- sourceold/scripts/tcw_readme.txt 2011-10-14 22:25:11.410156200 +0800 +++ source/scripts/tcw_readme.txt 2012-02-02 09:44:43.109375000 +0800 @@ -1,154 +1,25 @@ -/* Renegade Scripts.dll - Scripts by zunnie - http://dev.mp-gaming.com - Copyright 2011-2012 MP-Gaming - - This file is part of the Renegade scripts.dll - The Renegade scripts.dll is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the Free - Software Foundation; either version 2, or (at your option) any later - version. See the file COPYING for more details. - In addition, an exemption is given to allow Run Time Dynamic Linking of this code - with any closed source module that does not contain code covered by this licence. - Only the source code to the module(s) containing the licenced code has to be released. -*/ - ************************************************************************ ************************* Tiberium Crystal War ************************* ************************************************************************ -Tiberium Crystal War is a total standalone conversion of C&C Renegade. -TCW takes place in the C&C 3 time-line where you can play as GDI or Nod -in C&C 3 style with Renegade's FPS environment. You can use C&C3's most -powerful weapons like Scorpion Tank, Predator Battle Tank, Stealth -Tanks, Flame Tanks, Mammoth Tanks and much more. - -Have fun in Tiberium Crystal War - -Feel free to join irc.mp-gaming.com #MP-TCW - -Official ModDB Page: http://www.moddb.com/mods/tcw/ -Official Website: http://dev.mp-gaming.com/tcw/ - - +Official Homepage: http://www.tiberiumcrystalwar.com +IndieDB Profile: http://www.indiedb.com/games/tcw-w3d/ -************************************************************************ -************************* tcw_game ************************ -************************************************************************ - -- tcw_Tiberium_Harvester -This script is attached to vehicles which function as the -Tiberium Harvester. - -- tcw_tiberium_spike -Is attached to Tiberium Spikes. It is set to wait for a custom message -of 1000 and param 0 for Nod and custom message 1000 and param 1 for GDI. -When the message and param is received it will attach the script -tcw_Credit_Trickle to the Spike which generates money for the team that -currently controls the Spike. If the Spike was captured for the first -time then the whole team will be granted $250 credits. - -- tcw_tiberium_spike_capture -This is the script that goes on the zone covering the floor of the -Tiberium Spike. An Engineer or Saboteur has to walk into this zone -to initiate a capture of the Spike. A timer of 30 seconds will start -and when it runs out the Spike will be sent a message and param to -start granting the team that captured it money. - -- tcw_i_can_capture_spike -All units that are capable of capturing a Spike have this script -attached to them. Engineers and Saboteurs in TCW. - -- tcw_Credit_Trickle -This script will give money for the whole team to the object it is -attached to every second. Simple. - -- tcw_Tiberium_Field -The Tiberium Field zone will have this script attached to it. -When a Tiberium Harvester enters the zone it will send a message -to the Harvester and it will start collecting tiberium. - -- tcw_Tiberium_Deposit -Tiberium Depositing is easy. Just stick this script to a zone at the -refinery dumping area. When a Harvester drives into it it will generate -a tiberium dump and grant the whole team credits. - -- tcw_tiberium_spike_points -Unlike this scripts name indicates this script grants normal $5 -credits to a team owning the spike. I intended to make it give -points but that didn't work properly. This script attaches the -script tcw_Point_Trickle to the Spike. - -- tcw_Point_Trickle -Unlike the name says this script grants $5 credits a second to the -team owning the Spike. When the owning team's total credits hits -$50000 it will send a message to a dave arrow with the script -tcw_Custom_Win_Game_Credits which will end the game. - -- tcw_Custom_Win_Game_Credits -When a message of 1000 is received and param 0, then Nod will win -the game with a message "Nod wins with a x credits lead" where x -is replaced with the number of credits Nod had more than GDI. -When param 1 is passed the opposite will take place. - -- tcw_Set_Spike_Team -Used to set the team of a spike when it is created. Players don't -have to capture it first. - -************************************************************************ -************************* tcw_building ************************ -************************************************************************ -- tcw_building -Attached to all buildings. Unlike in Renegade where the strings.tdb -controls what sound or message to display when buildings are under -attack or destroyed. In TCW this scripts takes care of all that which -is a lot easier to update without too much hassle. - -- tcw_watchtower -Atteched to Watchtowers for GDI. Controls the damage and destroyed -indications like sounds and messages. +100% Free to Play +An awesome total standalone conversion of the Renegade W3D Engine with +CnC3 structures, units, sounds and assets in an First Person Shooter +environment. + +The War has just begun... a War to Command and Conquer. The stakes are +high... but whoever controls the Tiberium decides the fate of humanity. +Choose your side as GDI or NOD. Take your place on the battlefield with +exciting new tanks like Predators, Scorpions, Raiders, Mammoth Tanks and +so much more in this free First Person Shooter. +Have fun in Tiberium Crystal War -************************************************************************ -************************* tcw_player ************************ -************************************************************************ -- tcw_Grant_Powerup_Created -Attached to all TCW infantry units. Controls various things from -granting weapons to reveiling stealth and controlling unit limits like -the snipers and commando's. - - -************************************************************************ -************************* tcw_powerup ************************ -************************************************************************ -- tcw_POW_PickupSounds -Players drop weapon powerups in TCW just like in Renegade. This script -plays the sounds when you pick them up. - +Feel free to join irc.multiplayerforums.com #MPF-TCW ************************************************************************ -************************* tcw_technology ************************ -************************************************************************ -- tcw_Research_Composit_Armor -This script is attached to a pokable object on the map and its -functionality depends on the existance and status of a GDI Armory. -If the building is not present then you cannot research this upgrade. -Of course maps that don't have this building will obviously also lack -the purchase console. If the Armory is present but dead you can also not -research the upgrades that come with it. Researching costs for the -Composite Armor are $6000. This may seem a lot but remember that you -can purchase it as a team. If you have as little as four players it's -easily reached and purchased. - -- Other researchable upgrades are still in development. - - ************************************************************************ -************************* tcw_vehicle ************************ ************************************************************************ -- tcw_vehicle -Is attached to all vehicles in TCW and makes sure a purchase sound is -played when you purchase them. -This script also controls the Stealth Unit detection for example for -GDI Pitbulls. It basically sends out a message to all stealthed objects -and when they are within range they will destealth :) It's basically -how a bat sees but a little different :P \ No newline at end of file Only in source/scripts: tcw_superweapons.cpp Only in source/scripts: tcw_superweapons.h diff -uwr sourceold/scripts/tcw_technology.cpp source/scripts/tcw_technology.cpp --- sourceold/scripts/tcw_technology.cpp 2011-10-14 22:25:11.492187500 +0800 +++ source/scripts/tcw_technology.cpp 2012-02-02 09:44:43.147460900 +0800 @@ -1,6 +1,6 @@ /* Renegade Scripts.dll - Scripts by zunnie - http://dev.mp-gaming.com - Copyright 2011-2012 MP-Gaming + Scripts by zunnie - http://www.tiberiumcrystalwar.com + Copyright 2011-2012 MPF This file is part of the Renegade scripts.dll The Renegade scripts.dll is free software; you can redistribute it and/or modify it @@ -133,6 +133,15 @@ Hide_Preset_By_Name(0,"TCW_Nod_APC",true); Hide_Preset_By_Name(0,"TCW_Nod_Mammoth_Tank",true); + //gdi bar steal-able tech: + Hide_Preset_By_Name(0,"TCW_GDI_Rifle_Squad",true); + Hide_Preset_By_Name(0,"TCW_GDI_Engineer",true); + Hide_Preset_By_Name(0,"TCW_GDI_Missile_Squad",true); + Hide_Preset_By_Name(0,"TCW_GDI_Grenadier",true); + Hide_Preset_By_Name(0,"TCW_GDI_Sniper",true); + Hide_Preset_By_Name(0,"TCW_GDI_Zonetrooper",true); + Hide_Preset_By_Name(0,"TCW_GDI_Commando",true); + //nod wf steal-able tech: Hide_Preset_By_Name(1,"TCW_GDI_Attack_Bike",true); Hide_Preset_By_Name(1,"TCW_GDI_Flame_Tank",true); @@ -140,6 +149,14 @@ Hide_Preset_By_Name(1,"TCW_GDI_Raider_Buggy",true); Hide_Preset_By_Name(1,"TCW_GDI_Scorpion_Tank",true); Hide_Preset_By_Name(1,"TCW_GDI_Stealth_Tank",true); + + //nod hand steal-able tech: + Hide_Preset_By_Name(1,"TCW_Nod_Militant_Infantry",true); + Hide_Preset_By_Name(1,"TCW_Nod_Saboteur",true); + Hide_Preset_By_Name(1,"TCW_Nod_RocketGuy",true); + Hide_Preset_By_Name(1,"TCW_Nod_Shadow",true); + Hide_Preset_By_Name(1,"TCW_Nod_Black_Hand_Flame",true); + Hide_Preset_By_Name(1,"TCW_Nod_Commando",true); } @@ -149,9 +166,10 @@ { if (!Is_Building_Dead(Find_Building_By_Name(1,"TCW_GDI_War_Factory"))) { - if (Commands->Is_A_Star(enter)) + if ( (Commands->Is_A_Star(enter)) && (Commands->Get_Player_Type(enter) == 0) ) { - if ( (strcmp(Commands->Get_Preset_Name(enter),"TCW_Nod_Saboteur") == 0) || (strcmp(Commands->Get_Preset_Name(enter),"TCW_Nod_Saboteur_Low") == 0) ) + if ( (strcmp(Commands->Get_Preset_Name(enter),"TCW_GDI_Engineer") == 0) || (strcmp(Commands->Get_Preset_Name(enter),"TCW_GDI_Engineer_Low") == 0) || + (strcmp(Commands->Get_Preset_Name(enter),"TCW_Nod_Saboteur") == 0) || (strcmp(Commands->Get_Preset_Name(enter),"TCW_Nod_Saboteur_Low") == 0) ) { if (!Get_Vehicle(enter)) { @@ -163,9 +181,10 @@ } void tcw_steal_tech_zone_gwf::Exited(GameObject *obj, GameObject *exit) { - if (Commands->Is_A_Star(exit)) + if ( (Commands->Is_A_Star(exit)) && (Commands->Get_Player_Type(exit) == 0) ) { - if ( (strcmp(Commands->Get_Preset_Name(exit),"TCW_Nod_Saboteur") == 0) || (strcmp(Commands->Get_Preset_Name(exit),"TCW_Nod_Saboteur_Low") == 0) ) + if ( (strcmp(Commands->Get_Preset_Name(exit),"TCW_GDI_Engineer") == 0) || (strcmp(Commands->Get_Preset_Name(exit),"TCW_GDI_Engineer_Low") == 0) || + (strcmp(Commands->Get_Preset_Name(exit),"TCW_Nod_Saboteur") == 0) || (strcmp(Commands->Get_Preset_Name(exit),"TCW_Nod_Saboteur_Low") == 0) ) { Remove_Script(exit,"tcw_i_am_stealing_tech"); } @@ -174,11 +193,12 @@ void tcw_steal_tech_zone_nwf::Entered(GameObject *obj, GameObject *enter) { - if (!Is_Building_Dead(Find_Building_By_Name(1,"TCW_Nod_War_Factory"))) + if (!Is_Building_Dead(Find_Building_By_Name(0,"TCW_Nod_War_Factory"))) { - if (Commands->Is_A_Star(enter)) + if ( (Commands->Is_A_Star(enter)) && (Commands->Get_Player_Type(enter) == 1) ) { - if ( (strcmp(Commands->Get_Preset_Name(enter),"TCW_GDI_Engineer") == 0) || (strcmp(Commands->Get_Preset_Name(enter),"TCW_GDI_Engineer_Low") == 0) ) + if ( (strcmp(Commands->Get_Preset_Name(enter),"TCW_GDI_Engineer") == 0) || (strcmp(Commands->Get_Preset_Name(enter),"TCW_GDI_Engineer_Low") == 0) || + (strcmp(Commands->Get_Preset_Name(enter),"TCW_Nod_Saboteur") == 0) || (strcmp(Commands->Get_Preset_Name(enter),"TCW_Nod_Saboteur_Low") == 0) ) { if (!Get_Vehicle(enter)) { @@ -190,9 +210,68 @@ } void tcw_steal_tech_zone_nwf::Exited(GameObject *obj, GameObject *exit) { - if (Commands->Is_A_Star(exit)) + if ( (Commands->Is_A_Star(exit)) && (Commands->Get_Player_Type(exit) == 1) ) + { + if ( (strcmp(Commands->Get_Preset_Name(exit),"TCW_GDI_Engineer") == 0) || (strcmp(Commands->Get_Preset_Name(exit),"TCW_GDI_Engineer_Low") == 0) || + (strcmp(Commands->Get_Preset_Name(exit),"TCW_Nod_Saboteur") == 0) || (strcmp(Commands->Get_Preset_Name(exit),"TCW_Nod_Saboteur_Low") == 0) ) + { + Remove_Script(exit,"tcw_i_am_stealing_tech"); + } + } +} + +void tcw_steal_tech_zone_nhon::Entered(GameObject *obj, GameObject *enter) +{ + if (!Is_Building_Dead(Find_Building_By_Name(0,"TCW_Hand_Of_Nod"))) + { + if ( (Commands->Is_A_Star(enter)) && (Commands->Get_Player_Type(enter) == 1) ) + { + if ( (strcmp(Commands->Get_Preset_Name(enter),"TCW_GDI_Engineer") == 0) || (strcmp(Commands->Get_Preset_Name(enter),"TCW_GDI_Engineer_Low") == 0) || + (strcmp(Commands->Get_Preset_Name(enter),"TCW_Nod_Saboteur") == 0) || (strcmp(Commands->Get_Preset_Name(enter),"TCW_Nod_Saboteur_Low") == 0) ) + { + if (!Get_Vehicle(enter)) + { + Attach_Script_Once(enter,"tcw_i_am_stealing_tech","3"); + } + } + } + } +} +void tcw_steal_tech_zone_nhon::Exited(GameObject *obj, GameObject *exit) +{ + if ( (Commands->Is_A_Star(exit)) && (Commands->Get_Player_Type(exit) == 1) ) + { + if ( (strcmp(Commands->Get_Preset_Name(exit),"TCW_GDI_Engineer") == 0) || (strcmp(Commands->Get_Preset_Name(exit),"TCW_GDI_Engineer_Low") == 0) || + (strcmp(Commands->Get_Preset_Name(exit),"TCW_Nod_Saboteur") == 0) || (strcmp(Commands->Get_Preset_Name(exit),"TCW_Nod_Saboteur_Low") == 0) ) + { + Remove_Script(exit,"tcw_i_am_stealing_tech"); + } + } +} + +void tcw_steal_tech_zone_gbar::Entered(GameObject *obj, GameObject *enter) +{ + if (!Is_Building_Dead(Find_Building_By_Name(1,"TCW_GDI_Barracks"))) + { + if ( (Commands->Is_A_Star(enter)) && (Commands->Get_Player_Type(enter) == 0) ) + { + if ( (strcmp(Commands->Get_Preset_Name(enter),"TCW_GDI_Engineer") == 0) || (strcmp(Commands->Get_Preset_Name(enter),"TCW_GDI_Engineer_Low") == 0) || + (strcmp(Commands->Get_Preset_Name(enter),"TCW_Nod_Saboteur") == 0) || (strcmp(Commands->Get_Preset_Name(enter),"TCW_Nod_Saboteur_Low") == 0) ) + { + if (!Get_Vehicle(enter)) + { + Attach_Script_Once(enter,"tcw_i_am_stealing_tech","4"); + } + } + } + } +} +void tcw_steal_tech_zone_gbar::Exited(GameObject *obj, GameObject *exit) +{ + if ( (Commands->Is_A_Star(exit)) && (Commands->Get_Player_Type(exit) == 0) ) { - if ( (strcmp(Commands->Get_Preset_Name(exit),"TCW_GDI_Engineer") == 0) || (strcmp(Commands->Get_Preset_Name(exit),"TCW_GDI_Engineer_Low") == 0) ) + if ( (strcmp(Commands->Get_Preset_Name(exit),"TCW_GDI_Engineer") == 0) || (strcmp(Commands->Get_Preset_Name(exit),"TCW_GDI_Engineer_Low") == 0) || + (strcmp(Commands->Get_Preset_Name(exit),"TCW_Nod_Saboteur") == 0) || (strcmp(Commands->Get_Preset_Name(exit),"TCW_Nod_Saboteur_Low") == 0) ) { Remove_Script(exit,"tcw_i_am_stealing_tech"); } @@ -220,11 +299,29 @@ Send_Message_Team(1,255,204,0,stealermsg); Create_2D_WAV_Sound_Team("building_capture.wav",1); } + else if (building == 3)//gdi stealing nod hand of nod + { + Commands->Start_Timer(obj,this,15.0f,779903);//start stealing from the nod hand of nod + char stealermsg[250]; + sprintf(stealermsg,"%s is stealing technology from the Hand of Nod.",Get_Player_Name(obj)); + Send_Message_Team(1,255,204,0,stealermsg); + Create_2D_WAV_Sound_Team("building_capture.wav",1); + } + else if (building == 4)//nod stealing gdi barracks + { + Commands->Start_Timer(obj,this,15.0f,779904);//start stealing from the gdi barracks + char stealermsg[250]; + sprintf(stealermsg,"%s is stealing technology from the GDI Barracks.",Get_Player_Name(obj)); + Send_Message_Team(0,255,0,0,stealermsg); + Create_2D_WAV_Sound_Team("building_capture.wav",0); + } } void tcw_i_am_stealing_tech::Timer_Expired(GameObject *obj, int number) { if (number == 779901)//nod stole tech from gdi wf { + if (!Is_Building_Dead(Find_Building_By_Name(1,"TCW_GDI_War_Factory"))) + { if (Get_Total_Bullets(obj,"TCW_Weapon_Repairgun_Advanced") == 5)//full repairgun = successful stealing { Commands->Select_Weapon(obj,"TCW_Weapon_Pistol"); @@ -248,8 +345,10 @@ Destroy_Script(); } } - - if (number == 779902)//gdi stole tech from nod wf + } + else if (number == 779902)//gdi stole tech from nod wf + { + if (!Is_Building_Dead(Find_Building_By_Name(0,"TCW_Nod_War_Factory"))) { if (Get_Total_Bullets(obj,"TCW_Weapon_Repairgun_Advanced") == 5)//full repairgun = successful stealing { @@ -276,8 +375,70 @@ } } } + else if (number == 779903)//gdi stole tech from nod hand + { + if (!Is_Building_Dead(Find_Building_By_Name(0,"TCW_Hand_Of_Nod"))) + { + if (Get_Total_Bullets(obj,"TCW_Weapon_Repairgun_Advanced") == 5)//full repairgun = successful stealing + { + Commands->Select_Weapon(obj,"TCW_Weapon_Pistol"); + Remove_Weapon(obj,"TCW_Weapon_Repairgun_Advanced"); + + Hide_Preset_By_Name(1,"TCW_Nod_Militant_Infantry",false); + Hide_Preset_By_Name(1,"TCW_Nod_Saboteur",false); + Hide_Preset_By_Name(1,"TCW_Nod_RocketGuy",false); + Hide_Preset_By_Name(1,"TCW_Nod_Shadow",false); + Hide_Preset_By_Name(1,"TCW_Nod_Black_Hand_Flame",false); + Hide_Preset_By_Name(1,"TCW_Nod_Commando",false); + + char stealmsg[250]; + sprintf(stealmsg,"%s has stolen technology from the Hand of Nod",Get_Player_Name(obj)); + Send_Message_Team(1,255,204,0,stealmsg); + Send_Message_Team(1,255,204,0,"New technology acquired."); + Create_2D_WAV_Sound_Team("gdi_new_tech_acquired.wav",1); + } + else + { + Send_Message_Player(obj,255,204,0,"To steal technology you need a FULL AMMO Repair Gun."); + Destroy_Script(); + } + } + } + else if (number == 779904)//nod stole tech from gdi barracks + { + if (!Is_Building_Dead(Find_Building_By_Name(1,"TCW_GDI_Barracks"))) + { + if (Get_Total_Bullets(obj,"TCW_Weapon_Repairgun_Advanced") == 5)//full repairgun = successful stealing + { + Commands->Select_Weapon(obj,"TCW_Weapon_Pistol"); + Remove_Weapon(obj,"TCW_Weapon_Repairgun_Advanced"); + + Hide_Preset_By_Name(0,"TCW_GDI_Rifle_Squad",false); + Hide_Preset_By_Name(0,"TCW_GDI_Engineer",false); + Hide_Preset_By_Name(0,"TCW_GDI_Missile_Squad",false); + Hide_Preset_By_Name(0,"TCW_GDI_Grenadier",false); + Hide_Preset_By_Name(0,"TCW_GDI_Sniper",false); + Hide_Preset_By_Name(0,"TCW_GDI_Zonetrooper",false); + Hide_Preset_By_Name(0,"TCW_GDI_Commando",false); + + char stealmsg[250]; + sprintf(stealmsg,"%s has stolen technology from the GDI Barracks",Get_Player_Name(obj)); + Send_Message_Team(0,255,0,0,stealmsg); + Send_Message_Team(0,255,0,0,"New technology acquired."); + Create_2D_WAV_Sound_Team("nod_new_tech_acquired.wav",0); + } + else + { + Send_Message_Player(obj,255,0,0,"To steal technology you need a FULL AMMO Repair Gun."); + Destroy_Script(); + } + } + } +} +ScriptRegistrant tcw_steal_tech_zone_gbar_Registrant("tcw_steal_tech_zone_gbar",""); +ScriptRegistrant tcw_steal_tech_zone_nhon_Registrant("tcw_steal_tech_zone_nhon",""); ScriptRegistrant tcw_steal_tech_zone_nwf_Registrant("tcw_steal_tech_zone_nwf",""); ScriptRegistrant tcw_steal_tech_zone_gwf_Registrant("tcw_steal_tech_zone_gwf",""); ScriptRegistrant tcw_i_am_stealing_tech_Registrant("tcw_i_am_stealing_tech","Building=1:int"); diff -uwr sourceold/scripts/tcw_technology.h source/scripts/tcw_technology.h --- sourceold/scripts/tcw_technology.h 2011-10-14 22:27:32.105468700 +0800 +++ source/scripts/tcw_technology.h 2012-02-02 09:44:43.172851500 +0800 @@ -1,6 +1,6 @@ /* Renegade Scripts.dll - Scripts by zunnie - http://dev.mp-gaming.com - Copyright 2011-2012 MP-Gaming + Scripts by zunnie - http://www.tiberiumcrystalwar.com + Copyright 2011-2012 MPF This file is part of the Renegade scripts.dll The Renegade scripts.dll is free software; you can redistribute it and/or modify it @@ -40,6 +40,15 @@ void Exited(GameObject *obj, GameObject *exit); }; +class tcw_steal_tech_zone_nhon : public ScriptImpClass { + void Entered(GameObject *obj, GameObject *enter); + void Exited(GameObject *obj, GameObject *exit); +}; + +class tcw_steal_tech_zone_gbar : public ScriptImpClass { + void Entered(GameObject *obj, GameObject *enter); + void Exited(GameObject *obj, GameObject *exit); +}; class tcw_i_am_stealing_tech : public ScriptImpClass { void Created(GameObject *obj); diff -uwr sourceold/scripts/tcw_vehicle.cpp source/scripts/tcw_vehicle.cpp --- sourceold/scripts/tcw_vehicle.cpp 2011-10-14 22:25:11.452148400 +0800 +++ source/scripts/tcw_vehicle.cpp 2012-02-02 09:44:43.121093700 +0800 @@ -1,6 +1,6 @@ /* Renegade Scripts.dll - Scripts by zunnie - http://dev.mp-gaming.com - Copyright 2011-2012 MP-Gaming + Scripts by zunnie - http://www.tiberiumcrystalwar.com + Copyright 2011-2012 MPF This file is part of the Renegade scripts.dll The Renegade scripts.dll is free software; you can redistribute it and/or modify it @@ -15,6 +15,7 @@ #include "scripts.h" #include "engine.h" #include "tcw_vehicle.h" +#include "VehicleGameObj.h" void tcw_vehicle::Created(GameObject *obj) { @@ -450,11 +451,32 @@ { Commands->Start_Timer(obj,this,0.5f,100100); } - if ( (strcmp(Commands->Get_Preset_Name(obj),"TCW_GDI_Pitbull") == 0) || (strcmp(Commands->Get_Preset_Name(obj),"TCW_Nod_Pitbull") == 0) ) + else if ( (strcmp(Commands->Get_Preset_Name(obj),"TCW_GDI_Pitbull") == 0) || (strcmp(Commands->Get_Preset_Name(obj),"TCW_Nod_Pitbull") == 0) || (strcmp(Commands->Get_Preset_Name(obj),"TCW_Nod_Attack_Bike") == 0) || (strcmp(Commands->Get_Preset_Name(obj),"TCW_GDI_Attack_Bike") == 0) ) { Commands->Start_Timer(obj,this,5.0f,1004); triggerstealthdetection = true; } + else if ( (strcmp(Commands->Get_Preset_Name(obj),"TCW_GDI_APC") == 0) || (strcmp(Commands->Get_Preset_Name(obj),"TCW_Nod_APC") == 0) ) + { + if (Get_Vehicle_Occupant(obj,1))//if there is a passenger + { + if ( (strcmp(Commands->Get_Preset_Name(Get_Vehicle_Occupant(obj,1)),"TCW_GDI_Missile_Squad") == 0) || (strcmp(Commands->Get_Preset_Name(Get_Vehicle_Occupant(obj,1)),"TCW_Nod_RocketGuy") == 0) || (strcmp(Commands->Get_Preset_Name(Get_Vehicle_Occupant(obj,1)),"TCW_Nod_RocketGuy_Low") == 0) || (strcmp(Commands->Get_Preset_Name(Get_Vehicle_Occupant(obj,1)),"TCW_GDI_Missile_Squad_Low") == 0) ) + { + Commands->Give_PowerUp(obj,"TCW_POW_APC_Missile_Weapon",false); + Commands->Select_Weapon(obj,"TCW_Weapon_APC_Missile"); + } + else if ( (strcmp(Commands->Get_Preset_Name(Get_Vehicle_Occupant(obj,1)),"TCW_GDI_Sniper") == 0) || (strcmp(Commands->Get_Preset_Name(Get_Vehicle_Occupant(obj,1)),"TCW_GDI_Sniper_Low") == 0) || (strcmp(Commands->Get_Preset_Name(Get_Vehicle_Occupant(obj,1)),"TCW_Nod_Sniper") == 0) ) + { + Commands->Give_PowerUp(obj,"TCW_POW_APC_Sniper_Weapon",false); + Commands->Select_Weapon(obj,"TCW_Weapon_APC_Sniper"); + } + else if ( (strcmp(Commands->Get_Preset_Name(Get_Vehicle_Occupant(obj,1)),"TCW_GDI_Zonetrooper") == 0) || (strcmp(Commands->Get_Preset_Name(Get_Vehicle_Occupant(obj,1)),"TCW_GDI_Zonetrooper_Low") == 0) || (strcmp(Commands->Get_Preset_Name(Get_Vehicle_Occupant(obj,1)),"TCW_Nod_Zonetrooper") == 0) ) + { + Commands->Give_PowerUp(obj,"TCW_POW_APC_Zonetrooper_Weapon",false); + Commands->Select_Weapon(obj,"TCW_Weapon_APC_Zonetrooper"); + } + } + } } else if (message == CUSTOM_EVENT_VEHICLE_EXITED) { @@ -462,6 +484,21 @@ { triggerstealthdetection = false; } + else if ( (strcmp(Commands->Get_Preset_Name(obj),"TCW_Nod_Harvester") == 0) || (strcmp(Commands->Get_Preset_Name(obj),"TCW_Nod_GDI_Harvester") == 0) ) + { + Commands->Set_Player_Type(obj,0); + } + else if (strcmp(Commands->Get_Preset_Name(obj),"TCW_GDI_Nod_Harvester") == 0) + { + Commands->Set_Player_Type(obj,1); + } + else if ( (strcmp(Commands->Get_Preset_Name(obj),"TCW_GDI_APC") == 0) || (strcmp(Commands->Get_Preset_Name(obj),"TCW_Nod_APC") == 0) ) + { + if (!Get_Vehicle_Occupant(obj,1))//if there is no passenger + { + Commands->Select_Weapon(obj,"TCW_Weapon_APC");//let's always select the normal weapon when someone exits the vehicle + } + } } else if (message == 1004)//destealth unit { @@ -509,6 +546,8 @@ } else if (number == 1004) { + if (Get_Vehicle_Occupant(obj,0))//fix empty pitbull stealthdetection errors + { Send_Custom_Event_To_Object(obj,"TCW_Nod_Shadow",1004,1,0); Send_Custom_Event_To_Object(obj,"TCW_Nod_Shadow_Low",1004,1,0); Send_Custom_Event_To_Object(obj,"TCW_Nod_Stealth_Tank",1004,1,0); @@ -528,6 +567,7 @@ } } } + } else if (number == 1005)//enable stealth again after distance check { Commands->Enable_Stealth(obj, true); @@ -634,27 +674,38 @@ void tcw_vehexit_killtimer::Created(GameObject *obj) { timerid = Commands->Get_ID(obj); + driverid = 0; } void tcw_vehexit_killtimer::Custom(GameObject *obj, int message, int param, GameObject *sender) { - if (message == CUSTOM_EVENT_VEHICLE_EXITED) + if (message == CUSTOM_EVENT_VEHICLE_ENTERED) + { + driverid = Commands->Get_ID(Get_Vehicle_Driver(obj)); + //driverid = Commands->Get_ID(sender); + } + else if (message == CUSTOM_EVENT_VEHICLE_EXITED) { - Commands->Start_Timer(obj,this,60.0f,Commands->Get_ID(obj)); + Commands->Start_Timer(obj,this,30.0f,timerid); } } void tcw_vehexit_killtimer::Timer_Expired(GameObject *obj, int number) { if (number == timerid) { - if (!Get_Vehicle_Driver(obj)) + if (!Commands->Find_Object(driverid)) { Commands->Destroy_Object(obj); } + else + { + Commands->Start_Timer(obj,this,30.0f,timerid); + } } } void tcw_vehexit_killtimer::Register_Auto_Save_Variables() { Auto_Save_Variable(&timerid,sizeof(timerid),1); + Auto_Save_Variable(&driverid,sizeof(driverid),2); } diff -uwr sourceold/scripts/tcw_vehicle.h source/scripts/tcw_vehicle.h --- sourceold/scripts/tcw_vehicle.h 2011-10-15 12:39:38.283203100 +0800 +++ source/scripts/tcw_vehicle.h 2012-02-02 09:44:43.187500000 +0800 @@ -1,6 +1,6 @@ /* Renegade Scripts.dll - Scripts by zunnie - http://dev.mp-gaming.com - Copyright 2011-2012 MP-Gaming + Scripts by zunnie - http://www.tiberiumcrystalwar.com + Copyright 2011-2012 MPF This file is part of the Renegade scripts.dll The Renegade scripts.dll is free software; you can redistribute it and/or modify it @@ -33,4 +33,5 @@ void Timer_Expired(GameObject *obj, int number); public: void Register_Auto_Save_Variables(); int timerid; + int driverid; }; diff -uwr sourceold/scripts/tcw_zone.cpp source/scripts/tcw_zone.cpp --- sourceold/scripts/tcw_zone.cpp 2011-10-14 22:25:11.448242100 +0800 +++ source/scripts/tcw_zone.cpp 2012-02-02 09:44:43.118164000 +0800 @@ -1,6 +1,6 @@ /* Renegade Scripts.dll - Scripts by zunnie - http://dev.mp-gaming.com - Copyright 2011-2012 MP-Gaming + Scripts by zunnie - http://www.tiberiumcrystalwar.com + Copyright 2011-2012 MPF This file is part of the Renegade scripts.dll The Renegade scripts.dll is free software; you can redistribute it and/or modify it diff -uwr sourceold/scripts/tcw_zone.h source/scripts/tcw_zone.h --- sourceold/scripts/tcw_zone.h 2011-10-15 12:39:38.268554600 +0800 +++ source/scripts/tcw_zone.h 2012-02-02 09:44:43.158203100 +0800 @@ -1,6 +1,6 @@ /* Renegade Scripts.dll - Scripts by zunnie - http://dev.mp-gaming.com - Copyright 2011-2012 MP-Gaming + Scripts by zunnie - http://www.tiberiumcrystalwar.com + Copyright 2011-2012 MPF This file is part of the Renegade scripts.dll The Renegade scripts.dll is free software; you can redistribute it and/or modify it Only in source/scripts: z_domination.cpp Only in source/scripts: z_domination.h diff -uwr sourceold/swap/Swap.cpp source/swap/Swap.cpp --- sourceold/swap/Swap.cpp 2011-10-13 07:20:03.158203100 +0800 +++ source/swap/Swap.cpp 2012-01-11 22:21:18.041992100 +0800 @@ -14,6 +14,11 @@ #include "gmgame.h" #include "Iterator.h" +void* HookupAT3x(void* a, void* b, void* c, void* patch_start, void* patch_end, int (*version_selector)()) +{ + return HookupAT3(a,b,c,patch_start,patch_end,version_selector); +} + #define GDI 1 #define NOD 0 #define GREEN "104,234,40" @@ -214,7 +219,7 @@ Commands->Attach_Script(rtccontroller,"RTC_timer",""); const char *str = Get_Team_Name(0); const char *str2 = Get_Team_Name(1); - Msg.Format("msg %s on the %s team wants to swap with someone on the %s team. Type \"!rtc\" or \"!swap\" to change with them. There is %i seconds remaining before this expires.", Get_Player_Name(Get_GameObj(PlayerID)), str, str2, swap.SwapExpireLimit); + Msg.Format("msg %s on the %s team wants to swap with someone on the %s team. Type \"!rtc\" or \"!swap\" to change with them. There are %i seconds remaining before this expires.", Get_Player_Name(Get_GameObj(PlayerID)), str, str2, swap.SwapExpireLimit); Console_Input(Msg); delete[] str; delete[] str2; @@ -237,7 +242,7 @@ Commands->Attach_Script(rtccontroller,"RTC_timer",""); const char *str = Get_Team_Name(0); const char *str2 = Get_Team_Name(1); - Msg.Format("msg %s on the %s team wants to swap with someone on the %s team. Type \"!rtc\" or \"!swap\" to change with them. There is 1 minute remaining before this expires.",Get_Player_Name(Get_GameObj(PlayerID)),str,str2); + Msg.Format("msg %s on the %s team wants to swap with someone on the %s team. Type \"!rtc\" or \"!swap\" to change with them. There are %i seconds remaining before this expires.",Get_Player_Name(Get_GameObj(PlayerID)),str,str2, swap.SwapExpireLimit); Console_Input(Msg); delete[] str; delete[] str2; diff -uwr sourceold/teamspeak/teamspeak.cpp source/teamspeak/teamspeak.cpp --- sourceold/teamspeak/teamspeak.cpp 2011-10-11 23:02:36.131835900 +0800 +++ source/teamspeak/teamspeak.cpp 2012-01-11 22:21:38.350585900 +0800 @@ -13,6 +13,12 @@ #include "teamspeak.h" #include "TCPclass.h" #include "gmgame.h" + +void* HookupAT3x(void* a, void* b, void* c, void* patch_start, void* patch_end, int (*version_selector)()) +{ + return HookupAT3(a,b,c,patch_start,patch_end,version_selector); +} + TCPSocket *Client; class TS3 : public Plugin