diff --git a/Projects/Server/Items/Item.cs b/Projects/Server/Items/Item.cs index 9882748a9..cfb7e14b8 100644 --- a/Projects/Server/Items/Item.cs +++ b/Projects/Server/Items/Item.cs @@ -2110,7 +2110,7 @@ namespace Server [MethodImpl(MethodImplOptions.AggressiveInlining)] public bool CheckRace(Race race) => Race.IsAllowedRace(race, RequiredRaces); - public bool CheckRace(Mobile from, bool message = true) + public virtual bool CheckRace(Mobile from, bool message = true) { var race = from.Race; var requiredRaces = RequiredRaces; @@ -2125,21 +2125,21 @@ namespace Server return false; } - if (race == Race.Gargoyle) + if (requiredRaces == Race.AllowGargoylesOnly) + { + from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1111707); // Only gargoyles can wear this. + } + else if (race == Race.Gargoyle) { from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1111708); // Gargoyles can't wear this. } - else if (requiredRaces == Race.AllowGargoylesOnly) - { - from.LocalOverheadMessage(Network.MessageType.Regular, 0x3B2, 1111707); // Only gargoyles can wear this. - } - else if (race != Race.Elf) + else if (requiredRaces == Race.AllowElvesOnly) { from.SendLocalizedMessage(1072203); // Only Elves may use this. } - else if (race != Race.Human) + else { - from.SendMessage($"Only {race.PluralName} may use this."); + from.SendMessage($"{race.PluralName} may not use this."); } return false; diff --git a/Projects/Server/Network/Packets/OutgoingMapPackets.cs b/Projects/Server/Network/Packets/OutgoingMapPackets.cs index d0216d14d..be692358d 100644 --- a/Projects/Server/Network/Packets/OutgoingMapPackets.cs +++ b/Projects/Server/Network/Packets/OutgoingMapPackets.cs @@ -41,8 +41,8 @@ namespace Server.Network { var map = Map.Maps[i]; - writer.Write(map.Tiles.Patch.StaticBlocks); - writer.Write(map.Tiles.Patch.LandBlocks); + writer.Write(map?.Tiles.Patch.StaticBlocks ?? 0); + writer.Write(map?.Tiles.Patch.LandBlocks ?? 0); } } diff --git a/Projects/UOContent/Items/Weapons/Abilities/Dismount.cs b/Projects/UOContent/Items/Weapons/Abilities/Dismount.cs index d1dbf5811..8512bf0db 100644 --- a/Projects/UOContent/Items/Weapons/Abilities/Dismount.cs +++ b/Projects/UOContent/Items/Weapons/Abilities/Dismount.cs @@ -23,7 +23,7 @@ namespace Server.Items return false; } - if (from.Mounted && !(from.Weapon is Lance)) + if (from.Mounted && from.Weapon is not Lance) { from.SendLocalizedMessage(1061283); // You cannot perform that attack while mounted! return false; diff --git a/Projects/UOContent/Items/Weapons/Abilities/WeaponAbility.cs b/Projects/UOContent/Items/Weapons/Abilities/WeaponAbility.cs index 393634e50..4a66f0907 100644 --- a/Projects/UOContent/Items/Weapons/Abilities/WeaponAbility.cs +++ b/Projects/UOContent/Items/Weapons/Abilities/WeaponAbility.cs @@ -174,7 +174,7 @@ namespace Server.Items public virtual bool CheckWeaponSkill(Mobile from) { - if (!(from.Weapon is BaseWeapon weapon)) + if (from.Weapon is not BaseWeapon weapon) { return false; } @@ -319,7 +319,7 @@ namespace Server.Items return false; } - return CheckSkills(from) && CheckMana(from, false); + return CheckSkills(from); } public static bool IsWeaponAbility(Mobile m, WeaponAbility a) => @@ -342,7 +342,7 @@ namespace Server.Items return null; } - if (a?.ValidatesDuringHit == true && !a.Validate(m)) + if (a?.ValidatesDuringHit == true && (!a.Validate(m) || !a.CheckMana(m, false))) { ClearCurrentAbility(m); return null; @@ -365,7 +365,7 @@ namespace Server.Items return false; } - if (a?.Validate(m) == false) + if (a?.Validate(m) == false || a?.CheckMana(m, false) == false) { ClearCurrentAbility(m); return false; diff --git a/Projects/UOContent/Mobiles/Vendors/SBInfo/SBAnimalTrainer.cs b/Projects/UOContent/Mobiles/Vendors/SBInfo/SBAnimalTrainer.cs index a76c24a75..f6fb00490 100644 --- a/Projects/UOContent/Mobiles/Vendors/SBInfo/SBAnimalTrainer.cs +++ b/Projects/UOContent/Mobiles/Vendors/SBInfo/SBAnimalTrainer.cs @@ -22,7 +22,9 @@ namespace Server.Mobiles if (!Core.AOS) { Add(new AnimalBuyInfo(1, "an eagle", typeof(Eagle), 402, 10, 5, 0)); - Add(new AnimalBuyInfo(1, "a brown bear", typeof(BrownBear), 855, 10, 167, 0)); + // Using itemID 211 (old value) instead of 167 for compatibility with CUO. Brown bear was not added to UOP + // If/when it is added, CUO will be able to show the 167 value. + Add(new AnimalBuyInfo(1, "a brown bear", typeof(BrownBear), 855, 10, 211, 0)); Add(new AnimalBuyInfo(1, "a grizzly bear", typeof(GrizzlyBear), 1767, 10, 212, 0)); Add(new AnimalBuyInfo(1, "a panther", typeof(Panther), 1271, 10, 214, 0)); Add(new AnimalBuyInfo(1, "a timber wolf", typeof(TimberWolf), 768, 10, 225, 0));