diff --git a/Scripts/Mobiles/Vendors/PlayerVendor.cs b/Scripts/Mobiles/Vendors/PlayerVendor.cs index 5a13b6251..985271838 100644 --- a/Scripts/Mobiles/Vendors/PlayerVendor.cs +++ b/Scripts/Mobiles/Vendors/PlayerVendor.cs @@ -432,20 +432,16 @@ namespace Server.Mobiles private void UpgradeFromVersion0( object newVendorSystem ) { - ArrayList toRemove = new ArrayList(); + List toRemove = new List(); foreach ( VendorItem vi in m_SellItems.Values ) - { if ( !CanBeVendorItem( vi.Item ) ) toRemove.Add( vi.Item ); else vi.Description = Utility.FixHtml( vi.Description ); - } foreach ( Item item in toRemove ) - { RemoveVendorItem( item ); - } House = BaseHouse.FindHouseAt( this ); diff --git a/Scripts/Spells/Bushido/MomentumStrike.cs b/Scripts/Spells/Bushido/MomentumStrike.cs index e9be7fe45..6f5a5a98c 100644 --- a/Scripts/Spells/Bushido/MomentumStrike.cs +++ b/Scripts/Spells/Bushido/MomentumStrike.cs @@ -1,5 +1,5 @@ using System; -using System.Collections; +using System.Collections.Generic; using Server.Network; using Server.Items; using Server.Mobiles; @@ -27,7 +27,7 @@ namespace Server.Spells.Bushido BaseWeapon weapon = attacker.Weapon as BaseWeapon; - ArrayList targets = new ArrayList(); + List targets = new List(); foreach ( Mobile m in attacker.GetMobilesInRange( weapon.MaxRange ) ) { @@ -45,7 +45,7 @@ namespace Server.Spells.Bushido if ( !CheckMana( attacker, true ) ) return; - Mobile target = (Mobile)targets[Utility.Random( targets.Count )]; + Mobile target = targets[Utility.Random( targets.Count )]; double damageBonus = attacker.Skills[SkillName.Bushido].Value / 100.0; diff --git a/Scripts/Spells/Chivalry/DispelEvil.cs b/Scripts/Spells/Chivalry/DispelEvil.cs index 499b42390..8b7920cef 100644 --- a/Scripts/Spells/Chivalry/DispelEvil.cs +++ b/Scripts/Spells/Chivalry/DispelEvil.cs @@ -1,5 +1,5 @@ using System; -using System.Collections; +using System.Collections.Generic; using Server.Network; using Server.Items; using Server.Targeting; @@ -38,7 +38,7 @@ namespace Server.Spells.Chivalry { if ( CheckSequence() ) { - ArrayList targets = new ArrayList(); + List targets = new List(); foreach ( Mobile m in Caster.GetMobilesInRange( 8 ) ) { @@ -55,7 +55,7 @@ namespace Server.Spells.Chivalry for ( int i = 0; i < targets.Count; ++i ) { - Mobile m = (Mobile)targets[i]; + Mobile m = targets[i]; BaseCreature bc = m as BaseCreature; if ( bc != null ) diff --git a/Scripts/Spells/Chivalry/HolyLight.cs b/Scripts/Spells/Chivalry/HolyLight.cs index 1797532db..e2200e075 100644 --- a/Scripts/Spells/Chivalry/HolyLight.cs +++ b/Scripts/Spells/Chivalry/HolyLight.cs @@ -1,5 +1,5 @@ using System; -using System.Collections; +using System.Collections.Generic; using Server.Network; using Server.Items; using Server.Targeting; @@ -31,13 +31,11 @@ namespace Server.Spells.Chivalry { if ( CheckSequence() ) { - ArrayList targets = new ArrayList(); + List targets = new List(); foreach ( Mobile m in Caster.GetMobilesInRange( 3 ) ) - { if ( Caster != m && SpellHelper.ValidIndirectTarget( Caster, m ) && Caster.CanBeHarmful( m, false ) ) targets.Add( m ); - } Caster.PlaySound( 0x212 ); Caster.PlaySound( 0x206 ); @@ -47,7 +45,7 @@ namespace Server.Spells.Chivalry for ( int i = 0; i < targets.Count; ++i ) { - Mobile m = (Mobile)targets[i]; + Mobile m = targets[i]; int damage = ComputePowerValue( 10 ) + Utility.RandomMinMax( 0, 2 ); diff --git a/Scripts/Spells/Eighth/Earthquake.cs b/Scripts/Spells/Eighth/Earthquake.cs index f4f64ee01..e6d80f764 100644 --- a/Scripts/Spells/Eighth/Earthquake.cs +++ b/Scripts/Spells/Eighth/Earthquake.cs @@ -1,5 +1,5 @@ using System; -using System.Collections; +using System.Collections.Generic; using Server.Network; using Server.Items; using Server.Targeting; @@ -30,24 +30,20 @@ namespace Server.Spells.Eighth { if ( SpellHelper.CheckTown( Caster, Caster ) && CheckSequence() ) { - ArrayList targets = new ArrayList(); + List targets = new List(); Map map = Caster.Map; if ( map != null ) - { foreach ( Mobile m in Caster.GetMobilesInRange( 1 + (int)(Caster.Skills[SkillName.Magery].Value / 15.0) ) ) - { if ( Caster != m && SpellHelper.ValidIndirectTarget( Caster, m ) && Caster.CanBeHarmful( m, false ) && (!Core.AOS || Caster.InLOS( m )) ) targets.Add( m ); - } - } Caster.PlaySound( 0x2F3 ); for ( int i = 0; i < targets.Count; ++i ) { - Mobile m = (Mobile)targets[i]; + Mobile m = targets[i]; int damage; diff --git a/Scripts/Spells/Fourth/ArchCure.cs b/Scripts/Spells/Fourth/ArchCure.cs index 4271848a3..e7bbeb4fc 100644 --- a/Scripts/Spells/Fourth/ArchCure.cs +++ b/Scripts/Spells/Fourth/ArchCure.cs @@ -1,5 +1,5 @@ using System; -using System.Collections; +using System.Collections.Generic; using Server.Network; using Server.Items; using Server.Targeting; @@ -42,7 +42,7 @@ namespace Server.Spells.Fourth SpellHelper.GetSurfaceTop( ref p ); - ArrayList targets = new ArrayList(); + List targets = new List(); Map map = Caster.Map; @@ -68,7 +68,7 @@ namespace Server.Spells.Fourth for ( int i = 0; i < targets.Count; ++i ) { - Mobile m = (Mobile)targets[i]; + Mobile m = targets[i]; Caster.DoBeneficial( m ); diff --git a/Scripts/Spells/Fourth/ArchProtection.cs b/Scripts/Spells/Fourth/ArchProtection.cs index 5f6a798b4..94d8958cb 100644 --- a/Scripts/Spells/Fourth/ArchProtection.cs +++ b/Scripts/Spells/Fourth/ArchProtection.cs @@ -1,5 +1,5 @@ using System; -using System.Collections; +using System.Collections.Generic; using Server.Network; using Server.Items; using Server.Targeting; @@ -41,7 +41,7 @@ namespace Server.Spells.Fourth SpellHelper.GetSurfaceTop( ref p ); - ArrayList targets = new ArrayList(); + List targets = new List(); Map map = Caster.Map; @@ -64,9 +64,9 @@ namespace Server.Spells.Fourth for ( int i = 0; i < targets.Count; ++i ) { - Mobile m = (Mobile)targets[i]; + Mobile m = targets[i]; - if ( m == Caster || (party != null && party.Contains( m )) ) + if ( m == Caster || ( party != null && party.Contains( m ) ) ) { Caster.DoBeneficial( m ); Spells.Second.ProtectionSpell.Toggle( Caster, m ); @@ -83,7 +83,7 @@ namespace Server.Spells.Fourth { for ( int i = 0; i < targets.Count; ++i ) { - Mobile m = (Mobile)targets[i]; + Mobile m = targets[i]; if ( m.BeginAction( typeof( ArchProtectionSpell ) ) ) { diff --git a/Scripts/Spells/Necromancy/AnimateDeadSpell.cs b/Scripts/Spells/Necromancy/AnimateDeadSpell.cs index 71f28640a..022cfd7c4 100644 --- a/Scripts/Spells/Necromancy/AnimateDeadSpell.cs +++ b/Scripts/Spells/Necromancy/AnimateDeadSpell.cs @@ -1,5 +1,5 @@ using System; -using System.Collections; +using System.Collections.Generic; using Server.Network; using Server.Mobiles; using Server.Targeting; @@ -195,7 +195,7 @@ namespace Server.Spells.Necromancy if ( c.Owner != null ) type = c.Owner.GetType(); - if ( c.ItemID != 0x2006 || c.Channeled || type == typeof( PlayerMobile ) || type == null || (c.Owner != null && c.Owner.Fame < 100) || ((c.Owner != null) && (c.Owner is BaseCreature) && (((BaseCreature)c.Owner).Summoned || ((BaseCreature)c.Owner).IsBonded)) ) + if ( c.ItemID != 0x2006 || c.Channeled || type == typeof( PlayerMobile ) || type == null || ( c.Owner != null && c.Owner.Fame < 100 ) || ( ( c.Owner != null ) && ( c.Owner is BaseCreature ) && ( ((BaseCreature)c.Owner).Summoned || ((BaseCreature)c.Owner).IsBonded)) ) { Caster.SendLocalizedMessage( 1061085 ); // There's not enough life force there to animate. } @@ -229,14 +229,15 @@ namespace Server.Spells.Necromancy FinishSequence(); } - private static Hashtable m_Table = new Hashtable(); + private static Dictionary> m_Table = new Dictionary>(); public static void Unregister( Mobile master, Mobile summoned ) { if ( master == null ) return; - ArrayList list = (ArrayList)m_Table[master]; + List list = null; + m_Table.TryGetValue( master, out list ); if ( list == null ) return; @@ -252,17 +253,18 @@ namespace Server.Spells.Necromancy if ( master == null ) return; - ArrayList list = (ArrayList)m_Table[master]; + List list = null; + m_Table.TryGetValue( master, out list ); if ( list == null ) - m_Table[master] = list = new ArrayList(); + m_Table[master] = list = new List(); for ( int i = list.Count - 1; i >= 0; --i ) { if ( i >= list.Count ) continue; - Mobile mob = (Mobile)list[i]; + Mobile mob = list[i]; if ( mob.Deleted ) list.RemoveAt( i-- ); @@ -271,7 +273,7 @@ namespace Server.Spells.Necromancy list.Add( summoned ); if ( list.Count > 3 ) - Timer.DelayCall( TimeSpan.Zero, new TimerCallback( ((Mobile)list[0]).Kill ) ); + Timer.DelayCall( TimeSpan.Zero, new TimerCallback( list[0].Kill ) ); Timer.DelayCall( TimeSpan.FromSeconds( 2.0 ), TimeSpan.FromSeconds( 2.0 ), new TimerStateCallback( Summoned_Damage ), summoned ); }