示例#1
0
 public override bool OnMoveOver(Mobile m)
 {
     if (m.Player && m.Criminal)
     {
         m.SendLocalizedMessage(1005561, "", 0x22);                       // Thou'rt a criminal and cannot escape so easily.
         return(true);
     }
     else if (m is BaseOverland && (m as BaseOverland).GateTravel == false)
     {                       // overland mobs are afraid of magic and will not enter!
         BaseOverland bo = m as BaseOverland;
         bo.OnMoongate();
         return(true);
     }
     else
     {                   // Adam: there is an exploit where you drop a preview house on top of a gate.
         //  the GateTo checker below will send the exploiters to jail if that's the case
         bool jail;
         if (SpellHelper.CheckTravel(m.Map, this.Target, TravelCheckType.GateTo, m, out jail))
         {
             return(base.OnMoveOver(m));
         }
         else
         {
             if (jail == true)
             {
                 Point3D jailCell = new Point3D(5295, 1174, 0);
                 m.MoveToWorld(jailCell, m.Map);
             }
             return(false);
         }
     }
 }
示例#2
0
 public virtual void UseGate(Mobile m)
 {
     if (CheckSpecialRestrictions(m) == false)
     {
         m.SendMessage("You cannot use this moongate.");
     }
     //else if ( m.Murderer && m_TargetMap != Map.Felucca )
     //{
     //m.SendLocalizedMessage( 1019004 ); // You are not allowed to travel there.
     //}
     else if (m.Spell != null)
     {
         m.SendLocalizedMessage(1049616);                 // You are too busy to do that at the moment.
     }
     else if (m is BaseOverland && (m as BaseOverland).GateTravel == false)
     {                   // overland mobs are afraid of magic and will not enter!
         BaseOverland bo = m as BaseOverland;
         bo.OnMoongate();
     }
     else if (m_TargetMap != null && m_TargetMap != Map.Internal)
     {
         bool jail;
         // DestinationOverride lets us go places usually restricted by CheckTravel()
         if (DestinationOverride || SpellHelper.CheckTravel(m_TargetMap, m_Target, TravelCheckType.GateTo, m, out jail))
         {
             BaseCreature.TeleportPets(m, m_Target, m_TargetMap);
             // Adam: for now, this an allowed means of transportation of heavy objects
             // m.DropHolding();
             m.MoveToWorld(m_Target, m_TargetMap);
             m.PlaySound(0x1FE);
             OnGateUsed(m);
         }
         else
         {
             if (jail == true)
             {
                 Point3D jailCell = new Point3D(5295, 1174, 0);
                 m.MoveToWorld(jailCell, m.Map);
             }
             else
             {
                 m.SendMessage("This moongate does not seem to go anywhere.");
             }
         }
     }
     else
     {
         m.SendMessage("This moongate does not seem to go anywhere.");
     }
 }