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


C# LockableContainer.GetWorldLocation方法代码示例

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


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

示例1: Target

        public void Target( LockableContainer targ )
        {
            if ( Multis.BaseHouse.CheckLockedDownOrSecured( targ ) )
            {
                // You cannot cast this on a locked down item.
                Caster.LocalOverheadMessage( MessageType.Regular, 0x22, 501761 );
            }
            else if ( targ.Locked || targ.LockLevel == 0 || targ is ParagonChest )
            {
                // Target must be an unlocked chest.
                Caster.SendLocalizedMessage( 501762 );
            }
            else if ( CheckSequence() )
            {
                SpellHelper.Turn( Caster, targ );

                Point3D loc = targ.GetWorldLocation();

                Effects.SendLocationParticles(
                    EffectItem.Create( loc, targ.Map, EffectItem.DefaultDuration ),
                    0x376A, 9, 32, 5020 );

                Effects.PlaySound( loc, targ.Map, 0x1FA );

                // The chest is now locked!
                Caster.LocalOverheadMessage( MessageType.Regular, 0x3B2, 501763 );

                targ.LockLevel = -255; // signal magic lock
                targ.Locked = true;
            }

            FinishSequence();
        }
开发者ID:justdanofficial,项目名称:khaeros,代码行数:33,代码来源:MagicLock.cs

示例2: Target

        public void Target( LockableContainer targ )
        {
            if ( targ.Locked || targ.LockLevel == 0 || targ.MaxLockLevel == 0 )
            {
                Caster.SendLocalizedMessage( 501762 ); // Target must be an unlocked chest.
            }
            else if ( targ.MaxLockLevel > 65 )
            {
                Caster.SendAsciiMessage( "This chest cannot be magically locked." );
            }
            else if ( CheckSequence() )
            {
                SpellHelper.Turn( Caster, targ );

                Point3D loc = targ.GetWorldLocation();

                Effects.SendLocationParticles(
                    EffectItem.Create( loc, targ.Map, EffectItem.DefaultDuration ),
                    0x376A, 9, 32, 5020 );

                Effects.PlaySound( loc, targ.Map, 0x1FA );

                // The chest is now locked!
                Caster.LocalOverheadMessage( MessageType.Regular, 0x3B2, 501763 );

                targ.LockLevel = -255; // signal magic lock
                targ.Locked = true;
            }

            FinishSequence();
        }
开发者ID:FreeReign,项目名称:Rebirth-Repack,代码行数:31,代码来源:MagicLock.cs

示例3: Target

		public void Target( LockableContainer targ )
		{
			if ( Multis.BaseHouse.CheckSecured( targ ) )
			{
				// You cannot cast this on a secure item.
				Caster.SendLocalizedMessage( 503098 );
			}
			else if ( CheckSequence() )
			{
				SpellHelper.Turn( Caster, targ );

				Point3D loc = targ.GetWorldLocation();

				Effects.SendLocationParticles(
					EffectItem.Create( loc, targ.Map, EffectItem.DefaultDuration ),
					0x376A, 9, 32, 5024 );

				Effects.PlaySound( loc, targ.Map, 0x1FF );

				if ( targ.Locked && targ.LockLevel != 0 )
				{
					double magery = Caster.Skills[SkillName.Magery].Value;
					int level = (int)(magery * 0.8) - 4;

					if ( targ.LockLevel == -255 )
					{
						targ.Locked = false;
						FinishSequence();
						return;
					}
					if ( level >= targ.RequiredSkill && !(targ is TreasureMapChest && ((TreasureMapChest)targ).Level > 2) )
					{
						targ.Locked = false;

						

						if ( targ.LockLevel == 0 )
							targ.LockLevel = -1;
					}
					else
					{
						// My spell does not seem to have an effect on that lock.
						Caster.LocalOverheadMessage( MessageType.Regular, 0x3B2, 503099 );
					}
				}
				else
				{
					// That did not need to be unlocked.
					Caster.LocalOverheadMessage( MessageType.Regular, 0x3B2, 503101 );
				}
			}

			FinishSequence();
		}
开发者ID:zerodowned,项目名称:angelisland,代码行数:54,代码来源:Unlock.cs

示例4: Target

        public void Target( LockableContainer targ )
        {
            if ( CheckSequence() )
            {
                SpellHelper.Turn( Caster, targ );

                Point3D loc = targ.GetWorldLocation();

                Effects.SendLocationParticles(
                    EffectItem.Create( loc, targ.Map, EffectItem.DefaultDuration ),
                    0x376A, 9, 32, 5024 );

                Effects.PlaySound( loc, targ.Map, 0x1FF );

                if ( targ.Locked )
                {
                    if ( targ.LockLevel != 0 && ( targ.LockLevel == -255 || ( targ.MaxLockLevel <= 50 && Caster.Skills[SkillName.Magery].Value > targ.RequiredSkill ) ) )
                    {
                        targ.Locked = false;

                        if ( targ.LockLevel == -255 )
                        {
                            targ.LockLevel = targ.MaxLockLevel - 30;

                            if ( targ.RequiredSkill < targ.LockLevel )
                                targ.LockLevel = targ.RequiredSkill;

                            if ( targ.LockLevel < 1 )
                                targ.LockLevel = 1;
                        }
                    }
                    else
                    {
                        // My spell does not seem to have an effect on that lock.
                        Caster.LocalOverheadMessage( MessageType.Regular, 0x3B2, 503099 );
                    }
                }
                else
                {
                    // That did not need to be unlocked.
                    Caster.LocalOverheadMessage( MessageType.Regular, 0x3B2, 503101 );
                }
            }

            FinishSequence();
        }
开发者ID:FreeReign,项目名称:Rebirth-Repack,代码行数:46,代码来源:Unlock.cs

示例5: Verify

		private int Verify( LockableContainer container )
		{
			if ( container == null || container.KeyValue == 0 )
				return 1005638; // You can only trap lockable chests.
			if ( From.Map != container.Map || !From.InRange( container.GetWorldLocation(), 2 ) )
				return 500446; // That is too far away.
			if ( !container.Movable )
				return 502944; // You cannot trap this item because it is locked down.
			if ( !container.IsAccessibleTo( From ) )
				return 502946; // That belongs to someone else.
			if ( container.Locked )
				return 502943; // You can only trap an unlocked object.
			if ( container.TrapType != TrapType.None )
				return 502945; // You can only place one trap on an object at a time.

			return 0;
		}
开发者ID:greeduomacro,项目名称:unknown-shard-1,代码行数:17,代码来源:DefTinkering.cs

示例6: Verify

        private int Verify( LockableContainer container )
        {
            if (container == null || container.KeyValue == 0)
            {
                From.SendAsciiMessage("You can only trap lockable chests.");
                return 1005638; // You can only trap lockable chests.
            }
            if (From.Map != container.Map || !From.InRange(container.GetWorldLocation(), 2))
            {
                int OldHue = From.SpeechHue;
                From.SpeechHue = 0;
                From.SayTo(From, true, "I can't reach that.");
                From.SpeechHue = OldHue;
                return 500446; // That is too far away.
            }
            if (!container.Movable)
            {
                return 502944; // You cannot trap this item because it is locked down.
            }
            if (!container.IsAccessibleTo(From))
            {
                From.SendAsciiMessage("That belongs to someone else.");
                return 502946; // That belongs to someone else.
            }
            if (container.Locked)
            {
                From.SendAsciiMessage("You can only trap an unlocked object.");
                return 502943; // You can only trap an unlocked object.
            }
            if (container.TrapType != TrapType.None)
            {
                From.SendAsciiMessage("You can only place one trap on an object at a time.");
                return 502945; // You can only place one trap on an object at a time.
            }

            return 0;
        }
开发者ID:Godkong,项目名称:RunUO,代码行数:37,代码来源:DefTinkering.cs


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