当前位置: 首页>>代码示例>>C#>>正文


C# PlayerBarkeeper.MoveToWorld方法代码示例

本文整理汇总了C#中Server.Mobiles.PlayerBarkeeper.MoveToWorld方法的典型用法代码示例。如果您正苦于以下问题:C# PlayerBarkeeper.MoveToWorld方法的具体用法?C# PlayerBarkeeper.MoveToWorld怎么用?C# PlayerBarkeeper.MoveToWorld使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Server.Mobiles.PlayerBarkeeper的用法示例。


在下文中一共展示了PlayerBarkeeper.MoveToWorld方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnDoubleClick

        public override void OnDoubleClick( Mobile from )
        {
            if ( !IsChildOf( from.Backpack ) )
            {
                from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
            }
            else if ( from.AccessLevel >= AccessLevel.GameMaster )
            {
                from.SendLocalizedMessage( 503248 ); // Your godly powers allow you to place this vendor whereever you wish.

                Mobile v = new PlayerBarkeeper( from, BaseHouse.FindHouseAt( from ) );

                v.Direction = from.Direction & Direction.Mask;
                v.MoveToWorld( from.Location, from.Map );

                this.Delete();
            }
            else
            {
                BaseHouse house = BaseHouse.FindHouseAt( from );

                if ( house == null || !house.IsOwner( from ) )
                {
                    from.LocalOverheadMessage( MessageType.Regular, 0x3B2, false, "You are not the full owner of this house." );
                }
                else if ( !house.CanPlaceNewBarkeep() )
                {
                    from.SendLocalizedMessage( 1062490 ); // That action would exceed the maximum number of barkeeps for this house.
                }
                else
                {
                    bool vendor, contract;
                    BaseHouse.IsThereVendor( from.Location, from.Map, out vendor, out contract );

                    if ( vendor )
                    {
                        from.SendLocalizedMessage( 1062677 ); // You cannot place a vendor or barkeep at this location.
                    }
                    else if ( contract )
                    {
                        from.SendLocalizedMessage( 1062678 ); // You cannot place a vendor or barkeep on top of a rental contract!
                    }
                    else
                    {
                        Mobile v = new PlayerBarkeeper( from, house );

                        v.Direction = from.Direction & Direction.Mask;
                        v.MoveToWorld( from.Location, from.Map );

                        this.Delete();
                    }
                }
            }
        }
开发者ID:justdanofficial,项目名称:khaeros,代码行数:54,代码来源:BarkeepContract.cs

示例2: OnDoubleClick

		public override void OnDoubleClick( Mobile from )
		{
			if ( !IsChildOf( from.Backpack ) )
			{
				from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
			}
			else if ( from.AccessLevel >= AccessLevel.GameMaster )
			{
				from.SendLocalizedMessage( 503248 ); // Your godly powers allow you to place this vendor whereever you wish.

				Mobile v = new PlayerBarkeeper( from );

				v.Direction = from.Direction & Direction.Mask;
				v.MoveToWorld( from.Location, from.Map );

				this.Delete();
			}
			else
			{
				BaseHouse house = BaseHouse.FindHouseAt( from );

				if ( house == null || !house.IsOwner( from ) )
				{
					from.LocalOverheadMessage( MessageType.Regular, 0x3B2, false, "You are not the full owner of this house." );
				}
				else if ( !house.CanPlaceNewBarkeep() )
				{
					//from.SendLocalizedMessage( 1062490 ); // That action would exceed the m/aximum number of barkeeps for this house.
					from.SendMessage("You must purchase a work permit if you wish to employ more barkeepers.");
				}
				else
				{
					Mobile v = new PlayerBarkeeper( from );

					v.Direction = from.Direction & Direction.Mask;
					v.MoveToWorld( from.Location, from.Map );
						
					this.Delete();
				}
			}
		}
开发者ID:zerodowned,项目名称:angelisland,代码行数:41,代码来源:BarkeepContract.cs


注:本文中的Server.Mobiles.PlayerBarkeeper.MoveToWorld方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。