RemoveTimer() public static method

public static RemoveTimer ( Server.Mobile m ) : bool
m Server.Mobile
return bool
Esempio n. 1
0
            protected override void OnTick()
            {
                m_Player.NameMod = null;

                if (m_Player is PlayerMobile)
                {
                    ((PlayerMobile)m_Player).SetHairMods(-1, -1);
                }
                DisguiseTimers.RemoveTimer(m_Player);
            }
Esempio n. 2
0
        public static void RemoveDisguise(Mobile from)
        {
            from.HueMod  = -1;
            from.NameMod = null;
            ((PlayerMobile)from).SavagePaintExpiration = TimeSpan.Zero;

            ((PlayerMobile)from).SetHairMods(-1, -1);

            PolymorphSpell.StopTimer(from);
            IncognitoSpell.StopTimer(from);
            DisguiseTimers.RemoveTimer(from);

            from.EndAction(typeof(PolymorphSpell));
            from.EndAction(typeof(IncognitoSpell));
        }
Esempio n. 3
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            if (info.ButtonID == 0)
            {
                // Disguises wear off after 2 hours. : You're looking good.
                m_From.SendLocalizedMessage(m_Used ? 501706 : 501707);
                return;
            }

            var switches = info.Switches;

            if (switches.Length == 0)
            {
                return;
            }

            var switched = switches[0];
            var type     = switched % 2;
            var index    = switched / 2;

            var hair = (type == 0);

            var entries = (hair ? m_HairEntries : m_BeardEntries);

            if (index >= 0 && index < entries.Length)
            {
                var entry = entries[index];

                if (entry == null)
                {
                    return;
                }

                if (!m_Kit.ValidateUse(m_From))
                {
                    return;
                }

                if (!hair && (m_From.Female || m_From.Body.IsFemale))
                {
                    return;
                }

                m_From.NameMod = NameList.RandomName(m_From.Female ? "female" : "male");

                if (m_From is PlayerMobile)
                {
                    var pm = (PlayerMobile)m_From;

                    if (hair)
                    {
                        pm.SetHairMods(entry.m_ItemID, -2);
                    }
                    else
                    {
                        pm.SetHairMods(-2, entry.m_ItemID);
                    }
                }

                m_From.SendGump(new DisguiseGump(m_From, m_Kit, hair, true));

                DisguiseTimers.RemoveTimer(m_From);

                DisguiseTimers.CreateTimer(m_From, TimeSpan.FromHours(2.0));
                DisguiseTimers.StartTimer(m_From);

                BuffInfo.AddBuff(m_From, new BuffInfo(BuffIcon.Disguised, 1075821, 1075820, TimeSpan.FromHours(2.0), m_From));
            }
        }
Esempio n. 4
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            if (info.ButtonID == 0)
            {
                if (m_Used)
                {
                    m_From.SendLocalizedMessage(501706);                       // Disguises wear off after 2 hours.
                }
                else
                {
                    m_From.SendLocalizedMessage(501707);                       // You're looking good.
                }
                return;
            }

            int[] switches = info.Switches;

            if (switches.Length == 0)
            {
                return;
            }

            int switched = switches[0];
            int type     = switched % 2;
            int index    = switched / 2;

            bool hair = type == 0;

            DisguiseEntry[] entries = hair ? m_HairEntries : m_BeardEntries;

            if (index >= 0 && index < entries.Length)
            {
                DisguiseEntry entry = entries[index];

                if (entry == null)
                {
                    return;
                }

                if (!m_Kit.ValidateUse(m_From))
                {
                    return;
                }

                if (!hair && (m_From.Female || m_From.Body.IsFemale))
                {
                    return;
                }

                m_From.NameMod = NameList.RandomName(m_From.Female ? "female" : "male");

                if (m_From is PlayerMobile)
                {
                    PlayerMobile pm = (PlayerMobile)m_From;

                    if (hair)
                    {
                        pm.SetHairMods(entry.m_ItemID, -2);
                    }
                    else
                    {
                        pm.SetHairMods(-2, entry.m_ItemID);
                    }
                }

                m_From.SendGump(new DisguiseGump(m_From, m_Kit, hair, true));

                DisguiseTimers.RemoveTimer(m_From);

                DisguiseTimers.CreateTimer(m_From, TimeSpan.FromHours(2.0));
                DisguiseTimers.StartTimer(m_From);
            }
        }
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            if (info.ButtonID == 0)
            {
                if (m_Used)
                {
                    m_From.SendLocalizedMessage(501706);                       // Disguises wear off after 2 hours.
                }
                else
                {
                    m_From.SendLocalizedMessage(501707);                       // You're looking good.
                }
                return;
            }

            string name = info.GetTextEntry(0).Text.Trim();

            name = ValidateName(name);

            int[] switches = info.Switches;

            if (switches.Length == 0)
            {
                return;
            }

            int switched = switches[0];
            int type     = switched % 2;
            int index    = switched / 2;

            bool hair = (type == 0);

            DisguiseEntry[] entries = (hair ? m_HairEntries : m_BeardEntries);

            if (index >= 0 && index < entries.Length)
            {
                DisguiseEntry entry = entries[index];

                if (entry == null)
                {
                    return;
                }

                if (!m_Kit.ValidateUse(m_From))
                {
                    return;
                }

                if (!hair && (m_From.Female || m_From.Body.IsFemale))
                {
                    return;
                }

                m_From.NameMod = name;

                if (m_From is PlayerMobile)
                {
                    PlayerMobile pm = (PlayerMobile)m_From;

                    if (hair)
                    {
                        pm.SetHairMods(entry.m_ItemID, -2);
                    }
                    else
                    {
                        pm.SetHairMods(-2, entry.m_ItemID);
                    }
                }

                DisguiseTimers.RemoveTimer(m_From);

                DisguiseTimers.CreateTimer(m_From, TimeSpan.FromHours(2.0));
                DisguiseTimers.StartTimer(m_From);

                m_Kit.Delete();

                m_From.SendMessage("You put on the disguise and discard the container.");
            }
        }