Server.Mobiles.EtherealMount.Validate C# (CSharp) Méthode

Validate() public méthode

public Validate ( Mobile from ) : bool
from Mobile
Résultat bool
		public virtual bool Validate( Mobile from )
		{
			if( Parent == null )
			{
				from.SayTo( from, 1010095 ); // This must be on your person to use.
				return false;
			}
			else if( !BaseMount.CheckMountAllowed( from ) )
			{
				// CheckMountAllowed sends the message
				return false;
			}
			else if( from.Mounted )
			{
				from.SendLocalizedMessage( 1005583 ); // Please dismount first.
				return false;
			}
			else if( from.IsBodyMod && !from.Body.IsHuman )
			{
				from.SendLocalizedMessage( 1061628 ); // You can't do that while polymorphed.
				return false;
			}
			else if( from.HasTrade )
			{
				from.SendLocalizedMessage( 1042317, "", 0x41 ); // You may not ride at this time
				return false;
			}
			else if( ( from.Followers + FollowerSlots ) > from.FollowersMax )
			{
				from.SendLocalizedMessage( 1049679 ); // You have too many followers to summon your mount.
				return false;
			}

			return true;
		}

Usage Example

Exemple #1
0
            public override void OnCast()
            {
                if (!m_Mount.Deleted && m_Mount.Rider == null && m_Mount.Validate(m_Rider))
                {
                    m_Mount.Rider = m_Rider;
                }

                FinishSequence();
            }
All Usage Examples Of Server.Mobiles.EtherealMount::Validate