示例#1
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)}");
        }
示例#2
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);
        }