parent
096d39609e
commit
8e9221bb5a
400 changed files with 3688 additions and 5969 deletions
|
|
@ -131,31 +131,16 @@ namespace Server.Factions
|
|||
{
|
||||
Direction = GetDirectionTo(m);
|
||||
|
||||
string warning = null;
|
||||
|
||||
switch (Utility.Random(6))
|
||||
var warning = Utility.Random(6) switch
|
||||
{
|
||||
case 0:
|
||||
warning =
|
||||
"I warn you, {0}, you would do well to leave this area before someone shows you the world of gray.";
|
||||
break;
|
||||
case 1:
|
||||
warning = "It would be wise to leave this area, {0}, lest your head become my commanders' trophy.";
|
||||
break;
|
||||
case 2:
|
||||
warning =
|
||||
"You are bold, {0}, for one of the meager {1}. Leave now, lest you be taught the taste of dirt.";
|
||||
break;
|
||||
case 3:
|
||||
warning = "Your presence here is an insult, {0}. Be gone now, knave.";
|
||||
break;
|
||||
case 4:
|
||||
warning = "Dost thou wish to be hung by your toes, {0}? Nay? Then come no closer.";
|
||||
break;
|
||||
case 5:
|
||||
warning = "Hey, {0}. Yeah, you. Get out of here before I beat you with a stick.";
|
||||
break;
|
||||
}
|
||||
0 => "I warn you, {0}, you would do well to leave this area before someone shows you the world of gray.",
|
||||
1 => "It would be wise to leave this area, {0}, lest your head become my commanders' trophy.",
|
||||
2 => "You are bold, {0}, for one of the meager {1}. Leave now, lest you be taught the taste of dirt.",
|
||||
3 => "Your presence here is an insult, {0}. Be gone now, knave.",
|
||||
4 => "Dost thou wish to be hung by your toes, {0}? Nay? Then come no closer.",
|
||||
5 => "Hey, {0}. Yeah, you. Get out of here before I beat you with a stick.",
|
||||
_ => null
|
||||
};
|
||||
|
||||
Faction faction = Faction.Find(m);
|
||||
|
||||
|
|
@ -188,20 +173,13 @@ namespace Server.Factions
|
|||
}
|
||||
else
|
||||
{
|
||||
TextDefinition def = null;
|
||||
|
||||
switch (type)
|
||||
var def = type switch
|
||||
{
|
||||
case ReactionType.Ignore:
|
||||
def = faction.Definition.GuardIgnore;
|
||||
break;
|
||||
case ReactionType.Warn:
|
||||
def = faction.Definition.GuardWarn;
|
||||
break;
|
||||
case ReactionType.Attack:
|
||||
def = faction.Definition.GuardAttack;
|
||||
break;
|
||||
}
|
||||
ReactionType.Ignore => faction.Definition.GuardIgnore,
|
||||
ReactionType.Warn => faction.Definition.GuardWarn,
|
||||
ReactionType.Attack => faction.Definition.GuardAttack,
|
||||
_ => null
|
||||
};
|
||||
|
||||
if (def != null && def.Number > 0)
|
||||
Say(def.Number);
|
||||
|
|
@ -229,7 +207,7 @@ namespace Server.Factions
|
|||
{
|
||||
if (e.HasKeyword(0xE6) && (Insensitive.Equals(e.Speech, "orders") || WasNamed(e.Speech))) // *orders*
|
||||
{
|
||||
if (m_Town == null || !m_Town.IsSheriff(from))
|
||||
if (m_Town?.IsSheriff(from) != true)
|
||||
{
|
||||
Say(1042189); // I don't work for you!
|
||||
}
|
||||
|
|
@ -319,7 +297,7 @@ namespace Server.Factions
|
|||
{
|
||||
if (m_Faction != null && Map == Faction.Facet)
|
||||
{
|
||||
string text = string.Concat("(Guard, ", m_Faction.Definition.FriendlyName, ")");
|
||||
string text = $"(Guard, {m_Faction.Definition.FriendlyName})";
|
||||
|
||||
int hue = Faction.Find(from) == m_Faction ? 98 : 38;
|
||||
|
||||
|
|
|
|||
|
|
@ -212,22 +212,22 @@ namespace Server.Factions
|
|||
if (maxCircle < 1)
|
||||
maxCircle = 1;
|
||||
|
||||
switch (Utility.Random(maxCircle * 2))
|
||||
return Utility.Random(maxCircle * 2) switch
|
||||
{
|
||||
case 0:
|
||||
case 1: return new MagicArrowSpell(m_Guard);
|
||||
case 2:
|
||||
case 3: return new HarmSpell(m_Guard);
|
||||
case 4:
|
||||
case 5: return new FireballSpell(m_Guard);
|
||||
case 6:
|
||||
case 7: return new LightningSpell(m_Guard);
|
||||
case 8: return new MindBlastSpell(m_Guard);
|
||||
case 9: return new ParalyzeSpell(m_Guard);
|
||||
case 10: return new EnergyBoltSpell(m_Guard);
|
||||
case 11: return new ExplosionSpell(m_Guard);
|
||||
default: return new FlameStrikeSpell(m_Guard);
|
||||
}
|
||||
0 => (Spell)new MagicArrowSpell(m_Guard),
|
||||
1 => new MagicArrowSpell(m_Guard),
|
||||
2 => new HarmSpell(m_Guard),
|
||||
3 => new HarmSpell(m_Guard),
|
||||
4 => new FireballSpell(m_Guard),
|
||||
5 => new FireballSpell(m_Guard),
|
||||
6 => new LightningSpell(m_Guard),
|
||||
7 => new LightningSpell(m_Guard),
|
||||
8 => new MindBlastSpell(m_Guard),
|
||||
9 => new ParalyzeSpell(m_Guard),
|
||||
10 => new EnergyBoltSpell(m_Guard),
|
||||
11 => new ExplosionSpell(m_Guard),
|
||||
_ => new FlameStrikeSpell(m_Guard)
|
||||
};
|
||||
}
|
||||
|
||||
public Mobile FindDispelTarget(bool activeOnly)
|
||||
|
|
@ -367,7 +367,7 @@ namespace Server.Factions
|
|||
|
||||
public void RunFrom(Mobile m)
|
||||
{
|
||||
Run((m_Mobile.GetDirectionTo(m) - 4) & Direction.Mask);
|
||||
Run(m_Mobile.GetDirectionTo(m) - 4 & Direction.Mask);
|
||||
}
|
||||
|
||||
public void OnFailedMove()
|
||||
|
|
@ -398,7 +398,7 @@ namespace Server.Factions
|
|||
|
||||
public void Run(Direction d)
|
||||
{
|
||||
if (m_Mobile.Spell != null && m_Mobile.Spell.IsCasting || m_Mobile.Paralyzed || m_Mobile.Frozen ||
|
||||
if (m_Mobile.Spell?.IsCasting == true || m_Mobile.Paralyzed || m_Mobile.Frozen ||
|
||||
m_Mobile.DisallowAllMoves)
|
||||
return;
|
||||
|
||||
|
|
@ -498,10 +498,7 @@ namespace Server.Factions
|
|||
{
|
||||
Mobile toFollow = null;
|
||||
|
||||
if (m_Guard.Town != null && m_Guard.Orders.Movement == MovementType.Follow)
|
||||
{
|
||||
toFollow = m_Guard.Orders.Follow ?? m_Guard.Town.Sheriff;
|
||||
}
|
||||
if (m_Guard.Town != null && m_Guard.Orders.Movement == MovementType.Follow) toFollow = m_Guard.Orders.Follow ?? m_Guard.Town.Sheriff;
|
||||
|
||||
if (toFollow != null && toFollow.Map == m_Guard.Map &&
|
||||
toFollow.InRange(m_Guard, m_Guard.RangePerception * 3) &&
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue