public static void LoadRealmFirstAchievements() { foreach (AchievementRecord achievementRecord in AchievementRecord.Load(AchievementMgr.AchievementEntries .Values .Where <AchievementEntry >((Func <AchievementEntry, bool>)(achievementEntry => achievementEntry.IsRealmFirstType())) .Select <AchievementEntry, uint>( (Func <AchievementEntry, uint>)(achievementEntry => achievementEntry.ID)).ToArray <uint>())) { AchievementMgr.CompletedRealmFirstAchievements.Add(achievementRecord.AchievementEntryId); } }
public static void LoadRealmFirstAchievements() { var allRealmFirstRecords = (from achievementEntry in AchievementEntries.Values where achievementEntry.IsRealmFirstType() select achievementEntry.ID).ToArray(); var completedAchievements = AchievementRecord.Load(allRealmFirstRecords); foreach (var completedAchievement in completedAchievements) { CompletedRealmFirstAchievements.Add(completedAchievement.AchievementEntryId); } }
public void Load() { foreach (var mCompletedAchievement in AchievementRecord.Load((int)Owner.EntityId.Low)) { var achievement = AchievementMgr.GetAchievementEntry(mCompletedAchievement.AchievementEntryId); if (achievement != null) { if (m_completedAchievements.ContainsKey(achievement.ID)) { log.Warn("Character {0} had Achievement {1} more than once.", m_owner, achievement.ID); } else { AddAchievement(mCompletedAchievement); } } else { log.Warn("Character {0} has invalid Achievement: {1}", m_owner, mCompletedAchievement.AchievementEntryId); } } foreach (var achievementProgress in AchievementProgressRecord.Load((int)Owner.EntityId.Low)) { // how to check if there's no criteria //if (achievement != null) { if (m_progressRecords.ContainsKey(achievementProgress.AchievementCriteriaId)) { log.Warn("Character {0} had progress for Achievement Criteria {1} more than once.", m_owner, achievementProgress.AchievementCriteriaId); } else { AddProgressRecord(achievementProgress); } } //else //{ // log.Warn("Character {0} has invalid Achievement: {1}", m_owner, achivementProgress.AchievementCriteriaId); //} } }
public void Load() { foreach (AchievementRecord achievementRecord in AchievementRecord.Load((int)this.Owner.EntityId.Low)) { AchievementEntry achievementEntry = AchievementMgr.GetAchievementEntry(achievementRecord.AchievementEntryId); if (achievementEntry != null) { if (this.m_completedAchievements.ContainsKey(achievementEntry.ID)) { AchievementCollection.log.Warn("Character {0} had Achievement {1} more than once.", (object)this.m_owner, (object)achievementEntry.ID); } else { this.AddAchievement(achievementRecord); } } else { AchievementCollection.log.Warn("Character {0} has invalid Achievement: {1}", (object)this.m_owner, (object)achievementRecord.AchievementEntryId); } } foreach (AchievementProgressRecord achievementProgressRecord in AchievementProgressRecord.Load( (int)this.Owner.EntityId.Low)) { if (this.m_progressRecords.ContainsKey(achievementProgressRecord.AchievementCriteriaId)) { AchievementCollection.log.Warn( "Character {0} had progress for Achievement Criteria {1} more than once.", (object)this.m_owner, (object)achievementProgressRecord.AchievementCriteriaId); } else { this.AddProgressRecord(achievementProgressRecord); } } }