Example #1
0
            protected override void OnTarget(Mobile from, object target)
            {
                if (target is PlayerHouseTeleporter)
                {
                    PlayerHouseTeleporter mt = target as PlayerHouseTeleporter;

                    m_Pad.Target = mt;
                    mt.Target    = m_Pad;

                    if (m_Pad.Charges > mt.Charges || mt.Charges > m_Pad.Charges)
                    {
                        int c1    = mt.Charges;
                        int c2    = m_Pad.Charges;
                        int total = c1 + c2 / 2;

                        m_Pad.Charges = total;
                        mt.Charges    = total;

                        from.SendLocalizedMessage(1115119);                           //The two House Teleporters are now linked and the charges remaining have been rebalanced.
                    }
                    else
                    {
                        from.SendLocalizedMessage(1114919);                           //The two House Teleporters are now linked.
                    }
                }
                else
                {
                    from.SendMessage("That is not a valid target.");
                }
            }
Example #2
0
        public void ConsumeCharges(PlayerHouseTeleporter pad)
        {
            PlayerHouseTeleporter target = pad.Target as PlayerHouseTeleporter;

            pad.Charges -= 1;

            if (pad.Target != null)
            {
                target.Charges -= 1;
            }
        }
Example #3
0
        public override bool OnMoveOver(Mobile m)
        {
            if (m_Target != null && !m_Target.Deleted)
            {
                if (CheckAccess(m))
                {
                    if (!m.Hidden || m.AccessLevel == AccessLevel.Player)
                    {
                        new EffectTimer(Location, Map, 2023, 0x1F0, TimeSpan.FromSeconds(0.4)).Start();
                    }

                    PlayerHouseTeleporter pht = m_Target as PlayerHouseTeleporter;

                    if (this.Charges == 0 && !IsRewardItem)
                    {
                        m.SendLocalizedMessage(1115120);                           //There are no charges left in this teleporter.
                    }
                    else if (pht.Charges == 0 && !IsRewardItem)
                    {
                        m.SendLocalizedMessage(1115121);                           //There are no more charges left in the remote teleporter.
                    }
                    else if (m_Target.Movable == false)
                    {
                        m.SendLocalizedMessage(1113858);                           //This teleporter does not have a valid destination.
                    }
                    else if (this.Map != Map.Felucca && pht.Map == Map.Felucca)
                    {
                        m.CloseGump(typeof(PlayerHouseTeleporterConfirmGump));
                        m.SendGump(new PlayerHouseTeleporterConfirmGump(m, this));
                    }
                    else
                    {
                        this.ConsumeCharges(this);
                        new DelayTimer(this, m).Start();
                    }
                }
                else
                {
                    m.SendLocalizedMessage(1061637);                       // You are not allowed to access this.
                }
            }

            return(true);
        }
Example #4
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (info.ButtonID == 1)
            {
                PlayerHouseTeleporter pht    = m_Pad as PlayerHouseTeleporter;
                PlayerHouseTeleporter target = pht.Target as PlayerHouseTeleporter;

                Point3D p   = target.GetWorldTop();
                Map     map = target.Map;

                Server.Mobiles.BaseCreature.TeleportPets(m_From, p, map);
                m_From.MoveToWorld(p, map);

                if (!pht.IsRewardItem)
                {
                    pht.ConsumeCharges(pht);
                }
            }
        }
			public DelayTimer( PlayerHouseTeleporter tp, Mobile m ) : base( TimeSpan.FromSeconds( 1.0 ) )
			{
				m_Teleporter = tp;
				m_Mobile = m;
			}
			public TargetTarget( PlayerHouseTeleporter pad ) : base( 1, false, TargetFlags.None )
			{
				m_Pad = pad;
			}
		public void ConsumeCharges( PlayerHouseTeleporter pad )
		{
			PlayerHouseTeleporter target = pad.Target as PlayerHouseTeleporter;

			pad.Charges -= 1;
		
			if ( pad.Target != null )
				target.Charges -= 1;
		}
Example #8
0
 public DelayTimer(PlayerHouseTeleporter tp, Mobile m) : base(TimeSpan.FromSeconds(1.0))
 {
     m_Teleporter = tp;
     m_Mobile     = m;
 }
Example #9
0
 public TargetTarget(PlayerHouseTeleporter pad) : base(1, false, TargetFlags.None)
 {
     m_Pad = pad;
 }