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


C# Container.DisplayTo方法代码示例

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


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

示例1: Target

		public void Target( Container item )
		{
			if ( CheckSequence() )
			{
				SpellHelper.Turn( Caster, item );

				object root = item.RootParent;

				if ( !item.IsAccessibleTo( Caster ) )
				{
					item.OnDoubleClickNotAccessible( Caster );
				}
				else if ( !item.CheckItemUse( Caster, item ) )
				{
				}
				else if ( root != null && root is Mobile && root != Caster )
				{
					item.OnSnoop( Caster );
				}
				else if ( item is Corpse && !((Corpse)item).CheckLoot( Caster, null ) )
				{
				}
				else if ( Caster.Region.OnDoubleClick( Caster, item ) )
				{
					Effects.SendLocationParticles( EffectItem.Create( item.Location, item.Map, EffectItem.DefaultDuration ), 0x376A, 9, 32, 5022 );
					Effects.PlaySound( item.Location, item.Map, 0x1F5 );

					item.DisplayTo( Caster );
					item.OnItemUsed( Caster, item );
				}
			}

			FinishSequence();
		}
开发者ID:romeov007,项目名称:imagine-uo,代码行数:34,代码来源:Telekinesis.cs

示例2: Container_Snoop

		public static void Container_Snoop( Container cont, Mobile from )
		{

            if (from.BeginAction(typeof(IAction)))
            {
                bool releaseLock = true;
                bool canSnoop = true;

                if (from.AccessLevel > AccessLevel.Player || from.InRange(cont.GetWorldLocation(), 1))
                {
                    Mobile root = cont.RootParent as Mobile;

                    if (root != null && !root.Alive)
                        canSnoop = false;
                    else if (root != null && root.AccessLevel > AccessLevel.Player && from.AccessLevel == AccessLevel.Player)
                    {
                        from.SendLocalizedMessage(500209); // You can not peek into the container.
                        canSnoop = false;
                    }
                    else if (root != null && from.AccessLevel == AccessLevel.Player && !CheckSnoopAllowed(from, root))
                    {
                        from.SendLocalizedMessage(1001018); // You cannot perform negative acts on your target.
                        canSnoop = false;
                    }

                    if (canSnoop)
                    {
                        if (from.AccessLevel > AccessLevel.Player)
                            cont.DisplayTo(from);
                        else
                        {
                            new InternalTimer(from, cont).Start();
                            releaseLock = false;
                        }
                    }
                }
                else
                    from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.

                if (releaseLock && from is PlayerMobile)
                    ((PlayerMobile)from).EndPlayerAction();
            }
            else
                from.SendAsciiMessage("You must wait to perform another action.");
		}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:45,代码来源:Snooping.cs

示例3: Container_Snoop

		public static void Container_Snoop( Container cont, Mobile from )
		{
			if ( from.AccessLevel > AccessLevel.Player || from.InRange( cont.GetWorldLocation(), 1 ) )
			{
				Mobile root = cont.RootParent as Mobile;

				if ( root != null && !root.Alive )
					return;

				if ( root != null && root.AccessLevel > AccessLevel.Player && from.AccessLevel == AccessLevel.Player )
				{
					from.SendLocalizedMessage( 500209 ); // You can not peek into the container.
					return;
				}

				if ( root != null && from.AccessLevel == AccessLevel.Player && !CheckSnoopAllowed( from, root ) )
				{
					from.SendLocalizedMessage( 1001018 ); // You cannot perform negative acts on your target.
					return;
				}

				if ( root != null && from.AccessLevel == AccessLevel.Player && from.Skills[SkillName.Snooping].Value < Utility.Random( 100 ) )
				{
					Map map = from.Map;

					if ( map != null )
					{
						string message = String.Format( "You notice {0} attempting to peek into {1}'s belongings.", from.Name, root.Name );

						IPooledEnumerable eable = map.GetClientsInRange( from.Location, 8 );

						foreach ( NetState ns in eable )
						{
							if ( ns.Mobile != from )
								ns.Mobile.SendMessage( message );
						}

						eable.Free();
					}
				}

				if ( from.AccessLevel == AccessLevel.Player )
					Titles.AwardKarma( from, -4, true );

				if ( from.AccessLevel > AccessLevel.Player || from.CheckTargetSkill( SkillName.Snooping, cont, 0.0, 100.0 ) )
				{
					if ( cont is TrapableContainer && ((TrapableContainer)cont).ExecuteTrap( from ) )
						return;

					cont.DisplayTo( from );
				}
				else
				{
					from.SendLocalizedMessage( 500210 ); // You failed to peek into the container.
				}
			}
			else
			{
				from.SendLocalizedMessage( 500446 ); // That is too far away.
			}
		}
开发者ID:PepeBiondi,项目名称:runsa,代码行数:61,代码来源:Snooping.cs

示例4: Container_Snoop

		public static void Container_Snoop( Container cont, Mobile from )
		{
			/*if (!(from.Target is Stealing.StealingTarget) && DateTime.UtcNow < from.NextSkillTime)
			{
				from.SendMessage("You must wait a moment before you can snoop again.");
				return;
			}*/

			if ( from.AccessLevel > AccessLevel.Player || from.InRange( cont.GetWorldLocation(), 1 ) )
			{
				Mobile root = cont.RootParent as Mobile;

				if ( root != null )
				{
					if ( root.Alive )
					{
						if ( root.AccessLevel > AccessLevel.Player && from.AccessLevel == AccessLevel.Player )
						{
							from.SendLocalizedMessage( 500209 ); // You can not peek into the container.
							return;
						}
						else if ( from.AccessLevel == AccessLevel.Player && !CheckSnoopAllowed( from, root ) )
						{
							from.SendLocalizedMessage( 1001018 ); // You cannot perform negative acts on your target.
							return;
						}
						else if ( from.AccessLevel == AccessLevel.Player && from.Skills[SkillName.Snooping].Value < Utility.Random( 100 ) )
						{
							Map map = from.Map;

							if ( map != null )
							{
								root.SendMessage( String.Format( "You notice {0} attempting to peek into your belongings.", from.Name ) );

								string message = String.Format( "You notice {0} attempting to peek into {1}'s belongings.", from.Name, root.Name );

								IPooledEnumerable eable = map.GetClientsInRange( from.Location, 8 );

								foreach ( NetState ns in eable )
									if ( ns.Mobile != from && ns.Mobile != root )
										ns.Mobile.SendMessage( message );

								eable.Free();
							}
						}
					}
					else
						return;
				}

				if ( from.AccessLevel == AccessLevel.Player )
					Misc.Titles.AwardKarma(from, -4, true);

				if ( from.AccessLevel > AccessLevel.Player || from.CheckTargetSkill( SkillName.Snooping, cont, 0.0, 100.0 ) )
				{
					if (!(cont is TrapableContainer && ((TrapableContainer)cont).ExecuteTrap(from)))
					{
						cont.DisplayTo(from);

						//from.NextSkillTime = DateTime.UtcNow.AddSeconds(cont.Parent is Container ? 0.315 : 1.15);
					}
				}
				else
				{
					from.SendLocalizedMessage( 500210 ); // You failed to peek into the container.
					if ( from.Skills[SkillName.Hiding].Value / 2 < Utility.Random( 100 ) )
						from.RevealingAction();
				}
			}
			else
				from.SendLocalizedMessage( 500446 ); // That is too far away.
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:72,代码来源:Snooping.cs

示例5: RecurseOpen

            private static void RecurseOpen(Container c, Mobile from)
            {
                var parent = c.Parent as Container;

                if (parent != null)
                    RecurseOpen(parent, from);

                c.DisplayTo(from);
            }
开发者ID:Crome696,项目名称:ServUO,代码行数:9,代码来源:ShopMap.cs

示例6: OPENCONTAINERTO

			public static void OPENCONTAINERTO(TriggerObject trigObject, Container container, Mobile mob)
			{
				if (container != null && mob != null && mob.NetState != null)
				{
					container.DisplayTo(mob);
				}
			}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:7,代码来源:UberScriptFunctions.cs

示例7: Container_Snoop

        public static void Container_Snoop(Container cont, Mobile from)
        {
            if (from.AccessLevel > AccessLevel.Player || from.InRange(cont.GetWorldLocation(), 1))
            {
                Mobile root = cont.RootParent as Mobile;

                if (root != null && !root.Alive)
                    return;

                if (root != null && root.AccessLevel > AccessLevel.Player && from.AccessLevel == AccessLevel.Player)
                {
                    from.SendLocalizedMessage(500209); // You can not peek into the container.
                    return;
                }

                if (root != null && from.AccessLevel == AccessLevel.Player && !CheckSnoopAllowed(from, root))
                {
                    from.SendLocalizedMessage(1001018); // You cannot perform negative acts on your target.
                    return;
                }

                if (root != null && from.AccessLevel == AccessLevel.Player && from.Skills[SkillName.Snooping].Value < Utility.Random(100))
                {
                    Map map = from.Map;

                    if (map != null)
                    {
                        string message = String.Format("You notice {0} attempting to peek into {1}'s belongings.", from.Name, root.Name);

                        IPooledEnumerable eable = map.GetClientsInRange(from.Location, 8);

                        System.Collections.ArrayList list = new System.Collections.ArrayList();

                        foreach (NetState ns in eable)
                            list.Add( ns );

                        eable.Free();

                        foreach ( NetState ns in list )
                        {
                            if (ns == root.NetState)
                                root.SendAsciiMessage("You notice {0} attempting to peek into your belongings!", from.Name);
                            else if (ns != from.NetState)
                                ns.Mobile.SendAsciiMessage(message);
                        }
                    }
                }

                // custom change: only lose karma when snooping good guys
                if (from.AccessLevel == AccessLevel.Player && root != null && root.Karma > 0)
                    Titles.AwardKarma(from, -5, true);

                if (from.AccessLevel > AccessLevel.Player || from.CheckTargetSkill(SkillName.Snooping, cont, 0.0, 100.0))
                {
                    TrapableContainer tc = cont as TrapableContainer;

                    if ( from.AccessLevel == AccessLevel.Player && tc != null && tc.Trapped && tc.TrapType == TrapType.MagicTrap )
                        tc.ExecuteTrap( from );
                    cont.DisplayTo( from );
                }
                else
                {
                    from.SendLocalizedMessage(500210); // You failed to peek into the container.
                }
            }
            else
            {
                from.SendLocalizedMessage(500446); // That is too far away.
            }
        }
开发者ID:greeduomacro,项目名称:divinity,代码行数:70,代码来源:Snooping.cs


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