fix: Fixes PainSpike, ManaVampire, Evil Omen, and Curse (#1622)

Co-authored-by: Kamron Batman <3953314+kamronbatman@users.noreply.github.com>
This commit is contained in:
mark1145 2023-12-02 17:59:42 +00:00 • committed by GitHub
parent fec78040bc
commit 4ebdc75bdf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 119 additions and 73 deletions

View file

@ -45,26 +45,20 @@ namespace Server.Spells.Seventh
toDrain /= 2;
}
}
else if (CheckResisted(m))
{
m.SendLocalizedMessage(501783); // You feel yourself resisting magical energy.
}
else
{
if (CheckResisted(m))
{
m.SendLocalizedMessage(501783); // You feel yourself resisting magical energy.
}
else
{
toDrain = m.Mana;
}
toDrain = m.Mana;
}
// Will not drain more than the target has currently and will not put the caster over his maximum mana
toDrain = Math.Clamp(toDrain, 0, Math.Min(m.Mana, Caster.ManaMax - Caster.Mana));
// Will not drain more than the target has currently
toDrain = Math.Min(m.Mana, toDrain);
m.Mana -= toDrain;
if (toDrain > 0)
{
m.Mana -= toDrain;
Caster.Mana += toDrain;
}
Caster.Mana += toDrain;
if (Core.AOS)
{