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.
This commit is contained in:
Kamron Batman 2022-11-22 16:57:42 -08:00 • committed by GitHub
parent 2057fe74a2
commit 1d8e8ec0a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 121 additions and 69 deletions

View file

@ -43,15 +43,17 @@ public class JailRegion : BaseRegion
global = LightCycle.JailLevel;
}
public override bool CheckTravel(Mobile m, Point3D newLocation, TravelCheckType travelType)
private static TextDefinition _jailBreakPlan = 1114345; // You'll need a better jailbreak plan than that!
public override bool CheckTravel(Mobile m, Point3D newLocation, TravelCheckType travelType, out TextDefinition message)
{
if (m?.AccessLevel == AccessLevel.Player)
{
m.SendLocalizedMessage(1114345); // You'll need a better jailbreak plan than that!
message = _jailBreakPlan;
return false;
}
return base.CheckTravel(m, newLocation, travelType);
return base.CheckTravel(m, newLocation, travelType, out message);
}
public override bool OnBeginSpellCast(Mobile from, ISpell s)