fix: Fixes region priority and resolution. (#1254)
- [X] Fixes world location JSON deserializer. - [X] Fixes region resolver and priorities. - [X] Removes DynamicJson from regions. - [X] Adds missing region music.
This commit is contained in:
parent
139be1bc23
commit
18c4459e6b
31 changed files with 3809 additions and 3677 deletions
|
|
@ -1,131 +1,90 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.Json;
|
||||
using Server.Json;
|
||||
using Server.Logging;
|
||||
using Server.Mobiles;
|
||||
using Server.Utilities;
|
||||
|
||||
namespace Server.Regions
|
||||
namespace Server.Regions;
|
||||
|
||||
public class GuardedRegion : BaseRegion
|
||||
{
|
||||
public class GuardedRegion : BaseRegion
|
||||
private static readonly ILogger logger = LogFactory.GetLogger(typeof(GuardedRegion));
|
||||
|
||||
private static readonly object[] m_GuardParams = new object[1];
|
||||
|
||||
private readonly Dictionary<Mobile, GuardTimer> m_GuardCandidates = new();
|
||||
|
||||
public GuardedRegion(string name, Map map, int priority, params Rectangle3D[] area) :
|
||||
base(name, map, priority, area) => GuardType = DefaultGuardType;
|
||||
|
||||
public GuardedRegion(string name, Map map, int priority, params Rectangle2D[] area) :
|
||||
base(name, map, priority, area) => GuardType = DefaultGuardType;
|
||||
|
||||
public GuardedRegion(string name, Map map, Region parent, params Rectangle3D[] area) : base(name, map, parent, area) =>
|
||||
GuardType = DefaultGuardType;
|
||||
|
||||
public GuardedRegion(string name, Map map, Region parent, int priority, params Rectangle3D[] area)
|
||||
: base(name, map, parent, priority, area) => GuardType = DefaultGuardType;
|
||||
|
||||
public GuardedRegion(string name, Map map, Region parent, int priority, Type guardType, params Rectangle3D[] area)
|
||||
: base(name, map, parent, priority, area) => GuardType = guardType ?? DefaultGuardType;
|
||||
|
||||
public Type GuardType { get; set; }
|
||||
|
||||
public bool GuardsDisabled { get; set; }
|
||||
|
||||
public virtual bool AllowReds => Core.AOS;
|
||||
|
||||
public virtual Type DefaultGuardType
|
||||
{
|
||||
private static readonly ILogger logger = LogFactory.GetLogger(typeof(GuardedRegion));
|
||||
|
||||
private static readonly object[] m_GuardParams = new object[1];
|
||||
|
||||
private readonly Dictionary<Mobile, GuardTimer> m_GuardCandidates = new();
|
||||
private readonly Type m_GuardType;
|
||||
|
||||
public GuardedRegion(string name, Map map, int priority, params Rectangle3D[] area) :
|
||||
base(name, map, priority, area) =>
|
||||
m_GuardType = DefaultGuardType;
|
||||
|
||||
public GuardedRegion(string name, Map map, int priority, params Rectangle2D[] area) :
|
||||
base(name, map, priority, area) =>
|
||||
m_GuardType = DefaultGuardType;
|
||||
|
||||
public GuardedRegion(DynamicJson json, JsonSerializerOptions options) : base(json, options)
|
||||
get
|
||||
{
|
||||
if (json.GetProperty("guardsType", options, out string guardType))
|
||||
if (Map == Map.Ilshenar || Map == Map.Malas)
|
||||
{
|
||||
m_GuardType = AssemblyHandler.FindTypeByName(guardType);
|
||||
|
||||
if (!typeof(BaseGuard).IsAssignableFrom(m_GuardType))
|
||||
{
|
||||
logger.Warning("Invalid guard type for region '{Region}'", this);
|
||||
m_GuardType = DefaultGuardType;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_GuardType = DefaultGuardType;
|
||||
return typeof(ArcherGuard);
|
||||
}
|
||||
|
||||
Disabled = json.GetProperty("guardsDisabled", options, out bool disabled) && disabled;
|
||||
return typeof(WarriorGuard);
|
||||
}
|
||||
}
|
||||
|
||||
public bool Disabled { get; set; }
|
||||
public virtual bool IsDisabled() => GuardsDisabled;
|
||||
|
||||
public virtual bool AllowReds => Core.AOS;
|
||||
public static void Initialize()
|
||||
{
|
||||
CommandSystem.Register("CheckGuarded", AccessLevel.GameMaster, CheckGuarded_OnCommand);
|
||||
CommandSystem.Register("SetGuarded", AccessLevel.Administrator, SetGuarded_OnCommand);
|
||||
CommandSystem.Register("ToggleGuarded", AccessLevel.Administrator, ToggleGuarded_OnCommand);
|
||||
}
|
||||
|
||||
public virtual Type DefaultGuardType
|
||||
[Usage("CheckGuarded"), Description("Returns a value indicating if the current region is guarded or not.")]
|
||||
private static void CheckGuarded_OnCommand(CommandEventArgs e)
|
||||
{
|
||||
var from = e.Mobile;
|
||||
var reg = from.Region.GetRegion<GuardedRegion>();
|
||||
|
||||
if (reg == null)
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Map == Map.Ilshenar || Map == Map.Malas)
|
||||
{
|
||||
return typeof(ArcherGuard);
|
||||
}
|
||||
|
||||
return typeof(WarriorGuard);
|
||||
}
|
||||
from.SendMessage("You are not in a guardable region.");
|
||||
}
|
||||
|
||||
public virtual bool IsDisabled() => Disabled;
|
||||
|
||||
public static void Initialize()
|
||||
else if (reg.GuardsDisabled)
|
||||
{
|
||||
CommandSystem.Register("CheckGuarded", AccessLevel.GameMaster, CheckGuarded_OnCommand);
|
||||
CommandSystem.Register("SetGuarded", AccessLevel.Administrator, SetGuarded_OnCommand);
|
||||
CommandSystem.Register("ToggleGuarded", AccessLevel.Administrator, ToggleGuarded_OnCommand);
|
||||
from.SendMessage("The guards in this region have been disabled.");
|
||||
}
|
||||
|
||||
[Usage("CheckGuarded"), Description("Returns a value indicating if the current region is guarded or not.")]
|
||||
private static void CheckGuarded_OnCommand(CommandEventArgs e)
|
||||
else
|
||||
{
|
||||
var from = e.Mobile;
|
||||
var reg = from.Region.GetRegion<GuardedRegion>();
|
||||
|
||||
if (reg == null)
|
||||
{
|
||||
from.SendMessage("You are not in a guardable region.");
|
||||
}
|
||||
else if (reg.Disabled)
|
||||
{
|
||||
from.SendMessage("The guards in this region have been disabled.");
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage("This region is actively guarded.");
|
||||
}
|
||||
from.SendMessage("This region is actively guarded.");
|
||||
}
|
||||
}
|
||||
|
||||
[Usage("SetGuarded <true|false>"), Description("Enables or disables guards for the current region.")]
|
||||
private static void SetGuarded_OnCommand(CommandEventArgs e)
|
||||
[Usage("SetGuarded <true|false>"), Description("Enables or disables guards for the current region.")]
|
||||
private static void SetGuarded_OnCommand(CommandEventArgs e)
|
||||
{
|
||||
var from = e.Mobile;
|
||||
|
||||
if (e.Length == 1)
|
||||
{
|
||||
var from = e.Mobile;
|
||||
|
||||
if (e.Length == 1)
|
||||
{
|
||||
var reg = from.Region.GetRegion<GuardedRegion>();
|
||||
|
||||
if (reg == null)
|
||||
{
|
||||
from.SendMessage("You are not in a guardable region.");
|
||||
}
|
||||
else
|
||||
{
|
||||
reg.Disabled = !e.GetBoolean(0);
|
||||
|
||||
from.SendMessage(
|
||||
reg.Disabled
|
||||
? "The guards in this region have been disabled."
|
||||
: "The guards in this region have been enabled."
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage("Format: SetGuarded <true|false>");
|
||||
}
|
||||
}
|
||||
|
||||
[Usage("ToggleGuarded"), Description("Toggles the state of guards for the current region.")]
|
||||
private static void ToggleGuarded_OnCommand(CommandEventArgs e)
|
||||
{
|
||||
var from = e.Mobile;
|
||||
var reg = from.Region.GetRegion<GuardedRegion>();
|
||||
|
||||
if (reg == null)
|
||||
|
|
@ -134,252 +93,278 @@ namespace Server.Regions
|
|||
}
|
||||
else
|
||||
{
|
||||
reg.Disabled = !reg.Disabled;
|
||||
reg.GuardsDisabled = !e.GetBoolean(0);
|
||||
|
||||
from.SendMessage(
|
||||
reg.Disabled
|
||||
reg.GuardsDisabled
|
||||
? "The guards in this region have been disabled."
|
||||
: "The guards in this region have been enabled."
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public static GuardedRegion Disable(GuardedRegion reg)
|
||||
else
|
||||
{
|
||||
reg.Disabled = true;
|
||||
return reg;
|
||||
from.SendMessage("Format: SetGuarded <true|false>");
|
||||
}
|
||||
}
|
||||
|
||||
[Usage("ToggleGuarded"), Description("Toggles the state of guards for the current region.")]
|
||||
private static void ToggleGuarded_OnCommand(CommandEventArgs e)
|
||||
{
|
||||
var from = e.Mobile;
|
||||
var reg = from.Region.GetRegion<GuardedRegion>();
|
||||
|
||||
if (reg == null)
|
||||
{
|
||||
from.SendMessage("You are not in a guardable region.");
|
||||
}
|
||||
else
|
||||
{
|
||||
reg.GuardsDisabled = !reg.GuardsDisabled;
|
||||
|
||||
from.SendMessage(
|
||||
reg.GuardsDisabled
|
||||
? "The guards in this region have been disabled."
|
||||
: "The guards in this region have been enabled."
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public static GuardedRegion Disable(GuardedRegion reg)
|
||||
{
|
||||
reg.GuardsDisabled = true;
|
||||
return reg;
|
||||
}
|
||||
|
||||
public virtual bool CheckVendorAccess(BaseVendor vendor, Mobile from) =>
|
||||
from.AccessLevel >= AccessLevel.GameMaster || IsDisabled() || from.Kills < 5;
|
||||
|
||||
public override bool OnBeginSpellCast(Mobile m, ISpell s)
|
||||
{
|
||||
if (!IsDisabled() && !s.OnCastInTown(this))
|
||||
{
|
||||
m.SendLocalizedMessage(500946); // You cannot cast this in town!
|
||||
return false;
|
||||
}
|
||||
|
||||
public virtual bool CheckVendorAccess(BaseVendor vendor, Mobile from) =>
|
||||
from.AccessLevel >= AccessLevel.GameMaster || IsDisabled() || from.Kills < 5;
|
||||
return base.OnBeginSpellCast(m, s);
|
||||
}
|
||||
|
||||
public override bool OnBeginSpellCast(Mobile m, ISpell s)
|
||||
public override bool AllowHousing(Mobile from, Point3D p) => false;
|
||||
|
||||
public override void MakeGuard(Mobile focus)
|
||||
{
|
||||
var eable = focus.GetMobilesInRange<BaseGuard>(8);
|
||||
var useGuard = eable.FirstOrDefault(m => m.Focus == null);
|
||||
|
||||
eable.Free();
|
||||
|
||||
if (useGuard == null)
|
||||
{
|
||||
if (!IsDisabled() && !s.OnCastInTown(this))
|
||||
m_GuardParams[0] = focus;
|
||||
|
||||
try
|
||||
{
|
||||
m.SendLocalizedMessage(500946); // You cannot cast this in town!
|
||||
return false;
|
||||
GuardType.CreateInstance<object>(m_GuardParams);
|
||||
}
|
||||
|
||||
return base.OnBeginSpellCast(m, s);
|
||||
}
|
||||
|
||||
public override bool AllowHousing(Mobile from, Point3D p) => false;
|
||||
|
||||
public override void MakeGuard(Mobile focus)
|
||||
{
|
||||
var eable = focus.GetMobilesInRange<BaseGuard>(8);
|
||||
var useGuard = eable.FirstOrDefault(m => m.Focus == null);
|
||||
|
||||
eable.Free();
|
||||
|
||||
if (useGuard == null)
|
||||
catch
|
||||
{
|
||||
m_GuardParams[0] = focus;
|
||||
|
||||
try
|
||||
{
|
||||
m_GuardType.CreateInstance<object>(m_GuardParams);
|
||||
}
|
||||
catch
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
useGuard.Focus = focus;
|
||||
// ignored
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnEnter(Mobile m)
|
||||
else
|
||||
{
|
||||
if (IsDisabled())
|
||||
useGuard.Focus = focus;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnEnter(Mobile m)
|
||||
{
|
||||
if (IsDisabled())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!AllowReds && m.Kills >= 5)
|
||||
{
|
||||
CheckGuardCandidate(m);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnExit(Mobile m)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnSpeech(SpeechEventArgs args)
|
||||
{
|
||||
base.OnSpeech(args);
|
||||
|
||||
if (IsDisabled())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (args.Mobile.Alive && args.HasKeyword(0x0007)) // *guards*
|
||||
{
|
||||
CallGuards(args.Mobile.Location);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnAggressed(Mobile aggressor, Mobile aggressed, bool criminal)
|
||||
{
|
||||
base.OnAggressed(aggressor, aggressed, criminal);
|
||||
|
||||
if (!IsDisabled() && aggressor != aggressed && criminal)
|
||||
{
|
||||
CheckGuardCandidate(aggressor);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnGotBeneficialAction(Mobile helper, Mobile helped)
|
||||
{
|
||||
base.OnGotBeneficialAction(helper, helped);
|
||||
|
||||
if (IsDisabled())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var noto = Notoriety.Compute(helper, helped);
|
||||
|
||||
if (helper != helped && noto is Notoriety.Criminal or Notoriety.Murderer)
|
||||
{
|
||||
CheckGuardCandidate(helper);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnCriminalAction(Mobile m, bool message)
|
||||
{
|
||||
base.OnCriminalAction(m, message);
|
||||
|
||||
if (!IsDisabled())
|
||||
{
|
||||
CheckGuardCandidate(m);
|
||||
}
|
||||
}
|
||||
|
||||
public void CheckGuardCandidate(Mobile m)
|
||||
{
|
||||
if (IsDisabled() || !IsGuardCandidate(m))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!m_GuardCandidates.TryGetValue(m, out var timer))
|
||||
{
|
||||
timer = new GuardTimer(m, m_GuardCandidates);
|
||||
timer.Start();
|
||||
|
||||
m_GuardCandidates[m] = timer;
|
||||
m.SendLocalizedMessage(502275); // Guards can now be called on you!
|
||||
|
||||
var map = m.Map;
|
||||
|
||||
if (map == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!AllowReds && m.Kills >= 5)
|
||||
Mobile fakeCall = null;
|
||||
var prio = 0.0;
|
||||
|
||||
foreach (var v in m.GetMobilesInRange(8))
|
||||
{
|
||||
CheckGuardCandidate(m);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnExit(Mobile m)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnSpeech(SpeechEventArgs args)
|
||||
{
|
||||
base.OnSpeech(args);
|
||||
|
||||
if (IsDisabled())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (args.Mobile.Alive && args.HasKeyword(0x0007)) // *guards*
|
||||
{
|
||||
CallGuards(args.Mobile.Location);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnAggressed(Mobile aggressor, Mobile aggressed, bool criminal)
|
||||
{
|
||||
base.OnAggressed(aggressor, aggressed, criminal);
|
||||
|
||||
if (!IsDisabled() && aggressor != aggressed && criminal)
|
||||
{
|
||||
CheckGuardCandidate(aggressor);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnGotBeneficialAction(Mobile helper, Mobile helped)
|
||||
{
|
||||
base.OnGotBeneficialAction(helper, helped);
|
||||
|
||||
if (IsDisabled())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var noto = Notoriety.Compute(helper, helped);
|
||||
|
||||
if (helper != helped && noto is Notoriety.Criminal or Notoriety.Murderer)
|
||||
{
|
||||
CheckGuardCandidate(helper);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnCriminalAction(Mobile m, bool message)
|
||||
{
|
||||
base.OnCriminalAction(m, message);
|
||||
|
||||
if (!IsDisabled())
|
||||
{
|
||||
CheckGuardCandidate(m);
|
||||
}
|
||||
}
|
||||
|
||||
public void CheckGuardCandidate(Mobile m)
|
||||
{
|
||||
if (IsDisabled() || !IsGuardCandidate(m))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!m_GuardCandidates.TryGetValue(m, out var timer))
|
||||
{
|
||||
timer = new GuardTimer(m, m_GuardCandidates);
|
||||
timer.Start();
|
||||
|
||||
m_GuardCandidates[m] = timer;
|
||||
m.SendLocalizedMessage(502275); // Guards can now be called on you!
|
||||
|
||||
var map = m.Map;
|
||||
|
||||
if (map == null)
|
||||
if (!v.Player && v != m && !IsGuardCandidate(v) &&
|
||||
((v as BaseCreature)?.IsHumanInTown() ?? v.Body.IsHuman && v.Region.IsPartOf(this)))
|
||||
{
|
||||
return;
|
||||
}
|
||||
var dist = m.GetDistanceToSqrt(v);
|
||||
|
||||
Mobile fakeCall = null;
|
||||
var prio = 0.0;
|
||||
|
||||
foreach (var v in m.GetMobilesInRange(8))
|
||||
{
|
||||
if (!v.Player && v != m && !IsGuardCandidate(v) &&
|
||||
((v as BaseCreature)?.IsHumanInTown() ?? v.Body.IsHuman && v.Region.IsPartOf(this)))
|
||||
if (fakeCall == null || dist < prio)
|
||||
{
|
||||
var dist = m.GetDistanceToSqrt(v);
|
||||
|
||||
if (fakeCall == null || dist < prio)
|
||||
{
|
||||
fakeCall = v;
|
||||
prio = dist;
|
||||
}
|
||||
fakeCall = v;
|
||||
prio = dist;
|
||||
}
|
||||
}
|
||||
|
||||
if (fakeCall != null)
|
||||
{
|
||||
fakeCall.Say(
|
||||
Utility.RandomList(
|
||||
1007037,
|
||||
501603,
|
||||
1013037,
|
||||
1013038,
|
||||
1013039,
|
||||
1013041,
|
||||
1013042,
|
||||
1013043,
|
||||
1013052
|
||||
)
|
||||
);
|
||||
MakeGuard(m);
|
||||
timer.Stop();
|
||||
m_GuardCandidates.Remove(m);
|
||||
m.SendLocalizedMessage(502276); // Guards can no longer be called on you.
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
if (fakeCall != null)
|
||||
{
|
||||
fakeCall.Say(
|
||||
Utility.RandomList(
|
||||
1007037,
|
||||
501603,
|
||||
1013037,
|
||||
1013038,
|
||||
1013039,
|
||||
1013041,
|
||||
1013042,
|
||||
1013043,
|
||||
1013052
|
||||
)
|
||||
);
|
||||
MakeGuard(m);
|
||||
timer.Stop();
|
||||
timer.Start();
|
||||
m_GuardCandidates.Remove(m);
|
||||
m.SendLocalizedMessage(502276); // Guards can no longer be called on you.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
timer.Stop();
|
||||
timer.Start();
|
||||
}
|
||||
}
|
||||
|
||||
public void CallGuards(Point3D p)
|
||||
{
|
||||
if (IsDisabled())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var eable = Map.GetMobilesInRange(p, 14);
|
||||
|
||||
foreach (var m in eable)
|
||||
{
|
||||
if (IsGuardCandidate(m) &&
|
||||
(!AllowReds && m.Kills >= 5 && m.Region.IsPartOf(this) || m_GuardCandidates.ContainsKey(m)))
|
||||
{
|
||||
if (m_GuardCandidates.Remove(m, out var timer))
|
||||
{
|
||||
timer.Stop();
|
||||
}
|
||||
|
||||
MakeGuard(m);
|
||||
m.SendLocalizedMessage(502276); // Guards can no longer be called on you.
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void CallGuards(Point3D p)
|
||||
eable.Free();
|
||||
}
|
||||
|
||||
public bool IsGuardCandidate(Mobile m) =>
|
||||
m is not BaseGuard && m.Alive && m.AccessLevel <= AccessLevel.Player && !m.Blessed &&
|
||||
(m is not BaseCreature creature || !creature.IsInvulnerable) && !IsDisabled() &&
|
||||
(!AllowReds && m.Kills >= 5 || m.Criminal);
|
||||
|
||||
private class GuardTimer : Timer
|
||||
{
|
||||
private readonly Mobile m_Mobile;
|
||||
private readonly Dictionary<Mobile, GuardTimer> m_Table;
|
||||
|
||||
public GuardTimer(Mobile m, Dictionary<Mobile, GuardTimer> table) : base(TimeSpan.FromSeconds(15.0))
|
||||
{
|
||||
if (IsDisabled())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var eable = Map.GetMobilesInRange(p, 14);
|
||||
|
||||
foreach (var m in eable)
|
||||
{
|
||||
if (IsGuardCandidate(m) &&
|
||||
(!AllowReds && m.Kills >= 5 && m.Region.IsPartOf(this) || m_GuardCandidates.ContainsKey(m)))
|
||||
{
|
||||
if (m_GuardCandidates.Remove(m, out var timer))
|
||||
{
|
||||
timer.Stop();
|
||||
}
|
||||
|
||||
MakeGuard(m);
|
||||
m.SendLocalizedMessage(502276); // Guards can no longer be called on you.
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
eable.Free();
|
||||
m_Mobile = m;
|
||||
m_Table = table;
|
||||
}
|
||||
|
||||
public bool IsGuardCandidate(Mobile m) =>
|
||||
m is not BaseGuard && m.Alive && m.AccessLevel <= AccessLevel.Player && !m.Blessed &&
|
||||
(m is not BaseCreature creature || !creature.IsInvulnerable) && !IsDisabled() &&
|
||||
(!AllowReds && m.Kills >= 5 || m.Criminal);
|
||||
|
||||
private class GuardTimer : Timer
|
||||
protected override void OnTick()
|
||||
{
|
||||
private readonly Mobile m_Mobile;
|
||||
private readonly Dictionary<Mobile, GuardTimer> m_Table;
|
||||
|
||||
public GuardTimer(Mobile m, Dictionary<Mobile, GuardTimer> table) : base(TimeSpan.FromSeconds(15.0))
|
||||
if (m_Table.Remove(m_Mobile))
|
||||
{
|
||||
|
||||
m_Mobile = m;
|
||||
m_Table = table;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
if (m_Table.Remove(m_Mobile))
|
||||
{
|
||||
m_Mobile.SendLocalizedMessage(502276); // Guards can no longer be called on you.
|
||||
}
|
||||
m_Mobile.SendLocalizedMessage(502276); // Guards can no longer be called on you.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue