Skip to content

Commit

Permalink
a few extra effects
Browse files Browse the repository at this point in the history
  • Loading branch information
lempamo committed Jun 12, 2020
1 parent b873e8d commit dd0c4f5
Showing 1 changed file with 47 additions and 6 deletions.
53 changes: 47 additions & 6 deletions ChaosMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ public ChaosMain() {
//Effects.Add(new Effect("Zero Gravity", EffectMiscNoGravity, new Timer(28000), null, EffectMiscNormalGravity)); //this one doesn't affect vehicles :/
Effects.Add(new Effect("No HUD", EffectMiscNoHUD, new Timer(88000), null, EffectMiscShowHUD));
Effects.Add(new Effect("Nothing", EffectMiscNothing));
Effects.Add(new Effect("Spawn Jet", EffectMiscSpawnJet));
Effects.Add(new Effect("SPEEN", EffectMiscSPEEN, new Timer(28000), EffectMiscSPEEN, EffectMiscSPEEN));

Effects.Add(new Effect("All Nearby Peds Are Wanted", EffectPedsAllNearbyWanted));
Expand All @@ -178,6 +179,7 @@ public ChaosMain() {
Effects.Add(new Effect("Everyone Is A Ghost", EffectPedsInvisibleLoop, new Timer(88000), EffectPedsInvisibleLoop, EffectPedsInvisibleStop));
Effects.Add(new Effect("Ignite All Nearby Peds", EffectPedsIgniteNearby));
Effects.Add(new Effect("Launch All Nearby Peds Up", EffectPedsLaunch));
Effects.Add(new Effect("No Headshots", EffectPedsNoHeadshotsLoop, new Timer(88000), EffectPedsNoHeadshotsLoop, EffectPedsNoHeadshotsStop));
Effects.Add(new Effect("No Ragdoll", EffectPedsNoRagdollLoop, new Timer(88000), EffectPedsNoRagdollLoop, EffectPedsNoRagdollStop));
Effects.Add(new Effect("Obliterate All Nearby Peds", EffectPedsObliterateNearby));
Effects.Add(new Effect("One Hit KO", EffectPedsOHKO, new Timer(28000), EffectPedsOHKO, EffectPedsOHKOStop));
Expand All @@ -192,6 +194,7 @@ public ChaosMain() {
Effects.Add(new Effect("Exit Current Vehicle", EffectPlayerExitCurrentVehicle));
Effects.Add(new Effect("Give All Weapons", EffectPlayerGiveAll));
Effects.Add(new Effect("Give Grenades", EffectPlayerGiveGrenades));
Effects.Add(new Effect("Give Molotov Cocktails", EffectPlayerGiveGrenades));
Effects.Add(new Effect("Give Rocket Launcher", EffectPlayerGiveRocket));
Effects.Add(new Effect("Heal Player", EffectPlayerHeal));
Effects.Add(new Effect("Ignite Player", EffectPlayerIgnite));
Expand All @@ -209,6 +212,7 @@ public ChaosMain() {
Effects.Add(new Effect("Teleport To GetALife Building", EffectPlayerTeleportGetALife));
Effects.Add(new Effect("Teleport To The Heart Of Liberty City", EffectPlayerTeleportHeart));
Effects.Add(new Effect("Teleport To Nearest Safehouse", EffectPlayerTeleportNearestSafehouse));
Effects.Add(new Effect("Teleport To Swingset", EffectPlayerTeleportSwingset));
Effects.Add(new Effect("Teleport To Waypoint", EffectPlayerTeleportWaypoint));
Effects.Add(new Effect("+2 Wanted Stars", EffectPlayerWantedAddTwo));
Effects.Add(new Effect("Clear Wanted Level", EffectPlayerWantedClear));
Expand Down Expand Up @@ -237,8 +241,10 @@ public ChaosMain() {
Effects.Add(new Effect("Lock All Vehicles", EffectVehicleLockAll));
Effects.Add(new Effect("Lock Vehicle Player Is In", EffectVehicleLockPlayer));
Effects.Add(new Effect("Mass Breakdown", EffectVehicleMassBreakdown));
Effects.Add(new Effect("No Traffic", EffectVehicleTrafficNone, new Timer(88000), EffectVehicleTrafficNone, null));
Effects.Add(new Effect("Pop Tires Of Current Vehicle", EffectVehiclePopTiresPlayer));
Effects.Add(new Effect("Repair Current Vehicle", EffectVehicleRepairPlayer));
Effects.Add(new Effect("Spammy Vehicle Doors", EffectVehicleSpamDoors, new Timer(88000), EffectVehicleSpamDoors, null));
Effects.Add(new Effect("Spawn Bus", EffectVehicleSpawnBus));
Effects.Add(new Effect("Spawn Infernus", EffectVehicleSpawnInfernus));
Effects.Add(new Effect("Spawn Maverick", EffectVehicleSpawnMaverick));
Expand Down Expand Up @@ -386,6 +392,10 @@ public void EffectMiscShowHUD() {
isHUDless = false;
}

public void EffectMiscSpawnJet() {
World.CreateObject("ec_jet", Player.Character.Position.Around(2f));
}

public void EffectMiscSPEEN() {
foreach (GTA.Object o in World.GetAllObjects()) {
if (o.Exists()) o.Heading += 5f;
Expand Down Expand Up @@ -516,6 +526,18 @@ public void EffectPedsLaunch() {
}
}

public void EffectPedsNoHeadshotsLoop() {
foreach (Ped p in World.GetAllPeds()) {
if (p.Exists()) Function.Call("SET_CHAR_SUFFERS_CRITICAL_HITS", p, false);
}
}

public void EffectPedsNoHeadshotsStop() {
foreach (Ped p in World.GetAllPeds()) {
if (p.Exists()) Function.Call("SET_CHAR_SUFFERS_CRITICAL_HITS", p, true);
}
}

public void EffectPedsNoRagdollLoop() {
foreach (Ped p in World.GetAllPeds()) {
if (p.Exists()) p.PreventRagdoll = true;
Expand Down Expand Up @@ -629,13 +651,17 @@ public void EffectPlayerGiveAll() {
Function.Call("GIVE_WEAPON_TO_CHAR", Player.Character, 14, 9999); // rifle
Function.Call("GIVE_WEAPON_TO_CHAR", Player.Character, 17, 9999); // sniper
Function.Call("GIVE_WEAPON_TO_CHAR", Player.Character, 18, 9999); // rocket launcher
Function.Call("GIVE_WEAPON_TO_CHAR", Player.Character, 4, 9999); // grenades
Function.Call("GIVE_WEAPON_TO_CHAR", Player.Character, R.Next(4,5), 9999); // grenades or molotov
}

public void EffectPlayerGiveGrenades() {
Function.Call("GIVE_WEAPON_TO_CHAR", Player.Character, 4, 9999);
}

public void EffectPlayerGiveMolotovs() {
Function.Call("GIVE_WEAPON_TO_CHAR", Player.Character, 5, 9999);
}

public void EffectPlayerGiveRocket() {
Function.Call("GIVE_WEAPON_TO_CHAR", Player.Character, 18, 9999);
}
Expand Down Expand Up @@ -722,6 +748,10 @@ public void EffectPlayerTeleportNearestSafehouse() {
Player.TeleportTo(s);
}

public void EffectPlayerTeleportSwingset() {
Player.TeleportTo(new Vector3(1354, -256, 22));
}

public void EffectPlayerTeleportWaypoint() {
if (Game.GetWaypoint() != null) Player.TeleportTo(Game.GetWaypoint().Position);
else {
Expand Down Expand Up @@ -779,7 +809,7 @@ public void EffectTimeLagLoop() {

public void EffectTimeLapse() {
World.UnlockDayTime();
World.CurrentDayTime = World.CurrentDayTime.Add(new TimeSpan(0, 30, 0));
World.CurrentDayTime = World.CurrentDayTime.Add(new TimeSpan(0, 10, 0));
}

public void EffectTimeSetEvening() {
Expand Down Expand Up @@ -892,6 +922,11 @@ public void EffectVehicleRepairPlayer() {
if (Player.Character.isInVehicle()) Player.Character.CurrentVehicle.Repair();
}

public void EffectVehicleSpamDoors() {
if (Math.Round(EffectTimer.ElapsedTime / 100d, 0) % 10 == 0) foreach (Vehicle v in World.GetAllVehicles()) if (v.Exists()) for (int i = 0; i < 6; i++) Function.Call("SHUT_CAR_DOOR", v, i);
if (Math.Round((EffectTimer.ElapsedTime + 500) / 100d, 0) % 10 == 0) foreach (Vehicle v in World.GetAllVehicles()) if (v.Exists()) for (int i = 0; i < 6; i++) Function.Call("OPEN_CAR_DOOR", v, i);
}

public void EffectVehicleSpawnBus() {
World.CreateVehicle(new Model("BUS"), Player.Character.Position.Around(2f));
}
Expand Down Expand Up @@ -934,6 +969,12 @@ public void EffectVehicleTrafficBlue() {
}
}

public void EffectVehicleTrafficNone() {
foreach (Vehicle v in World.GetAllVehicles()) {
if (v.Exists() & !v.isRequiredForMission & v != Player.Character.CurrentVehicle) v.Delete();
}
}

public void EffectVehicleTrafficRed() {
foreach (Vehicle v in World.GetAllVehicles()) {
if (v.Exists()) v.Color = ColorIndex.VeryRed;
Expand All @@ -949,19 +990,19 @@ public void EffectVehicleTrafficWhite() {

#region Weather Effects
public void EffectWeatherCloudy() {
World.Weather = Weather.Cloudy;
Function.Call("FORCE_WEATHER_NOW", 3);
}

public void EffectWeatherFoggy() {
World.Weather = Weather.Foggy;
Function.Call("FORCE_WEATHER_NOW", 6);
}

public void EffectWeatherSunny() {
World.Weather = Weather.ExtraSunny;
Function.Call("FORCE_WEATHER_NOW", 0);
}

public void EffectWeatherThunder() {
World.Weather = Weather.ThunderStorm;
Function.Call("FORCE_WEATHER_NOW", 7);
}
#endregion
}
Expand Down

0 comments on commit dd0c4f5

Please sign in to comment.