SetMountBlock() public méthode

public SetMountBlock ( BlockMountType type, TimeSpan duration, bool dismount ) : void
type BlockMountType
duration TimeSpan
dismount bool
Résultat void
Exemple #1
0
        public void DoDismount()
        {
            List <Mobile> targets = new List <Mobile>();

            IPooledEnumerable eable = GetMobilesInRange(12);

            foreach (Mobile mob in eable)
            {
                if (!CanBeHarmful(mob) || mob == this)
                {
                    continue;
                }

                if (mob is BaseCreature && (((BaseCreature)mob).Controlled || ((BaseCreature)mob).Summoned || ((BaseCreature)mob).Team != Team))
                {
                    targets.Add(mob);
                }
                else if (mob is PlayerMobile && mob.Alive)
                {
                    targets.Add(mob);
                }
            }
            eable.Free();

            PlaySound(0x2F3);
            for (int i = 0; i < targets.Count; ++i)
            {
                Mobile m = targets[i];

                if (m != null && !m.Deleted && m is PlayerMobile)
                {
                    PlayerMobile pm = m as PlayerMobile;

                    if (pm != null && (pm.Mounted || pm.Flying))
                    {
                        pm.SetMountBlock(BlockMountType.DismountRecovery, TimeSpan.FromSeconds(10), true);
                    }
                }

                double damage = m.Hits * 0.6;
                if (damage < 10.0)
                {
                    damage = 10.0;
                }
                else if (damage > 75.0)
                {
                    damage = 75.0;
                }

                DoHarmful(m);
                AOS.Damage(m, this, (int)damage, 100, 0, 0, 0, 0);
                if (m.Alive && m.Body.IsHuman && !m.Mounted)
                {
                    m.Animate(20, 7, 1, true, false, 0);
                }
            }


            m_NextDismount = DateTime.UtcNow + TimeSpan.FromMinutes(2);
        }
Exemple #2
0
        public void Earthquake()
        {
            Map map = Map;

            if (map == null)
            {
                return;
            }
            ArrayList         targets = new ArrayList();
            IPooledEnumerable eable   = GetMobilesInRange(8);

            foreach (Mobile m in eable)
            {
                if (m == this || !CanBeHarmful(m))
                {
                    continue;
                }
                if (m is BaseCreature && (((BaseCreature)m).Controlled || ((BaseCreature)m).Summoned || ((BaseCreature)m).Team != Team))
                {
                    targets.Add(m);
                }
                else if (m.Player)
                {
                    targets.Add(m);
                }
            }
            eable.Free();
            PlaySound(0x2F3);
            for (int i = 0; i < targets.Count; ++i)
            {
                Mobile m = (Mobile)targets[i];
                if (m != null && !m.Deleted && m is PlayerMobile)
                {
                    PlayerMobile pm = m as PlayerMobile;
                    if (pm != null && pm.Mounted)
                    {
                        pm.SetMountBlock(BlockMountType.DismountRecovery, TimeSpan.FromSeconds(10), true);
                    }
                }
                double damage = m.Hits * 0.6;//was .6
                if (damage < 10.0)
                {
                    damage = 10.0;
                }
                else if (damage > 75.0)
                {
                    damage = 75.0;
                }
                DoHarmful(m);
                AOS.Damage(m, this, (int)damage, 100, 0, 0, 0, 0);
                if (m.Alive && m.Body.IsHuman && !m.Mounted)
                {
                    m.Animate(20, 7, 1, true, false, 0); // take hit
                }
            }
        }
Exemple #3
0
		public virtual void InvalidateStrayPlayer(PlayerMobile player)
		{
			if (player == null || player.Deleted || player.Region == null || State == PvPBattleState.Internal || Hidden)
			{
				return;
			}

			if (player.Region.IsPartOf(SpectateRegion))
			{
				if (IsParticipant(player))
				{
					Eject(player, false);
				}

				if (!IsSpectator(player))
				{
					AddSpectator(player, false);
				}
			}
			else if (player.Region.IsPartOf(BattleRegion))
			{
				if (IsParticipant(player))
				{
					if (IsSpectator(player))
					{
						RemoveSpectator(player, false);
					}

					if (IsQueued(player))
					{
						Queue.Remove(player);
					}

					if (DebugMode || player.AccessLevel < AccessLevel.Counselor)
					{
						if (player.Flying && !Options.Rules.CanFly)
						{
							player.Flying = false;
						}

						if (player.Mounted)
						{
							if ((player.Mount is EtherealMount && !Options.Rules.CanMountEthereal) ||
								(player.Mount is BaseMount && !Options.Rules.CanMount))
							{
								player.SetMountBlock(BlockMountType.None, TimeSpan.FromSeconds(3), true);
							}
						}
					}
				}
				else if (!IsSpectator(player))
				{
					if ((DebugMode || player.AccessLevel < AccessLevel.Counselor) && SpectateAllowed)
					{
						AddSpectator(player, true);
					}
					else if (player.AccessLevel < AccessLevel.Counselor)
					{
						Eject(player, true);
					}
				}
			}
		}