- [X] `BaseRegion.CheckTravel` now properly cascades through parent regions - [X] `SpellHelper.CheckTravel` now returns a failure message instead of sending one internally. - [X] Consolidates travel restriction messages so they aren't duplicated.
23 lines
784 B
C#
23 lines
784 B
C#
using Server;
|
|
using Server.Regions;
|
|
using Server.Spells;
|
|
|
|
public class NoTravelSpellsAllowedRegion : DungeonRegion
|
|
{
|
|
public NoTravelSpellsAllowedRegion(string name, Map map, Region parent, params Rectangle3D[] area)
|
|
: base(name, map, parent, area)
|
|
{
|
|
}
|
|
|
|
public NoTravelSpellsAllowedRegion(string name, Map map, Region parent, int priority, params Rectangle3D[] area)
|
|
: base(name, map, parent, priority, area)
|
|
{
|
|
}
|
|
|
|
public override bool CheckTravel(Mobile m, Point3D newLocation, TravelCheckType travelType, out TextDefinition message)
|
|
{
|
|
message = null; // Use default message
|
|
return m.AccessLevel > AccessLevel.Player ||
|
|
travelType is not TravelCheckType.TeleportFrom or TravelCheckType.TeleportTo;
|
|
}
|
|
}
|