Esempio n. 1
0
 static void BuffIcons_Removed(BuffIcon buffID)
 {
     if (buffID == BuffIcon.GiftOfLife && timer != null)
     {
         timer.Stop();
         timer = null;
     }
 }
Esempio n. 2
0
 private static void BuffIcons_Added(BuffIcon buffID, BuffInfo buff)
 {
     if (buffID == BuffIcon.GiftOfLife && buff.Duration > 15)
     {
         if (timer != null)
             timer.Stop();
         timer = Timer.DelayedCallback(TimeSpan.FromSeconds(buff.Duration - 15), OnTimer);
         timer.Start();
     }
 }
Esempio n. 3
0
        private static void OnPartyMessage( PacketReader p, PacketHandlerEventArgs args )
        {
            switch ( p.ReadByte() )
            {
                case 0x01: // List
                {
                    m_Party.Clear();

                    int count = p.ReadByte();
                    for(int i=0;i<count;i++)
                    {
                        Serial s = p.ReadUInt32();
                        if ( World.Player == null || s != World.Player.Serial )
                            m_Party.Add( s );
                    }

                    break;
                }
                case 0x02: // Remove Member/Re-list
                {
                    m_Party.Clear();
                    int count = p.ReadByte();
                    Serial remSerial = p.ReadUInt32(); // the serial of who was removed

                    if ( World.Player != null )
                    {
                        Mobile rem = World.FindMobile( remSerial );
                        if ( rem != null && !Utility.InRange( World.Player.Position, rem.Position, World.Player.VisRange ) )
                            rem.Remove();
                    }

                    for(int i=0;i<count;i++)
                    {
                        Serial s = p.ReadUInt32();
                        if ( World.Player == null || s != World.Player.Serial )
                            m_Party.Add( s );
                    }

                    break;
                }
                case 0x03: // text message
                case 0x04: // 3 = private, 4 = public
                {
                    //Serial from = p.ReadUInt32();
                    //string text = p.ReadUnicodeStringSafe();
                    break;
                }
                case 0x07: // party invite
                {
                    //Serial leader = p.ReadUInt32();
                    PartyLeader = p.ReadUInt32();
                    if ( m_PartyDeclineTimer == null )
                        m_PartyDeclineTimer = Timer.DelayedCallback( TimeSpan.FromSeconds( 10.0 ), new TimerCallback( PartyAutoDecline ) );
                    m_PartyDeclineTimer.Start();
                    break;
                }
            }

            if (Engine.MainWindow.MapWindow != null)
                Engine.MainWindow.MapWindow.UpdateMap();
        }
Esempio n. 4
0
 private static void OnTimer()
 {
     timer = null;
     WorldEx.OverHeadMessage("Gift of Life ends in 15 seconds!!!");
 }
Esempio n. 5
0
 public void ResetCriminalTimer()
 {
     if ( m_CriminalStart == DateTime.MinValue || DateTime.Now - m_CriminalStart >= TimeSpan.FromSeconds( 1 ) )
     {
         m_CriminalStart = DateTime.Now;
         if ( m_CriminalTime == null )
             m_CriminalTime = new CriminalTimer( this );
         m_CriminalTime.Start();
         ClientCommunication.RequestTitlebarUpdate();
     }
 }
Esempio n. 6
0
        public void RemoveRequest()
        {
            if ( m_RemoveTimer == null )
                m_RemoveTimer = Timer.DelayedCallback( TimeSpan.FromSeconds( 0.25 ), new TimerCallback( Remove ) );
            else if ( m_RemoveTimer.Running )
                m_RemoveTimer.Stop();

            m_RemoveTimer.Start();
        }
Esempio n. 7
0
 static BandageTimer()
 {
     m_Timer = new InternalTimer();
 }