New Jail System for MUO ---------------------------- Commands: [jail [player] [reason] - Jail with time escalation per offense (5 to 120 minutes, GM only) [unjail [player] - Manual release from jail regardless of time (GM only) [jailinfo [player] - Check jail status and history (GM only) [jailrecord - Checks their own jail record stats (player access) Jail/Unjail can be found in the client view of a player in Admin Gump  Jail record gump, invoked with [jailrecord (30 second cooldown) 
90 lines
2.5 KiB
C#
90 lines
2.5 KiB
C#
using System.Text.Json.Serialization;
|
|
using Server.Spells;
|
|
|
|
namespace Server.Regions;
|
|
|
|
public class JailRegion : BaseRegion
|
|
{
|
|
[JsonConstructor] // Don't include parent, since it is special
|
|
public JailRegion(string name, Map map, int priority, params Rectangle3D[] area) : base(name, map, priority, area)
|
|
{
|
|
}
|
|
|
|
public JailRegion(string name, Map map, Region parent, params Rectangle3D[] area)
|
|
: base(name, map, parent, area)
|
|
{
|
|
}
|
|
|
|
public JailRegion(string name, Map map, Region parent, int priority, params Rectangle3D[] area)
|
|
: base(name, map, parent, priority, area)
|
|
{
|
|
}
|
|
|
|
public override bool AllowGain(Mobile m, Skill skill, object obj) => m.AccessLevel > AccessLevel.Player;
|
|
|
|
public override bool AllowBeneficial(Mobile from, Mobile target)
|
|
{
|
|
if (from.AccessLevel == AccessLevel.Player)
|
|
{
|
|
from.SendMessage("You may not do that in jail.");
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
public override bool AllowHarmful(Mobile from, Mobile target)
|
|
{
|
|
if (from.AccessLevel == AccessLevel.Player)
|
|
{
|
|
from.SendMessage("You may not do that in jail.");
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
public override bool AllowHousing(Mobile from, Point3D p) => false;
|
|
|
|
public override void AlterLightLevel(Mobile m, ref int global, ref int personal)
|
|
{
|
|
global = LightCycle.JailLevel;
|
|
}
|
|
|
|
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)
|
|
{
|
|
message = _jailBreakPlan;
|
|
return false;
|
|
}
|
|
|
|
return base.CheckTravel(m, newLocation, travelType, out message);
|
|
}
|
|
|
|
public override bool OnBeginSpellCast(Mobile from, ISpell s)
|
|
{
|
|
if (from.AccessLevel == AccessLevel.Player)
|
|
{
|
|
from.SendLocalizedMessage(502629); // You cannot cast spells here.
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
public override bool OnSkillUse(Mobile from, int Skill)
|
|
{
|
|
if (from.AccessLevel == AccessLevel.Player)
|
|
{
|
|
from.SendMessage("You may not use skills in jail.");
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
public override bool OnCombatantChange(Mobile from, Mobile Old, Mobile New) => from.AccessLevel > AccessLevel.Player;
|
|
}
|