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


C# Mobile.MoveToWorld方法代码示例

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


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

示例1: OnMovement

        public override void OnMovement(Mobile m, Point3D oldLocation)
        {
            var pm = m as PlayerMobile;
            if (m.InRange(Location, 1) && m.Backpack != null && pm != null && DateTime.UtcNow >= pm.AsylumDoorNextUse)
            {
                if (KeyType == AsylumKeyType.None)
                {
                    if (TeleportLocation != Point3D.Zero)
                    {
                        pm.AsylumDoorNextUse = DateTime.UtcNow + TimeSpan.FromSeconds(60);
                        BaseCreature.TeleportPets(m, TeleportLocation, m.Map, false);
                        m.MoveToWorld(TeleportLocation, Map);
                    }
                }
                else
                {
                    if (SearchPackForItem(m.Backpack))
                    {
                        if (TeleportLocation != Point3D.Zero)
                        {
                            pm.AsylumDoorNextUse = DateTime.UtcNow + TimeSpan.FromSeconds(60);
                            BaseCreature.TeleportPets(m, TeleportLocation, m.Map, false);
                            m.MoveToWorld(TeleportLocation, Map);
                        }
                    }
                }
            }
            else if (pm != null && pm.InRange(Location, 1))
            {
                TimeSpan nextuse = pm.AsylumDoorNextUse - DateTime.UtcNow;
                pm.SendMessage("You cannot use an asylum door for another " + nextuse.Seconds + " seconds.");
            }

            base.OnMovement(m, oldLocation);
        }
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:35,代码来源:AsylumTeleportationDoor.cs

示例2: OnMoveOver

		public override bool OnMoveOver( Mobile m )
		{
			if( m.SolidHueOverride != -1 )
				return true;
		    if( m.Player && !m.Alive ) // mobile is dead
		    {
		        m.SolidHueOverride = -1;

		        if( m_TargetMap != null && m_TargetMap != Map.Internal )
		        {
		            m.MoveToWorld( m_Target, m_TargetMap );
		            BaseCreature.TeleportPets( m, m_Target, m_TargetMap );
		        }
		        else
		            m.SendAsciiMessage( "This has not yet been activated" );

		        m.Combatant = null;
		        m.Warmode = false;
		        m.Resurrect();
		        return false;
		    }
		    if( ( m.Player ) && ( m.Hits < m.HitsMax ) )
		        m.LocalOverheadMessage( MessageType.Regular, 906, true, "You do not have full HP." );
		    else if( m.Player && m.SolidHueOverride != 2535 )
		    {
		        new RuneTimer( this, m ).Start();
		        m.SolidHueOverride = 2535;
		    }

		    return true;
		}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:31,代码来源:PitsRune.cs

示例3: OnDoubleClick

		public override void OnDoubleClick( Mobile m )
		{
			if ( !m_Active )
				return;

			Map map = m_MapDest;

			if ( map == null || map == Map.Internal )
				map = m.Map;

			Point3D p = m_PointDest;

			if ( p == Point3D.Zero )
				p = m.Location;

			if ( m.InRange( this, 3 ) )
			{
				Server.Mobiles.BaseCreature.TeleportPets( m, m_PointDest, m_MapDest );

				m.MoveToWorld( m_PointDest, m_MapDest );
			}
			else
			{
				m.SendLocalizedMessage( 1019045 ); // I can't reach that.
			}
		}
开发者ID:Godkong,项目名称:RunUO,代码行数:26,代码来源:KhaldunPitTeleporter.cs

示例4: OnMoveOver

		public override bool OnMoveOver( Mobile m )
		{
			if( m.SolidHueOverride != -1 )
				return true;
			else if( m.Player && !m.Alive ) // mobile is dead
			{
				m.SolidHueOverride = -1;

				if( m_TargetMap != null && m_TargetMap != Map.Internal )
				{
					m.MoveToWorld( m_Target, m_TargetMap );
					BaseCreature.TeleportPets( m, m_Target, m_TargetMap );
				}
				else
					m.SendAsciiMessage( "This has not yet been activated" );

				m.Combatant = null;
				m.Warmode = false;
				m.Resurrect();
				return false;
			}
			else if( ( m.Player ) && ( m.Hits < m.HitsMax ) )
				m.LocalOverheadMessage( MessageType.Regular, 906, true, "For liablity issues, we require all visitors to be in perfect health!" );
			else if( m.Player && m.SolidHueOverride != 2544 )
			{
                m_CasinoTimer = new CasinoTimer(this, m);
                m_CasinoTimer.Start();				
				m.SolidHueOverride = 2544;
				m.SendAsciiMessage( "You are about to enter the Casino!" );
			}

			return true;
		}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:33,代码来源:CasinoEntrance.cs

示例5: Teleport

        public bool Teleport(Mobile m)
        {
            if (m_TargetMap != null && m_TargetMap != Map.Internal && m_TargetLocation != Point3D.Zero)
            {
                m.MoveToWorld(m_TargetLocation, m_TargetMap);
                return false;
            }

            return true;
        }
开发者ID:FreeReign,项目名称:imaginenation,代码行数:10,代码来源:CustomGameEventSupplier.cs

示例6: TeleportToFerry

        public static void TeleportToFerry(Mobile from)
        {
            Point3D loc = new Point3D(408, 251, 2);
            Map map = Map.Malas;

            Effects.SendLocationParticles(EffectItem.Create(loc, map, EffectItem.DefaultDuration), 0x3728, 10, 10, 0, 0, 2023, 0);
            Effects.PlaySound(loc, map, 0x1FE);

            BaseCreature.TeleportPets(from, loc, map);

            from.MoveToWorld(loc, map);
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:12,代码来源:Chyloth.cs

示例7: OnDoubleClick

 public override void OnDoubleClick(Mobile from)
 {
     if (from.InRange(this.Location, 2))
     {
         if (!this.m_Locked && this.m_Active)
         {
             from.MoveToWorld(this.m_PointDest, this.m_MapDest);
             from.SendLocalizedMessage(1072790); // The wall becomes transparent, and you push your way through it.
         }
         else
             from.Say(502684); // This door appears to be locked.
     }
 }
开发者ID:Crome696,项目名称:ServUO,代码行数:13,代码来源:SecretWallTeleporters.cs

示例8: OnDoubleClick

		public override void OnDoubleClick( Mobile m )
		{
			if ( !m.InRange( this.GetWorldLocation(), 3 ) )
				return;
			if ( m_Controller.Enabled )
				return;

			if ( (m_Wanderer == null || !m_Wanderer.Alive) )
			{
				m_Wanderer = new WandererOfTheVoid();
				m_Wanderer.MoveToWorld( LeverPuzzleController.lr_Enter, Map.Malas );
				m_Wanderer.PublicOverheadMessage( MessageType.Regular, 0x3B2, 1060002, "" ); // I am the guardian of...
				Timer.DelayCall( TimeSpan.FromSeconds( 5.0 ), new TimerCallback( CallBackMessage ) );
			}
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:15,代码来源:LeverPuzzleItems.cs

示例9: OnDoubleClick

		public override void OnDoubleClick( Mobile from )
		{
			if ( from.InRange( this, 2 ) )
			{
				Map map = Map;

				if ( map == Map.Trammel || map == Map.Felucca )
				{
					from.MoveToWorld( new Point3D( 5922, 2024, 0 ), map );
					PublicOverheadMessage( MessageType.Regular, 0x3B2, true, String.Format( "* {0} dives into the hole and disappears!*", from.Name ) ); 
				}
			}
			else
				from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:15,代码来源:SolenAntHole.cs

示例10: UseGate

		public override void UseGate( Mobile m )
		{
			if ( MateGate == null || MateGate.Deleted )
			{
				Console.WriteLine( "The Gate at {0} is missing it's mate", this.Location.ToString() );
				return;
			}
			m_Target = MateGate.Location;
			m_TargetMap = MateGate.Map;
			
			int flags = m.NetState == null ? 0 : (int)m.NetState.Flags;

			if ( Factions.Sigil.ExistsOn( m ) )
			{
				m.SendLocalizedMessage( 1061632 ); // You can't do that while carrying the sigil.
			}
			else if ( m_TargetMap == Map.Felucca && m is PlayerMobile && ((PlayerMobile)m).Young )
			{
				m.SendLocalizedMessage( 1049543 ); // You decide against traveling to Felucca while you are still young.
			}
			else if ( (m.Kills >= 5 && m_TargetMap != Map.Felucca) || ( m_TargetMap == Map.Tokuno && (flags & 0x10) == 0 ) || ( m_TargetMap == Map.Malas && (flags & 0x8) == 0 ) || ( m_TargetMap == Map.Ilshenar && (flags & 0x4) == 0 ) )
			{
				m.SendLocalizedMessage( 1019004 ); // You are not allowed to travel there.
			}
			else if ( m.Spell != null )
			{
				m.SendLocalizedMessage( 1049616 ); // You are too busy to do that at the moment.
			}
			else if ( m_TargetMap != null && m_TargetMap != Map.Internal )
			{
				BaseCreature.TeleportPets( m, m_Target, m_TargetMap );

				m.MoveToWorld( m_Target, m_TargetMap );

				m.PlaySound( 0x1FE );

				OnGateUsed( m );
			}
			else
			{
				m.SendMessage( "This moongate does not seem to go anywhere." );
			}
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:43,代码来源:LinkedGate.cs

示例11: OnTarget

			protected override void OnTarget(Mobile from, object o)
			{
				if (o is BaseCreature)
				{
					if (((BaseCreature)o).Spawner != null)
					{
						BaseCreature bc = (BaseCreature)o;
						from.MoveToWorld(bc.Spawner.Location, bc.Spawner.Map);
					}
					else
					{
						from.SendMessage("That mobile is homeless");
					}
				}
				else
				{
					from.SendMessage("Why would that have a spawner?");
				}
			}
开发者ID:zerodowned,项目名称:angelisland,代码行数:19,代码来源:Spawner.cs

示例12: OnDoubleClick

		public override void OnDoubleClick( Mobile from )
		{
			if ( !from.InRange( GetWorldLocation(), 2 ) )
			{
				from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
				return;
			}

			MLQuestContext context;

			if ( from is PlayerMobile && ( context = MLQuestSystem.GetContext( (PlayerMobile)from ) ) != null && context.BedlamAccess )
			{
				BaseCreature.TeleportPets( from, PointDest, MapDest );
				from.MoveToWorld( PointDest, MapDest );
			}
			else
			{
				from.SendLocalizedMessage( 1074276 ); // You press and push on the iron maiden, but nothing happens.
			}
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:20,代码来源:BedlamTeleporter.cs

示例13: OnDoubleClick

 public override void OnDoubleClick(Mobile from)
 {
     if (from.InRange(GetWorldLocation(), 2) && from.InLOS(this))
     {
         if (GuildID != -1 && from.Guild != null && !(from.Guild.Disbanded))
         {
             if (from.Guild.Id == GuildID)
             {
                 from.MoveToWorld(this.Location, this.Map);
                 Effects.SendLocationParticles(EffectItem.Create(from.Location, from.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 2023);
                 from.PlaySound(510);
                 return;
             }
         }
         else
         from.SendAsciiMessage("You cannot use that!");
     }
     else
         from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
 }
开发者ID:FreeReign,项目名称:imaginenation,代码行数:20,代码来源:GuildDoor.cs

示例14: Followers_OnTarget

        public static void Followers_OnTarget(Mobile from, object obj)
        {
            if (from == null || from.Deleted)
            {
                return;
            }

            var master = obj as PlayerMobile;
            var pet = obj as BaseCreature;

            if (master != null)
            {
                var pets = World.Mobiles.Values.OfType<BaseCreature>().Where(bc => (bc.Controlled && bc.ControlMaster == master) || (bc.Summoned && bc.SummonMaster == master)).ToList();

                from.CloseGump(typeof(FollowersGump));
                from.SendGump(new FollowersGump(pets, master));
            }
            else if (pet != null)
            {
                if (pet.Controlled && pet.ControlMaster != null)
                {
                    if (pet.ControlMaster == from)
                    {
                        from.SendMessage("You found your own pet!");
                    }
                    if (pet.ControlMaster.Map == Map.Internal)
                    {
                        from.SendMessage("The owner of this pet is currently not online.");
                    }
                    else
                    {
                        from.MoveToWorld(pet.ControlMaster.Location, pet.ControlMaster.Map);
                        from.SendMessage("You have been moved to the creatures master: {0}.", pet.ControlMaster.Name);
                    }
                }
                else
                {
                    from.SendMessage("That creature is unowned.");
                }
            }
        }
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:41,代码来源:ShowFollowers.cs

示例15: OnDoubleClick

        public override void OnDoubleClick(Mobile from)
        { 
            if (from.NetState == null || !from.NetState.SupportsExpansion(Expansion.ML))
            {
                from.SendLocalizedMessage(1072608); // You must upgrade to the Mondain's Legacy expansion in order to enter here.				
                return;
            }
            else if (!MondainsLegacy.Labyrinth && (int)from.AccessLevel < (int)AccessLevel.GameMaster)
            {
                from.SendLocalizedMessage(1042753, "Labyrinth"); // ~1_SOMETHING~ has been temporarily disabled.
                return;
            }
		
            if (from.InRange(this.Location, 2))
            {
                Point3D p = new Point3D(330, 1973, 0);
				
                BaseCreature.TeleportPets(from, p, this.Map);
                from.MoveToWorld(p, this.Map);
            }
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:21,代码来源:LabyrinthTeleporters.cs


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