ModernUO/Projects/UOContent/Regions/GreenAcresRegion.cs
Kamron Batman 1d8e8ec0a8
fix: Fixes travel restriction messages (#1263)
- [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.
2022-11-22 16:57:42 -08:00

36 lines
1.1 KiB
C#

using Server.Spells;
using Server.Spells.Sixth;
namespace Server.Regions;
public class GreenAcresRegion : BaseRegion
{
public GreenAcresRegion(string name, Map map, Region parent, params Rectangle3D[] area) : base(name, map, parent, area)
{
}
public GreenAcresRegion(string name, Map map, Region parent, int priority, params Rectangle3D[] area)
: base(name, map, parent, priority, area)
{
}
public override bool AllowHousing(Mobile from, Point3D p) =>
from.AccessLevel != AccessLevel.Player && base.AllowHousing(from, p);
public override bool CheckTravel(Mobile m, Point3D newLocation, TravelCheckType travelType, out TextDefinition message)
{
message = null; // Use default message
return m.AccessLevel != AccessLevel.Player;
}
public override bool OnBeginSpellCast(Mobile m, ISpell s)
{
if (m.AccessLevel == AccessLevel.Player && s is MarkSpell)
{
m.SendLocalizedMessage(501802); // Thy spell doth not appear to work...
return false;
}
return base.OnBeginSpellCast(m, s);
}
}