Server.Mobiles.BaseCreature.SetControlMaster C# (CSharp) Méthode

SetControlMaster() public méthode

public SetControlMaster ( Mobile m ) : bool
m Mobile
Résultat bool
        public bool SetControlMaster( Mobile m )
        {
            if ( m == null )
            {
                ControlMaster = null;
                Controlled = false;
                ControlTarget = null;
                ControlOrder = OrderType.None;
                Guild = null;

                Delta( MobileDelta.Noto );
            }
            else
            {
                ISpawner se = this.Spawner;
                if ( se != null && se.UnlinkOnTaming )
                {
                    this.Spawner.Remove( this );
                    this.Spawner = null;
                }

                if ( m.Followers + ControlSlots > m.FollowersMax )
                {
                    m.SendLocalizedMessage( 1049607 ); // You have too many followers to control that creature.
                    return false;
                }

                CurrentWayPoint = null;//so tamed animals don't try to go back

                ControlMaster = m;
                Controlled = true;
                ControlTarget = null;
                ControlOrder = OrderType.Come;
                Guild = null;

                if ( m_DeleteTimer != null )
                {
                    m_DeleteTimer.Stop();
                    m_DeleteTimer = null;
                }

                Delta( MobileDelta.Noto );
            }

            InvalidateProperties();

            return true;
        }

Usage Example

		/// <summary>
		/// Creates a new MobileStatuette object - for internal use only
		/// </summary>
		private MobileStatuette( BaseCreature creature )
		{
			m_Creature = creature;
			ItemID = ShrinkTable.Lookup( m_Creature );
			Hue = m_Creature.Hue;

			m_Creature.ControlTarget = null;
			m_Creature.ControlOrder = OrderType.Stay;
			m_Creature.Internalize();
			m_Creature.SetControlMaster( null );
			m_Creature.SummonMaster = null;
			m_Creature.IsStabled = true;

			// Set the type of the creature as the name for this item
			Name = InsertSpaces( creature.GetType().Name );
		}
All Usage Examples Of Server.Mobiles.BaseCreature::SetControlMaster
BaseCreature