parent
096d39609e
commit
8e9221bb5a
400 changed files with 3688 additions and 5969 deletions
|
|
@ -477,33 +477,23 @@ namespace Server.Mobiles
|
|||
Direction dir = GetDirection4(oldWorldLoc, newWorldLoc);
|
||||
|
||||
if (itemIDs.Length == 2)
|
||||
switch (dir)
|
||||
item.ItemID = dir switch
|
||||
{
|
||||
case Direction.North:
|
||||
case Direction.South:
|
||||
item.ItemID = itemIDs[0];
|
||||
break;
|
||||
case Direction.East:
|
||||
case Direction.West:
|
||||
item.ItemID = itemIDs[1];
|
||||
break;
|
||||
}
|
||||
Direction.North => itemIDs[0],
|
||||
Direction.South => itemIDs[0],
|
||||
Direction.East => itemIDs[1],
|
||||
Direction.West => itemIDs[1],
|
||||
_ => item.ItemID
|
||||
};
|
||||
else if (itemIDs.Length == 4)
|
||||
switch (dir)
|
||||
item.ItemID = dir switch
|
||||
{
|
||||
case Direction.South:
|
||||
item.ItemID = itemIDs[0];
|
||||
break;
|
||||
case Direction.East:
|
||||
item.ItemID = itemIDs[1];
|
||||
break;
|
||||
case Direction.North:
|
||||
item.ItemID = itemIDs[2];
|
||||
break;
|
||||
case Direction.West:
|
||||
item.ItemID = itemIDs[3];
|
||||
break;
|
||||
}
|
||||
Direction.South => itemIDs[0],
|
||||
Direction.East => itemIDs[1],
|
||||
Direction.North => itemIDs[2],
|
||||
Direction.West => itemIDs[3],
|
||||
_ => item.ItemID
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -575,8 +565,7 @@ namespace Server.Mobiles
|
|||
else if (AnimalForm.UnderTransformation(this)) AnimalForm.RemoveContext(this, true);
|
||||
}
|
||||
|
||||
if (m_MountBlock == null || !m_MountBlock.m_Timer.Running ||
|
||||
m_MountBlock.m_Timer.Next < DateTime.UtcNow + duration) m_MountBlock = new MountBlock(duration, type, this);
|
||||
if (m_MountBlock?.m_Timer.Running != true || m_MountBlock.m_Timer.Next < DateTime.UtcNow + duration) m_MountBlock = new MountBlock(duration, type, this);
|
||||
}
|
||||
|
||||
public override void OnSkillInvalidated(Skill skill)
|
||||
|
|
@ -1722,10 +1711,7 @@ namespace Server.Mobiles
|
|||
|
||||
DropHolding();
|
||||
|
||||
if (Core.AOS && Backpack?.Deleted == false)
|
||||
{
|
||||
Backpack.FindItemsByType<Item>(FindItems_Callback).ForEach(item => Backpack.AddItem(item));
|
||||
}
|
||||
if (Core.AOS && Backpack?.Deleted == false) Backpack.FindItemsByType<Item>(FindItems_Callback).ForEach(item => Backpack.AddItem(item));
|
||||
|
||||
EquipSnapshot = new List<Item>(Items);
|
||||
|
||||
|
|
@ -1931,8 +1917,7 @@ namespace Server.Mobiles
|
|||
if (YoungDeathTeleport())
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(2.5), SendYoungDeathNotice);
|
||||
|
||||
if (DuelContext == null || !DuelContext.Registered || !DuelContext.Started || m_DuelPlayer == null ||
|
||||
m_DuelPlayer.Eliminated)
|
||||
if (DuelContext?.Registered != true || !DuelContext.Started || m_DuelPlayer?.Eliminated != false)
|
||||
Faction.HandleDeath(this, killer);
|
||||
|
||||
Guilds.Guild.HandleDeath(this, killer);
|
||||
|
|
@ -1988,7 +1973,7 @@ namespace Server.Mobiles
|
|||
}
|
||||
else if (type == MessageType.Alliance)
|
||||
{
|
||||
if (g.Alliance != null && g.Alliance.IsMember(g))
|
||||
if (g.Alliance?.IsMember(g) == true)
|
||||
{
|
||||
//g.Alliance.AllianceTextMessage( hue, "[Alliance][{0}]: {1}", this.Name, text );
|
||||
g.Alliance.AllianceChat(this, text);
|
||||
|
|
@ -2691,28 +2676,24 @@ namespace Server.Mobiles
|
|||
|
||||
if (faction.Commander == this)
|
||||
{
|
||||
text = string.Concat(Female ? "(Commanding Lady of the " : "(Commanding Lord of the ",
|
||||
faction.Definition.FriendlyName, ")");
|
||||
text = $"{(Female ? "(Commanding Lady of the " : "(Commanding Lord of the ")}{faction.Definition.FriendlyName})";
|
||||
}
|
||||
else if (pl.Sheriff != null)
|
||||
{
|
||||
text = string.Concat("(The Sheriff of ", pl.Sheriff.Definition.FriendlyName, ", ",
|
||||
faction.Definition.FriendlyName, ")");
|
||||
text = $"(The Sheriff of {pl.Sheriff.Definition.FriendlyName}, {faction.Definition.FriendlyName})";
|
||||
}
|
||||
else if (pl.Finance != null)
|
||||
{
|
||||
text = string.Concat("(The Finance Minister of ", pl.Finance.Definition.FriendlyName, ", ",
|
||||
faction.Definition.FriendlyName, ")");
|
||||
text = $"(The Finance Minister of {pl.Finance.Definition.FriendlyName}, {faction.Definition.FriendlyName})";
|
||||
}
|
||||
else
|
||||
{
|
||||
ascii = true;
|
||||
|
||||
if (pl.MerchantTitle != MerchantTitle.None)
|
||||
text = string.Concat("(", MerchantTitles.GetInfo(pl.MerchantTitle).Title.String, ", ",
|
||||
faction.Definition.FriendlyName, ")");
|
||||
text = $"({MerchantTitles.GetInfo(pl.MerchantTitle).Title.String}, {faction.Definition.FriendlyName})";
|
||||
else
|
||||
text = string.Concat("(", pl.Rank.Title.String, ", ", faction.Definition.FriendlyName, ")");
|
||||
text = $"({pl.Rank.Title.String}, {faction.Definition.FriendlyName})";
|
||||
}
|
||||
|
||||
int hue = Faction.Find(from) == faction ? 98 : 38;
|
||||
|
|
@ -3284,7 +3265,7 @@ namespace Server.Mobiles
|
|||
|
||||
private void ToggleItemInsurance_Callback(Mobile from, Item item, bool target)
|
||||
{
|
||||
if (item == null || !item.IsChildOf(this))
|
||||
if (item?.IsChildOf(this) != true)
|
||||
{
|
||||
if (target)
|
||||
BeginTarget(-1, false, TargetFlags.None, ToggleItemInsurance_Callback);
|
||||
|
|
@ -3766,7 +3747,7 @@ namespace Server.Mobiles
|
|||
|
||||
public override bool CheckPoisonImmunity(Mobile from, Poison poison)
|
||||
{
|
||||
if (Young && (DuelContext == null || !DuelContext.Started || DuelContext.Finished))
|
||||
if (Young && (DuelContext?.Started != true || DuelContext.Finished))
|
||||
return true;
|
||||
|
||||
return base.CheckPoisonImmunity(from, poison);
|
||||
|
|
@ -3774,7 +3755,7 @@ namespace Server.Mobiles
|
|||
|
||||
public override void OnPoisonImmunity(Mobile from, Poison poison)
|
||||
{
|
||||
if (Young && (DuelContext == null || !DuelContext.Started || DuelContext.Finished))
|
||||
if (Young && (DuelContext?.Started != true || DuelContext.Finished))
|
||||
SendLocalizedMessage(
|
||||
502808); // You would have been poisoned, were you not new to the land of Britannia. Be careful in the future.
|
||||
else
|
||||
|
|
@ -4107,7 +4088,7 @@ namespace Server.Mobiles
|
|||
if (suffix.Length == 0)
|
||||
suffix = "(Young)";
|
||||
else
|
||||
suffix = string.Concat(suffix, " (Young)");
|
||||
suffix = $"{suffix} (Young)";
|
||||
}
|
||||
|
||||
#region Ethics
|
||||
|
|
@ -4117,7 +4098,7 @@ namespace Server.Mobiles
|
|||
if (suffix.Length == 0)
|
||||
suffix = EthicPlayer.Ethic.Definition.Adjunct.String;
|
||||
else
|
||||
suffix = string.Concat(suffix, " ", EthicPlayer.Ethic.Definition.Adjunct.String);
|
||||
suffix = $"{suffix} {EthicPlayer.Ethic.Definition.Adjunct.String}";
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
@ -4132,7 +4113,7 @@ namespace Server.Mobiles
|
|||
if (suffix.Length == 0)
|
||||
suffix = adjunct;
|
||||
else
|
||||
suffix = string.Concat(suffix, " ", adjunct);
|
||||
suffix = $"{suffix} {adjunct}";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -4686,12 +4667,12 @@ namespace Server.Mobiles
|
|||
|
||||
public void RemoveBuff(BuffIcon b)
|
||||
{
|
||||
if (m_BuffTable == null || !m_BuffTable.ContainsKey(b))
|
||||
if (m_BuffTable?.ContainsKey(b) != true)
|
||||
return;
|
||||
|
||||
BuffInfo info = m_BuffTable[b];
|
||||
|
||||
if (info.Timer != null && info.Timer.Running)
|
||||
if (info.Timer?.Running == true)
|
||||
info.Timer.Stop();
|
||||
|
||||
m_BuffTable.Remove(b);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue