コード例 #1
0
 /// <summary>
 /// Adds a new achievement to the list, when achievement is earned.
 /// </summary>
 /// <param name="achievementEntry"></param>
 public void EarnAchievement(AchievementEntry achievement)
 {
     this.AddAchievement(AchievementRecord.CreateNewAchievementRecord(this.m_owner, achievement.ID));
     this.CheckPossibleAchievementUpdates(AchievementCriteriaType.CompleteAchievement, achievement.ID, 1U,
                                          (Unit)null);
     this.RemoveAchievementProgress(achievement);
     foreach (AchievementReward reward in achievement.Rewards)
     {
         reward.GiveReward(this.Owner);
     }
     if (this.m_owner.IsInGuild)
     {
         this.m_owner.Guild.Broadcast(
             AchievementHandler.CreateAchievementEarnedToGuild(achievement.ID, this.m_owner));
     }
     if (achievement.IsRealmFirstType())
     {
         AchievementHandler.SendServerFirstAchievement(achievement.ID, this.m_owner);
     }
     AchievementHandler.SendAchievementEarned(achievement.ID, this.m_owner);
 }
コード例 #2
0
        /// <summary>
        /// Adds a new achievement to the list, when achievement is earned.
        /// </summary>
        /// <param name="achievementEntry"></param>
        public void EarnAchievement(AchievementEntry achievement)
        {
            AddAchievement(AchievementRecord.CreateNewAchievementRecord(m_owner, achievement.ID));
            CheckPossibleAchievementUpdates(AchievementCriteriaType.CompleteAchievement, (uint)achievement.ID, 1);
            RemoveAchievementProgress(achievement);

            foreach (var achievementReward in achievement.Rewards)
            {
                achievementReward.GiveReward(Owner);
            }

            if (m_owner.IsInGuild)
            {
                m_owner.Guild.Broadcast(AchievementHandler.CreateAchievementEarnedToGuild(achievement.ID, m_owner));
            }

            if (achievement.IsRealmFirstType())
            {
                AchievementHandler.SendServerFirstAchievement(achievement.ID, m_owner);
            }

            AchievementHandler.SendAchievementEarned(achievement.ID, m_owner);
        }