Example #1
0
        public static void Resurrect(PlayerMobile m, AnkhOfSacrificeAddon ankh)
        {
            if (m == null)
            {
            }
            else if (!m.InRange(ankh.GetWorldLocation(), 2))
            {
                m.SendLocalizedMessage(500446); // That is too far away.
            }
            else if (m.Alive)
            {
                m.SendLocalizedMessage(1060197); // You are not dead, and thus cannot be resurrected!
            }
            else if (m.AnkhNextUse > DateTime.UtcNow)
            {
                TimeSpan delay = m.AnkhNextUse - DateTime.UtcNow;

                if (delay.TotalMinutes > 0)
                {
                    m.SendLocalizedMessage(1079265, Math.Round(delay.TotalMinutes).ToString()); // You must wait ~1_minutes~ minutes before you can use this item.
                }
                else
                {
                    m.SendLocalizedMessage(1079263, Math.Round(delay.TotalSeconds).ToString()); // You must wait ~1_seconds~ seconds before you can use this item.
                }
            }
            else
            {
                m.CloseGump(typeof(AnkhResurrectGump));
                m.SendGump(new AnkhResurrectGump(m, ResurrectMessage.VirtueShrine));
            }
        }
Example #2
0
            public override void OnClick()
            {
                if (!m_Mobile.InRange(m_Ankh.GetWorldLocation(), 2))
                {
                    m_Mobile.SendLocalizedMessage(500446); // That is too far away.
                }
                else
                {
                    m_Mobile.KarmaLocked = !m_Mobile.KarmaLocked;

                    if (m_Mobile.KarmaLocked)
                    {
                        m_Mobile.SendLocalizedMessage(1060192); // Your karma has been locked. Your karma can no longer be raised.
                    }
                    else
                    {
                        m_Mobile.SendLocalizedMessage(1060191); // Your karma has been unlocked. Your karma can be raised again.
                    }
                }
            }