當前位置: 首頁>>代碼示例>>C#>>正文


C# Item.GetWorldLocation方法代碼示例

本文整理匯總了C#中Server.Items.Item.GetWorldLocation方法的典型用法代碼示例。如果您正苦於以下問題:C# Item.GetWorldLocation方法的具體用法?C# Item.GetWorldLocation怎麽用?C# Item.GetWorldLocation使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Server.Items.Item的用法示例。


在下文中一共展示了Item.GetWorldLocation方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: DismantleItem

            private void DismantleItem(Mobile from, Item item)
            {
                if (!from.InRange(item.GetWorldLocation(), 2))
                {
                    from.SendMessage("You need to be closer to it.");
                    return;
                }
                else if (!item.IsChildOf(from.Backpack) && !item.Movable)
                {
                    from.SendMessage("It can't be dismantled.");
                    return;
                }

                from.SendMessage("You dismantle the object.");
                Effects.PlaySound(item.GetWorldLocation(), item.Map, 0x3B3);

                if (item is Container)
                {
                    if (item is TrapableContainer)
                        (item as TrapableContainer).ExecuteTrap(from);

                    ((Container)item).Destroy();
                }
                else
                {
                    item.Delete();
                }
            }
開發者ID:greeduomacro,項目名稱:last-wish,代碼行數:28,代碼來源:Dismantle.cs

示例2: DestroyFurniture

		private void DestroyFurniture( Mobile from, Item item )
		{
			if ( !from.InRange( item.GetWorldLocation(), 3 ) )
			{
				from.SendLocalizedMessage( 500446 ); // That is too far away.
				return;
			}
			else if ( !item.IsChildOf( from.Backpack ) && !item.Movable )
			{
				from.SendLocalizedMessage( 500462 ); // You can't destroy that while it is here.
				return;
			}

			from.SendLocalizedMessage( 500461 ); // You destroy the item.
			Effects.PlaySound( item.GetWorldLocation(), item.Map, 0x3B3 );

			if ( item is Container )
			{
				if ( item is TrapableContainer )
					(item as TrapableContainer).ExecuteTrap( from );

				((Container)item).Destroy();
			}
			else
			{
				item.Delete();
			}
		}
開發者ID:Grimoric,項目名稱:RunUO.T2A,代碼行數:28,代碼來源:HarvestTarget.cs

示例3: Resurrect

		public static void Resurrect(Mobile m, Item item)
		{
			if (m.Alive)
			{
				return;
			}

			if (!m.InRange(item.GetWorldLocation(), ResurrectRange))
			{
				m.SendLocalizedMessage(500446); // That is too far away.
			}
			else if (m.Map != null && m.Map.CanFit(m.Location, 16, false, false))
			{
				m.CloseGump(typeof(ResurrectGump));

				/*PlayerMobile pres = m as PlayerMobile;

				if (pres.MurderBounty > 0)
					m.SendGump( new ResurrectGump( m, m, pres.MurderBounty ) );
				else*/
				m.SendGump(new ResurrectGump(m, ResurrectMessage.VirtueShrine));
			}
			else
			{
				m.SendLocalizedMessage(502391); // Thou can not be resurrected there!
			}
		}
開發者ID:greeduomacro,項目名稱:UO-Forever,代碼行數:27,代碼來源:Ankhs.cs

示例4: Resurrect

		public static void Resurrect( Mobile m, Item item )
		{
			if ( m.Alive )
				return;

			if ( !m.InRange( item.GetWorldLocation(), ResurrectRange ) )
				m.SendLocalizedMessage( 500446 ); // That is too far away.
			else if( m.Map != null && m.Map.CanFit( m.Location, 16, false, false ) )
			{
				m.CloseGump( typeof( ResurrectGump ) );
				m.SendGump( new ResurrectGump( m, ResurrectMessage.VirtueShrine ) );
			}
			else
				m.SendLocalizedMessage( 502391 ); // Thou can not be resurrected there!
		}
開發者ID:greeduomacro,項目名稱:last-wish,代碼行數:15,代碼來源:Ankhs.cs

示例5: DestroyFurniture

		private void DestroyFurniture( Mobile from, Item item )
		{
			if ( !from.InRange( item.GetWorldLocation(), 3 ) || !from.InLOS(item) )
			{
                from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
				return;
			}
		    if ( !item.IsChildOf( from.Backpack ) && !item.Movable )
		    {
		        from.SendLocalizedMessage( 500462 ); // You can't destroy that while it is here.
		        return;
		    }

		    from.SendLocalizedMessage( 500461 ); // You destroy the item.
			Effects.PlaySound( item.GetWorldLocation(), item.Map, 0x3B3 );

			if ( item is Container )
			{
				if ( item is TrapableContainer )
					(item as TrapableContainer).ExecuteTrap( from );

				((Container)item).Destroy();
			}
			else
			{
				item.Delete();
			}
		}
開發者ID:FreeReign,項目名稱:imaginenation,代碼行數:28,代碼來源:HarvestTarget.cs


注:本文中的Server.Items.Item.GetWorldLocation方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。