Server.Items.TreasureMap.OnBeginDig C# (CSharp) Method

OnBeginDig() public method

public OnBeginDig ( Server.Mobile from ) : void
from Server.Mobile
return void
		public void OnBeginDig( Mobile from )
		{
			if ( m_Completed )
			{
				from.SendLocalizedMessage( 503028 ); // The treasure for this map has already been found.
			}
			else if ( from != m_Decoder )
			{
				from.SendLocalizedMessage( 503016 ); // Only the person who decoded this map may actually dig up the treasure.
			}
			else if ( m_Decoder != from && !HasRequiredSkill( from ) )
			{
				from.SendLocalizedMessage( 503031 ); // You did not decode this map and have no clue where to look for the treasure.
			}
			else if ( !from.CanBeginAction( typeof( TreasureMap ) ) )
			{
				from.SendLocalizedMessage( 503020 ); // You are already digging treasure.
			}
			else if ( from.Map != this.m_Map )
			{
				from.SendLocalizedMessage( 1010479 ); // You seem to be in the right place, but may be on the wrong facet!
			}
			else
			{
				from.SendLocalizedMessage( 503033 ); // Where do you wish to dig?
				from.Target = new DigTarget( this );
			}
		}

Usage Example

Esempio n. 1
0
            public override void OnClick()
            {
                if (m_Map.Deleted)
                {
                    return;
                }

                Mobile from = Owner.From;

                if (HasDiggingTool(from))
                {
                    m_Map.OnBeginDig(from);
                }
                else
                {
                    from.SendMessage("You must have a digging tool to dig for treasure.");
                }
            }