Fixes dictionary uses (#7)

This commit is contained in:
Kamron Batman 2018-11-02 08:16:42 -07:00 • committed by GitHub
parent d4a52344f2
commit 916d404c51
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
161 changed files with 1211 additions and 1722 deletions

View file

@ -9,7 +9,7 @@ namespace Server.Mobiles
{
public class Ilhenir : BaseChampion
{
private static Dictionary<Mobile, Timer> m_Table = new Dictionary<Mobile, Timer>();
private static HashSet<Mobile> m_Table = new HashSet<Mobile>();
[Constructible]
public Ilhenir()
@ -230,13 +230,14 @@ namespace Server.Mobiles
public virtual void CacophonicAttack(Mobile to)
{
if (to.Alive && to.Player && !m_Table.ContainsKey(to))
if (to.Alive && to.Player && !UnderCacophonicAttack(to))
{
to.Send(SpeedControl.WalkSpeed);
to.SendLocalizedMessage(1072069); // A cacophonic sound lambastes you, suppressing your ability to move.
to.PlaySound(0x584);
m_Table[to] = Timer.DelayCall(TimeSpan.FromSeconds(30), CacophonicEnd, to);
m_Table.Add(to);
Timer.DelayCall(TimeSpan.FromSeconds(30), CacophonicEnd, to);
}
}
@ -248,7 +249,7 @@ namespace Server.Mobiles
public static bool UnderCacophonicAttack(Mobile from)
{
return m_Table.ContainsKey(from);
return m_Table.Contains(from);
}
public virtual void DropOoze()