ModernUO/Projects/UOContent/Items/Weapons/Abilities/MovingShot.cs
Kamron Batman c8463e2eaf
fix: Fixes lightning arrow (#1583)
### Summary
- [X] Lightning arrow no longer allows SDI
- [X] Lightning arrow now proc's even without arrows
- [X] Fixed NPE with lightning arrow when a monster is already killed.
2023-11-05 17:36:09 -08:00

35 lines
1.2 KiB
C#

namespace Server.Items
{
/// <summary>
/// Available on some crossbows, this special move allows archers to fire while on the move.
/// This shot is somewhat less accurate than normal, but the ability to fire while running is a clear advantage.
/// </summary>
public class MovingShot : WeaponAbility
{
public override int BaseMana => 15;
public override int AccuracyBonus => -25;
public override bool ValidatesDuringHit => false;
public override bool OnBeforeSwing(Mobile attacker, Mobile defender) =>
Validate(attacker) && CheckMana(attacker, true);
public override void OnMiss(Mobile attacker, Mobile defender)
{
// Validates in OnSwing for accuracy scalar
ClearCurrentAbility(attacker);
attacker.SendLocalizedMessage(1060089); // You fail to execute your special move
}
public override void OnHit(Mobile attacker, Mobile defender, int damage, WorldLocation worldLocation)
{
// Validates in OnSwing for accuracy scalar
ClearCurrentAbility(attacker);
attacker.SendLocalizedMessage(1060216); // Your shot was successful
}
}
}