fix: Blood Oath, Wraith form, & Strangle (#1153)

Fixes blood oath mechanic, and wraith form not properly leeching.
This commit is contained in:
mark1145 2022-09-02 02:19:40 +10:00 • committed by GitHub
parent c5d2a58917
commit 1e50ff9966
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 52 additions and 78 deletions

View file

@ -32,6 +32,19 @@ namespace Server.Spells.Necromancy
public override int PoisResistOffset => 0;
public override int NrgyResistOffset => -5;
public static void DoWraithLeech(Mobile wraith, Mobile defender, int damageGiven)
{
var wraithLeech = 5 + (int)(15 * wraith.Skills.SpiritSpeak.Value / 100); // Wraith form gives 5-20% mana leech
var manaLeech = Math.Min(defender.Mana, AOS.Scale(damageGiven, wraithLeech));
if (manaLeech != 0)
{
wraith.Mana += manaLeech;
defender.Mana -= manaLeech;
wraith.PlaySound(0x44D);
}
}
public override void DoEffect(Mobile m)
{
if (m is PlayerMobile mobile)