Beispiel #1
0
        public static void PlayerDeath(PlayerDeathEventArgs args)
        {
            PlayerMobile pm = (PlayerMobile)args.Mobile;

            if (pm != null && pm.Backpack != null)
            {
                GemOfSalvation gem = pm.Backpack.FindItemByType <GemOfSalvation>();

                if (gem != null)
                {
                    Timer.DelayCall(TimeSpan.FromSeconds(2), () =>
                    {
                        if (DateTime.UtcNow < pm.NextGemOfSalvationUse)
                        {
                            TimeSpan left = pm.NextGemOfSalvationUse - DateTime.UtcNow;

                            if (left >= TimeSpan.FromMinutes(1.0))
                            {
                                pm.SendLocalizedMessage(1095131, ((left.Hours * 60) + left.Minutes).ToString()); // Your spirit lacks cohesion. You must wait ~1_minutes~ minutes before invoking the power of a Gem of Salvation.
                            }
                            else
                            {
                                pm.SendLocalizedMessage(1095130, left.Seconds.ToString()); // Your spirit lacks cohesion. You must wait ~1_seconds~ seconds before invoking the power of a Gem of Salvation.
                            }
                        }
                        else
                        {
                            pm.CloseGump(typeof(ResurrectGump));
                            pm.SendGump(new GemResurrectGump(pm, gem));
                        }
                    });
                }
            }
        }
Beispiel #2
0
 public GemResurrectGump(PlayerMobile pm, GemOfSalvation gem)
     : base(pm, ResurrectMessage.GemOfSalvation)
 {
     m_Gem    = gem;
     m_Mobile = pm;
 }
Beispiel #3
0
 public GemResurrectGump( PlayerMobile pm, GemOfSalvation gem )
     : base(pm, ResurrectMessage.GemOfSalvation)
 {
     m_Gem = gem;
     m_Mobile = pm;
 }
Beispiel #4
0
 public static void CheckCleanup(AfterWorldSaveEventArgs e)
 {
     DoCleanup();
     ManaDraught.DoCleanup();
     GemOfSalvation.DoCleanup();
 }