ModernUO/Projects/UOContent/Spells/Eighth/WaterElemental.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

65 lines
1.8 KiB
C#

using System;
using Server.Mobiles;
namespace Server.Spells.Eighth
{
public class WaterElementalSpell : MagerySpell
{
private static readonly SpellInfo _info = new(
"Water Elemental",
"Kal Vas Xen An Flam",
269,
9070,
false,
Reagent.Bloodmoss,
Reagent.MandrakeRoot,
Reagent.SpidersSilk
);
public WaterElementalSpell(Mobile caster, Item scroll = null) : base(caster, scroll, _info)
{
}
public override SpellCircle Circle => SpellCircle.Eighth;
public override bool CheckCast()
{
if (!base.CheckCast())
{
return false;
}
if (Caster.Followers + 3 > Caster.FollowersMax)
{
Caster.SendLocalizedMessage(1049645); // You have too many followers to summon that creature.
return false;
}
return true;
}
public override void OnCast()
{
if (CheckSequence())
{
var duration = Core.Expansion switch
{
Expansion.None => TimeSpan.FromSeconds(Caster.Skills.Magery.Value),
// T2A -> Current
_ => TimeSpan.FromSeconds(4 * Math.Max(5, Caster.Skills.Magery.Value)),
};
if (Core.AOS)
{
SpellHelper.Summon(new SummonedWaterElemental(), Caster, 0x217, duration, false, false);
}
else
{
SpellHelper.Summon(new WaterElemental(), Caster, 0x217, duration, false, false);
}
}
FinishSequence();
}
}
}