From d407847fc431a9516947bea7f1fa06d06c9439f8 Mon Sep 17 00:00:00 2001 From: Kamron Batman <3953314+kamronbatman@users.noreply.github.com> Date: Tue, 4 Feb 2025 22:11:29 -0800 Subject: [PATCH] fix: Fixes axes not working when equipped or in backpack (#2112) --- .../ML Quests/Items/PrismaticCrystal.cs | 40 +++++++------- .../UOContent/Engines/Plants/PlantItem.cs | 13 +++-- .../SEDecorationArtifacts.cs | 23 ++++---- Projects/UOContent/Items/Food/Beverage.cs | 16 +++--- .../Items/Skill Items/Fishing/FishingPole.cs | 18 ++++--- .../Items/Skill Items/Misc/RecipeScroll.cs | 41 ++++++++------- .../Items/Special/Heritage Items/Curtains.cs | 25 +++++---- .../Special/Heritage Items/FruitTrees.cs | 52 +++++++++---------- .../Special/Heritage Items/Guillotine.cs | 23 ++++---- .../Special/Heritage Items/IronMaiden.cs | 25 +++++---- .../Items/Special/Heritage Items/WallTorch.cs | 27 +++++----- .../UOContent/Items/Special/Holiday/Wreath.cs | 20 +++---- .../Items/Special/Veteran Rewards/Banner.cs | 23 ++++---- .../Veteran Rewards/DecorativeShield.cs | 23 ++++---- .../Special/Veteran Rewards/FlamingHead.cs | 23 ++++---- .../Veteran Rewards/HangingSkeleton.cs | 23 ++++---- .../Special/Veteran Rewards/StoneAnkh.cs | 23 ++++---- .../UOContent/Items/Weapons/Axes/BaseAxe.cs | 13 +++-- 18 files changed, 224 insertions(+), 227 deletions(-) diff --git a/Projects/UOContent/Engines/ML Quests/Items/PrismaticCrystal.cs b/Projects/UOContent/Engines/ML Quests/Items/PrismaticCrystal.cs index 8559e3cc8..ed5da7386 100644 --- a/Projects/UOContent/Engines/ML Quests/Items/PrismaticCrystal.cs +++ b/Projects/UOContent/Engines/ML Quests/Items/PrismaticCrystal.cs @@ -24,32 +24,30 @@ public partial class PrismaticCrystal : Item return; } - if (pm.InRange(GetWorldLocation(), 2)) + if (!pm.InRange(GetWorldLocation(), 2)) { - if (MLQuestSystem.GetContext(pm)?.IsDoingQuest(typeof(UnfadingMemoriesPartOne)) == true && - pm.Backpack.FindItemByType(false) == null) - { - Item amber = new PrismaticAmber(); + pm.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that. + return; + } - if (pm.PlaceInBackpack(amber)) - { - MLQuestSystem.MarkQuestItem(pm, amber); - Delete(); - } - else - { - pm.SendLocalizedMessage(502385); // Your pack cannot hold this item. - amber.Delete(); - } - } - else - { - pm.SendLocalizedMessage(1075464); // You already have as many of those as you need. - } + if (MLQuestSystem.GetContext(pm)?.IsDoingQuest(typeof(UnfadingMemoriesPartOne)) != true || + pm.Backpack.FindItemByType(false) != null) + { + pm.SendLocalizedMessage(1075464); // You already have as many of those as you need. + return; + } + + var amber = new PrismaticAmber(); + + if (pm.PlaceInBackpack(amber)) + { + MLQuestSystem.MarkQuestItem(pm, amber); + Delete(); } else { - pm.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that. + pm.SendLocalizedMessage(502385); // Your pack cannot hold this item. + amber.Delete(); } } } diff --git a/Projects/UOContent/Engines/Plants/PlantItem.cs b/Projects/UOContent/Engines/Plants/PlantItem.cs index 3bc098ffe..13c28cdd9 100644 --- a/Projects/UOContent/Engines/Plants/PlantItem.cs +++ b/Projects/UOContent/Engines/Plants/PlantItem.cs @@ -467,12 +467,15 @@ public partial class PlantItem : Item, ISecurable return; } - var loc = GetWorldLocation(); - - if (!from.InLOS(loc) || !from.InRange(loc, 2)) + if (!IsChildOf(from)) { - from.LocalOverheadMessage(MessageType.Regular, 0x3E9, 1019045); // I can't reach that. - return; + var loc = GetWorldLocation(); + + if (!from.InLOS(loc) || !from.InRange(loc, 2)) + { + from.LocalOverheadMessage(MessageType.Regular, 0x3E9, 1019045); // I can't reach that + return; + } } if (!IsUsableBy(from)) diff --git a/Projects/UOContent/Items/Decoration Artifacts/SEDecorationArtifacts.cs b/Projects/UOContent/Items/Decoration Artifacts/SEDecorationArtifacts.cs index 70908c34b..89db33b85 100644 --- a/Projects/UOContent/Items/Decoration Artifacts/SEDecorationArtifacts.cs +++ b/Projects/UOContent/Items/Decoration Artifacts/SEDecorationArtifacts.cs @@ -536,22 +536,21 @@ public partial class TowerLanternArtifact : BaseDecorationArtifact public override void OnDoubleClick(Mobile from) { - if (from.InRange(GetWorldLocation(), 2)) + if (!from.InRange(GetWorldLocation(), 2)) { - if (IsOn) - { - IsOn = false; - from.PlaySound(0x3BE); - } - else - { - IsOn = true; - from.PlaySound(0x47); - } + from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that. + return; + } + + if (IsOn) + { + IsOn = false; + from.PlaySound(0x3BE); } else { - from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that. + IsOn = true; + from.PlaySound(0x47); } } } diff --git a/Projects/UOContent/Items/Food/Beverage.cs b/Projects/UOContent/Items/Food/Beverage.cs index dd994bfc9..6398fffc3 100644 --- a/Projects/UOContent/Items/Food/Beverage.cs +++ b/Projects/UOContent/Items/Food/Beverage.cs @@ -361,17 +361,17 @@ public abstract partial class BaseBeverage : Item, IHasQuantity } } - if (from.Map != Map || !from.InRange(GetWorldLocation(), 2) || !from.InLOS(this)) + if (from.Map == Map && from.InRange(GetWorldLocation(), 2) && from.InLOS(this)) { - if (message) - { - from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that. - } - - return false; + return true; } - return true; + if (message) + { + from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that. + } + + return false; } public virtual void Fill_OnTarget(Mobile from, object targ) diff --git a/Projects/UOContent/Items/Skill Items/Fishing/FishingPole.cs b/Projects/UOContent/Items/Skill Items/Fishing/FishingPole.cs index 76334722e..3cecb25d2 100644 --- a/Projects/UOContent/Items/Skill Items/Fishing/FishingPole.cs +++ b/Projects/UOContent/Items/Skill Items/Fishing/FishingPole.cs @@ -17,16 +17,18 @@ public partial class FishingPole : Item public override void OnDoubleClick(Mobile from) { - var loc = GetWorldLocation(); + if (!IsChildOf(from)) + { + var loc = GetWorldLocation(); - if (!from.InLOS(loc) || !from.InRange(loc, 2)) - { - from.LocalOverheadMessage(MessageType.Regular, 0x3E9, 1019045); // I can't reach that - } - else - { - Fishing.System.BeginHarvesting(from, this); + if (!from.InLOS(loc) || !from.InRange(loc, 2)) + { + from.LocalOverheadMessage(MessageType.Regular, 0x3E9, 1019045); // I can't reach that + return; + } } + + Fishing.System.BeginHarvesting(from, this); } public override void GetContextMenuEntries(Mobile from, ref PooledRefList list) diff --git a/Projects/UOContent/Items/Skill Items/Misc/RecipeScroll.cs b/Projects/UOContent/Items/Skill Items/Misc/RecipeScroll.cs index 36278b63e..95f0776b0 100644 --- a/Projects/UOContent/Items/Skill Items/Misc/RecipeScroll.cs +++ b/Projects/UOContent/Items/Skill Items/Misc/RecipeScroll.cs @@ -59,28 +59,29 @@ public partial class RecipeScroll : Item var r = Recipe; - if (r != null && from is PlayerMobile pm) + if (r == null || from is not PlayerMobile pm) { - if (!pm.HasRecipe(r)) - { - var chance = r.CraftItem.GetSuccessChance(pm, null, r.CraftSystem, false, out var allRequiredSkills); + return; + } - if (allRequiredSkills && chance >= 0.0) - { - // You have learned a new recipe: ~1_RECIPE~ - pm.SendLocalizedMessage(1073451, r.TextDefinition.ToString()); - pm.AcquireRecipe(r); - Delete(); - } - else - { - pm.SendLocalizedMessage(1044153); // You don't have the required skills to attempt this item. - } - } - else - { - pm.SendLocalizedMessage(1073427); // You already know this recipe. - } + if (pm.HasRecipe(r)) + { + pm.SendLocalizedMessage(1073427); // You already know this recipe. + return; + } + + var chance = r.CraftItem.GetSuccessChance(pm, null, r.CraftSystem, false, out var allRequiredSkills); + + if (allRequiredSkills && chance >= 0.0) + { + // You have learned a new recipe: ~1_RECIPE~ + pm.SendLocalizedMessage(1073451, r.TextDefinition.ToString()); + pm.AcquireRecipe(r); + Delete(); + } + else + { + pm.SendLocalizedMessage(1044153); // You don't have the required skills to attempt this item. } } } diff --git a/Projects/UOContent/Items/Special/Heritage Items/Curtains.cs b/Projects/UOContent/Items/Special/Heritage Items/Curtains.cs index 60f6cb16d..4f1b2347e 100644 --- a/Projects/UOContent/Items/Special/Heritage Items/Curtains.cs +++ b/Projects/UOContent/Items/Special/Heritage Items/Curtains.cs @@ -31,21 +31,20 @@ public partial class CurtainsComponent : AddonComponent, IDyable { base.OnDoubleClick(from); - if (Addon != null) + if (Addon == null || !from.InRange(Location, 1)) { - if (from.InRange(Location, 1)) + return; + } + + foreach (var c in Addon.Components) + { + if (c is CurtainsComponent curtain) { - foreach (var c in Addon.Components) - { - if (c is CurtainsComponent curtain) - { - (curtain.ItemID, curtain.ClosedId) = (curtain.ClosedId, curtain.ItemID); - } - else - { - from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that. - } - } + (curtain.ItemID, curtain.ClosedId) = (curtain.ClosedId, curtain.ItemID); + } + else + { + from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that. } } } diff --git a/Projects/UOContent/Items/Special/Heritage Items/FruitTrees.cs b/Projects/UOContent/Items/Special/Heritage Items/FruitTrees.cs index a93e7dd2e..6a7e5af6f 100644 --- a/Projects/UOContent/Items/Special/Heritage Items/FruitTrees.cs +++ b/Projects/UOContent/Items/Special/Heritage Items/FruitTrees.cs @@ -24,40 +24,38 @@ public abstract partial class BaseFruitTreeAddon : BaseAddon public override void OnComponentUsed(AddonComponent c, Mobile from) { - if (from.InRange(c.Location, 2)) + if (!from.InRange(c.Location, 2)) { - if (_fruits > 0) - { - var fruit = Fruit; + from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that. + return; + } - if (fruit == null) - { - return; - } + if (_fruits <= 0) + { + from.SendLocalizedMessage(501017); // There is no more fruit on this tree + return; + } - if (!from.PlaceInBackpack(fruit)) - { - fruit.Delete(); - from.SendLocalizedMessage(501015); // There is no room in your backpack for the fruit. - } - else - { - if (--Fruits == 0) - { - Timer.StartTimer(TimeSpan.FromMinutes(30), Respawn); - } + var fruit = Fruit; - from.SendLocalizedMessage(501016); // You pick some fruit and put it in your backpack. - } - } - else - { - from.SendLocalizedMessage(501017); // There is no more fruit on this tree - } + if (fruit == null) + { + return; + } + + if (!from.PlaceInBackpack(fruit)) + { + fruit.Delete(); + from.SendLocalizedMessage(501015); // There is no room in your backpack for the fruit. } else { - from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that. + if (--Fruits == 0) + { + Timer.StartTimer(TimeSpan.FromMinutes(30), Respawn); + } + + from.SendLocalizedMessage(501016); // You pick some fruit and put it in your backpack. } } diff --git a/Projects/UOContent/Items/Special/Heritage Items/Guillotine.cs b/Projects/UOContent/Items/Special/Heritage Items/Guillotine.cs index 5890ac152..10a84e7cb 100644 --- a/Projects/UOContent/Items/Special/Heritage Items/Guillotine.cs +++ b/Projects/UOContent/Items/Special/Heritage Items/Guillotine.cs @@ -28,23 +28,22 @@ public partial class GuillotineAddon : BaseAddon public override void OnComponentUsed(AddonComponent c, Mobile from) { - if (from.InRange(Location, 2)) + if (!from.InRange(Location, 2)) { - if (Utility.RandomBool()) - { - from.Location = Location; + from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that. + return; + } - Timer.StartTimer(TimeSpan.FromSeconds(0.5), () => Activate(c, from)); - } - else - { - // Hmm... you suspect that if you used this again, it might hurt. - from.LocalOverheadMessage(MessageType.Regular, 0, 501777); - } + if (Utility.RandomBool()) + { + from.Location = Location; + + Timer.StartTimer(TimeSpan.FromSeconds(0.5), () => Activate(c, from)); } else { - from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that. + // Hmm... you suspect that if you used this again, it might hurt. + from.LocalOverheadMessage(MessageType.Regular, 0, 501777); } } diff --git a/Projects/UOContent/Items/Special/Heritage Items/IronMaiden.cs b/Projects/UOContent/Items/Special/Heritage Items/IronMaiden.cs index d4fc4c2cd..ca8cf1a47 100644 --- a/Projects/UOContent/Items/Special/Heritage Items/IronMaiden.cs +++ b/Projects/UOContent/Items/Special/Heritage Items/IronMaiden.cs @@ -16,24 +16,23 @@ public partial class IronMaidenAddon : BaseAddon public override void OnComponentUsed(AddonComponent c, Mobile from) { - if (from.InRange(GetWorldLocation(), 2) && from.InLOS(GetWorldLocation())) + if (!from.InRange(GetWorldLocation(), 2) || !from.InLOS(GetWorldLocation())) { - if (Utility.RandomBool()) - { - from.Location = Location; - c.ItemID = 0x124A; + from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that. + return; + } - Timer.StartTimer(TimeSpan.FromSeconds(0.5), TimeSpan.FromSeconds(0.5), 3, () => Activate(c, from)); - } - else - { - // Hmm... you suspect that if you used this again, it might hurt. - from.LocalOverheadMessage(MessageType.Regular, 0, 501777); - } + if (Utility.RandomBool()) + { + from.Location = Location; + c.ItemID = 0x124A; + + Timer.StartTimer(TimeSpan.FromSeconds(0.5), TimeSpan.FromSeconds(0.5), 3, () => Activate(c, from)); } else { - from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that. + // Hmm... you suspect that if you used this again, it might hurt. + from.LocalOverheadMessage(MessageType.Regular, 0, 501777); } } diff --git a/Projects/UOContent/Items/Special/Heritage Items/WallTorch.cs b/Projects/UOContent/Items/Special/Heritage Items/WallTorch.cs index 15f844459..0fd529525 100644 --- a/Projects/UOContent/Items/Special/Heritage Items/WallTorch.cs +++ b/Projects/UOContent/Items/Special/Heritage Items/WallTorch.cs @@ -14,23 +14,22 @@ public partial class WallTorchComponent : AddonComponent public override void OnDoubleClick(Mobile from) { - if (from.InRange(Location, 2)) - { - ItemID = ItemID switch - { - 0x3D98 => 0x3D9B, - 0x3D9B => 0x3D98, - 0x3D94 => 0x3D97, - 0x3D97 => 0x3D94, - _ => ItemID - }; - - Effects.PlaySound(Location, Map, 0x3BE); - } - else + if (!from.InRange(Location, 2)) { from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that. + return; } + + ItemID = ItemID switch + { + 0x3D98 => 0x3D9B, + 0x3D9B => 0x3D98, + 0x3D94 => 0x3D97, + 0x3D97 => 0x3D94, + _ => ItemID + }; + + Effects.PlaySound(Location, Map, 0x3BE); } } diff --git a/Projects/UOContent/Items/Special/Holiday/Wreath.cs b/Projects/UOContent/Items/Special/Holiday/Wreath.cs index f5de38f7c..37d844bfc 100644 --- a/Projects/UOContent/Items/Special/Holiday/Wreath.cs +++ b/Projects/UOContent/Items/Special/Holiday/Wreath.cs @@ -92,16 +92,18 @@ public partial class WreathAddon : Item, IDyable, IAddon { var house = BaseHouse.FindHouseAt(this); - if (house?.IsCoOwner(from) == true) + if (house?.IsCoOwner(from) != true) { - if (from.InRange(GetWorldLocation(), 3)) - { - from.SendGump(new WreathAddonGump(from, this)); - } - else - { - from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that. - } + return; + } + + if (from.InRange(GetWorldLocation(), 3)) + { + from.SendGump(new WreathAddonGump(from, this)); + } + else + { + from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that. } } diff --git a/Projects/UOContent/Items/Special/Veteran Rewards/Banner.cs b/Projects/UOContent/Items/Special/Veteran Rewards/Banner.cs index 823ce8604..bb610754d 100644 --- a/Projects/UOContent/Items/Special/Veteran Rewards/Banner.cs +++ b/Projects/UOContent/Items/Special/Veteran Rewards/Banner.cs @@ -71,23 +71,22 @@ public partial class Banner : Item, IAddon, IDyable, IRewardItem public override void OnDoubleClick(Mobile from) { - if (from.InRange(Location, 2)) + if (!from.InRange(Location, 2)) { - var house = BaseHouse.FindHouseAt(this); + from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that. + return; + } - if (house?.IsOwner(from) == true) - { - from.SendGump(new RewardDemolitionGump(this, 1018318)); // Do you wish to re-deed this banner? - } - else - { - // You can only re-deed a banner if you placed it or you are the owner of the house. - from.SendLocalizedMessage(1018330); - } + var house = BaseHouse.FindHouseAt(this); + + if (house?.IsOwner(from) == true) + { + from.SendGump(new RewardDemolitionGump(this, 1018318)); // Do you wish to re-deed this banner? } else { - from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that. + // You can only re-deed a banner if you placed it or you are the owner of the house. + from.SendLocalizedMessage(1018330); } } } diff --git a/Projects/UOContent/Items/Special/Veteran Rewards/DecorativeShield.cs b/Projects/UOContent/Items/Special/Veteran Rewards/DecorativeShield.cs index 26838a7ee..e5d298296 100644 --- a/Projects/UOContent/Items/Special/Veteran Rewards/DecorativeShield.cs +++ b/Projects/UOContent/Items/Special/Veteran Rewards/DecorativeShield.cs @@ -55,23 +55,22 @@ public partial class DecorativeShield : Item, IAddon, IRewardItem public override void OnDoubleClick(Mobile from) { - if (from.InRange(Location, 2)) + if (!from.InRange(Location, 2)) { - var house = BaseHouse.FindHouseAt(this); + from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that. + return; + } - if (house?.IsOwner(from) == true) - { - from.SendGump(new RewardDemolitionGump(this, 1049783)); // Do you wish to re-deed this decoration? - } - else - { - // You can only re-deed this decoration if you are the house owner or originally placed the decoration. - from.SendLocalizedMessage(1049784); - } + var house = BaseHouse.FindHouseAt(this); + + if (house?.IsOwner(from) == true) + { + from.SendGump(new RewardDemolitionGump(this, 1049783)); // Do you wish to re-deed this decoration? } else { - from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that. + // You can only re-deed this decoration if you are the house owner or originally placed the decoration. + from.SendLocalizedMessage(1049784); } } } diff --git a/Projects/UOContent/Items/Special/Veteran Rewards/FlamingHead.cs b/Projects/UOContent/Items/Special/Veteran Rewards/FlamingHead.cs index 198628300..1407ad549 100644 --- a/Projects/UOContent/Items/Special/Veteran Rewards/FlamingHead.cs +++ b/Projects/UOContent/Items/Special/Veteran Rewards/FlamingHead.cs @@ -69,23 +69,22 @@ public partial class FlamingHead : StoneFaceTrapNoDamage, IAddon, IRewardItem public override void OnDoubleClick(Mobile from) { - if (from.InRange(Location, 2)) + if (!from.InRange(Location, 2)) { - var house = BaseHouse.FindHouseAt(this); + from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that. + return; + } - if (house?.IsOwner(from) == true) - { - from.SendGump(new RewardDemolitionGump(this, 1018329)); // Do you wish to re-deed this skull? - } - else - { - // You can only re-deed a skull if you placed it or you are the owner of the house. - from.SendLocalizedMessage(1018328); - } + var house = BaseHouse.FindHouseAt(this); + + if (house?.IsOwner(from) == true) + { + from.SendGump(new RewardDemolitionGump(this, 1018329)); // Do you wish to re-deed this skull? } else { - from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that. + // You can only re-deed a skull if you placed it or you are the owner of the house. + from.SendLocalizedMessage(1018328); } } } diff --git a/Projects/UOContent/Items/Special/Veteran Rewards/HangingSkeleton.cs b/Projects/UOContent/Items/Special/Veteran Rewards/HangingSkeleton.cs index 728a35d7d..a60dfe642 100644 --- a/Projects/UOContent/Items/Special/Veteran Rewards/HangingSkeleton.cs +++ b/Projects/UOContent/Items/Special/Veteran Rewards/HangingSkeleton.cs @@ -59,23 +59,22 @@ public partial class HangingSkeleton : Item, IAddon, IRewardItem public override void OnDoubleClick(Mobile from) { - if (from.InRange(Location, 3)) + if (!from.InRange(Location, 3)) { - var house = BaseHouse.FindHouseAt(this); + from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that. + return; + } - if (house?.IsOwner(from) == true) - { - from.SendGump(new RewardDemolitionGump(this, 1049783)); // Do you wish to re-deed this decoration? - } - else - { - // You can only re-deed this decoration if you are the house owner or originally placed the decoration. - from.SendLocalizedMessage(1049784); - } + var house = BaseHouse.FindHouseAt(this); + + if (house?.IsOwner(from) == true) + { + from.SendGump(new RewardDemolitionGump(this, 1049783)); // Do you wish to re-deed this decoration? } else { - from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that. + // You can only re-deed this decoration if you are the house owner or originally placed the decoration. + from.SendLocalizedMessage(1049784); } } } diff --git a/Projects/UOContent/Items/Special/Veteran Rewards/StoneAnkh.cs b/Projects/UOContent/Items/Special/Veteran Rewards/StoneAnkh.cs index b520563cc..0cee61cf5 100644 --- a/Projects/UOContent/Items/Special/Veteran Rewards/StoneAnkh.cs +++ b/Projects/UOContent/Items/Special/Veteran Rewards/StoneAnkh.cs @@ -70,23 +70,22 @@ public partial class StoneAnkh : BaseAddon, IRewardItem public override void OnComponentUsed(AddonComponent c, Mobile from) { - if (from.InRange(Location, 2)) + if (!from.InRange(Location, 2)) { - var house = BaseHouse.FindHouseAt(this); + from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that. + return; + } - if (house?.IsOwner(from) == true) - { - from.SendGump(new RewardDemolitionGump(this, 1049783)); // Do you wish to re-deed this decoration? - } - else - { - // You can only re-deed this decoration if you are the house owner or originally placed the decoration. - from.SendLocalizedMessage(1049784); - } + var house = BaseHouse.FindHouseAt(this); + + if (house?.IsOwner(from) == true) + { + from.SendGump(new RewardDemolitionGump(this, 1049783)); // Do you wish to re-deed this decoration? } else { - from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that. + // You can only re-deed this decoration if you are the house owner or originally placed the decoration. + from.SendLocalizedMessage(1049784); } } } diff --git a/Projects/UOContent/Items/Weapons/Axes/BaseAxe.cs b/Projects/UOContent/Items/Weapons/Axes/BaseAxe.cs index 3fb291bed..9b1c0ae66 100644 --- a/Projects/UOContent/Items/Weapons/Axes/BaseAxe.cs +++ b/Projects/UOContent/Items/Weapons/Axes/BaseAxe.cs @@ -73,12 +73,15 @@ namespace Server.Items return; } - var loc = GetWorldLocation(); - - if (!from.InLOS(loc) || !from.InRange(loc, 2)) + if (!IsChildOf(from)) { - from.LocalOverheadMessage(MessageType.Regular, 0x3E9, 1019045); // I can't reach that - return; + var loc = GetWorldLocation(); + + if (!from.InLOS(loc) || !from.InRange(loc, 2)) + { + from.LocalOverheadMessage(MessageType.Regular, 0x3E9, 1019045); // I can't reach that + return; + } } if (!IsAccessibleTo(from))