Beispiel #1
0
        public virtual void OnExit(PvPRegion region, Mobile m)
        {
            if (region == null || m == null || m.Deleted)
            {
                return;
            }

            PlayerMobile pm = m as PlayerMobile;

            if (pm != null)
            {
                if (region.IsPartOf(BattleRegion))
                {
                    if (IsParticipant(pm))
                    {
                        Eject(pm, false);
                    }

                    pm.SendMessage("You have left {0}", Name);
                }
                else if (region.IsPartOf(SpectateRegion))
                {
                    pm.SendMessage("You have left {0} spectator area", Name);

                    if (IsSpectator(pm))
                    {
                        RemoveSpectator(pm, false);
                    }
                }
            }

            m.Delta(MobileDelta.Noto);
        }
Beispiel #2
0
        public virtual void OnEnter(PvPRegion region, Mobile m)
        {
            if (region == null || m == null || m.Deleted)
            {
                return;
            }

            PlayerMobile pm = m as PlayerMobile;

            if (pm != null)
            {
                if (region.IsPartOf(BattleRegion))
                {
                    pm.SendMessage("You have entered {0}", Name);
                }
                else if (region.IsPartOf(SpectateRegion))
                {
                    pm.SendMessage("You have entered {0} spectator area.", Name);

                    if (!IsSpectator(pm))
                    {
                        AddSpectator(pm, false);
                    }
                }
            }

            m.Delta(MobileDelta.Noto);
        }
Beispiel #3
0
 public static void InvokeExitBattle(PvPBattle battle, PvPRegion region, Mobile m)
 {
     if (OnExitBattle != null)
     {
         OnExitBattle(battle, region, m);
     }
 }
Beispiel #4
0
 public virtual void SerializeRegion(GenericWriter w, PvPRegion r)
 {
     if (r != null)
     {
         r.Serialize(w);
     }
 }
Beispiel #5
0
        public virtual void OnExit(PvPRegion region, Mobile m)
        {
            if (region == null || m == null || m.Deleted)
            {
                return;
            }

            if (region.IsPartOf(BattleRegion) && !m.InRegion(BattleRegion))
            {
                var pm = m as PlayerMobile;

                if (pm != null)
                {
                    if (IsParticipant(pm))
                    {
                        Quit(pm, false);
                    }

                    pm.SendMessage("You have left {0}", Name);
                }

                AutoPvP.InvokeExitBattle(this, region, m);
            }
            else if (region.IsPartOf(SpectateRegion) && !m.InRegion(SpectateRegion))
            {
                var pm = m as PlayerMobile;

                if (pm != null)
                {
                    pm.SendMessage("You have left {0} spectator area", Name);

                    if (IsSpectator(pm))
                    {
                        RemoveSpectator(pm, false);
                    }
                }

                AutoPvP.InvokeExitBattle(this, region, m);
            }

            m.Delta(MobileDelta.Noto);
        }
Beispiel #6
0
		public virtual void OnExit(PvPRegion region, Mobile m)
		{
			if (region == null || m == null || m.Deleted)
			{
				return;
			}

			var pm = m as PlayerMobile;

			if (pm != null)
			{
				if (region.IsPartOf(BattleRegion))
				{
					if (IsParticipant(pm))
					{
						Eject(pm, false);
					}

					pm.SendMessage("You have left {0}", Name);
				}
				else if (region.IsPartOf(SpectateRegion))
				{
					pm.SendMessage("You have left {0} spectator area", Name);

					if (IsSpectator(pm))
					{
						RemoveSpectator(pm, false);
					}
				}
			}

			m.Delta(MobileDelta.Noto);
		}
Beispiel #7
0
		public virtual void OnEnter(PvPRegion region, Mobile m)
		{
			if (region == null || m == null || m.Deleted)
			{
				return;
			}

			var pm = m as PlayerMobile;

			if (pm != null)
			{
				if (region.IsPartOf(BattleRegion))
				{
					pm.SendMessage("You have entered {0}", Name);
				}
				else if (region.IsPartOf(SpectateRegion))
				{
					pm.SendMessage("You have entered {0} spectator area.", Name);

					if (!IsSpectator(pm))
					{
						AddSpectator(pm, false);
					}
				}
			}

			m.Delta(MobileDelta.Noto);
		}