ModernUO/Projects/UOContent/Spells/First/Feeblemind.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

57 lines
1.5 KiB
C#

using Server.Targeting;
namespace Server.Spells.First
{
public class FeeblemindSpell : MagerySpell, ISpellTargetingMobile
{
private static readonly SpellInfo _info = new(
"Feeblemind",
"Rel Wis",
212,
9031,
Reagent.Ginseng,
Reagent.Nightshade
);
public FeeblemindSpell(Mobile caster, Item scroll = null) : base(caster, scroll, _info)
{
}
public override SpellCircle Circle => SpellCircle.First;
public void Target(Mobile m)
{
if (CheckHSequence(m))
{
SpellHelper.Turn(Caster, m);
SpellHelper.CheckReflect((int)Circle, Caster, ref m);
// TODO: StoneForm immunity
var length = SpellHelper.GetDuration(Caster, m);
SpellHelper.AddStatCurse(Caster, m, StatType.Int, length, false);
m.Spell?.OnCasterHurt();
m.Paralyzed = false;
m.FixedParticles(0x3779, 10, 15, 5004, EffectLayer.Head);
m.PlaySound(0x1E4);
var percentage = (int)(SpellHelper.GetOffsetScalar(Caster, m, true) * 100);
BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.FeebleMind, 1075833, length, m, percentage.ToString()));
HarmfulSpell(m);
}
FinishSequence();
}
public override void OnCast()
{
Caster.Target = new SpellTargetMobile(this, TargetFlags.Harmful, Core.ML ? 10 : 12);
}
}
}