Server.Items.Teleporter.DoTeleport C# (CSharp) Méthode

DoTeleport() public méthode

public DoTeleport ( Mobile m ) : void
m Mobile
Résultat void
		public virtual void DoTeleport(Mobile m)
		{
			Map map = m_MapDest;

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

			Point3D p = m_PointDest;

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

			Server.Mobiles.BaseCreature.TeleportPets(m, p, map);

			bool sendEffect = (!m.Hidden || m.AccessLevel == AccessLevel.Player);

			if (m_SourceEffect && sendEffect)
				Effects.SendLocationEffect(m.Location, m.Map, 0x3728, 10, 10);

			m.MoveToWorld(p, map);

			if (m_DestEffect && sendEffect)
				Effects.SendLocationEffect(m.Location, m.Map, 0x3728, 10, 10);

			if (m_SoundID > 0 && sendEffect)
				Effects.PlaySound(m.Location, m.Map, m_SoundID);
		}

Usage Example

        public override void OnResponse(NetState sender, RelayInfo info)
        {
            PlayerMobile pm = sender.Mobile as PlayerMobile;

            if (pm == null || !pm.InRange(Location, 5))
            {
                return;
            }

            switch (info.ButtonID)
            {
            case 2:     // Yes, and do not ask me again
            {
                pm.DisabledPvpWarning = true;
                pm.SendLocalizedMessage(1113796);         // You may use your avatar's context menu to re-enable the warning later.

                goto case 1;
            }

            case 1:     // Yes, I wish to proceed
            {
                //BaseCreature.TeleportPets(pm, m_Owner.PointDest, m_Owner.MapDest);
                //pm.MoveToWorld(m_Owner.PointDest, m_Owner.MapDest);
                if (Teleporter != null)
                {
                    Teleporter.DoTeleport(pm);
                }

                break;
            }

            case 0:     // No, I do not wish to proceed
            {
                break;
            }
            }
        }