Example #1
0
		public bool Gate(Mobile m)
		{
			if (m == null || m.Deleted)
			{
				return false;
			}

			if (_Location.Internal || _Location.Zero)
			{
				m.SendMessage("That rune is blank.");
				return false;
			}

			if (m.Player)
			{
				var t = GetType();

				if (m.AccessLevel < AccessLevel.Counselor && !m.BeginAction(t))
				{
					m.SendMessage("You must wait before using the rune codex again.");
					return false;
				}

				GateTravelSpell spell = new GateTravelSpell(
					m, null, new RunebookEntry(_Location.Location, _Location.Map, _Description, null));

				if (!spell.Cast())
				{
					m.EndAction(t);
					return false;
				}

				Timer.DelayCall(TimeSpan.FromSeconds(3), () => m.EndAction(t));
			}
			else
			{
				_Location.MoveToWorld(m);
			}

			return true;
		}