Adds style cop (#109)

This commit is contained in:
Kamron Batman 2020-04-26 00:16:02 -07:00 committed by GitHub
parent 3e715bcb60
commit 556a17aba8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1725 changed files with 33831 additions and 38046 deletions

View file

@ -11,18 +11,17 @@ namespace Server.Spells.Necromancy
{
public class AnimateDeadSpell : NecromancerSpell, ISpellTargetingItem
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Animate Dead", "Uus Corp",
203,
9031,
Reagent.GraveDust,
Reagent.DaemonBlood
);
Reagent.DaemonBlood);
private static CreatureGroup[] m_Groups =
private static readonly CreatureGroup[] m_Groups =
{
// Undead group--empty
new CreatureGroup(SlayerGroup.GetEntryByName(SlayerName.Silver).Types, new SummonEntry[0]),
new CreatureGroup(SlayerGroup.GetEntryByName(SlayerName.Silver).Types, Array.Empty<SummonEntry>()),
// Insects
new CreatureGroup(new[]
{
@ -81,7 +80,7 @@ namespace Server.Spells.Necromancy
new SummonEntry(0, typeof(PatchworkSkeleton))
}),
// Default group
new CreatureGroup(new Type[0], new[]
new CreatureGroup(Array.Empty<Type>(), new[]
{
new SummonEntry(18000, typeof(LichLord)),
new SummonEntry(10000, typeof(FleshGolem)),
@ -93,7 +92,7 @@ namespace Server.Spells.Necromancy
})
};
private static Dictionary<Mobile, List<Mobile>> m_Table = new Dictionary<Mobile, List<Mobile>>();
private static readonly Dictionary<Mobile, List<Mobile>> m_Table = new Dictionary<Mobile, List<Mobile>>();
public AnimateDeadSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{
@ -164,8 +163,8 @@ namespace Server.Spells.Necromancy
if (c.Owner != null) type = c.Owner.GetType();
if (c.ItemID != 0x2006 || c.Animated || type == typeof(PlayerMobile) || type == null ||
c.Owner != null && c.Owner.Fame < 100 || c.Owner is BaseCreature creature &&
(creature.Summoned || creature.IsBonded))
(c.Owner != null && c.Owner.Fame < 100) ||
(c.Owner is BaseCreature creature && (creature.Summoned || creature.IsBonded)))
{
Caster.SendLocalizedMessage(1061085); // There's not enough life force there to animate.
}
@ -350,8 +349,8 @@ namespace Server.Spells.Necromancy
private class CreatureGroup
{
public SummonEntry[] m_Entries;
public Type[] m_Types;
public readonly SummonEntry[] m_Entries;
public readonly Type[] m_Types;
public CreatureGroup(Type[] types, SummonEntry[] entries)
{
@ -362,8 +361,8 @@ namespace Server.Spells.Necromancy
private class SummonEntry
{
public int m_Requirement;
public Type[] m_ToSummon;
public readonly int m_Requirement;
public readonly Type[] m_ToSummon;
public SummonEntry(int requirement, params Type[] toSummon)
{

View file

@ -7,15 +7,14 @@ namespace Server.Spells.Necromancy
{
public class BloodOathSpell : NecromancerSpell, ISpellTargetingMobile
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Blood Oath", "In Jux Mani Xen",
203,
9031,
Reagent.DaemonBlood
);
Reagent.DaemonBlood);
private static Dictionary<Mobile, Mobile> m_OathTable = new Dictionary<Mobile, Mobile>();
private static Dictionary<Mobile, ExpireTimer> m_Table = new Dictionary<Mobile, ExpireTimer>();
private static readonly Dictionary<Mobile, Mobile> m_OathTable = new Dictionary<Mobile, Mobile>();
private static readonly Dictionary<Mobile, ExpireTimer> m_Table = new Dictionary<Mobile, ExpireTimer>();
public BloodOathSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{
@ -76,7 +75,7 @@ namespace Server.Spells.Necromancy
m.FixedParticles(0x3728, 1, 13, 9502, 33, 7, (EffectLayer)255);
TimeSpan duration = TimeSpan.FromSeconds((GetDamageSkill(Caster) - GetResistSkill(m)) / 8 + 8);
m.CheckSkill(SkillName.MagicResist, 0.0, 120.0); //Skill check for gain
m.CheckSkill(SkillName.MagicResist, 0.0, 120.0); // Skill check for gain
timer = new ExpireTimer(Caster, m, duration);
timer.Start();
@ -97,13 +96,13 @@ namespace Server.Spells.Necromancy
t?.DoExpire();
}
public static Mobile GetBloodOath(Mobile m) => m == null || m_OathTable.TryGetValue(m, out Mobile oath) && oath == m ? null : oath;
public static Mobile GetBloodOath(Mobile m) => m == null || (m_OathTable.TryGetValue(m, out Mobile oath) && oath == m) ? null : oath;
private class ExpireTimer : Timer
{
private Mobile m_Caster;
private DateTime m_End;
private Mobile m_Target;
private readonly Mobile m_Caster;
private readonly DateTime m_End;
private readonly Mobile m_Target;
public ExpireTimer(Mobile caster, Mobile target, TimeSpan delay) : base(TimeSpan.FromSeconds(1.0),
TimeSpan.FromSeconds(1.0))

View file

@ -6,15 +6,14 @@ namespace Server.Spells.Necromancy
{
public class CorpseSkinSpell : NecromancerSpell, ISpellTargetingMobile
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Corpse Skin", "In Agle Corp Ylem",
203,
9051,
Reagent.BatWing,
Reagent.GraveDust
);
Reagent.GraveDust);
private static Dictionary<Mobile, ExpireTimer> m_Table = new Dictionary<Mobile, ExpireTimer>();
private static readonly Dictionary<Mobile, ExpireTimer> m_Table = new Dictionary<Mobile, ExpireTimer>();
public CorpseSkinSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{
@ -63,7 +62,7 @@ namespace Server.Spells.Necromancy
double ss = GetDamageSkill(Caster);
double mr = Caster == m ? 0.0 : GetResistSkill(m);
m.CheckSkill(SkillName.MagicResist, 0.0, 120.0); //Skill check for gain
m.CheckSkill(SkillName.MagicResist, 0.0, 120.0); // Skill check for gain
TimeSpan duration = TimeSpan.FromSeconds((ss - mr) / 2.5 + 40.0);
@ -102,8 +101,8 @@ namespace Server.Spells.Necromancy
private class ExpireTimer : Timer
{
private Mobile m_Mobile;
private ResistanceMod[] m_Mods;
private readonly Mobile m_Mobile;
private readonly ResistanceMod[] m_Mods;
public ExpireTimer(Mobile m, ResistanceMod[] mods, TimeSpan delay) : base(delay)
{

View file

@ -6,14 +6,13 @@ namespace Server.Spells.Necromancy
{
public class CurseWeaponSpell : NecromancerSpell
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Curse Weapon", "An Sanct Gra Char",
203,
9031,
Reagent.PigIron
);
Reagent.PigIron);
private static Dictionary<BaseWeapon, ExpireTimer> m_Table = new Dictionary<BaseWeapon, ExpireTimer>();
private static readonly Dictionary<BaseWeapon, ExpireTimer> m_Table = new Dictionary<BaseWeapon, ExpireTimer>();
public CurseWeaponSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{
@ -63,7 +62,7 @@ namespace Server.Spells.Necromancy
private class ExpireTimer : Timer
{
private BaseWeapon m_Weapon;
private readonly BaseWeapon m_Weapon;
public ExpireTimer(BaseWeapon weapon, TimeSpan delay) : base(delay)
{
@ -81,7 +80,7 @@ namespace Server.Spells.Necromancy
private class SoundEffectTimer : Timer
{
private Mobile m_Mobile;
private readonly Mobile m_Mobile;
public SoundEffectTimer(Mobile m) : base(TimeSpan.FromSeconds(0.75))
{

View file

@ -7,15 +7,14 @@ namespace Server.Spells.Necromancy
{
public class EvilOmenSpell : NecromancerSpell, ISpellTargetingMobile
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Evil Omen", "Pas Tym An Sanct",
203,
9031,
Reagent.BatWing,
Reagent.NoxCrystal
);
Reagent.NoxCrystal);
private static Dictionary<Mobile, DefaultSkillMod> m_Table = new Dictionary<Mobile, DefaultSkillMod>();
private static readonly Dictionary<Mobile, DefaultSkillMod> m_Table = new Dictionary<Mobile, DefaultSkillMod>();
public EvilOmenSpell(Mobile caster, Item scroll = null)
: base(caster, scroll, m_Info)

View file

@ -12,13 +12,12 @@ namespace Server.Spells.Necromancy
{
public class ExorcismSpell : NecromancerSpell
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Exorcism", "Ort Corp Grav",
203,
9031,
Reagent.NoxCrystal,
Reagent.GraveDust
);
Reagent.GraveDust);
private static readonly int Range = Core.ML ? 48 : 18;
@ -67,7 +66,6 @@ namespace Server.Spells.Necromancy
public override double RequiredSkill => 80.0;
public override int RequiredMana => 40;
public override bool DelayedDamage => false;
public override bool CheckCast()
@ -99,7 +97,7 @@ namespace Server.Spells.Necromancy
IEnumerable<Mobile> targets = r.ChampionSpawn.GetMobilesInRange(Range).Where(IsValidTarget);
foreach (Mobile m in targets)
//Surprisingly, no sparkle type effects
// Surprisingly, no sparkle type effects
m.Location = GetNearestShrine(m);
}
}
@ -118,12 +116,12 @@ namespace Server.Spells.Necromancy
if (c?.Deleted == false && map != null && c.Map == map)
{
if (SpellHelper.IsAnyT2A(map, c.Location) && SpellHelper.IsAnyT2A(map, m.Location))
return false; //Same Map, both in T2A, ie, same 'sub server'.
return false; // Same Map, both in T2A, ie, same 'sub server'.
if (m.Region.IsPartOf<DungeonRegion>() == Region.Find(c.Location, map).IsPartOf<DungeonRegion>())
return false; //Same Map, both in Dungeon region OR They're both NOT in a dungeon region.
return false; // Same Map, both in Dungeon region OR They're both NOT in a dungeon region.
//Just an approximation cause RunUO doesn't divide up the world the same way OSI does ;p
// Just an approximation cause RunUO doesn't divide up the world the same way OSI does ;p
}
if (Party.Get(m)?.Contains(Caster) == true)
@ -143,7 +141,7 @@ namespace Server.Spells.Necromancy
Faction f = Faction.Find(m);
return Faction.Facet != m.Map || f == null || f != Faction.Find(Caster);
return m.Map != Faction.Facet || f == null || f != Faction.Find(Caster);
}
private static Point3D GetNearestShrine(Mobile m)
@ -152,7 +150,6 @@ namespace Server.Spells.Necromancy
Point3D[] locList;
if (map == Map.Felucca || map == Map.Trammel)
locList = m_BritanniaLocs;
else if (map == Map.Ilshenar)
@ -162,7 +159,7 @@ namespace Server.Spells.Necromancy
else if (map == Map.Malas)
locList = m_MalasLocs;
else
locList = new Point3D[0];
locList = Array.Empty<Point3D>();
Point3D closest = Point3D.Zero;
double minDist = double.MaxValue;

View file

@ -4,13 +4,12 @@ namespace Server.Spells.Necromancy
{
public class HorrificBeastSpell : TransformationSpell
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Horrific Beast", "Rel Xen Vas Bal",
203,
9031,
Reagent.BatWing,
Reagent.DaemonBlood
);
Reagent.DaemonBlood);
public HorrificBeastSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{

View file

@ -4,14 +4,13 @@ namespace Server.Spells.Necromancy
{
public class LichFormSpell : TransformationSpell
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Lich Form", "Rel Xen Corp Ort",
203,
9031,
Reagent.GraveDust,
Reagent.DaemonBlood,
Reagent.NoxCrystal
);
Reagent.NoxCrystal);
public LichFormSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{

View file

@ -6,16 +6,15 @@ namespace Server.Spells.Necromancy
{
public class MindRotSpell : NecromancerSpell, ISpellTargetingMobile
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Mind Rot", "Wis An Ben",
203,
9031,
Reagent.BatWing,
Reagent.PigIron,
Reagent.DaemonBlood
);
Reagent.DaemonBlood);
private static Dictionary<Mobile, MRBucket> m_Table = new Dictionary<Mobile, MRBucket>();
private static readonly Dictionary<Mobile, MRBucket> m_Table = new Dictionary<Mobile, MRBucket>();
public MindRotSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{
@ -55,7 +54,7 @@ namespace Server.Spells.Necromancy
TimeSpan duration =
TimeSpan.FromSeconds(
((GetDamageSkill(Caster) - GetResistSkill(m)) / 5.0 + 20.0) * (m.Player ? 1.0 : 2.0));
m.CheckSkill(SkillName.MagicResist, 0.0, 120.0); //Skill check for gain
m.CheckSkill(SkillName.MagicResist, 0.0, 120.0); // Skill check for gain
SetMindRotScalar(Caster, m, m.Player ? 1.25 : 2.00, duration);
@ -104,8 +103,8 @@ namespace Server.Spells.Necromancy
public class MRExpireTimer : Timer
{
private DateTime m_End;
private Mobile m_Target;
private readonly DateTime m_End;
private readonly Mobile m_Target;
public MRExpireTimer(Mobile caster, Mobile target, TimeSpan delay) : base(TimeSpan.FromSeconds(1.0),
TimeSpan.FromSeconds(1.0))

View file

@ -8,13 +8,13 @@ namespace Server.Spells.Necromancy
{
}
public abstract double RequiredSkill{ get; }
public abstract int RequiredMana{ get; }
public abstract double RequiredSkill { get; }
public abstract int RequiredMana { get; }
public override SkillName CastSkill => SkillName.Necromancy;
public override SkillName DamageSkill => SkillName.SpiritSpeak;
//public override int CastDelayBase => base.CastDelayBase; // Reference, 3
// public override int CastDelayBase => base.CastDelayBase; // Reference, 3
public override bool ClearHandsOnCast => false;
@ -25,12 +25,11 @@ namespace Server.Spells.Necromancy
public override int ComputeKarmaAward()
{
//TODO: Verify this formula being that Necro spells don't HAVE a circle.
//int karma = -(70 + (10 * (int)Circle));
// TODO: Verify this formula being that Necro spells don't HAVE a circle.
// int karma = -(70 + (10 * (int)Circle));
int karma = -(40 + (int)(10 * (CastDelayBase.TotalSeconds / CastDelaySecondsPerTick)));
if (Core.ML
) // Pub 36: "Added a new property called Increased Karma Loss which grants higher karma loss for casting necromancy spells."
if (Core.ML) // Pub 36: "Added a new property called Increased Karma Loss which grants higher karma loss for casting necromancy spells."
karma += AOS.Scale(karma, AosAttributes.GetValue(Caster, AosAttribute.IncreasedKarmaLoss));
return karma;

View file

@ -7,15 +7,14 @@ namespace Server.Spells.Necromancy
{
public class PainSpikeSpell : NecromancerSpell, ISpellTargetingMobile
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Pain Spike", "In Sar",
203,
9031,
Reagent.GraveDust,
Reagent.PigIron
);
Reagent.PigIron);
private static Dictionary<Mobile, InternalTimer> m_Table = new Dictionary<Mobile, InternalTimer>();
private static readonly Dictionary<Mobile, InternalTimer> m_Table = new Dictionary<Mobile, InternalTimer>();
public PainSpikeSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{
@ -42,7 +41,7 @@ namespace Server.Spells.Necromancy
{
SpellHelper.Turn(Caster, m);
//SpellHelper.CheckReflect( (int)this.Circle, Caster, ref m ); //Irrelevent after AoS
// SpellHelper.CheckReflect( (int)this.Circle, Caster, ref m ); //Irrelevent after AoS
/* Temporarily causes intense physical pain to the target, dealing direct damage.
* After 10 seconds the spell wears off, and if the target is still alive,
@ -54,7 +53,7 @@ namespace Server.Spells.Necromancy
m.PlaySound(0x210);
double damage = (GetDamageSkill(Caster) - GetResistSkill(m)) / 10 + (m.Player ? 18 : 30);
m.CheckSkill(SkillName.MagicResist, 0.0, 120.0); //Skill check for gain
m.CheckSkill(SkillName.MagicResist, 0.0, 120.0); // Skill check for gain
if (damage < 1)
damage = 1;
@ -81,7 +80,7 @@ namespace Server.Spells.Necromancy
SpellHelper.DoLeech((int)damage, Caster, m);
WeightOverloading.DFA = DFAlgorithm.Standard;
//SpellHelper.Damage( this, m, damage, 100, 0, 0, 0, 0, Misc.DFAlgorithm.PainSpike );
// SpellHelper.Damage( this, m, damage, 100, 0, 0, 0, 0, Misc.DFAlgorithm.PainSpike );
HarmfulSpell(m);
}
@ -90,8 +89,8 @@ namespace Server.Spells.Necromancy
private class InternalTimer : Timer
{
private Mobile m_Mobile;
private int m_ToRestore;
private readonly Mobile m_Mobile;
private readonly int m_ToRestore;
public InternalTimer(Mobile m, double toRestore) : base(TimeSpan.FromSeconds(10.0))
{

View file

@ -9,12 +9,11 @@ namespace Server.Spells.Necromancy
{
public class PoisonStrikeSpell : NecromancerSpell, ISpellTargetingMobile
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Poison Strike", "In Vas Nox",
203,
9031,
Reagent.NoxCrystal
);
Reagent.NoxCrystal);
public PoisonStrikeSpell(Mobile caster, Item scroll = null)
: base(caster, scroll, m_Info)
@ -47,7 +46,9 @@ namespace Server.Spells.Necromancy
* One tile from main target receives 50% damage, two tiles from target receives 33% damage.
*/
//CheckResisted( m ); // Check magic resist for skill, but do not use return value //reports from OSI: Necro spells don't give Resist gain
// CheckResisted( m );
// Check magic resist for skill, but do not use return value
// reports from OSI: Necro spells don't give Resist gain
Effects.SendLocationParticles(EffectItem.Create(m.Location, m.Map, EffectItem.DefaultDuration), 0x36B0, 1,
14, 63, 7, 9915, 0);

View file

@ -6,15 +6,14 @@ namespace Server.Spells.Necromancy
{
public class StrangleSpell : NecromancerSpell, ISpellTargetingMobile
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Strangle", "In Bal Nox",
209,
9031,
Reagent.DaemonBlood,
Reagent.NoxCrystal
);
Reagent.NoxCrystal);
private static Dictionary<Mobile, InternalTimer> m_Table = new Dictionary<Mobile, InternalTimer>();
private static readonly Dictionary<Mobile, InternalTimer> m_Table = new Dictionary<Mobile, InternalTimer>();
public StrangleSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{
@ -39,7 +38,8 @@ namespace Server.Spells.Necromancy
{
SpellHelper.Turn(Caster, m);
//SpellHelper.CheckReflect( (int)this.Circle, Caster, ref m ); //Irrelevent after AoS
// SpellHelper.CheckReflect( (int)this.Circle, Caster, ref m );
// Irrelevent after AoS
/* Temporarily chokes off the air suply of the target with poisonous fumes.
* The target is inflicted with poison damage over time.
@ -70,7 +70,7 @@ namespace Server.Spells.Necromancy
HarmfulSpell(m);
}
//Calculations for the buff bar
// Calculations for the buff bar
double spiritlevel = Caster.Skills.SpiritSpeak.Value / 10;
if (spiritlevel < 4)
spiritlevel = 4;
@ -123,12 +123,15 @@ namespace Server.Spells.Necromancy
private class InternalTimer : Timer
{
private int m_Count, m_MaxCount;
private int m_Count;
private readonly int m_MaxCount;
private int m_HitDelay;
private double m_MinBaseDamage, m_MaxBaseDamage;
private readonly double m_MinBaseDamage;
private readonly double m_MaxBaseDamage;
private DateTime m_NextHit;
private Mobile m_Target, m_From;
private readonly Mobile m_Target;
private readonly Mobile m_From;
public InternalTimer(Mobile target, Mobile from) : base(TimeSpan.FromSeconds(0.1), TimeSpan.FromSeconds(0.1))
{
@ -205,8 +208,7 @@ namespace Server.Spells.Necromancy
AOS.Damage(m_Target, m_From, (int)damage, 0, 0, 0, 100, 0);
if (0.60 <= Utility.RandomDouble()
) // OSI: randomly revealed between first and third damage tick, guessing 60% chance
if (Utility.RandomDouble() >= 0.60) // OSI: randomly revealed between first and third damage tick, guessing 60% chance
m_Target.RevealingAction();
}
}

View file

@ -9,14 +9,13 @@ namespace Server.Spells.Necromancy
{
public class SummonFamiliarSpell : NecromancerSpell
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Summon Familiar", "Kal Xen Bal",
203,
9031,
Reagent.BatWing,
Reagent.GraveDust,
Reagent.DaemonBlood
);
Reagent.DaemonBlood);
public SummonFamiliarSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{
@ -27,9 +26,9 @@ namespace Server.Spells.Necromancy
public override double RequiredSkill => 30.0;
public override int RequiredMana => 17;
public static Dictionary<Mobile, BaseCreature> Table{ get; } = new Dictionary<Mobile, BaseCreature>();
public static Dictionary<Mobile, BaseCreature> Table { get; } = new Dictionary<Mobile, BaseCreature>();
public static SummonFamiliarEntry[] Entries{ get; } =
public static SummonFamiliarEntry[] Entries { get; } =
{
new SummonFamiliarEntry(typeof(HordeMinionFamiliar), 1060146, 30.0, 30.0), // Horde Minion
new SummonFamiliarEntry(typeof(ShadowWispFamiliar), 1060142, 50.0, 50.0), // Shadow Wisp
@ -69,13 +68,13 @@ namespace Server.Spells.Necromancy
ReqSpiritSpeak = reqSpiritSpeak;
}
public Type Type{ get; }
public Type Type { get; }
public object Name{ get; }
public object Name { get; }
public double ReqNecromancy{ get; }
public double ReqNecromancy { get; }
public double ReqSpiritSpeak{ get; }
public double ReqSpiritSpeak { get; }
}
public class SummonFamiliarGump : Gump
@ -86,10 +85,10 @@ namespace Server.Spells.Necromancy
private const int EnabledColor32 = 0x18CD00;
private const int DisabledColor32 = 0x4A8B52;
private SummonFamiliarEntry[] m_Entries;
private Mobile m_From;
private readonly SummonFamiliarEntry[] m_Entries;
private readonly Mobile m_From;
private SummonFamiliarSpell m_Spell;
private readonly SummonFamiliarSpell m_Spell;
public SummonFamiliarGump(Mobile from, SummonFamiliarEntry[] entries, SummonFamiliarSpell spell) : base(200, 100)
{
@ -143,11 +142,9 @@ namespace Server.Spells.Necromancy
double necro = m_From.Skills.Necromancy.Value;
double spirit = m_From.Skills.SpiritSpeak.Value;
#region Dueling
if ((m_From as PlayerMobile)?.DuelContext?.AllowSpellCast(m_From, m_Spell) == false)
{
}
#endregion
else if (SummonFamiliarSpell.Table.TryGetValue(m_From, out BaseCreature check) && check?.Deleted == false)
{
m_From.SendLocalizedMessage(1061605); // You already have a familiar.

View file

@ -7,7 +7,7 @@ namespace Server.Spells.Necromancy
}
public override bool BlockedByHorrificBeast => false;
public abstract int Body{ get; }
public abstract int Body { get; }
public virtual int Hue => 0;
public virtual int PhysResistOffset => 0;

View file

@ -5,14 +5,13 @@ namespace Server.Spells.Necromancy
{
public class VampiricEmbraceSpell : TransformationSpell
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Vampiric Embrace", "Rel Xen An Sanct",
203,
9031,
Reagent.BatWing,
Reagent.NoxCrystal,
Reagent.PigIron
);
Reagent.PigIron);
public VampiricEmbraceSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{

View file

@ -6,14 +6,13 @@ namespace Server.Spells.Necromancy
{
public class VengefulSpiritSpell : NecromancerSpell, ISpellTargetingMobile
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Vengeful Spirit", "Kal Xen Bal Beh",
203,
9031,
Reagent.BatWing,
Reagent.GraveDust,
Reagent.PigIron
);
Reagent.PigIron);
public VengefulSpiritSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{

View file

@ -7,14 +7,13 @@ namespace Server.Spells.Necromancy
{
public class WitherSpell : NecromancerSpell
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Wither", "Kal Vas An Flam",
203,
9031,
Reagent.NoxCrystal,
Reagent.GraveDust,
Reagent.PigIron
);
Reagent.PigIron);
public WitherSpell(Mobile caster, Item scroll = null)
: base(caster, scroll, m_Info)
@ -93,8 +92,8 @@ namespace Server.Spells.Necromancy
damage /= 100;
// TODO: cap?
//if ( damage > 40 )
// damage = 40;
// if (damage > 40)
// damage = 40;
SpellHelper.Damage(this, m, damage, 0, 0, 100, 0, 0);
}

View file

@ -5,13 +5,12 @@ namespace Server.Spells.Necromancy
{
public class WraithFormSpell : TransformationSpell
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Wraith Form", "Rel Xen Um",
203,
9031,
Reagent.NoxCrystal,
Reagent.PigIron
);
Reagent.PigIron);
public WraithFormSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{