public void Handle(Chaos mod, String from, IEnumerable <String> rest) { Ped player = Game.Player.Character; if (player == null) { mod.ShowText($"{from} tried to boost you :("); return; } var what = "Boost"; float time = 30f; float factor = 20f; if (super) { factor = 200f; what = "Super Boost"; } var timer = mod.Timer(what, time); mod.AddTicker(new BoostTicker(player, timer, factor)); mod.ShowText($"{from} caused the vehicle to boost!"); }
public void Handle(Chaos mod, String from, IEnumerable <String> rest) { Ped player = Game.Player.Character; Vehicle vehicle = player.CurrentVehicle; if (vehicle == null) { mod.ShowText($"{from} tried to blow out your tires!"); return; } if (!vehicle.CanTiresBurst) { vehicle.CanTiresBurst = true; } var wheels = vehicle.Wheels; foreach (var i in WHEELS) { if (vehicle.IsVehicleTyreBurst(i, true)) { continue; } if (mod.Rnd.NextBoolean()) { wheels[i].Burst(); } } mod.ShowText($"{from} blew out your tires!"); }
public void Handle(Chaos mod, String from, IEnumerable <String> rest) { Ped player = Game.Player.Character; if (player == null) { return; } var r = rest.GetEnumerator(); if (!r.MoveNext()) { return; } var id = r.Current; WeaponHash?weapon = mod.GetWeaponById(id); if (!weapon.HasValue) { mod.ShowText($"{from} tried to give you a weapon :( ({id})"); return; } var w = player.Weapons.Give(weapon.Value, 0, true, true); w.Ammo = w.MaxAmmo; w.AmmoInClip = w.MaxAmmoInClip; mod.ShowText($"{from} gave you a weapon! ({id})"); }
public void Handle(Chaos mod, String from, IEnumerable <String> rest) { var player = Game.Player.Character; if (player == null) { return; } var r = rest.GetEnumerator(); if (!r.MoveNext()) { return; } var amount = int.Parse(r.Current); for (var i = 0; i < amount; i++) { var pedHash = ENEMY_MODELS[mod.Rnd.Next(0, ENEMY_MODELS.Length)]; var weaponHash = ENEMY_WEAPONS[mod.Rnd.Next(0, ENEMY_WEAPONS.Length)]; var distance = mod.Rnd.Next(10, 20); var ped = World.CreatePed(new Model(pedHash), player.Position.Around(distance)); var weapon = ped.Weapons.Give(weaponHash, 0, true, true); weapon.Ammo = weapon.MaxAmmo; ped.IsEnemy = true; ped.RelationshipGroup = mod.HateGroup.GroupId; ped.SetCombatAttributes(CombatAttributes.AlwaysFight, true); ped.SetCombatAttributes(CombatAttributes.CanFightArmedPedsWhenNotArmed, true); ped.Task.ClearAll(); ped.Task.FightAgainst(player); ped.Detach(); ped.MarkAsNoLongerNeeded(); var blip = ped.AttachBlip(); mod.AddTicker(new EnemyBlipTicker(blip, ped)); } if (amount == 1) { mod.ShowText($"{from} spawned an fib operative out to get you!"); } else { mod.ShowText($"{from} spawned {amount} fib operatives out to get you!"); } }
public void Handle(Chaos mod, String from, IEnumerable <String> rest) { Ped player = Game.Player.Character; if (player == null) { mod.ShowText($"{from} tried to take your weapons!"); return; } player.Weapons.RemoveAll(); mod.ShowText($"{from} took ALL your weapons!"); }
public void Handle(Chaos mod, String from, IEnumerable <String> rest) { Ped player = Game.Player.Character; if (player == null) { mod.ShowText($"{from} tried to kill you!"); return; } player.Kill(); mod.ShowText($"{from} killed you!"); }
public void Handle(Chaos mod, String from, IEnumerable <String> rest) { var player = Game.Player.Character; if (player == null) { mod.ShowText($"{from} tried to open your parachute!"); return; } player.Task.UseParachute(); mod.ShowText($"{from} opened your parachute!"); }
public void Handle(Chaos mod, String from, IEnumerable <String> rest) { Ped player = Game.Player.Character; if (player == null) { mod.ShowText($"{from} tried to give you armor!"); return; } player.Health = player.MaxHealth; mod.ShowText($"{from} gave you armor!"); }
public void Handle(Chaos mod, String from, IEnumerable <String> rest) { Ped player = Game.Player.Character; Vehicle vehicle = player.CurrentVehicle; if (vehicle == null) { mod.ShowText($"{from} tried to kill your engine!"); return; } vehicle.EngineHealth = 0; mod.ShowText($"{from} killed your engine!"); }
public void Handle(Chaos mod, String from, IEnumerable <String> rest) { Ped player = Game.Player.Character; Vehicle vehicle = player.CurrentVehicle; if (vehicle == null) { mod.ShowText($"{from} tried to repair your car!"); return; } vehicle.Repair(); mod.ShowText($"{from} repaired your car!"); }
public void Handle(Chaos mod, String from, IEnumerable <String> rest) { var player = Game.Player.Character; var vehicle = player?.CurrentVehicle; if (player == null || vehicle == null) { mod.ShowText($"{from} tried to eject from vehicle :("); return; } player.Task.LeaveVehicle(); mod.ShowText($"{from} caused you to eject from your vehicle!"); }
public void Handle(Chaos mod, String from, IEnumerable <String> rest) { Ped player = Game.Player.Character; Weapon weapon = player.Weapons.Current; if (weapon == null) { mod.ShowText($"{from} tried to take your ammo!"); return; } weapon.AmmoInClip = 0; weapon.Ammo = 0; mod.ShowText($"{from} took all your ammo!"); }
public void Handle(Chaos mod, String from, IEnumerable <String> rest) { Ped player = Game.Player.Character; Vehicle vehicle = player.CurrentVehicle; if (vehicle == null) { mod.ShowText($"{from} tried to brake your vehicle!"); return; } var timer = mod.Timer("Handbrake On", 5f); mod.AddTicker(new BrakeTicker(vehicle, timer)); mod.ShowText($"{from} caused the vehicle to brake!"); }
public void Handle(Chaos mod, String from, IEnumerable <String> rest) { Ped player = Game.Player.Character; player.Euphoria.HighFall.Start(1000); mod.ShowText($"{from} caused you to fall!"); }
public void Handle(Chaos mod, String from, IEnumerable <String> rest) { Ped player = Game.Player.Character; if (player == null) { mod.ShowText($"{from} tried to taze you!"); return; } player.Euphoria.Electrocute.Start(3_000); var timer = mod.Timer("Tazing", 3); mod.AddUniqueTicker(TickerId.Electrocuted, timer); mod.ShowText($"{from} tazed you!"); }
public void Handle(Chaos mod, String from, IEnumerable <String> rest) { Ped player = Game.Player.Character; if (player == null) { return; } var vehicle = player.CurrentVehicle; if (vehicle == null) { return; } var count = vehicle.Mods.ColorCombinationCount; if (count == 0) { vehicle.Mods.ColorCombination = mod.Rnd.Next(0, count); } vehicle.RandomizeColors(mod.Rnd); mod.ShowText($"{from} scrambled your vehicle colors!"); }
public void Handle(Chaos mod, String from, IEnumerable <String> rest) { var player = Game.Player.Character; if (player == null) { mod.ShowText($"{from} tried to make you skyfall :("); return; } // parameters when in vehicle if (player.CurrentVehicle != null) { player.CurrentVehicle.Delete(); } switch (player.ParachuteState) { case ParachuteState.Deploying: case ParachuteState.Gliding: player.Task.UseParachute(); break; default: break; } var timer = mod.Timer("Skyfall", 20f); player.Weapons.Give(WeaponHash.Parachute, 1, true, true); mod.AddUniqueTicker(TickerId.Skyfall, new SkyfallTicker(player, timer)); }
public void Handle(Chaos mod, String from, IEnumerable <String> rest) { Ped player = Game.Player.Character; player.Euphoria.StaggerFall.Start(500); mod.ShowText($"{from} tripped you!"); }
public void Handle(Chaos mod, String from, IEnumerable <String> rest) { Ped player = Game.Player.Character; if (player == null) { return; } var vehicle = player.CurrentVehicle; if (vehicle == null) { return; } var license = String.Join(" ", rest); if (license.Length == 0) { license = from; } license = String.Concat(license.Take(8)); vehicle.Mods.LicensePlate = license; mod.ShowText($"{from} set your license plate to \"{license}\"!"); }
public void Handle(Chaos mod, String from, IEnumerable <String> rest) { Ped player = Game.Player.Character; Weapon weapon = player.Weapons.Current; if (weapon != null) { player.Weapons.Remove(weapon); } else { var weapons = mod.PlayerWeapons(); if (weapons.Count == 0) { mod.ShowText($"{from} tried to take your weapons, but no weapons to take :("); return; } var take = weapons[mod.Rnd.Next(0, weapons.Count - 1)]; // take a random weapon. player.Weapons.Remove(take); } player.Weapons.Select(WeaponHash.Unarmed, true); // mod.ShowText($"{from} took your weapon!"); }
public void Handle(Chaos mod, String from, IEnumerable <String> rest) { var r = rest.GetEnumerator(); if (!r.MoveNext()) { return; } String what = null; DisabledControl control = DisabledControl.Steering; var id = r.Current; switch (id) { case "steering": control = DisabledControl.Steering; what = "Steering"; break; default: throw new Exception($"bad disable-control id `{id}`"); } var timer = mod.Timer($"Disabled {what}", 10f); mod.AddTicker(new DisableControlTicker(timer, control)); mod.ShowText($"{from} disabled the {what} control!"); }
public void Handle(Chaos mod, String from, IEnumerable <String> rest) { var r = rest.GetEnumerator(); if (!r.MoveNext()) { return; } var level = int.Parse(r.Current); String what; if (level == 0) { what = $"{from} cleared your wanted level!"; } else if (level == 1) { what = $"{from} set your wanted level to one star!"; } else { what = $"{from} set your wanted level to {level} stars!"; } Game.Player.WantedLevel = level; mod.ShowText(what); }
public void Handle(Chaos mod, String from, IEnumerable <String> rest) { Ped player = Game.Player.Character; if (player == null) { mod.ShowText($"{from} tried to make EVERYONE attack you!"); return; } var peds = World.GetNearbyPeds(player.Position, 5000f); var count = 0; foreach (var ped in peds) { if (!ped.Exists() || !ped.IsHuman || !ped.IsAlive || ped == player) { continue; } ped.NeverLeavesGroup = true; ped.RelationshipGroup = mod.HateGroup.GroupId; // var blip = ped.AddBlip(); // mod.AddTicker(new EnemyBlipTicker(blip, ped)); ped.SetCombatAttributes(CombatAttributes.AlwaysFight, true); ped.SetCombatAttributes(CombatAttributes.CanFightArmedPedsWhenNotArmed, true); ped.Task.ClearAll(); ped.Task.FightAgainst(player); count += 1; } if (count == 0) { mod.ShowText($"{from} tried to set pedestrians on you, but there are none :("); return; } var timer = mod.AnonymousTimer(30f); mod.AddUniqueTicker(TickerId.SuppressShocking, new SuppressShockingTicker(timer)); mod.ShowText($"{from} set {count} pedestrians on you!"); }
public void Handle(Chaos mod, String from, IEnumerable <String> rest) { var duration = rest.GetEnumerator().NextFloatOrDefault(30f); var timer = mod.Timer("Exploding Bullets", duration); mod.AddUniqueTicker(TickerId.ExplodingBullets, new ExplodingBulletsTicker(timer)); mod.ShowText($"{from} enabled exploding bullets!"); }
public void Handle(Chaos mod, String from, IEnumerable <String> rest) { var duration = rest.GetEnumerator().NextFloatOrDefault(30f); var timer = mod.Timer("Super Swim", duration); mod.AddUniqueTicker(TickerId.SuperSwim, new SuperSwimTicker(timer, 10f)); mod.ShowText($"{from} gave you with super swim for {duration} seconds"); }
public void Handle(Chaos mod, String from, IEnumerable <String> rest) { Ped player = Game.Player.Character; Vehicle vehicle = player.CurrentVehicle; if (vehicle == null) { mod.ShowText($"{from} tried to cause your fuel tank to leak :("); return; } var initial = vehicle.FuelLevel / 100f; var timer = mod.AnonymousTimer(30f * initial, 30f); var gauge = mod.Gauge("Fuel Level"); mod.AddTicker(new FuelLeakageTicker(vehicle, gauge, timer)); mod.ShowText($"{from} caused your fuel tank to leak!"); }
public void Handle(Chaos mod, String from, IEnumerable <String> rest) { var player = Game.Player.Character; if (player == null) { mod.ShowText($"{from} tried to enable matrix slam :("); return; } var entities = World.GetNearbyEntities(player.Position, 100f); var timer = mod.AnonymousTimer(2f); var controller = new MatrixController(entities, player, timer); mod.AddTicker(controller); mod.ShowText($"{from} performed a matrix slam!"); }
public void Handle(Chaos mod, String from, IEnumerable <String> rest) { Ped player = Game.Player.Character; if (player == null) { mod.ShowText($"{from} tried to put you on fire!"); return; } var timer = mod.Timer("On Fire", 5f); if (mod.AddUniqueTicker(TickerId.SetOnFire, new SetOnFireTicker(player, timer))) { player.StartEntityFire(); } mod.ShowText($"{from} put you on fire!"); }
public void Handle(Chaos mod, String from, IEnumerable <String> rest) { Ped player = Game.Player.Character; if (player == null) { mod.ShowText($"{from} tried to put EVERYONE on fire!"); return; } var peds = World.GetNearbyPeds(player.Position, 1000f); var scriptFires = new List <ScriptFire>(); foreach (var ped in peds) { if (ped.IsHuman && !ped.IsOnFire && ped.IsAlive && ped != player) { if (ped.CurrentVehicle != null) { ped.Task.ClearAll(); ped.AlwaysKeepTask = true; ped.Task.LeaveVehicle(); } ped.Euphoria.OnFire.Start(10_000); var id = WorldExtension.StartScriptFire(ped.Position, 5, true); scriptFires.Add(new ScriptFire(id, ped)); } } if (scriptFires.Count == 0) { mod.ShowText($"{from} tried to put pedestrians on fire but there are none :("); return; } var timer = mod.Timer("Peds On Fire", 10f); mod.AddTicker(new SetPedsOnFireTicker(scriptFires, timer)); mod.ShowText($"{from} set {scriptFires.Count} pedestrians on fire!"); }
public void Handle(Chaos mod, String from, IEnumerable <String> rest) { var timer = mod.Timer("Time Slowdown", 5f); if (mod.AddUniqueTicker(TickerId.SlowDownTime, new SlowDownTimeTicker(timer))) { Function.Call(Hash.SET_TIME_SCALE, 0.25f); } mod.ShowText($"{from} slowed down time!"); }