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


C# PlayerVendor.MoveToWorld方法代码示例

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


在下文中一共展示了PlayerVendor.MoveToWorld方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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 PlayerVendor( from, BaseHouse.FindHouseAt( from ) );

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

				v.SayTo( from, 503246 ); // Ah! it feels good to be working again.

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

				if ( house == null )
				{
					from.SendLocalizedMessage( 503240 ); // Vendors can only be placed in houses.	
				}
				else if ( !house.IsFriend( from ) )
				{
					from.SendLocalizedMessage( 503242 ); // You must ask the owner of this building to name you a friend of the household in order to place a vendor here.
				}
				else if ( !house.Public ) 
				{
					from.SendLocalizedMessage( 503241 ); // You cannot place this vendor or barkeep.  Make sure the house is public and has sufficient storage available.
				}
				else
				{
					bool vendor;
					BaseHouse.IsThereVendor( from.Location, from.Map, out vendor );

					if ( vendor )
					{
						from.SendLocalizedMessage( 1062677 ); // You cannot place a vendor or barkeep at this location.
					}
					else
					{
						Mobile v = new PlayerVendor( from, house );

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

						v.SayTo( from, 503246 ); // Ah! it feels good to be working again.

						this.Delete();
					}
				}
			}
		}
开发者ID:Grimoric,项目名称:RunUO.T2A,代码行数:58,代码来源:PlayerVendorDeed.cs

示例2: OnDoubleClick

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

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

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

                v.SayTo( from, 503246 ); // Ah! it feels good to be working again.

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

                if ( house == null )
                {
                    from.SendAsciiMessage( "Vendors can only be placed in houses." );
                }
                else if ( !BaseHouse.NewVendorSystem && !house.IsFriend( from ) )
                {
                    from.SendAsciiMessage( "You must ask the owner of this building to name you a friend of the household in order to place a vendor here." );
                }
                else if ( BaseHouse.NewVendorSystem && !house.IsOwner( from ) )
                {
                    from.SendAsciiMessage( "Only the house owner can directly place vendors.  Please ask the house owner to offer you a vendor contract so that you may place a vendor in this house." );
                }
                else if ( !house.Public || !house.CanPlaceNewVendor() )
                {
                    from.SendAsciiMessage( "You cannot place this vendor or barkeep.  Make sure the house is public and has sufficient storage available." );
                }
                else
                {
                    bool vendor, contract;
                    BaseHouse.IsThereVendor( from.Location, from.Map, out vendor, out contract );

                    if ( vendor )
                    {
                        from.SendAsciiMessage( "You cannot place a vendor or barkeep at this location." );
                    }
                    else if ( contract )
                    {
                        from.SendAsciiMessage( "You cannot place a vendor or barkeep on top of a rental contract!" );
                    }
                    else
                    {
                        Mobile v = new PlayerVendor( from, house );

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

                        v.SayTo( from, 503246 ); // Ah! it feels good to be working again.

                        this.Delete();
                    }
                }
            }
        }
开发者ID:cynricthehun,项目名称:UOLegends,代码行数:66,代码来源:PlayerVendorDeed.cs

示例3: 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 PlayerVendor( from, BaseHouse.FindHouseAt( from ) );

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

                if( from is PlayerMobile && ((PlayerMobile)from).Nation != Nation.None )
                {
                    Nation nation = ((PlayerMobile)from).Nation;
                    v.Hue = BaseKhaerosMobile.AssignRacialHue( nation );
                    v.HairItemID = BaseKhaerosMobile.AssignRacialHair( nation, v.Female );
                    int hairhue = BaseKhaerosMobile.AssignRacialHairHue( nation );
                    v.HairHue = hairhue;
                    v.Name = BaseKhaerosMobile.RandomName( nation, v.Female );

                    if( !v.Female )
                    {

                        v.FacialHairItemID = BaseKhaerosMobile.AssignRacialFacialHair( nation );
                        v.FacialHairHue = hairhue;
                    }

                    BaseCreature.RemoveEquipFrom( v );
                    BaseKhaerosMobile.RandomCrafterClothes( v, nation );
                }

                v.SayTo( from, 503246 ); // Ah! it feels good to be working again.

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

                if ( house == null )
                {
                    from.SendLocalizedMessage( 503240 ); // Vendors can only be placed in houses.
                }
                else if ( !BaseHouse.NewVendorSystem && !house.IsFriend( from ) )
                {
                    from.SendLocalizedMessage( 503242 ); // You must ask the owner of this building to name you a friend of the household in order to place a vendor here.
                }
                else if ( BaseHouse.NewVendorSystem && !house.IsOwner( from ) && !house.IsCoOwner( from ) )
                {
                    from.SendLocalizedMessage( 1062423 ); // Only the house owner can directly place vendors.  Please ask the house owner to offer you a vendor contract so that you may place a vendor in this house.
                }
                else if ( !house.Public || !house.CanPlaceNewVendor() )
                {
                    from.SendLocalizedMessage( 503241 ); // You cannot place this vendor or barkeep.  Make sure the house is public and has sufficient storage available.
                }
                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 PlayerVendor( from, house );

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

                        v.SayTo( from, 503246 ); // Ah! it feels good to be working again.

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

示例4: 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 PlayerVendor( from, BaseHouse.FindHouseAt( from ) );

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

				v.SayTo( from, 503246 ); // Ah! it feels good to be working again.

				Delete();
			}
			else
			{
                bool canplace = false;
				BaseHouse house = BaseHouse.FindHouseAt( from );
                CustomRegion cR;

                if ((cR = from.Region as CustomRegion) != null && !cR.Controller.CanPlaceVendors)
                {
                    if (house == null)
                        from.SendAsciiMessage("Vendors can only be placed in houses or specified areas.");
                    else
                        from.SendAsciiMessage("You cannot place a vendor in this region");
                }
                else if ((cR = from.Region as CustomRegion) != null && cR.Controller.CanPlaceVendors)
                {
                    canplace = true;

                    try
                    {
                    foreach (Mobile mob in cR.GetMobiles())
                    {
                        if (mob is PlayerVendor && (mob as PlayerVendor).Owner.Account == from.Account)
                        {
                            from.SendAsciiMessage("You alread have a vendor placed in this region.");
                            canplace = false;
                            return;
                        }
                    }
                    }
                    catch (Exception e)
                    {
                    	Console.WriteLine(e.ToString());
                    }
                }
				else if ( house == null )
				{
                    from.SendAsciiMessage("Vendors can only be placed in houses or specified areas.");
				}
				else if ( !BaseHouse.NewVendorSystem && !house.IsFriend( from ) )
				{
					from.SendLocalizedMessage( 503242 ); // You must ask the owner of this building to name you a friend of the household in order to place a vendor here.
				}
				else if ( BaseHouse.NewVendorSystem && !house.IsOwner( from ) )
				{
					from.SendLocalizedMessage( 1062423 ); // Only the house owner can directly place vendors.  Please ask the house owner to offer you a vendor contract so that you may place a vendor in this house.
				}
				else if ( !house.Public || !house.CanPlaceNewVendor() ) 
				{
					from.SendLocalizedMessage( 503241 ); // You cannot place this vendor or barkeep.  Make sure the house is public and has sufficient storage available.
				}
                else
                {
                    canplace = true;
                }

                if ( canplace )
				{
					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 PlayerVendor( from, house );

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

						v.SayTo( from, 503246 ); // Ah! it feels good to be working again.

						Delete();
					}
				}
			}
//.........这里部分代码省略.........
开发者ID:FreeReign,项目名称:imaginenation,代码行数:101,代码来源:PlayerVendorDeed.cs

示例5: 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 PlayerVendor( from, BaseHouse.FindHouseAt( from ) );

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

				v.SayTo( from, 503246 ); // Ah! it feels good to be working again.

				this.Delete();
			}
			else
			{
				BaseHouse house = BaseHouse.FindHouseAt( from );
                
                #region VendorTile
                Sector sector = from.Map.GetSector(from.Location);
                foreach (Item i in sector.Items)
                {
                    if (i is VendorTile && i.Location.X == from.Location.X && i.Location.Y == from.Location.Y)
                    {
                        Mobile v = new PlayerVendor(from, house);

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

                        v.SayTo(from, 503246); // Ah! it feels good to be working again.

                        this.Delete();
                        return;
                    }
                }
                #endregion

                if ( house == null )
				{
					from.SendLocalizedMessage( 503240 ); // Vendors can only be placed in houses.	
				}
				else if ( !BaseHouse.NewVendorSystem && !house.IsFriend( from ) )
				{
					from.SendLocalizedMessage( 503242 ); // You must ask the owner of this building to name you a friend of the household in order to place a vendor here.
				}
				else if ( BaseHouse.NewVendorSystem && !house.IsOwner( from ) )
				{
					from.SendLocalizedMessage( 1062423 ); // Only the house owner can directly place vendors.  Please ask the house owner to offer you a vendor contract so that you may place a vendor in this house.
				}
				else if ( !house.Public || !house.CanPlaceNewVendor() ) 
				{
					from.SendLocalizedMessage( 503241 ); // You cannot place this vendor or barkeep.  Make sure the house is public and has sufficient storage available.
				}
				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 PlayerVendor( from, house );

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

						v.SayTo( from, 503246 ); // Ah! it feels good to be working again.

						this.Delete();
					}
				}
			}
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:85,代码来源:PlayerVendorDeed.cs

示例6: OnDoubleClick

        public override void OnDoubleClick( Mobile from )
        {
            if ( !IsChildOf( from.Backpack ) )
            {
                from.SendMessage( "O item precisa estar na sua bag" ); // That must be in your pack for you to use it.
            }
            else if ( from.AccessLevel >= AccessLevel.GameMaster )
            {
                from.SendMessage("Voce e GM e pode colocar o vendedor onde quiser."); // Your godly powers allow you to place this vendor whereever you wish.

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

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

                v.SayTo( from, "Ah! Como e bom voltar ao trabalho..." ); // Ah! it feels good to be working again.

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

                if ( house == null )
                {
                    from.SendMessage("Vendedores so podem ser colocados dentro de casa"); // Vendors can only be placed in houses.
                }
                else if ( !BaseHouse.NewVendorSystem && !house.IsFriend( from ) )
                {
                    from.SendMessage("Apenas o dono, sócios e amigos podem colocar vendedores nesta casa"); // You must ask the owner of this building to name you a friend of the household in order to place a vendor here.
                }
                else if ( BaseHouse.NewVendorSystem && !house.IsOwner( from ) )
                {
                    from.SendMessage("Apenas o dono pode colocar vendedores diretamente."); // Only the house owner can directly place vendors.  Please ask the house owner to offer you a vendor contract so that you may place a vendor in this house.
                }
                else if ( !house.Public || !house.CanPlaceNewVendor() )
                {
                    from.SendMessage("Voce nao pode colocar este vendedor aqui. Verifique se a casa e publica e tem espaco suficiente."); // You cannot place this vendor or barkeep.  Make sure the house is public and has sufficient storage available.
                }
                else
                {
                    bool vendor, contract;
                    BaseHouse.IsThereVendor( from.Location, from.Map, out vendor, out contract );

                    if ( vendor )
                    {
                        from.SendMessage("Voce nao pode colocar um vendedor aqui"); // You cannot place a vendor or barkeep at this location.
                    }
                    else if ( contract )
                    {
                        from.SendMessage("Voce nao pode colocar este vendedor aqui, verifique o contrato."); // You cannot place a vendor or barkeep on top of a rental contract!
                    }
                    else
                    {
                        Mobile v = new PlayerVendor( from, house );

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

                        v.SayTo( from, "Ah! Como e bom voltar ao trabalho..."); // Ah! it feels good to be working again.

                        this.Delete();
                    }
                }
            }
        }
开发者ID:greeduomacro,项目名称:DimensionsNewAge,代码行数:66,代码来源:PlayerVendorDeed.cs

示例7: 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 PlayerVendor( from, HousingHelper.FindHouseAt( from ) );

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

                v.SayTo( from, 503246 ); // Ah! it feels good to be working again.

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

                if ( house == null )
                {
                    from.SendLocalizedMessage( 503240 ); // Vendors can only be placed in houses.
                }
                else if ( !house.IsOwner( from ) )
                {
                    from.SendLocalizedMessage( 1062423 ); // Only the house owner can directly place vendors.  Please ask the house owner to offer you a vendor contract so that you may place a vendor in this house.
                }
                else if ( !house.Public || !house.CanPlaceNewVendor() )
                {
                    from.SendLocalizedMessage( 503241 ); // You cannot place this vendor or barkeep.  Make sure the house is public and has sufficient storage available.
                }
                else
                {
                    bool vendor, contract;
                    HousingHelper.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 PlayerVendor( from, house );

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

                        v.SayTo( from, 503246 ); // Ah! it feels good to be working again.

                        this.Delete();
                    }
                }
            }
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:62,代码来源:PlayerVendorDeed.cs


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