Exemple #1
0
		public static bool CoolingDown( Mobile mob, MagicalFood id )
		{	
			if ( m_Cooldown != null && m_Cooldown[ mob ] != null && ( (int) m_Cooldown[ mob ] & (int) id ) > 0 )
				return true;
				
			return false;
		}
Exemple #2
0
		public static bool IsUnderInfluence( Mobile mob, MagicalFood id )
		{	
			if ( m_Table != null && m_Table[ mob ] != null && ( (int) m_Table[ mob ] & (int) id ) > 0 )
				return true;
				
			return false;
		}
Exemple #3
0
		public static void StartInfluence( Mobile mob, MagicalFood id, TimeSpan duration, TimeSpan cooldown )
		{
			if ( m_Table == null )
				m_Table = new Hashtable();
			
			if ( m_Table[ mob ] == null )
				m_Table[ mob ] = 0;
				
			m_Table[ mob ] = (int) m_Table[ mob ] | (int) id; 
			
			Timer.DelayCall( duration, new TimerStateCallback( EndInfluence ), new object[] { mob, id, cooldown } );
		}
        public static void EndInfluence(Mobile mob, MagicalFood id, TimeSpan cooldown)
        {
            m_Table[mob] = (int)m_Table[mob] & ~(int)id;

            if (cooldown != TimeSpan.Zero)
            {
                if (m_Cooldown == null)
                {
                    m_Cooldown = new Hashtable();
                }

                if (m_Cooldown[mob] == null)
                {
                    m_Cooldown[mob] = 0;
                }

                m_Cooldown[mob] = (int)m_Cooldown[mob] | (int)id;

                Timer.DelayCall(cooldown, new TimerStateCallback(EndCooldown), new object[] { mob, id });
            }
        }
Exemple #5
0
 public static void EndCooldown(Mobile mob, MagicalFood id)
 {
     m_Cooldown[mob] = (int)m_Cooldown[mob] & ~((int)id);
 }
Exemple #6
0
		public static void EndInfluence( Mobile mob, MagicalFood id, TimeSpan cooldown )
		{							
			m_Table[ mob ] = (int) m_Table[ mob ] & ~((int) id);
			
			if ( cooldown != TimeSpan.Zero )
			{			
				if ( m_Cooldown == null )
					m_Cooldown = new Hashtable();					
				
				if ( m_Cooldown[ mob ] == null )
					m_Cooldown[ mob ] = 0;
					
				m_Cooldown[ mob ] = (int) m_Cooldown[ mob ] | (int) id;
				
				Timer.DelayCall( cooldown, new TimerStateCallback( EndCooldown ), new object[] { mob, id } );		
			}
		}
Exemple #7
0
		public static void EndCooldown( Mobile mob, MagicalFood id )
		{				
			m_Cooldown[ mob ] = (int) m_Cooldown[ mob ] & ~((int) id);
		}