private int Verify( LockableContainer container )
		{
			if ( container == null || container.KeyValue == 0 )
				return 1005638; // You can only trap lockable chests.
			if ( From.Map != container.Map || !From.InRange( container.GetWorldLocation(), 2 ) )
				return 500446; // That is too far away.
			if ( !container.Movable )
				return 502944; // You cannot trap this item because it is locked down.
			if ( !container.IsAccessibleTo( From ) )
				return 502946; // That belongs to someone else.
			if ( container.Locked )
				return 502943; // You can only trap an unlocked object.
			if ( container.TrapType != TrapType.None )
				return 502945; // You can only place one trap on an object at a time.

			return 0;
		}
Esempio n. 2
0
        private int Verify( LockableContainer container )
        {
            if (container == null || container.KeyValue == 0)
            {
                From.SendAsciiMessage("You can only trap lockable chests.");
                return 1005638; // You can only trap lockable chests.
            }
            if (From.Map != container.Map || !From.InRange(container.GetWorldLocation(), 2))
            {
                int OldHue = From.SpeechHue;
                From.SpeechHue = 0;
                From.SayTo(From, true, "I can't reach that.");
                From.SpeechHue = OldHue;
                return 500446; // That is too far away.
            }
            if (!container.Movable)
            {
                return 502944; // You cannot trap this item because it is locked down.
            }
            if (!container.IsAccessibleTo(From))
            {
                From.SendAsciiMessage("That belongs to someone else.");
                return 502946; // That belongs to someone else.
            }
            if (container.Locked)
            {
                From.SendAsciiMessage("You can only trap an unlocked object.");
                return 502943; // You can only trap an unlocked object.
            }
            if (container.TrapType != TrapType.None)
            {
                From.SendAsciiMessage("You can only place one trap on an object at a time.");
                return 502945; // You can only place one trap on an object at a time.
            }

            return 0;
        }