public override void OnDoubleClick(Mobile from) { CustomRegion cR = from.Region as CustomRegion; if (!IsChildOf(from.Backpack)) { from.SendLocalizedMessage(1060640); // "This item must be in your backpack to use it" return; } if (PointDest == Point3D.Zero || MapDest == null || MapDest == Map.Internal) { from.SendAsciiMessage("This waystone does not lead anywhere"); return; } if (m_TeleportTimer != null && m_TeleportTimer.Running) { from.SendAsciiMessage("You stop the timer"); m_TeleportTimer.Stop(); return; } if (cR != null && !cR.Controller.CanUseStuckMenu) { from.SendAsciiMessage("You cannot use a waystone in this region"); return; } if (from.Region.IsPartOf(typeof(Jail))) { from.SendLocalizedMessage(1114345, "", 0x35); // You'll need a better jailbreak plan than that! return; } if (from.Hits < from.HitsMax) { from.SendAsciiMessage("You must be fully healed to use this"); return; } m_Origin = from.Location; from.SendAsciiMessage(string.Format("You will be teleported in {0} seconds", Delay)); m_TeleportTimer = new TeleportTimer(this, from); m_TeleportTimer.Start(); }
public override bool OnMoveOver(Mobile m) { if (m.SolidHueOverride != -1) { return(true); } if (m.IsInEvent && !AllowIsInEvent) { m.SendAsciiMessage("You cannot use this while in an event"); return(true); } if (m is PlayerMobile && !m.Alive && !AllowDead) { m.SendAsciiMessage("You cannot use this while dead"); return(true); } if (!AllowMounted && m.Player && m.Mounted) { m.SendAsciiMessage("You cannot use this while mounted"); return(true); } if (m is PlayerMobile && ((!m.Alive && AllowDead && DeadTeleInstantly) || DelayWithCount <= 0)) { if (!base.OnMoveOver(m)) { if (!m.Alive && ResurrectDead) { m.Resurrect(); } return(false); } return(true); } if ((m is PlayerMobile) && (m.Hits < m.HitsMax) && MustBeFullyHealed && m.Alive) { m.LocalOverheadMessage(MessageType.Regular, 906, true, "You must be fully healed to use this!"); return(true); } if (CombatCheck && SpellHelper.CheckCombat(m)) { m.SendLocalizedMessage(1005564, "", 0x22); // Wouldst thou flee during the heat of battle?? return(true); } if (!AllowCriminals && (m.Criminal || Misc.NotorietyHandlers.IsGuardCandidate(m))) { m.SendAsciiMessage("Criminals or murderers can't use this teleporter!"); return(true); } if (m is PlayerMobile && m.SolidHueOverride != OnMoveOverHue) { m_TeleportTimer = new TeleportTimer(this, m); m_TeleportTimer.Start(); m.SolidHueOverride = OnMoveOverHue; if (!String.IsNullOrEmpty(OnMoveOverMessage)) { m.SendAsciiMessage(OnMoveOverMessage); } return(true); } return(true); }
public override bool OnMoveOver( Mobile m ) { if (m.SolidHueOverride != -1) return true; if (m.IsInEvent && !AllowIsInEvent) { m.SendAsciiMessage("You cannot use this while in an event"); return true; } if (m is PlayerMobile && !m.Alive && !AllowDead) { m.SendAsciiMessage("You cannot use this while dead"); return true; } if (!AllowMounted && m.Player && m.Mounted) { m.SendAsciiMessage("You cannot use this while mounted"); return true; } if( m is PlayerMobile && ((!m.Alive && AllowDead && DeadTeleInstantly) || DelayWithCount <= 0) ) { if (!base.OnMoveOver(m)) { if (!m.Alive && ResurrectDead) m.Resurrect(); return false; } return true; } if ((m is PlayerMobile) && (m.Hits < m.HitsMax) && MustBeFullyHealed && m.Alive) { m.LocalOverheadMessage(MessageType.Regular, 906, true, "You must be fully healed to use this!"); return true; } if (CombatCheck && SpellHelper.CheckCombat(m)) { m.SendLocalizedMessage(1005564, "", 0x22); // Wouldst thou flee during the heat of battle?? return true; } if (!AllowCriminals && (m.Criminal || Misc.NotorietyHandlers.IsGuardCandidate(m))) { m.SendAsciiMessage("Criminals or murderers can't use this teleporter!"); return true; } if (m is PlayerMobile && m.SolidHueOverride != OnMoveOverHue) { m_TeleportTimer = new TeleportTimer(this, m); m_TeleportTimer.Start(); m.SolidHueOverride = OnMoveOverHue; if (!String.IsNullOrEmpty(OnMoveOverMessage)) m.SendAsciiMessage(OnMoveOverMessage); return true; } return true; }