Example #1
0
        public static void CheckHeaveTimer(Mobile from)
        {
            if (from.BAC > 0 && from.Map != Map.Internal && !from.Deleted)
            {
                Timer t = (Timer)m_Table[from];

                if (t == null)
                {
                    if (from.BAC > 60)
                    {
                        from.BAC = 60;
                    }

                    t = new HeaveTimer(from);
                    t.Start();

                    m_Table[from] = t;
                }
            }
            else
            {
                Timer t = (Timer)m_Table[from];

                if (t != null)
                {
                    t.Stop();
                    m_Table.Remove(from);

                    from.SendLocalizedMessage(500850);   // You feel sober.
                }
            }
        }
		public static void CheckHeaveTimer( Mobile from )
		{
			if ( from.BAC > 0 && from.Map != Map.Internal && !from.Deleted )
			{
				Timer t = (Timer)m_Table[from];

				if ( t == null )
				{
					if ( from.BAC > 60 )
						from.BAC = 60;

					t = new HeaveTimer( from );
					t.Start();

					m_Table[from] = t;
				}
			}
			else
			{
				Timer t = (Timer)m_Table[from];

				if ( t != null )
				{
					t.Stop();
					m_Table.Remove( from );

					from.SendLocalizedMessage( 500850 ); // You feel sober.
				}
			}
		}
Example #3
0
		public static void CheckHeaveTimer(Mobile from)
		{
			if (from.BAC > 0 && from.Map != Map.Internal && !from.Deleted)
			{
				Timer t;
				m_Table.TryGetValue(from, out t);

				if (t == null)
				{
					if (from.BAC > 100)
					{
						from.BAC = 100;
					}

					t = new HeaveTimer(from);
					t.Start();

					m_Table[from] = t;
				}
			}
			else
			{
				Timer t;
				m_Table.TryGetValue(from, out t);

				if (t != null)
				{
					t.Stop();
					m_Table.Remove(from);

					from.SendLocalizedMessage(500850); // You feel sober.
				}
			}
		}