public bool ProgressAchievement(GameClient Session, string AchievementGroup, int ProgressAmount, bool FromZero = false)
        {
            if (!_achievements.ContainsKey(AchievementGroup) || Session == null)
            {
                return(false);
            }

            Achievement AchievementData = null;

            AchievementData = _achievements[AchievementGroup];
            UserAchievement UserData = Session.GetHabbo().GetAchievementData(AchievementGroup);

            if (UserData == null)
            {
                UserData = new UserAchievement(AchievementGroup, 0, 0);
                Session.GetHabbo().Achievements.TryAdd(AchievementGroup, UserData);
            }

            int TotalLevels = AchievementData.Levels.Count;

            if (UserData != null && UserData.Level == TotalLevels)
            {
                return(false); // done, no more.
            }
            int TargetLevel = (UserData != null ? UserData.Level + 1 : 1);

            if (TargetLevel > TotalLevels)
            {
                TargetLevel = TotalLevels;
            }

            AchievementLevel TargetLevelData = AchievementData.Levels[TargetLevel];
            int NewProgress = 0;

            if (FromZero)
            {
                NewProgress = ProgressAmount;
            }
            else
            {
                NewProgress = (UserData != null ? UserData.Progress + ProgressAmount : ProgressAmount);
            }
            int NewLevel  = (UserData != null ? UserData.Level : 0);
            int NewTarget = NewLevel + 1;

            if (NewTarget > TotalLevels)
            {
                NewTarget = TotalLevels;
            }

            if (NewProgress >= TargetLevelData.Requirement)
            {
                NewLevel++;
                NewTarget++;
                NewProgress = 0;

                if (TargetLevel == 1)
                {
                    Session.GetHabbo().GetBadgeComponent().GiveBadge(string.Format("{0}{1}", AchievementGroup, TargetLevel), true, Session);
                }
                else
                {
                    Session.GetHabbo().GetBadgeComponent().RemoveBadge(Convert.ToString(string.Format("{0}{1}", AchievementGroup, TargetLevel - 1)));
                }
                Session.GetHabbo().GetBadgeComponent().GiveBadge(string.Format("{0}{1}", AchievementGroup, TargetLevel), true, Session);

                if (NewTarget > TotalLevels)
                {
                    NewTarget = TotalLevels;
                }

                Session.SendMessage(new AchievementUnlockedComposer(AchievementData, TargetLevel, TargetLevelData.RewardPoints, TargetLevelData.RewardPixels));
                Session.GetHabbo().GetMessenger().BroadcastAchievement(Session.GetHabbo().Id, Users.Messenger.MessengerEventTypes.ACHIEVEMENT_UNLOCKED, AchievementGroup + TargetLevel);

                using (IQueryAdapter dbClient = BiosEmuThiago.GetDatabaseManager().GetQueryReactor())
                {
                    dbClient.SetQuery(string.Concat("REPLACE INTO `user_achievements` VALUES ('" + Session.GetHabbo().Id + "', @group, '" + NewLevel + "', '" + NewProgress + "')"));
                    dbClient.AddParameter("group", AchievementGroup);
                    dbClient.RunQuery();
                }

                UserData.Level    = NewLevel;
                UserData.Progress = NewProgress;

                Session.GetHabbo().Duckets += TargetLevelData.RewardPixels;
                Session.GetHabbo().GetStats().AchievementPoints += TargetLevelData.RewardPoints;
                Session.SendMessage(new HabboActivityPointNotificationComposer(Session.GetHabbo().Duckets, TargetLevelData.RewardPixels));
                Session.SendMessage(new AchievementScoreComposer(Session.GetHabbo().GetStats().AchievementPoints));

                AchievementLevel NewLevelData = AchievementData.Levels[NewTarget];
                Session.SendMessage(new AchievementProgressedComposer(AchievementData, NewTarget, NewLevelData, TotalLevels, Session.GetHabbo().GetAchievementData(AchievementGroup)));

                // Set Talent
                Talent talent = null;
                if (BiosEmuThiago.GetGame().GetTalentManager().TryGetTalent(AchievementGroup, out talent))
                {
                    BiosEmuThiago.GetGame().GetTalentManager().CompleteUserTalent(Session, talent);
                }
                return(true);
            }
            else
            {
                UserData.Level    = NewLevel;
                UserData.Progress = NewProgress;
                using (IQueryAdapter dbClient = BiosEmuThiago.GetDatabaseManager().GetQueryReactor())
                {
                    dbClient.SetQuery("REPLACE INTO `user_achievements` VALUES ('" + Session.GetHabbo().Id + "', @group, '" + NewLevel + "', '" + NewProgress + "')");
                    dbClient.AddParameter("group", AchievementGroup);
                    dbClient.RunQuery();
                }

                Session.SendMessage(new AchievementProgressedComposer(AchievementData, TargetLevel, TargetLevelData, TotalLevels, Session.GetHabbo().GetAchievementData(AchievementGroup)));
            }
            return(false);
        }
        /// <summary>
        ///     Completes the user talent.
        /// </summary>
        /// <param name="session">The session.</param>
        /// <param name="talent">The talent.</param>
        public void CompleteUserTalent(GameClient session, Talent talent)
        {
            if (session == null || session.GetHabbo() == null || session.GetHabbo().CurrentTalentLevel < talent.Level ||
                session.GetHabbo().Talents.ContainsKey(talent.Id))
            {
                return;
            }

            if (!LevelIsCompleted(session, talent.Type, talent.Level))
            {
                return;
            }

            if (!string.IsNullOrEmpty(talent.Prize) && talent.PrizeBaseItem > 0)
            {
                ItemData item = null;
                if (!BiosEmuThiago.GetGame().GetItemManager().GetItem(talent.PrizeBaseItem, out item))
                {
                    return;
                }

                Item GiveItem = ItemFactory.CreateSingleItemNullable(item, session.GetHabbo(), string.Empty, string.Empty);
                if (GiveItem != null)
                {
                    session.GetHabbo().GetInventoryComponent().TryAddItem(GiveItem);
                    session.SendMessage(new FurniListNotificationComposer(GiveItem.Id, 1));

                    session.SendMessage(new PurchaseOKComposer());
                    session.SendMessage(new FurniListAddComposer(GiveItem));
                    session.SendMessage(new FurniListUpdateComposer());
                }
            }

            session.GetHabbo().Talents.Add(talent.Id, new UserTalent(talent.Id, 1));

            using (IQueryAdapter queryReactor = BiosEmuThiago.GetDatabaseManager().GetQueryReactor())
            {
                queryReactor.runFastQuery(string.Concat("REPLACE INTO users_talents VALUES (", session.GetHabbo().Id, ", ", talent.Id, ", ", 1, ");"));
            }

            session.SendMessage(new TalentLevelUpComposer(talent));

            if (talent.Type == "citizenship")
            {
                switch (talent.Level)
                {
                case 3:
                    BiosEmuThiago.GetGame().GetAchievementManager().ProgressAchievement(session, "ACH_Citizenship", 1);
                    break;

                case 4:
                    // session.GetHabbo().GetSubscriptionManager().AddSubscription(7);

                    using (IQueryAdapter queryReactor = BiosEmuThiago.GetDatabaseManager().GetQueryReactor())
                    {
                        queryReactor.runFastQuery(string.Concat(new object[] { "UPDATE users SET talent_status = 'helper' WHERE id = ", session.GetHabbo().Id, ";" }));
                    }
                    break;
                }
            }
        }