From 302f1ad98800144081e07113e28cc6c8fd020353 Mon Sep 17 00:00:00 2001 From: LoveDesignUA <68774128+LoveDesignUA@users.noreply.github.com> Date: Sat, 24 Oct 2026 10:21:36 +0700 Subject: [PATCH] fix: Moving Shot only charges mana for a fired shot (#2726) Moving Shot charged its mana in `OnBeforeSwing`, before `BaseRanged.OnSwing` decided whether to fire. A swing that fired nothing (a paralyzed or frozen archer, no ammo, a failed harmful check) still took the mana and left the move armed. Every swing after that charged again, so inside the 3-second window you paid twice, until the archer ran out of mana. `OnBeforeSwing` now only checks the mana. Moving Shot's own `OnHit`/`OnMiss` charge it, and those only run once a shot has fired. This is how the other weapon abilities pay. A miss still costs mana. A parried shot no longer does: the parry clears the move before `OnHit` runs, the same as for every other ability. --- .../UOContent/Items/Weapons/Abilities/MovingShot.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Projects/UOContent/Items/Weapons/Abilities/MovingShot.cs b/Projects/UOContent/Items/Weapons/Abilities/MovingShot.cs index e0b543cfd..955023c8f 100644 --- a/Projects/UOContent/Items/Weapons/Abilities/MovingShot.cs +++ b/Projects/UOContent/Items/Weapons/Abilities/MovingShot.cs @@ -11,8 +11,9 @@ namespace Server.Items public override bool ValidatesDuringHit => false; + // Mana is only checked here; OnHit/OnMiss charge it, since they run only for a shot that actually fired. public override bool OnBeforeSwing(Mobile attacker, Mobile defender) => - Validate(attacker) && CheckMana(attacker, true); + Validate(attacker) && CheckMana(attacker, false); public override void OnMiss(Mobile attacker, Mobile defender) { @@ -20,7 +21,10 @@ namespace Server.Items ClearCurrentAbility(attacker); - attacker.SendLocalizedMessage(1060089); // You fail to execute your special move + if (CheckMana(attacker, true)) + { + attacker.SendLocalizedMessage(1060089); // You fail to execute your special move + } } public override void OnHit(Mobile attacker, Mobile defender, int damage, WorldLocation worldLocation) @@ -29,7 +33,10 @@ namespace Server.Items ClearCurrentAbility(attacker); - attacker.SendLocalizedMessage(1060216); // Your shot was successful + if (CheckMana(attacker, true)) + { + attacker.SendLocalizedMessage(1060216); // Your shot was successful + } } } }