Server.Items.ConditionTeleporter.CanTeleport C# (CSharp) Méthode

CanTeleport() public méthode

public CanTeleport ( Mobile m ) : bool
m Mobile
Résultat bool
		public override bool CanTeleport(Mobile m)
		{
			if (!base.CanTeleport(m))
				return false;

			if (GetFlag(ConditionFlag.StaffOnly) && m.AccessLevel < AccessLevel.Counselor)
				return false;

			if (GetFlag(ConditionFlag.DenyMounted) && m.Mounted)
			{
				m.SendLocalizedMessage(1077252); // You must dismount before proceeding.
				return false;
			}

			if (GetFlag(ConditionFlag.DenyFollowers) && (m.Followers != 0))
			{
				m.SendLocalizedMessage(1077250); // No pets permitted beyond this point.
				return false;
			}

			Container pack = m.Backpack;

			if (pack != null)
			{
				if (GetFlag(ConditionFlag.DenyPackContents) && pack.TotalItems != 0)
				{
					m.SendMessage("You must empty your backpack before proceeding.");
					return false;
				}

				if (GetFlag(ConditionFlag.DenyPackEthereals) && (pack.FindItemByType(typeof(EtherealMount)) != null ))
				{
					m.SendMessage("You must empty your backpack of ethereal mounts before proceeding.");
					return false;
				}
			}

			if (GetFlag(ConditionFlag.DenyHolding) && m.Holding != null)
			{
				m.SendMessage("You must let go of what you are holding before proceeding.");
				return false;
			}

			if (GetFlag(ConditionFlag.DenyEquipment))
			{
				foreach (Item item in m.Items)
				{
					switch (item.Layer)
					{
						case Layer.Hair:
						case Layer.FacialHair:
						case Layer.Backpack:
						case Layer.Mount:
						case Layer.Bank:
							{
								continue; // ignore
							}
						default:
							{
								m.SendMessage("You must remove all of your equipment before proceeding.");
								return false;
							}
					}
				}
			}

			if (GetFlag(ConditionFlag.DenyTransformed) && m.IsBodyMod)
			{
				m.SendMessage("You cannot go there in this form.");
				return false;
			}

			if (GetFlag(ConditionFlag.DeadOnly) && m.Alive)
			{
				m.SendLocalizedMessage(1060014); // Only the dead may pass.
				return false;
			}

			return true;
		}