Example #1
0
        public virtual void OnProgress(PlayerMobile pm, AchievementProfile profile)
        {
            int progress    = profile.GetProgress(this);
            int maxProgress = profile.GetMaxProgress(this);

            if (profile.ShowProgress || progress == 1 || (maxProgress > 50 && progress % 10 == 0))
            {
                SendProgressionMessage(pm, progress, maxProgress);
                SendTag(pm);
            }

            RefreshGumps(pm);
        }
Example #2
0
        private void BuildProgressBar(AchievementProfile profile, Achievement achievement)
        {
            AddImage(167, 61, 2053);

            int progress    = profile.GetProgress(achievement);
            int maxProgress = achievement.MaxProgress;

            if (progress > 0 && maxProgress > 1)
            {
                int length = Math.Max(5, (int)(109.0 * (double)((double)progress / (double)maxProgress)));

                if (length > 0)
                {
                    AddImageTiled(167, 61, Math.Min(109, length), 11, 2056);

                    AddLabel(283, 58, AchievementGump.GetColor(progress, maxProgress), String.Format("{0}%", (((double)progress / (double)maxProgress) * 100).ToString("0.0")));
                }
            }
        }
Example #3
0
        public virtual void OnAchieved(PlayerMobile pm, AchievementProfile profile)
        {
            Timer.DelayCall(Delay, () =>
            {
                SendAchievementMessage(pm);
                SendTag(pm);
                RefreshGumps(pm);

                if (Unlocks != null && Unlocks.Length > 0)
                {
                    for (int i = 0; i < Unlocks.Length; i++)
                    {
                        var achievement = AchievementSystem.GetAchievement(Unlocks[i]);

                        if (achievement != null)
                        {
                            pm.SendLocalizedMessage(1060658, String.Format("You have unlocked\t{0}", Name.ToString()), 2949);
                        }
                    }
                }
            });
        }