ModernUO/Projects/UOContent/Items/Weapons/Abilities/DoubleShot.cs
Kamron Batman bea20f36a0
fix: Fixes targeting checks (#869)
* Adds CanTarget for more granular overrides of specific targeting restrictions
* Updates spell targeting
* Fixes targeting checks
2021-12-01 08:15:16 -08:00

56 lines
1.7 KiB
C#

namespace Server.Items
{
/// <summary>
/// Send two arrows flying at your opponent if you're mounted. Requires Bushido or Ninjitsu skill.
/// </summary>
public class DoubleShot : WeaponAbility
{
public override int BaseMana => 30;
public override bool RequiresTactics(Mobile from) => false;
public override bool RequiresSecondarySkill(Mobile from) => true;
public override void OnHit(Mobile attacker, Mobile defender, int damage)
{
Use(attacker, defender);
}
public override void OnMiss(Mobile attacker, Mobile defender)
{
Use(attacker, defender);
}
public override bool Validate(Mobile from)
{
if (base.Validate(from))
{
if (from.Mounted)
{
return true;
}
from.SendLocalizedMessage(1070770); // You can only execute this attack while mounted!
ClearCurrentAbility(from);
}
return false;
}
public void Use(Mobile attacker, Mobile defender)
{
if (!Validate(attacker) || !CheckMana(attacker, true) || attacker.Weapon == null) // sanity
{
return;
}
ClearCurrentAbility(attacker);
attacker.SendLocalizedMessage(1063348); // You launch two shots at once!
defender.SendLocalizedMessage(1063349); // You're attacked with a barrage of shots!
defender.FixedParticles(0x37B9, 1, 19, 0x251D, EffectLayer.Waist);
attacker.Weapon.OnSwing(attacker, defender);
}
}
}