Fixes chaos damage bug with the spell system. Fixes various small other bugs. Fixes more merge cast type checks and uses default values.

This commit is contained in:
Kamron Batman 2018-09-16 21:04:36 -07:00
parent 9542c79ea4
commit c155c82325
115 changed files with 644 additions and 1041 deletions

View file

@ -76,8 +76,8 @@ namespace Server.Spells.Mysticism
protected override void OnTarget(Mobile from, object o)
{
if (o is IPoint3D)
m_Owner.Target((IPoint3D)o);
if (o is IPoint3D d)
m_Owner.Target(d);
}
protected override void OnTargetFinish(Mobile from)

View file

@ -75,8 +75,8 @@ namespace Server.Spells.Mysticism
protected override void OnTarget(Mobile from, object o)
{
if (o is Mobile)
m_Owner.Target((Mobile)o);
if (o is Mobile mobile)
m_Owner.Target(mobile);
}
protected override void OnTargetFinish(Mobile from)

View file

@ -43,8 +43,8 @@ namespace Server.Spells.Mysticism
SpellHelper.Turn(Caster, p);
if (p is Item)
p = ((Item)p).GetWorldLocation();
if (p is Item item)
p = item.GetWorldLocation();
List<Mobile> targets = new List<Mobile>();
@ -131,9 +131,7 @@ namespace Server.Spells.Mysticism
protected override void OnTarget(Mobile from, object o)
{
IPoint3D p = o as IPoint3D;
if (p != null)
if (o is IPoint3D p)
m_Owner.Target(p);
}

View file

@ -46,8 +46,8 @@ namespace Server.Spells.Mysticism
SpellHelper.Turn(Caster, p);
if (p is Item)
p = ((Item)p).GetWorldLocation();
if (p is Item item)
p = item.GetWorldLocation();
List<Mobile> targets = new List<Mobile>();
@ -83,11 +83,7 @@ namespace Server.Spells.Mysticism
foreach (Mobile m in targets)
{
Caster.DoHarmful(m);
int[] types = new int[4];
types[Utility.Random(types.Length)] = 100;
SpellHelper.Damage(this, m, damage, 0, types[0], types[1], types[2], types[3]);
SpellHelper.Damage(this, m, damage, 0, 0, 0, 0, 0, 100);
double resistedReduction = reduction - m.Skills[SkillName.MagicResist].Value / 800.0;

View file

@ -63,11 +63,7 @@ namespace Server.Spells.Mysticism
VisualEffect(targeted);
int damage = GetNewAosDamage(33, 1, 5, targeted);
int[] types = new int[4];
types[Utility.Random(types.Length)] = 100;
SpellHelper.Damage(this, targeted, damage, 0, types[0], types[1], types[2], types[3]);
SpellHelper.Damage(this, targeted, damage, 0, 0, 0, 0, 0);
SpellPlagueContext context = new SpellPlagueContext(this, targeted);
@ -176,10 +172,7 @@ namespace Server.Spells.Mysticism
m_Explosions++;
m_LastExploded = DateTime.Now;
int[] types = new int[4];
types[Utility.Random(types.Length)] = 100;
SpellHelper.Damage(m_Owner, m_Target, damage, 0, types[0], types[1], types[2], types[3]);
SpellHelper.Damage(m_Owner, m_Target, damage, 0, 0, 0, 0, 0, 100);
if (m_Explosions >= 3)
EndPlague();
@ -222,8 +215,8 @@ namespace Server.Spells.Mysticism
protected override void OnTarget(Mobile from, object o)
{
if (o is Mobile)
m_Owner.Target((Mobile)o);
if (o is Mobile mobile)
m_Owner.Target(mobile);
}
protected override void OnTargetFinish(Mobile from)