ModernUO/Projects/UOContent/Spells/Fifth/DispelField.cs
Kamron Batman 6d43f2549c
fix: Adjusts spell ranges to match OSI (#2171)
### Summary

Adjusts spell ranges according to OSI. Specifically, the [April 14, 1999 patch](https://uo.com/wiki/ultima-online-wiki/technical/previous-publishes/1999-2/1999-06-14th-april/) changed spell ranges to 10 tiles, and 15 tiles for fields.
2025-05-01 20:03:56 -07:00

59 lines
1.7 KiB
C#

using Server.Items;
using Server.Misc;
namespace Server.Spells.Fifth
{
public class DispelFieldSpell : MagerySpell, ITargetingSpell<Item>
{
private static readonly SpellInfo _info = new(
"Dispel Field",
"An Grav",
206,
9002,
Reagent.BlackPearl,
Reagent.SpidersSilk,
Reagent.SulfurousAsh,
Reagent.Garlic
);
public DispelFieldSpell(Mobile caster, Item scroll = null) : base(caster, scroll, _info)
{
}
public override SpellCircle Circle => SpellCircle.Fifth;
public int TargetRange => Core.T2A ? 15 : 18;
public void Target(Item item)
{
if (!item.GetType().IsDefined(typeof(DispellableFieldAttribute), false))
{
Caster.SendLocalizedMessage(1005049); // That cannot be dispelled.
}
else if (item is Moongate { Dispellable: false })
{
Caster.SendLocalizedMessage(1005047); // That magic is too chaotic
}
else if (CheckSequence())
{
SpellHelper.Turn(Caster, item);
Effects.SendLocationParticles(
EffectItem.Create(item.Location, item.Map, EffectItem.DefaultDuration),
0x376A,
9,
20,
5042
);
Effects.PlaySound(item.GetWorldLocation(), item.Map, 0x201);
item.Delete();
}
}
public override void OnCast()
{
Caster.Target = new SpellTarget<Item>(this);
}
}
}