Exemplo n.º 1
0
        public AchievementsComposer(Character Character, IEnumerable<AchievementCategory> Categorys)
        {
            base.WriteHeader(MessageComposerIds.AchievementsComposer);
            base.Write(System.HabboSystem.AchievementManager.GetAchievementAmount());

            foreach (AchievementCategory Category in Categorys)
            {
                foreach (Achievement Achievement in Category.Achievements.Values)
                {
                    int CurrentLevel = Character.GetAchievementProgress(Achievement.Id);

                    int NextLevel = (CurrentLevel + 1);

                    if (NextLevel > Achievement.Levels)
                    {
                        NextLevel = Achievement.Levels;
                    }

                    base.Write(Achievement.Id);
                    base.Write(NextLevel);
                    base.Write(Achievement.GetBadgeCode(NextLevel));
                    base.Write(Achievement.GetRequired(NextLevel));
                    base.Write(Achievement.GetPixelReward(NextLevel));
                    base.Write((int)AchievementRewardType.Pixels);
                    base.Write(Character.GetAchievementProgessLimit(Achievement.Id));
                    base.Write(CurrentLevel == Achievement.Levels);
                    base.Write(Category.Caption.ToLower());
                    base.Write(Achievement.Levels);
                }
            }
        }
Exemplo n.º 2
0
        public AchievementComposer(Character Character, Achievement Achievement)
        {
            base.WriteHeader(MessageComposerIds.AchievementComposer);

            int CurrentLevel = Character.GetAchievementProgress(Achievement.Id);

            int NextLevel = (CurrentLevel + 1);

            if (NextLevel > Achievement.Levels)
            {
                NextLevel = Achievement.Levels;
            }

            base.Write(Achievement.Id);
            base.Write(NextLevel);
            base.Write(Achievement.GetBadgeCode(NextLevel));
            base.Write(Achievement.GetRequired(NextLevel));
            base.Write(Achievement.GetPixelReward(NextLevel));
            base.Write((int)AchievementRewardType.Pixels);
            base.Write(Character.GetAchievementProgessLimit(Achievement.Id));
            base.Write(CurrentLevel == Achievement.Levels);
            base.Write(System.HabboSystem.AchievementManager.GetCategory(Achievement.CategoryId).Caption.ToLower());
            base.Write(Achievement.Levels);
        }