Exemplo n.º 1
0
        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!");
        }
Exemplo n.º 2
0
        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!");
        }
Exemplo n.º 3
0
        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})");
        }
Exemplo n.º 4
0
        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!");
            }
        }
Exemplo n.º 5
0
        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!");
        }
Exemplo n.º 6
0
        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!");
        }
Exemplo n.º 7
0
        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!");
        }
Exemplo n.º 8
0
        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!");
        }
Exemplo n.º 9
0
        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!");
        }
Exemplo n.º 10
0
        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!");
        }
Exemplo n.º 11
0
        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!");
        }
Exemplo n.º 12
0
        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!");
        }
Exemplo n.º 13
0
        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!");
        }
Exemplo n.º 14
0
        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!");
        }
Exemplo n.º 15
0
        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!");
        }
Exemplo n.º 16
0
        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!");
        }
Exemplo n.º 17
0
        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));
        }
Exemplo n.º 18
0
        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!");
        }
Exemplo n.º 19
0
        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}\"!");
        }
Exemplo n.º 20
0
        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!");
        }
Exemplo n.º 21
0
        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!");
        }
Exemplo n.º 22
0
        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);
        }
Exemplo n.º 23
0
        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!");
        }
Exemplo n.º 24
0
        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!");
        }
Exemplo n.º 25
0
        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");
        }
Exemplo n.º 26
0
        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!");
        }
Exemplo n.º 27
0
        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!");
        }
Exemplo n.º 28
0
        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!");
        }
Exemplo n.º 29
0
        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!");
        }
Exemplo n.º 30
0
        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!");
        }