diff --git a/Scripts/Skills/AnimalTaming.cs b/Scripts/Skills/AnimalTaming.cs index 0d02d7bf7..bf759d8ce 100644 --- a/Scripts/Skills/AnimalTaming.cs +++ b/Scripts/Skills/AnimalTaming.cs @@ -1,5 +1,5 @@ using System; -using System.Collections; +using System.Collections.Generic; using Server; using Server.Targeting; using Server.Network; @@ -12,7 +12,7 @@ namespace Server.SkillHandlers { public class AnimalTaming { - private static Hashtable m_BeingTamed = new Hashtable(); + private static Dictionary m_BeingTamed = new Dictionary(); public static void Initialize() { @@ -182,7 +182,7 @@ namespace Server.SkillHandlers } } - if ( m_BeingTamed.Contains( targeted ) ) + if ( m_BeingTamed.ContainsKey( creature ) ) { creature.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 502802, from.NetState ); // Someone else is already taming this. } @@ -211,7 +211,7 @@ namespace Server.SkillHandlers } else { - m_BeingTamed[targeted] = from; + m_BeingTamed[creature] = from; from.LocalOverheadMessage( MessageType.Emote, 0x59, 1010597 ); // You start to tame the creature. from.NonlocalOverheadMessage( MessageType.Emote, 0x59, 1010598 ); // *begins taming a creature.* diff --git a/Scripts/Skills/Inscribe.cs b/Scripts/Skills/Inscribe.cs index f87cdc46a..12a392a88 100644 --- a/Scripts/Skills/Inscribe.cs +++ b/Scripts/Skills/Inscribe.cs @@ -1,5 +1,5 @@ using System; -using System.Collections; +using System.Collections.Generic; using Server; using Server.Targeting; using Server.Items; @@ -23,7 +23,7 @@ namespace Server.SkillHandlers return TimeSpan.FromSeconds( 1.0 ); } - private static Hashtable m_UseTable = new Hashtable(); + private static Dictionary m_UseTable = new Dictionary(); private static void SetUser( BaseBook book, Mobile mob ) { @@ -37,7 +37,9 @@ namespace Server.SkillHandlers public static Mobile GetUser( BaseBook book ) { - return (Mobile)m_UseTable[book]; + Mobile m = null; + m_UseTable.TryGetValue(book, out m); + return m; } public static bool IsEmpty( BaseBook book ) diff --git a/Scripts/Spells/Sixth/Invisibility.cs b/Scripts/Spells/Sixth/Invisibility.cs index 35596f69a..5854d1583 100644 --- a/Scripts/Spells/Sixth/Invisibility.cs +++ b/Scripts/Spells/Sixth/Invisibility.cs @@ -1,5 +1,5 @@ using System; -using System.Collections; +using System.Collections.Generic; using Server; using Server.Targeting; using Server.Items; @@ -76,16 +76,17 @@ namespace Server.Spells.Sixth FinishSequence(); } - private static Hashtable m_Table = new Hashtable(); + private static Dictionary m_Table = new Dictionary(); public static bool HasTimer( Mobile m ) { - return m_Table[m] != null; + return m_Table.ContainsKey(m); } public static void RemoveTimer( Mobile m ) { - Timer t = (Timer)m_Table[m]; + Timer t = null; + m_Table.TryGetValue(m, out t); if ( t != null ) {