示例#1
0
        // Returns Bonus Damage on use.
        public static int Event(Client client)
        {
            int bonusDamage = 0;

            if (!client.HasData(EntityData.Account))
            {
                return(bonusDamage);
            }

            if (!(client.GetData(EntityData.Account) is Account account))
            {
                return(bonusDamage);
            }

            if (client.CurrentWeapon != WeaponHash.Unarmed)
            {
                return(bonusDamage);
            }

            LevelRanks levelRanks = account.GetLevelRanks();

            bonusDamage = levelRanks.Fisticuffs;

            return(bonusDamage);
        }
示例#2
0
        public static void Use(Client client, Client target)
        {
            if (!target.Exists)
            {
                return;
            }

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

            if (!cooldowns.IsIntimidateReady || ranks.Intimidate <= 0)
            {
                return;
            }

            if (client.Position.DistanceTo2D(target.Position) > 4)
            {
                return;
            }

            cooldowns.IsIntimidateReady = false;
            Utilities.ForcePlayerCower(target, ranks.Intimidate * 1000);
            client.SendChatMessage($"~r~Intimidate ~w~You look quite intimidating and ~o~{target.Name}~w~ has noticed.");
            target.SendChatMessage($"~r~Intimidate ~o~{client.Name} ~w~looks very intimidating you cower in fear.");
        }
示例#3
0
        public static void Use(Client client, Client target)
        {
            if (!client.Exists)
            {
                return;
            }

            if (!target.Exists)
            {
                return;
            }

            if (client.Position.DistanceTo2D(target.Position) > 5)
            {
                return;
            }

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

            if (ranks.Drag <= 0)
            {
                return;
            }

            if (!cooldowns.IsDragReady)
            {
                return;
            }

            cooldowns.IsDragReady = false;
            Utilities.ForcePlayerToFollowPlayer(target, client, ranks.Drag * 1500);
            client.SendNotification($"You are dragging ~o~{target.Name}.");
            target.SendNotification($"You are being dragged by ~o~{client.Name}.");
        }
示例#4
0
        private void CheckPassive(object source, Client client)
        {
            if (!(client.GetData(EntityData.Account) is Account account))
            {
                return;
            }

            LevelRanks levelRanks = account.GetLevelRanks();

            if (levelRanks.Regenerate <= 0)
            {
                return;
            }

            LevelRankCooldowns levelRankCooldowns = AccountUtil.GetCooldowns(client);

            levelRankCooldowns.UpdateCooldownTime(client, "IsRegenerateReady", SkillCooldowns.Regenerate);

            if (!levelRankCooldowns.IsRegenerateReady)
            {
                return;
            }

            levelRankCooldowns.IsRegenerateReady = false;

            if (client.Health >= 95)
            {
                return;
            }

            client.SendNotification("~b~Regenerate ~w~You feel a bit healthier.");
            client.Health += levelRanks.Regenerate;
        }
示例#5
0
        public static int Use(Client client)
        {
            int damageRollBonus = 0;

            if (!client.Exists)
            {
                return(damageRollBonus);
            }

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

            if (ranks.DamageRoll <= 0)
            {
                return(damageRollBonus);
            }

            if (!cooldowns.IsDamageRollReady)
            {
                return(damageRollBonus);
            }

            damageRollBonus = ranks.DamageRoll / 2;

            cooldowns.IsDamageRollReady = false;
            client.SendNotification("Your shot hit for a little more damage.");
            return(damageRollBonus);
        }
示例#6
0
        private void HandleDeath(object source, Client client, Client killer)
        {
            AccountUtil.SetPlayerDeath(client, true);
            LevelRanks         levelRanks  = AccountUtil.GetLevelRanks(client);
            LevelRankCooldowns cooldowns   = AccountUtil.GetCooldowns(client);
            DateTime           timeOfDeath = AccountUtil.SetTimeOfDeath(client);

            int downerBonus = 0;

            if (levelRanks.Downer > 0 && cooldowns.IsDownerReady)
            {
                cooldowns.IsDownerReady = false;
                downerBonus             = 5000 * levelRanks.Downer;
                client.SendChatMessage("~r~Downer ~w~You are using your extended downtime for dieing.");
            }

            NotifyPlayersOfDeath(client);

            NAPI.Task.Run(() =>
            {
                if (!AccountUtil.IsPlayerDead(client))
                {
                    return;
                }

                if (timeOfDeath != AccountUtil.GetTimeOfDeath(client))
                {
                    return;
                }

                AccountUtil.SetPlayerDeath(client, false);
            }, 30000 + downerBonus); // 30 Seconds + Bonus
        }
示例#7
0
        public void GetPoints(Client client)
        {
            Account account = client.GetData(EntityData.Account);

            LevelRanks levelRanks = JsonConvert.DeserializeObject <LevelRanks>(account.LevelRanks);

            client.SendChatMessage($"{levelRanks.GetUnallocatedRankPointCount(account.CurrentExperience)}");
        }
示例#8
0
        public static bool Weapon(Client client, string name)
        {
            LevelRanks levelRanks = AccountUtil.GetLevelRanks(client);
            WeaponHash hash       = NAPI.Util.WeaponNameToModel(name);

            if (Array.IndexOf(WeaponNamesData.AssaultWeapons, name.ToLower()) >= 0)
            {
                if (levelRanks.MediumWeaponry <= 0)
                {
                    client.SendChatMessage("~o~You are unable to wield this weapon type: ~y~Medium");
                    Utilities.PlaySoundFrontend(client, "ERROR", "HUD_FRONTEND_DEFAULT_SOUNDSET");
                    return(false);
                }
            }

            if (Array.IndexOf(WeaponNamesData.ShotgunWeapons, name.ToLower()) >= 0)
            {
                if (levelRanks.MediumWeaponry <= 0)
                {
                    client.SendChatMessage("~o~You are unable to wield this weapon type: ~y~Medium");
                    Utilities.PlaySoundFrontend(client, "ERROR", "HUD_FRONTEND_DEFAULT_SOUNDSET");
                    return(false);
                }
            }

            if (Array.IndexOf(WeaponNamesData.SmgWeapons, name.ToLower()) >= 0)
            {
                if (levelRanks.LightWeaponry <= 0)
                {
                    client.SendChatMessage("~o~You are unable to wield this weapon type: ~y~Light");
                    Utilities.PlaySoundFrontend(client, "ERROR", "HUD_FRONTEND_DEFAULT_SOUNDSET");
                    return(false);
                }
            }

            if (Array.IndexOf(WeaponNamesData.HeavyWeapons, name.ToLower()) >= 0)
            {
                if (levelRanks.HeavyWeaponry <= 0)
                {
                    client.SendChatMessage("~o~You are unable to wield this weapon type: ~y~Heavy");
                    Utilities.PlaySoundFrontend(client, "ERROR", "HUD_FRONTEND_DEFAULT_SOUNDSET");
                    return(false);
                }
            }

            // Try adding the weapon to the player.
            if (!AccountUtil.AddPlayerWeapon(client, hash))
            {
                return(false);
            }

            Utilities.PlaySoundFrontend(client, "PICK_UP_WEAPON", "HUD_FRONTEND_CUSTOM_SOUNDSET");
            client.SendNotification("A weapon may be unequipped into your inventory by pressing ~o~R~w~.");
            return(true);
        }
示例#9
0
        /// <summary>
        /// Update the player's local game with the required information for the Level System.
        /// </summary>
        /// <param name="client"></param>
        public static void UpdateLevelSystemLocally(Client client)
        {
            Account    account    = RetrieveAccount(client);
            LevelRanks levelRanks = JsonConvert.DeserializeObject <LevelRanks>(account.LevelRanks);

            int currentXP         = account.CurrentExperience;
            int unallocatedPoints = levelRanks.GetUnallocatedRankPointCount(currentXP);
            int lastXP            = LevelSystem.GetLastLevelExperience(currentXP);
            int nextLevelXP       = LevelSystem.GetNextLevelExperience(currentXP);
            int currentLvl        = LevelSystem.GetCurrentLevel(currentXP);

            client.TriggerEvent("eventRecieveRanks", account.LevelRanks);
            client.TriggerEvent("UpdateExperienceHUD", lastXP, currentXP, nextLevelXP, currentLvl, unallocatedPoints);
        }
示例#10
0
        public static int Use(Client client, int number)
        {
            LevelRankCooldowns cooldowns = AccountUtil.GetCooldowns(client);
            LevelRanks         ranks     = AccountUtil.GetLevelRanks(client);

            if (!cooldowns.IsQuickReady || ranks.Quick <= 0)
            {
                return(number);
            }

            cooldowns.IsQuickReady = false;
            client.SendNotification("You used your increased dodge chance.");
            return(number += ranks.Quick);
        }
示例#11
0
        public static bool Use(Client client)
        {
            LevelRankCooldowns cooldowns = AccountUtil.GetCooldowns(client);
            LevelRanks         ranks     = AccountUtil.GetLevelRanks(client);

            if (!cooldowns.IsCalculatedReady || ranks.Calculated <= 0)
            {
                return(false);
            }

            client.SendNotification("Your shot hit with 100% accuracy.");
            cooldowns.IsCalculatedReady = false;
            return(true);
        }
示例#12
0
        public static int Use(Client client, int number)
        {
            LevelRankCooldowns cooldowns = AccountUtil.GetCooldowns(client);
            LevelRanks         ranks     = AccountUtil.GetLevelRanks(client);

            if (!cooldowns.IsConcentrateReady || ranks.Concentrate <= 0)
            {
                return(number);
            }

            cooldowns.IsConcentrateReady = false;
            client.SendNotification("Your shot hit for double damage.");
            return(number * 2);
        }
示例#13
0
        public static bool Use(Client client)
        {
            LevelRankCooldowns cooldowns = AccountUtil.GetCooldowns(client);
            LevelRanks         ranks     = AccountUtil.GetLevelRanks(client);

            if (!cooldowns.IsDeadeyeReady || ranks.Deadeye <= 0)
            {
                return(false);
            }

            cooldowns.IsDeadeyeReady = false;
            client.SendNotification("Your shot had increased accuracy.");
            return(true);
        }
示例#14
0
        private void CheckPassive(object source, Client client)
        {
            if (!client.HasData(VariableName + Notification))
                client.SetData(VariableName + Notification, false);

            if (!(client.GetData(EntityData.Account) is Account account))
                return;

            LevelRanks levelRanks = account.GetLevelRanks();

            if (levelRanks.Electric <= 0)
                return;

            LevelRankCooldowns levelRankCooldowns = AccountUtil.GetCooldowns(client);
            levelRankCooldowns.UpdateCooldownTime(client, VariableName, SkillCooldowns.Electric);

            if (!levelRankCooldowns.IsElectricReady)
            {
                client.SetData(VariableName + Notification, false);
                return;
            }

            if (client.IsInVehicle)
            {
                // Check if the vehicle is electric.
                if (!client.Vehicle.HasData("ElectricVehicle"))
                    return;

                // Get the electric vehicle class.
                if (!(client.GetData("ElectricVehicle") is ElectricVehicle electricVehicle))
                    return;
                
                // If the electric vehicle's power is greater than 100. Don't try recharging.
                if (electricVehicle.Power > 100)
                    return;

                // If the electric vehicle has less than 100 power. Add some power based on ranks put into Electric.
                levelRankCooldowns.IsElectricReady = false;
                electricVehicle.Power += levelRanks.Electric;
                client.SendChatMessage("~b~Electric ~w~This vehicle has recieved a little more power.");
            }

            // Has the notification been sent.
            if (client.GetData(VariableName + Notification))
                return;

            client.SetData(VariableName + Notification, true);
            client.SendChatMessage("~b~Electric ~w~You will recharge a vehicle slightly when you enter it.");
        }
示例#15
0
        public void UpdateCurrentLevelResults(int score, Definitions.SurvivalRank rank)
        {
            while (LevelScores.Count <= LastSelectedLevel)
            {
                LevelScores.Add(0);
            }
            LevelScores[LastSelectedLevel] = score;

            while (LevelRanks.Count <= LastSelectedLevel)
            {
                LevelRanks.Add(Definitions.SurvivalRank.NotSet);
            }
            if ((LevelRanks[LastSelectedLevel] == Definitions.SurvivalRank.NotSet) || ((int)LevelRanks[LastSelectedLevel] > (int)rank))
            {
                LevelRanks[LastSelectedLevel] = rank;
            }
        }
示例#16
0
        public void CheckPassive(object source, Client client)
        {
            if (!client.HasData(VariableName + Notification))
            {
                client.SetData(VariableName + Notification, false);
            }

            if (!(client.GetData(EntityData.Account) is Account account))
            {
                return;
            }

            LevelRanks levelRanks = account.GetLevelRanks();

            if (levelRanks.Brute <= 0)
            {
                return;
            }

            LevelRankCooldowns levelRankCooldowns = AccountUtil.GetCooldowns(client);

            levelRankCooldowns.UpdateCooldownTime(client, VariableName, SkillCooldowns.Brute);

            if (!levelRankCooldowns.IsBruteReady)
            {
                client.SetData(VariableName + Notification, false);
                return;
            }

            levelRankCooldowns.IsBruteReady = false;

            if (client.Armor >= levelRanks.Brute)
            {
                return;
            }

            if (!client.GetData(VariableName + Notification))
            {
                client.SetData(VariableName + Notification, true);
                client.SendChatMessage("~r~Brute ~w~You feel your skin tighten.");
                client.Armor = levelRanks.Brute;
            }
        }
示例#17
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);
        }
示例#18
0
        public static void AllocateRankPoint(Client client, params object[] args)
        {
            if (args[1] == null)
            {
                return;
            }

            if (!client.HasData(EntityData.Account))
            {
                return;
            }

            if (!(client.GetData(EntityData.Account) is Account account))
            {
                return;
            }

            string argumentString = args[1] as string;

            if (argumentString.Contains(":"))
            {
                argumentString = argumentString.Substring(0, argumentString.Length - 3);
                argumentString = Regex.Replace(argumentString, @"[0-9\s:]", String.Empty);
            }

            LevelRanks levelRanks = JsonConvert.DeserializeObject <LevelRanks>(account.LevelRanks);
            bool       success    = levelRanks.AllocateSkillPoint(account.CurrentExperience, argumentString);

            if (!success)
            {
                Utilities.PushBrowserEvent(client, BrowserData.Skilltree_Error_Point_Assign);
                Utilities.PlaySoundFrontend(client, "Hack_Failed", "DLC_HEIST_BIOLAB_PREP_HACKING_SOUNDS");
                return;
            }

            levelRanks.UpdateLevelRanks(client);
            Utilities.PushBrowserEvent(client, BrowserData.Skilltree_Update_Data);
            Utilities.PlaySoundFrontend(client, "Hack_Success", "DLC_HEIST_BIOLAB_PREP_HACKING_SOUNDS");
        }
示例#19
0
        private void CheckPassive(object source, Client client)
        {
            if (!client.HasData(VariableName + Notification))
            {
                client.SetData(VariableName + Notification, false);
            }

            if (!(client.GetData(EntityData.Account) is Account account))
            {
                return;
            }

            LevelRanks levelRanks = account.GetLevelRanks();

            if (levelRanks.Downer <= 0)
            {
                return;
            }

            LevelRankCooldowns levelRankCooldowns = AccountUtil.GetCooldowns(client);

            levelRankCooldowns.UpdateCooldownTime(client, VariableName, SkillCooldowns.Downer);

            if (!levelRankCooldowns.IsDownerReady)
            {
                client.SetData(VariableName + Notification, false);
                return;
            }

            if (client.GetData(VariableName + Notification))
            {
                return;
            }

            client.SetData(VariableName + Notification, true);
            client.SendChatMessage("~r~Downer ~w~You have an extended down time available.");
        }
示例#20
0
        private void CheckPassive(object source, Client client)
        {
            if (!client.HasData(VariableName + Notification))
            {
                client.SetData(VariableName + Notification, false);
            }

            if (!(client.GetData(EntityData.Account) is Account account))
            {
                return;
            }

            LevelRanks levelRanks = account.GetLevelRanks();

            if (levelRanks.Hidden <= 0)
            {
                return;
            }

            LevelRankCooldowns levelRankCooldowns = AccountUtil.GetCooldowns(client);

            levelRankCooldowns.UpdateCooldownTime(client, VariableName, SkillCooldowns.Hidden);

            if (!levelRankCooldowns.IsHiddenReady)
            {
                client.SetData(VariableName + Notification, false);
                return;
            }

            if (client.GetData(VariableName + Notification))
            {
                return;
            }

            client.SetData(VariableName + Notification, true);
            client.SendChatMessage("~o~Hidden ~w~You are able to hide your nametag from others for a period of time.");
        }
示例#21
0
        private void CheckPassive(object source, Client client)
        {
            if (!client.HasData(VariableName + Notification))
            {
                client.SetData(VariableName + Notification, false);
            }

            if (!(client.GetData(EntityData.Account) is Account account))
            {
                return;
            }

            LevelRanks levelRanks = account.GetLevelRanks();

            if (levelRanks.Quick <= 0)
            {
                return;
            }

            LevelRankCooldowns levelRankCooldowns = AccountUtil.GetCooldowns(client);

            levelRankCooldowns.UpdateCooldownTime(client, VariableName, SkillCooldowns.Quick);

            if (!levelRankCooldowns.IsQuickReady)
            {
                client.SetData(VariableName + Notification, false);
                return;
            }

            if (client.GetData(VariableName + Notification))
            {
                return;
            }

            client.SetData(VariableName + Notification, true);
            client.SendNotification("~g~Quick ~w~You have increased dodge chance for your next hit.");
        }
示例#22
0
        private void CheckPassive(object source, Client client)
        {
            if (!client.HasData(VariableName + Notification))
            {
                client.SetData(VariableName + Notification, false);
            }

            if (!(client.GetData(EntityData.Account) is Account account))
            {
                return;
            }

            LevelRanks levelRanks = account.GetLevelRanks();

            if (levelRanks.Attention <= 0)
            {
                return;
            }

            LevelRankCooldowns levelRankCooldowns = AccountUtil.GetCooldowns(client);

            levelRankCooldowns.UpdateCooldownTime(client, VariableName, SkillCooldowns.Attention);

            if (!levelRankCooldowns.IsAttentionReady)
            {
                client.SetData(VariableName + Notification, false);
                return;
            }

            if (client.GetData(VariableName + Notification))
            {
                return;
            }

            client.SetData(VariableName + Notification, true);
            client.SendChatMessage("~o~Attention ~w~You are able to draw the attention of everyone around you.");
        }
示例#23
0
        private void CheckPassive(object source, Client client)
        {
            if (!client.HasData(VariableName + Notification))
            {
                client.SetData(VariableName + Notification, false);
            }

            if (!(client.GetData(EntityData.Account) is Account account))
            {
                return;
            }

            LevelRanks levelRanks = account.GetLevelRanks();

            if (levelRanks.Brains <= 0)
            {
                return;
            }

            LevelRankCooldowns levelRankCooldowns = AccountUtil.GetCooldowns(client);

            levelRankCooldowns.UpdateCooldownTime(client, VariableName, SkillCooldowns.Brains);

            if (!levelRankCooldowns.IsBrainsReady)
            {
                client.SetData(VariableName + Notification, false);
                return;
            }

            if (client.GetData(VariableName + Notification))
            {
                return;
            }

            client.SetData(VariableName + Notification, true);
            client.SendChatMessage("~o~Brains ~w~Your next complete objective grants additional currency.");
        }
示例#24
0
        private void CheckPassive(object source, Client client)
        {
            if (!client.HasData(VariableName + Notification))
            {
                client.SetData(VariableName + Notification, false);
            }

            if (!(client.GetData(EntityData.Account) is Account account))
            {
                return;
            }

            LevelRanks levelRanks = account.GetLevelRanks();

            if (levelRanks.Leadership <= 0)
            {
                return;
            }

            LevelRankCooldowns levelRankCooldowns = AccountUtil.GetCooldowns(client);

            levelRankCooldowns.UpdateCooldownTime(client, VariableName, SkillCooldowns.Leadership);

            if (!levelRankCooldowns.IsLeadershipReady)
            {
                client.SetData(VariableName + Notification, false);
                return;
            }

            if (client.GetData(VariableName + Notification))
            {
                return;
            }

            client.SetData(VariableName + Notification, true);
            client.SendChatMessage("~o~Leadership ~w~You can increase your teammates ability scores again.");
        }
示例#25
0
        private void CheckPassive(object source, Client client)
        {
            if (!client.HasData(VariableName + Notification))
            {
                client.SetData(VariableName + Notification, false);
            }

            if (!(client.GetData(EntityData.Account) is Account account))
            {
                return;
            }

            LevelRanks levelRanks = account.GetLevelRanks();

            if (levelRanks.Drag <= 0)
            {
                return;
            }

            LevelRankCooldowns levelRankCooldowns = AccountUtil.GetCooldowns(client);

            levelRankCooldowns.UpdateCooldownTime(client, VariableName, SkillCooldowns.Drag);

            if (!levelRankCooldowns.IsDragReady)
            {
                client.SetData(VariableName + Notification, false);
                return;
            }

            if (client.GetData(VariableName + Notification))
            {
                return;
            }

            client.SetData(VariableName + Notification, true);
            client.SendNotification("~r~Drag ~w~You're able to drag someone again.");
        }
示例#26
0
        private void CheckPassive(object source, Client client)
        {
            if (!client.HasData(VariableName + Notification))
            {
                client.SetData(VariableName + Notification, false);
            }

            if (!(client.GetData(EntityData.Account) is Account account))
            {
                return;
            }

            LevelRanks levelRanks = account.GetLevelRanks();

            if (levelRanks.VehicleSense <= 0)
            {
                return;
            }

            LevelRankCooldowns levelRankCooldowns = AccountUtil.GetCooldowns(client);

            levelRankCooldowns.UpdateCooldownTime(client, VariableName, SkillCooldowns.VehicleSense);

            if (!levelRankCooldowns.IsVehicleSenseReady)
            {
                client.SetData(VariableName + Notification, false);
                return;
            }

            if (client.GetData(VariableName + Notification))
            {
                return;
            }

            client.SetData(VariableName + Notification, true);
            client.SendChatMessage("~b~VehicleSense ~w~You're able to see your owned vehicles and moving vehicles again.");
        }
示例#27
0
        private void CheckPassive(object source, Client client)
        {
            if (!client.HasData(VariableName + Notification))
            {
                client.SetData(VariableName + Notification, false);
            }

            if (!(client.GetData(EntityData.Account) is Account account))
            {
                return;
            }

            LevelRanks levelRanks = account.GetLevelRanks();

            if (levelRanks.CrowdControl <= 0)
            {
                return;
            }

            LevelRankCooldowns levelRankCooldowns = AccountUtil.GetCooldowns(client);

            levelRankCooldowns.UpdateCooldownTime(client, VariableName, SkillCooldowns.CrowdControl);

            if (!levelRankCooldowns.IsCrowdControlReady)
            {
                client.SetData(VariableName + Notification, false);
                return;
            }

            if (client.GetData(VariableName + Notification))
            {
                return;
            }

            client.SetData(VariableName + Notification, true);
            client.SendChatMessage("~b~CrowdControl ~w~You are able to disable a person or vehicle temporarily again.");
        }
示例#28
0
        private void CheckPassive(object source, Client client)
        {
            if (!client.HasData(VariableName + Notification))
            {
                client.SetData(VariableName + Notification, false);
            }

            if (!(client.GetData(EntityData.Account) is Account account))
            {
                return;
            }

            LevelRanks levelRanks = account.GetLevelRanks();

            if (levelRanks.Smash <= 0)
            {
                return;
            }

            LevelRankCooldowns levelRankCooldowns = AccountUtil.GetCooldowns(client);

            levelRankCooldowns.UpdateCooldownTime(client, VariableName, SkillCooldowns.Smash - (levelRanks.Smash * 7));

            if (!levelRankCooldowns.IsSmashReady)
            {
                client.SetData(VariableName + Notification, false);
                return;
            }

            if (client.GetData(VariableName + Notification))
            {
                return;
            }

            client.SetData(VariableName + Notification, true);
            client.SendChatMessage("~r~Smash ~w~You're able to break a window again.");
        }
示例#29
0
        private void CheckPassive(object source, Client client)
        {
            if (!client.HasData(VariableName + Notification))
            {
                client.SetData(VariableName + Notification, false);
            }

            if (!(client.GetData(EntityData.Account) is Account account))
            {
                return;
            }

            LevelRanks levelRanks = account.GetLevelRanks();

            if (levelRanks.Lockpick <= 0)
            {
                return;
            }

            LevelRankCooldowns levelRankCooldowns = AccountUtil.GetCooldowns(client);

            levelRankCooldowns.UpdateCooldownTime(client, VariableName, SkillCooldowns.Lockpick - (levelRanks.Lockpick * 5));

            if (!levelRankCooldowns.IsLockpickReady)
            {
                client.SetData(VariableName + Notification, false);
                return;
            }

            if (client.GetData(VariableName + Notification))
            {
                return;
            }

            client.SetData(VariableName + Notification, true);
            client.SendChatMessage("~b~Lockpick ~w~Your next lockpick will have a higher chance to succeed.");
        }
示例#30
0
        private void CheckPassive(object source, Client client)
        {
            if (!client.HasData(VariableName + Notification))
            {
                client.SetData(VariableName + Notification, false);
            }

            if (!(client.GetData(EntityData.Account) is Account account))
            {
                return;
            }

            LevelRanks levelRanks = account.GetLevelRanks();

            if (levelRanks.Disguise <= 0)
            {
                return;
            }

            LevelRankCooldowns levelRankCooldowns = AccountUtil.GetCooldowns(client);

            levelRankCooldowns.UpdateCooldownTime(client, VariableName, SkillCooldowns.Disguise);

            if (!levelRankCooldowns.IsDisguiseReady)
            {
                client.SetData(VariableName + Notification, false);
                return;
            }

            if (client.GetData(VariableName + Notification))
            {
                return;
            }

            client.SetData(VariableName + Notification, true);
            client.SendChatMessage("~o~Disguise ~w~You can swap to a new outfit again.");
        }