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


C# Item.MoveToWorld方法代码示例

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


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

示例1: Carve

        public void Carve(Mobile from, Item item)
        {
            Item ribcage = new RibCage();
            Item heart = new Item( 7405 );
            Item liver = new Item( 7406 );
            Item entrails = new Item( 7407 );

            if ( m_Owner != null )
            {
                ribcage.Name = "ribcage of " + m_Owner.Name;
                liver.Name = "liver of " + m_Owner.Name;
                heart.Name = "heart of " + m_Owner.Name;
                entrails.Name = "entrails of " + m_Owner.Name;
            }

            if ( !(Parent is Container) )
            {
                ribcage.MoveToWorld( GetWorldLocation(), Map );
                liver.MoveToWorld( GetWorldLocation(), Map );
                heart.MoveToWorld( GetWorldLocation(), Map );
                entrails.MoveToWorld( GetWorldLocation(), Map );
            }
            else
            {
                Container cont = (Container)Parent;
                cont.DropItem( ribcage );
                cont.DropItem( liver );
                cont.DropItem( heart );
                cont.DropItem( entrails );
            }

            Delete();
        }
开发者ID:greeduomacro,项目名称:divinity,代码行数:33,代码来源:Torso.cs

示例2: AddItem

		public virtual void AddItem( Item item, int xOffset, int yOffset, int zOffset )
		{
			m_Items.Add( item );

            int zavg = Map.GetAverageZ(X + xOffset, Y + yOffset);
            item.MoveToWorld(new Point3D(X + xOffset, Y + yOffset, zavg + zOffset), Map);
		}
开发者ID:romeov007,项目名称:imagine-uo,代码行数:7,代码来源:BaseCamp.cs

示例3: Execute

		public override void Execute( CommandEventArgs args, object o )
		{
			if( o is AddonComponent )
			{
				BaseAddon addon = ((AddonComponent)o).Addon;

				if( addon.Components.Count > 0 )
				{
					for( int i = 0; i < addon.Components.Count; i++ )
					{
						AddonComponent component = addon.Components[i];
						Item newItem = new Item( component.ItemID );

						newItem.Hue = component.Hue;
						newItem.Light = component.Light;
						newItem.Movable = true;
						newItem.Name = component.Name;

						newItem.MoveToWorld( component.Location, component.Map );
					}
				}

				addon.Delete();

				AddResponse( "The add-on has been converted into individual items." );
			}
			else if( o is Item )
			{
				Item i = (Item)o;
				Item newItem = new Item( i.ItemID );

				newItem.Hue = i.Hue;
				newItem.Layer = i.Layer;
				newItem.Light = i.Light;
				newItem.Movable = true;
				newItem.Name = i.Name;

				newItem.MoveToWorld( i.Location, i.Map );

				if( i.Parent == args.Mobile )
					newItem.Bounce( args.Mobile );

				if( i is Container )
					((Container)i).Destroy();
				else
					i.Delete();

				AddResponse( "The item has been converted to an item." );
			}
			else
			{
				LogFailure( "This command only works with item objects." );
			}
		}
开发者ID:greeduomacro,项目名称:hubroot,代码行数:54,代码来源:ToItem.cs

示例4: OnTarget

		protected override void OnTarget( Mobile from, object targeted ) 
		{ 
			if ( from.Name == null)
			{
				from.SendMessage("Your name is not valid fix it now");
				return;
			}
           
			if ( targeted is Mobile )
			{ 
				Mobile m_target = (Mobile)targeted;
				from.PublicOverheadMessage(MessageType.Emote ,20, true,"*" + from.Name + " Points at*");
            	
				if ( m_target.Name != null)
					m_target.PublicOverheadMessage(MessageType.Emote ,20,true, "*" + m_target.Name + "*");
				else
					m_target.PublicOverheadMessage(MessageType.Emote ,20,true,"*"+ from.Name + " whatever it is!*");
			}
			else if ( targeted is Item ) 
			{ 
				Item m_target = (Item)targeted;
				from.PublicOverheadMessage(MessageType.Emote ,20, true,"*" + from.Name + " Points at*");
				if (m_target.Name != null)
					m_target.PublicOverheadMessage(MessageType.Emote ,20,true, "* " + m_target.Name + "*");
				else
					m_target.PublicOverheadMessage(MessageType.Emote ,20,true, "*Points Here*");
			}
			else 
			{
				IPoint3D p = targeted as IPoint3D; 

				if ( p != null ) 
				{
					Map map = from.Map;
					Item pointer = new Item (8302);
					Point3D m_point = new Point3D(p);
					pointer.MoveToWorld(m_point,map);
					pointer.Movable = false;
					PointTimer p_time = new PointTimer(pointer);
					from.PublicOverheadMessage(MessageType.Emote ,20, true, "*" + from.Name.ToString() + " Points at*");
					pointer.PublicOverheadMessage(MessageType.Emote ,20, true, "*This Spot*" );
				}
				else
				{ 
					from.SendMessage( "Cannot point at this for some reason!" ); 
				} 
			}     
		}
开发者ID:greeduomacro,项目名称:dragonknights-uo,代码行数:48,代码来源:Point.cs

示例5: TryCreateItem

		public static Item TryCreateItem( int x, int y, int z, Item srcItem )
		{
			IPooledEnumerable eable = Map.Felucca.GetItemsInBounds( new Rectangle2D( x, y, 1, 1 ) );

				foreach ( Item item in eable )
				{
					if ( item.GetType() == srcItem.GetType() )
					{
						eable.Free();
						srcItem.Delete();
						return item;
					}
				}

			eable.Free();
			srcItem.MoveToWorld( new Point3D( x, y, z ), Map.Felucca );
			m_Count++;

			return srcItem;
		}
开发者ID:kamronbatman,项目名称:DefianceUO-Pre1.10,代码行数:20,代码来源:KhaldunGen.cs

示例6: Execute

		public override void Execute( Server.Commands.CommandEventArgs args, object o )
		{
			if( o is AddonComponent )
			{
				BaseAddon addon = ((AddonComponent)o).Addon;
				
				if( addon.Components.Count > 0 )
				{
					for( int i = 0; i < addon.Components.Count; i++ )
					{
						AddonComponent component = (addon.Components)[i];
                        Item newItem = new Item( component.ItemID) {Hue = component.Hue, Name = component.Name};

					    newItem.MoveToWorld( new Point3D( component.Location ), component.Map );
					}
				}
				
				addon.Delete();
				
				AddResponse( "The add-on has been converted to an item." );
			}
			else if( o is Static )
			{
				Static s = (Static)o;
				Item newItem = new Item( s.ItemID ) {Hue = s.Hue, Layer = s.Layer, Light = s.Light, Name = s.Name};

			    newItem.MoveToWorld( new Point3D( s.Location ), s.Map );
				
				if( s.Parent == args.Mobile )
					newItem.Bounce( args.Mobile );

				s.Delete();
				
				AddResponse( "The static has been converted to an item." );
			}
			else
			{
				LogFailure( "This command only works with static items or add-ons." );
			}
		}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:40,代码来源:ToItem.cs

示例7: GiveArtifactTo

        public static void GiveArtifactTo( Mobile m, Item artifact )
        {
            bool message = true;

            if ( !m.AddToBackpack( artifact ) )
            {
                Container bank = m.BankBox;

                if ( !( bank != null && bank.TryDropItem( m, artifact, false ) ) )
                {
                    m.SendLocalizedMessage( 1072523, "", 64 ); // You find an artifact, but your backpack and bank are too full to hold it.

                    message = false;

                    artifact.MoveToWorld( m.Location, m.Map );
                }
            }

            if ( message )
                m.SendLocalizedMessage( 1062317, "", 64 ); // For your valor in combating the fallen beast, a special artifact has been bestowed on you.

            EffectPool.ArtifactDrop( m );
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:23,代码来源:MonsterHelper.cs

示例8: AddRubble

        private void AddRubble(Item i, Point3D p)
        {
            i.MoveToWorld(p, this.Map);

            if (Rubble == null)
                Rubble = new List<Item>();

            Rubble.Add(i);
        }
开发者ID:Ravenwolfe,项目名称:ServUO,代码行数:9,代码来源:Beacon.cs

示例9: DoSwap

 public void DoSwap(Item firstHand, Item secondHand)
 {
     if (secondHand == null)
     {
         if (m_Cont == null)
         {
             //m_Mobile.SendMessage(MessageColorization ? this.Hue : 49, "You swapped {0} for {1}.", this.Name != null ? this.Name : this.ItemData.Name, firstHand.Name != null ? firstHand.Name : firstHand.ItemData.Name);
             firstHand.MoveToWorld(this.Location);
             m_Mobile.EquipItem(this);
         }
         else if (m_Cont.TryDropItem(m_Mobile, firstHand, true))
         {
             //m_Mobile.SendMessage(MessageColorization ? this.Hue : 49, "You swapped {0} for {1}.", this.Name != null ? this.Name : this.ItemData.Name, firstHand.Name != null ? firstHand.Name : firstHand.ItemData.Name);
             firstHand.Location = this.Location;
             m_Mobile.EquipItem(this);
         }
     }
     else
     {
         if (m_Cont == null)
         {
             //m_Mobile.SendMessage(MessageColorization ? this.Hue : 49, "You swapped {0} for {1} and {2}.", this.Name != null ? this.Name : this.ItemData.Name, firstHand.Name != null ? firstHand.Name : firstHand.ItemData.Name, secondHand.Name != null ? secondHand.Name : secondHand.ItemData.Name);
             firstHand.MoveToWorld(this.Location);
             secondHand.MoveToWorld(this.Location);
             m_Mobile.EquipItem(this);
         }
         else if (m_Cont.TryDropItem(m_Mobile, firstHand, true) && m_Cont.TryDropItem(m_Mobile, secondHand, true))
         {
             //m_Mobile.SendMessage(MessageColorization ? this.Hue : 49, "You swapped {0} for {1} and {2}.", this.Name != null ? this.Name : this.ItemData.Name, firstHand.Name != null ? firstHand.Name : firstHand.ItemData.Name, secondHand.Name != null ? secondHand.Name : secondHand.ItemData.Name);
             firstHand.Location = this.Location;
             secondHand.Location = this.Location;
             m_Mobile.EquipItem(this);
         }
     }
 }
开发者ID:greeduomacro,项目名称:vivre-uo,代码行数:35,代码来源:BaseWearable.cs

示例10: SpawnItem

		protected bool SpawnItem( Item item )
		{
			for ( int i = 0; i < 5; i++ ) // Try 5 times
			{
				int x = Location.X + Utility.RandomMinMax( -1, 1 );
				int y = Location.Y + Utility.RandomMinMax( -1, 1 );
				int z = Map.GetAverageZ( x, y );

				if ( Map.CanFit( x, y, Location.Z, 1 ) )
				{
					item.MoveToWorld( new Point3D( x, y, Location.Z ), Map );
					return true;
				}
				else if ( Map.CanFit( x, y, z, 1 ) )
				{
					item.MoveToWorld( new Point3D( x, y, z ), Map );
					return true;
				}
			}

			return false;
		}
开发者ID:nick12344356,项目名称:The-Basement,代码行数:22,代码来源:GreenThorns.cs

示例11: HouseFoundation

        private FoundationType m_Type; // Graphic type of this foundation.

        #endregion Fields

        #region Constructors

        public HouseFoundation( Mobile owner, int multiID, int maxLockdowns, int maxSecures )
            : base(multiID, owner, maxLockdowns, maxSecures)
        {
            m_SignpostGraphic = 9;

            m_Fixtures = new ArrayList();

            int x = Components.Min.X;
            int y = Components.Height - 1 - Components.Center.Y;

            m_SignHanger = new Static( 0xB98 );
            m_SignHanger.MoveToWorld( new Point3D( X + x, Y + y, Z + 7 ), Map );

            CheckSignpost();

            SetSign( x, y, 7 );

            BanLocation = new Point3D( x, y, 0 );
        }
开发者ID:BackupTheBerlios,项目名称:sunuo-svn,代码行数:25,代码来源:HouseFoundation.cs

示例12: SetWhiteSkullCount

        public void SetWhiteSkullCount(int val)
        {
            for (int i = m_WhiteSkulls.Count - 1; i >= val; --i)
            {
                m_WhiteSkulls[i].Delete();
                m_WhiteSkulls.RemoveAt(i);
            }

            for (int i = m_WhiteSkulls.Count; i < val; ++i)
            {
                Item skull = new Item(0x1854);

                skull.Movable = false;
                skull.Light = LightType.Circle150;

                skull.MoveToWorld(GetWhiteSkullLocation(i), Map);

                m_WhiteSkulls.Add(skull);

                Effects.PlaySound(skull.Location, skull.Map, 0x29);
                Effects.SendLocationEffect(new Point3D(skull.X + 1, skull.Y + 1, skull.Z), skull.Map, 0x3728, 10);
            }
        }
开发者ID:PepeBiondi,项目名称:runsa,代码行数:23,代码来源:ChampionSpawn.cs

示例13: AddFixture

 public void AddFixture( Item item, MultiTileEntry mte )
 {
     m_Fixtures.Add( item );
     item.MoveToWorld( new Point3D( X + mte.m_OffsetX, Y + mte.m_OffsetY, Z + mte.m_OffsetZ ), Map );
 }
开发者ID:BackupTheBerlios,项目名称:sunuo-svn,代码行数:5,代码来源:HouseFoundation.cs

示例14: AddItem

        public virtual void AddItem( Item item, int xOffset, int yOffset, int zOffset )
        {
            m_Items.Add( item );

            item.MoveToWorld( new Point3D( X + xOffset, Y + yOffset, Z + zOffset ), Map );
        }
开发者ID:FreeReign,项目名称:Rebirth-Repack,代码行数:6,代码来源:BaseCamp.cs

示例15: MoveParticipants

        private void MoveParticipants()
        {
            m_Region = new DuelRegion(this);
            m_Region.Register();

            List<Item> fieldstoremove = new List<Item>();

            IPooledEnumerable ip = Map.GetItemsInBounds(Area2D);

            foreach (Item item in ip)
                if (item != null && item.GetType().IsDefined(typeof(DispellableFieldAttribute), false))
                    fieldstoremove.Add(item);

            ip.Free();

            foreach (Item item in fieldstoremove)
                if(!item.Deleted)
                    item.Delete();

            for(int i = 0; i < Participants.Length; i++)
            {
                Mobile m = Participants[i];

                    if (DuelType is DDDuelType)
                    m.SendLocalizedMessage(1060398, DuelSystem.GoldCost2v2.ToString()); // ~1_AMOUNT~ gold has been withdrawn from your bank box.

                else
                    m.SendLocalizedMessage(1060398, DuelSystem.GoldCost.ToString()); // ~1_AMOUNT~ gold has been withdrawn from your bank box.

                m.Frozen = true;
                m.Hidden = false;
                m.Map = Map;
                m.Hits = m.HitsMax;
                m.Mana = m.ManaMax;
                m.Stam = m.StamMax;

                TransformationSpellHelper.RemoveContext(m, true);
                for(int j = m.StatMods.Count -1; j >= 0; j--)
                {
                    StatMod st = m.StatMods[j];
                    if (st.Name.StartsWith("[Magic]"))
                        m.StatMods.RemoveAt(j);
                }
                if (m.Spell != null && m.Spell.IsCasting)
                    m.Spell.OnCasterHurt();
                Targeting.Target.Cancel(m);
                m.CloseGump(typeof(SummonFamiliarGump));
                List<Item> armthis = new List<Item>();
                MoveMob(m, 1);

                SunnySystem.Undress(m, ItemNotAllowed);

                if (SpellWatch)
                {
                    SpellWatcher sw = new SpellWatcher(m);
                    SpellWatchList.Add(sw);
                }

                if (DuelType is TMFDuelType || DuelType is UMFDuelType)
                {
                    DuelBlockAddon dba = new DuelBlockAddon();
                    if (m == Starter)
                        blockadd0 = dba;
                    else
                        blockadd1 = dba;
                    dba.MoveToWorld(m.Location, m.Map);

                    if (DuelType is UMFDuelType)
                    {
                        armthis.Add(new Spellbook(ulong.MaxValue));
                        if (m.Skills[SkillName.Magery].Value > 80)
                        {
                            NecromancerSpellbook book = new NecromancerSpellbook();
                            book.Content = 0x1FFFF;
                            armthis.Add(book);
                        }
                        GoldRing ring = new GoldRing();
                        ring.Attributes.LowerRegCost = 100;
                        ring.LootType = LootType.Cursed;
                        armthis.Add(ring);
                    }
                }

                if (DuelType is UDFDuelType)
                {
                    armthis.Add(new Bandage(75));

                    if (m.Skills[SkillName.Chivalry].Value > 80)
                    {
                        BookOfChivalry bookch = new BookOfChivalry();
                        bookch.Content = 1023;
                        armthis.Add(bookch);
                    }

                    if (m.Skills[SkillName.Necromancy].Value > 80)
                    {
                        NecromancerSpellbook book = new NecromancerSpellbook();
                        book.Content = 0x1FFFF;
                        armthis.Add(book);
                    }
//.........这里部分代码省略.........
开发者ID:kamronbatman,项目名称:Defiance-AOS-Pre-2012,代码行数:101,代码来源:Dueller.cs


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