ModernUO/Projects/UOContent/Spells/Second/Agility.cs
mark1145 060edaa76a
fix: Fixes disarm, strangle, curse, summons, looting rights, creatures attacking, and items going to the floor (#1174)
* Fixes disarm
* Fixes strangle not refreshing
* Fixes curse not refreshing
* Fixes 125% bonus to looting rights
* Fixes mobs attacking each other, or not attacking each other
* Fixes items dropping to the floor
* Fixes protection spell
* Fixes cure sending wrong message
2022-09-27 22:19:15 -07:00

59 lines
1.6 KiB
C#

using Server.Engines.ConPVP;
using Server.Targeting;
namespace Server.Spells.Second
{
public class AgilitySpell : MagerySpell, ISpellTargetingMobile
{
private static readonly SpellInfo _info = new(
"Agility",
"Ex Uus",
212,
9061,
Reagent.Bloodmoss,
Reagent.MandrakeRoot
);
public AgilitySpell(Mobile caster, Item scroll = null) : base(caster, scroll, _info)
{
}
public override SpellCircle Circle => SpellCircle.Second;
public void Target(Mobile m)
{
if (CheckBSequence(m))
{
SpellHelper.Turn(Caster, m);
var length = SpellHelper.GetDuration(Caster, m);
SpellHelper.AddStatBonus(Caster, m, StatType.Dex, length, false);
m.FixedParticles(0x375A, 10, 15, 5010, EffectLayer.Waist);
m.PlaySound(0x1e7);
var percentage = (int)(SpellHelper.GetOffsetScalar(Caster, m, false) * 100);
BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.Agility, 1075841, length, m, percentage.ToString()));
}
FinishSequence();
}
public override bool CheckCast()
{
if (DuelContext.CheckSuddenDeath(Caster))
{
Caster.SendMessage(0x22, "You cannot cast this spell when in sudden death.");
return false;
}
return base.CheckCast();
}
public override void OnCast()
{
Caster.Target = new SpellTargetMobile(this, TargetFlags.Beneficial, Core.ML ? 10 : 12);
}
}
}