Пример #1
0
		private int Verify( BaseDoor door ) {

			if( door.RequiredSkill > (int)(From.Skills.Tinkering.Value) )
				return 1;

			if( door == null || door.HasLock == false )
				return 1;

			if( From.Map != door.Map || !From.InRange( door.GetWorldLocation(), 1 ) )
				return 1;

			if( !door.IsAccessibleTo( From ) )
				return 1;

			if( door.Locked )
				return 1;

			if( door.Open == false )
				return 1;

			return 0;
		}
Пример #2
0
		private int Verify( BaseDoor door ) {

            if (door is BaseHouseDoor)
            {
                BaseHouse house = ((BaseHouseDoor)door).FindHouse();

                if (house != null)
                {
                    if (!house.IsFriend(From))
                        return 1;
                }
            }

			if(door == null || door.HasLock)
				return 1;

			if(From.Map != door.Map || !From.InRange( door.GetWorldLocation(), 1 ))
				return 1;

			if(!door.IsAccessibleTo( From ))
				return 1;

			if(door.Locked)
				return 1;

			if(!door.Open)
				return 1;

            if (door.IsPublic)
                return 1;

			return 0;
		}
Пример #3
0
		private string Message( BaseDoor door ) {

			if( door.RequiredSkill > (int)(From.Skills.Tinkering.Value) )
				return "You have no idea how to work this lock.";

			if( door == null || door.HasLock == false )
				return "This door doesn't have a lock.";

			if( From.Map != door.Map || !From.InRange( door.GetWorldLocation(), 1 ) )
				return "That is too far away.";

			if( !door.IsAccessibleTo( From ) )
				return "That is inaccessable.";

			if( door.Locked )
				return "You must target an unlocked door.";

			if( door.Open == false )
				return "You must target an open door.";

			return null;
		}
Пример #4
0
		private string Message( BaseDoor door ) {

            if (door is BaseHouseDoor)
            {
                BaseHouse house = ((BaseHouseDoor)door).FindHouse();

                if (house != null)
                {
                    if (!house.IsFriend(From))
                        return "You do not have permission to modify this lock.";
                }
            }

			if( door == null || door.HasLock )
				return "This door already has a lock.";

			if( From.Map != door.Map || !From.InRange( door.GetWorldLocation(), 1 ) )
				return "That is too far away.";

			if( !door.IsAccessibleTo( From ) )
				return "That is inaccessable.";

			if( door.Locked )
				return "You must target an unlocked door.";

			if( !door.Open)
				return "You must target an open door.";

            if (door.IsPublic)
                return "You may not install locks on public buildings.";

			return null;
		}