fix: Blood Oath, Wraith form, & Strangle (#1153)
Fixes blood oath mechanic, and wraith form not properly leeching.
This commit is contained in:
parent
c5d2a58917
commit
1e50ff9966
10 changed files with 52 additions and 78 deletions
|
|
@ -53,13 +53,8 @@ namespace Server.Spells.Necromancy
|
|||
|
||||
if (!_table.ContainsKey(m))
|
||||
{
|
||||
var mod = new DefaultSkillMod(SkillName.MagicResist, false, 50.0);
|
||||
|
||||
if (m.Skills.MagicResist.Base > 50.0)
|
||||
{
|
||||
m.AddSkillMod(mod);
|
||||
}
|
||||
|
||||
var mod = new DefaultSkillMod(SkillName.MagicResist, false, m.Skills.MagicResist.Value / 2);
|
||||
m.AddSkillMod(mod);
|
||||
_table[m] = mod;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,6 +29,8 @@ namespace Server.Spells.Necromancy
|
|||
|
||||
public override bool DelayedDamage => false;
|
||||
|
||||
public static bool UnderEffect(Mobile m) => _table.ContainsKey(m);
|
||||
|
||||
public void Target(Mobile m)
|
||||
{
|
||||
if (m == null)
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ namespace Server.Spells.Necromancy
|
|||
var hitDelay = 5;
|
||||
var length = hitDelay;
|
||||
|
||||
while (count > 1)
|
||||
while (count >= 1)
|
||||
{
|
||||
--count;
|
||||
if (hitDelay > 1)
|
||||
|
|
@ -149,7 +149,7 @@ namespace Server.Spells.Necromancy
|
|||
_hitDelay = 5;
|
||||
_nextHit = Core.Now + TimeSpan.FromSeconds(_hitDelay);
|
||||
|
||||
_maxCount = _count = Math.Min(4, (int)spiritLevel);
|
||||
_maxCount = _count = Math.Max(4, (int)spiritLevel);
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue