Modernization Fixes & Updates to Default Values (#3)

This commit is contained in:
Kamron Batman 2018-10-28 00:33:16 -07:00 committed by GitHub
parent 445eddff68
commit dcf64091b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
768 changed files with 10507 additions and 14196 deletions

View file

@ -1,5 +1,6 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Server.Targeting;
namespace Server.Spells.Necromancy
@ -15,7 +16,7 @@ namespace Server.Spells.Necromancy
Reagent.DaemonBlood
);
private static Hashtable m_Table = new Hashtable();
private static Dictionary<Mobile, MRBucket> m_Table = new Dictionary<Mobile, MRBucket>();
public MindRotSpell(Mobile caster, Item scroll) : base(caster, scroll, m_Info)
{
@ -70,13 +71,13 @@ namespace Server.Spells.Necromancy
public static void ClearMindRotScalar(Mobile m)
{
if (!m_Table.ContainsKey(m))
MRBucket tmpB = m_Table[m];
if (tmpB == null)
return;
BuffInfo.RemoveBuff(m, BuffIcon.Mindrot);
MRBucket tmpB = (MRBucket)m_Table[m];
MRExpireTimer tmpT = tmpB.m_MRExpireTimer;
tmpT.Stop();
tmpB.m_MRExpireTimer.Stop();
m_Table.Remove(m);
m.SendLocalizedMessage(1060872); // Your mind feels normal again.
}
@ -88,10 +89,11 @@ namespace Server.Spells.Necromancy
public static bool GetMindRotScalar(Mobile m, ref double scalar)
{
if (!m_Table.ContainsKey(m))
MRBucket tmpB = m_Table[m];
if (tmpB == null)
return false;
MRBucket tmpB = (MRBucket)m_Table[m];
scalar = tmpB.m_Scalar;
return true;
}
@ -100,11 +102,10 @@ namespace Server.Spells.Necromancy
{
if (!m_Table.ContainsKey(target))
{
m_Table.Add(target, new MRBucket(scalar, new MRExpireTimer(caster, target, duration)));
MRBucket tmpB = new MRBucket(scalar, new MRExpireTimer(caster, target, duration));
m_Table.Add(target, tmpB);
BuffInfo.AddBuff(target, new BuffInfo(BuffIcon.Mindrot, 1075665, duration, target));
MRBucket tmpB = (MRBucket)m_Table[target];
MRExpireTimer tmpT = tmpB.m_MRExpireTimer;
tmpT.Start();
tmpB.m_MRExpireTimer.Start();
target.SendLocalizedMessage(1074384);
}
}
@ -146,16 +147,6 @@ namespace Server.Spells.Necromancy
Priority = TimerPriority.TwoFiftyMS;
}
public void RenewDelay(TimeSpan delay)
{
m_End = DateTime.UtcNow + delay;
}
public void Halt()
{
Stop();
}
protected override void OnTick()
{
if (m_Target.Deleted || !m_Target.Alive || DateTime.UtcNow >= m_End)
@ -178,4 +169,4 @@ namespace Server.Spells.Necromancy
m_MRExpireTimer = theTimer;
}
}
}
}