コード例 #1
0
        public AchievementCategory(DataRow Row)
        {
            using (RowAdapter Adapter = new RowAdapter(Row))
            {
                Id = Adapter.PopInt32("id");
                Caption = Adapter.PopString("caption");
            }

            Achievements = new Dictionary<int, Achievement>();

            foreach (DataRow AchievementRow in System.MySQLManager.GetObject(new AchievementsQuery(Id)).GetOutput<DataTable>().Rows)
            {
                Achievement Achievement = new Achievement(AchievementRow);

                if (!Achievements.ContainsKey(Achievement.Id))
                {
                    Achievements.Add(Achievement.Id, Achievement);
                }
            }
        }
コード例 #2
0
ファイル: Achievements.cs プロジェクト: devMextur/Tazqon
        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);
        }
コード例 #3
0
ファイル: Achievements.cs プロジェクト: devMextur/Tazqon
 public HabboAchievementNotificationMessageComposer(int Level, Achievement Achievement)
 {
     base.WriteHeader(MessageComposerIds.HabboAchievementNotificationMessageComposer);
     base.Write(Achievement.Id);
     base.Write(Level);
     base.Write(Achievement.BadgeId + Level);
     base.Write(Achievement.GetBadgeCode(Level));
     base.Write(Achievement.GetScoreReward(Level));
     base.Write(Achievement.GetPixelReward(Level));
     base.Write(0); // TODO : Need to find out what this means.
     base.Write(0); // TODO : Extra Achievement Score.
     base.Write(Achievement.BadgeId + (Level - 1));
     base.Write(Achievement.GetBadgeCode(Level - 1 <= 0 ? 1 : Level - 1));
     base.Write(System.HabboSystem.AchievementManager.GetCategory(Achievement.CategoryId).Caption.ToLower());
 }