Esempio n. 1
0
        /// <summary>
        /// Pick lock a vehicle door.
        /// </summary>
        /// <param name="client"></param>
        /// <param name="arguments"></param>
        public static void PicklockDoor(Client client, params object[] arguments)
        {
            if (arguments[1] == null)
                return;

            Vehicle vehicle = arguments[1] as Vehicle;

            if (client.Position.DistanceTo2D(vehicle.Position) > 5)
                return;

            if (!vehicle.Locked)
                return;

            if (!Skillcheck.SkillCheckPlayer(client, Skillcheck.Skills.intelligence, 15, -1))
                return;

            vehicle.Locked = false;
            client.SendChatMessage("Success!");
        }
Esempio n. 2
0
        public static void Use(Client client, Vehicle vehicle)
        {
            if (!vehicle.Exists)
            {
                return;
            }

            LevelRankCooldowns cooldowns = AccountUtil.GetCooldowns(client);
            LevelRanks         ranks     = AccountUtil.GetLevelRanks(client);

            if (!cooldowns.IsSmashReady || ranks.Smash <= 0)
            {
                return;
            }

            if (client.Position.DistanceTo2D(vehicle.Position) > 2.5)
            {
                return;
            }

            if (!vehicle.Locked)
            {
                return;
            }

            cooldowns.IsSmashReady = false;

            bool didPlayerSucceed = Skillcheck.SkillCheckPlayer(client, Skillcheck.Skills.strength, new Random().Next(15, 28), clientModifier: ranks.Smash, impact: -1);

            if (!didPlayerSucceed)
            {
                client.SendNotification("You try to smash the vehicle window but end up hurting your fist.");
                return;
            }

            vehicle.Locked = false;
            client.SendNotification("You successfully smash the vehicle window.");
            Utilities.BreakVehicleWindow(client, vehicle);
        }