예제 #1
0
 public void ActivatePassphraseTimer(Mobile m_From, string m_passphrase, bool incseconds)
 {
     if (incseconds)
     {
         m_TotalSeconds++;
         m_seconds++;
         if ((m_MaxSeconds - m_TotalSeconds) < 10 && m_seconds > 10 && m_From != null)
         {
             m_From.PlaySound(976);
         }
     }
     m_GumpTimer = new GumpTimer(m_Staff, m_From, m_RetryCount, m_MaxRetries, m_TotalSeconds, m_MaxSeconds, m_userphrase, m_Kick, m_Jail, m_MoveTo, m_MoveToMap, m_Website, m_passphrase, this, m_seconds, TimeSpan.FromSeconds(1));
     m_GumpTimer.Start();
 }
예제 #2
0
 public void ActivatePassphraseTimer(Mobile m_From, string m_passphrase, bool incseconds)
 {
     if (incseconds)
     {
         m_TotalSeconds++;
         m_seconds++;
         if ((m_MaxSeconds - m_TotalSeconds) < 10 && m_seconds > 10 && m_From != null)
             m_From.PlaySound(976);
     }
     m_GumpTimer = new GumpTimer(m_Staff, m_From, m_RetryCount, m_MaxRetries, m_TotalSeconds, m_MaxSeconds, m_userphrase, m_Kick, m_Jail, m_MoveTo, m_MoveToMap, m_Website, m_passphrase, this, m_seconds, TimeSpan.FromSeconds(1));
     m_GumpTimer.Start();
 }
예제 #3
0
        public PartyRadarGump(Mobile from, Mobile pm) : base(5, 5)
        {
            int gumpX = 0;             // Default X value
            int gumpY = 0;             // Default Y value

            int minY = 20;             // Minimum Radar Y value - needs to be verified
            int maxY = 250;            //Maximum Radar Y value - needs to be verified

            int minX = 20;             // Minimum Radar X value - needs to be verified
            int maxX = 250;            // Maximum Radar X value - needs to be verified

            //Base Gump Objects
            AddPage(0);
            AddImage(0, 0, 5011);
            AddImage(134, 134, 1209);

            //Positioning of Icon gumps on radar
            Party p = Engines.PartySystem.Party.Get(from);

            foreach (PartyMemberInfo mi in p.Members)
            {
                PlayerMobile pl = mi.Mobile as PlayerMobile;

                if (pl != from)
                {
                    gumpX = 0;
                    gumpY = 0;

                    Point3D myLoc    = new Point3D(from.X, from.Y, from.Z);
                    Point3D theirLoc = new Point3D(pl.X, pl.Y, pl.Z);

                    double distanceX = Math.Sqrt(Math.Pow(theirLoc.X - myLoc.X, 2));                      // calculate distance from player to party member on X axis
                    double distanceY = Math.Sqrt(Math.Pow(theirLoc.Y - myLoc.Y, 2));                      // calculate distance from player to party member on Y axis

                    if (pl.X < from.X)
                    {
                        gumpX = (134 - (Convert.ToInt32(distanceY)));                         // converts (center of gump - distance between players to integer = X Axis =
                    }
                    else
                    {
                        gumpX = (134 + Convert.ToInt32(distanceY));                         // converts (center of gump - distance between players to integer = X Axis =
                    }

                    if (pl.Y < from.Y)
                    {
                        gumpY = (134 - (Convert.ToInt32(distanceX)));                         // converts (center of gump - distance between players to integer = Y Axis =
                    }
                    else
                    {
                        gumpY = (134 + Convert.ToInt32(distanceX));                         // converts (center of gump - distance between players to integer = Y Axis =
                    }

                    if (pl == p.Leader)
                    {
                        if (gumpX < minX)
                        {
                            gumpX = minX;
                        }
                        if (gumpX > maxX)
                        {
                            gumpX = maxX;
                        }
                        if (gumpY < minY)
                        {
                            gumpY = minY;
                        }
                        if (gumpY > maxY)
                        {
                            gumpY = maxY;
                        }

                        AddImage(gumpX, gumpY, 2361, 0x489);                           // Add a blue 'dot' for party leader
                        AddLabel((gumpX - 12), (gumpY - 17), 0x489, pl.Name);          // Add party leader's name above dot
                    }
                    else
                    {
                        if (gumpX < minX)
                        {
                            gumpX = minX;
                        }
                        if (gumpX > maxX)
                        {
                            gumpX = maxX;
                        }
                        if (gumpY < minY)
                        {
                            gumpY = minY;
                        }
                        if (gumpY > maxY)
                        {
                            gumpY = maxY;
                        }

                        AddImage(gumpX, gumpY, 2361, 0x559);                           // Add a green 'dot' for party member
                        AddLabel((gumpX - 12), (gumpY - 17), 0x559, pl.Name);          // Add party member's name above dot
                    }

                    if (pm.InRange(from, 30))                          // display indication arrow until player is within 30 tiles
                    {
                        if (from.QuestArrow != null)                   // stop arrow tracking for members within range
                        {
                            from.QuestArrow.Stop();
                        }
                    }
                    else
                    {
                        if (pm.InRange(from, 200) && pm.Map == from.Map)
                        {
                            from.QuestArrow = new TrackArrow(from, pm, 200);        // uses arrow from Tracking to indicate direction of member outside of radar
                        }
                        else if (from.QuestArrow != null)                           // stop arrow tracking if too far out of range or different map
                        {
                            from.QuestArrow.Stop();
                        }
                    }
                }
            }

            GumpTimer gumpTimer = new GumpTimer(from, pm);

            gumpTimer.Start();
        }
예제 #4
0
		public PartyRadarGump( Mobile from, Mobile pm ) : base( 5, 5 )
		{
			int gumpX = 0; // Default X value
			int gumpY = 0; // Default Y value

			int minY = 20; // Minimum Radar Y value - needs to be verified
			int maxY = 250; //Maximum Radar Y value - needs to be verified

			int minX = 20; // Minimum Radar X value - needs to be verified
			int maxX = 250; // Maximum Radar X value - needs to be verified

			//Base Gump Objects
			AddPage( 0 );
			AddImage( 0, 0, 5011 );
			AddImage( 134, 134, 1209 );

			//Positioning of Icon gumps on radar
			Party p = Engines.PartySystem.Party.Get( from );

			foreach ( PartyMemberInfo mi in p.Members )
			{
				PlayerMobile pl = mi.Mobile as PlayerMobile;

				if ( pl != from )
				{
					gumpX = 0;
					gumpY = 0;

					Point3D myLoc = new Point3D( from.X, from.Y, from.Z);
					Point3D theirLoc = new Point3D( pl.X, pl.Y, pl.Z);

					double distanceX = Math.Sqrt(Math.Pow(theirLoc.X - myLoc.X, 2) ); // calculate distance from player to party member on X axis
					double distanceY = Math.Sqrt(Math.Pow(theirLoc.Y - myLoc.Y, 2) ); // calculate distance from player to party member on Y axis

					if ( pl.X < from.X )
					{
						gumpX = (134 - (Convert.ToInt32(distanceY))); // converts (center of gump - distance between players to integer = X Axis =
					}
					else
					{
						gumpX = (134 + Convert.ToInt32(distanceY)); // converts (center of gump - distance between players to integer = X Axis =
					}

					if (pl.Y < from.Y )
					{
						gumpY = (134 - (Convert.ToInt32(distanceX))); // converts (center of gump - distance between players to integer = Y Axis =
					}
					else
					{
						gumpY = (134 + Convert.ToInt32(distanceX)); // converts (center of gump - distance between players to integer = Y Axis =
					}

					if ( pl == p.Leader)
					{
						if ( gumpX < minX )
						{
							gumpX = minX;
						}
						if ( gumpX > maxX )
						{
							gumpX = maxX;
						}
						if ( gumpY < minY )
						{
							gumpY = minY;
						}
						if ( gumpY > maxY )
						{
							gumpY = maxY;
						}

						AddImage( gumpX, gumpY, 2361, 0x489 ); // Add a blue 'dot' for party leader
						AddLabel( (gumpX - 12), (gumpY -17), 0x489, pl.Name ); // Add party leader's name above dot
					}
					else
					{
						if ( gumpX < minX )
						{
							gumpX = minX;
						}
						if ( gumpX > maxX )
						{
							gumpX = maxX;
						}
						if ( gumpY < minY )
						{
							gumpY = minY;
						}
						if ( gumpY > maxY )
						{
							gumpY = maxY;
						}

						AddImage( gumpX, gumpY, 2361, 0x559 ); // Add a green 'dot' for party member
						AddLabel( (gumpX - 12), (gumpY - 17), 0x559, pl.Name ); // Add party member's name above dot
					}

					if ( pm.InRange ( from, 30 ) ) // display indication arrow until player is within 30 tiles
					{
						if ( from.QuestArrow != null ) // stop arrow tracking for members within range
						{
							from.QuestArrow.Stop();
						}
					}
					else
					{
						if ( pm.InRange( from, 200 ) && pm.Map == from.Map)
						{
							from.QuestArrow = new TrackArrow( from, pm, 200 ); // uses arrow from Tracking to indicate direction of member outside of radar
						}
						else if ( from.QuestArrow != null ) // stop arrow tracking if too far out of range or different map
						{
							from.QuestArrow.Stop();
						}
					}
				}
			}

			GumpTimer gumpTimer = new GumpTimer( from, pm );
			gumpTimer.Start();
		}
예제 #5
0
		public void Add( Mobile m )
		{
			PartyMemberInfo mi = this[m];

			if ( mi == null )
			{
				m_Members.Add( new PartyMemberInfo( m ) );
				m.Party = this;

				Packet memberList = new PartyMemberList( this );
				Packet attrs  = new MobileAttributesN( m );

				for ( int i = 0; i < m_Members.Count; ++i )
				{
					Mobile f = ((PartyMemberInfo)m_Members[i]).Mobile;

					f.Send( memberList );

					if (! f.HasGump( typeof( PartyRadarGump)))
					{
						PartyRadarGump pr = new PartyRadarGump( f, m );
						f.SendGump( pr ); // Custom Radar Gump

						GumpTimer gumpTimer = new GumpTimer( f, m );
						gumpTimer.Start();

						GumpTimer gumpTimerT = new GumpTimer( m, f );
						gumpTimerT.Start();
					}

					if ( f != m )
					{
						f.Send( new MobileStatusCompact( m.CanBeRenamedBy( f ), m ) );
						f.Send( attrs );
						m.Send( new MobileStatusCompact( f.CanBeRenamedBy( m ), f ) );
						m.Send( new MobileAttributesN( f ) );
					}
				}
			}
		}