massive branch sync

This commit is contained in:
mark 2010-04-25 06:09:43 +00:00
parent 489bbabe93
commit b3e8ec0a08
192 changed files with 1249 additions and 1124 deletions

View file

@ -101,7 +101,7 @@ namespace Server.Engines.Doom
m_Teles = new List<Item>();
for (; i<15; i++)
m_Teles.Add( AddLeverPuzzlePart( TA[i], new LampRoomTelePorter( TA[++i] )));
m_Teles.Add( AddLeverPuzzlePart( TA[i], new LampRoomTeleporter( TA[++i] )));
m_Statues = new List<Item>();
for (; i<19; i++)
@ -266,7 +266,7 @@ namespace Server.Engines.Doom
/* if one bit in each of the four nibbles is set, this is false */
if( (TheirKey=(ushort)(code|(TheirKey<<=4))) < 4095 )
if( (TheirKey=(ushort)(code|(TheirKey<<=4))) < 0x0FFF )
{
l_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 30.0 ), new TimerCallback( ResetPuzzle ));
return;

View file

@ -152,9 +152,11 @@ namespace Server.Engines.Doom
m_Controller = reader.ReadItem() as LeverPuzzleController;
}
}
public class LampRoomTelePorter : Item
[TypeAlias( "Server.Engines.Doom.LampRoomTelePorter" )]
public class LampRoomTeleporter : Item
{
public LampRoomTelePorter( int[] dat )
public LampRoomTeleporter( int[] dat )
{
Hue = dat[1];
ItemID = dat[0];
@ -180,7 +182,7 @@ namespace Server.Engines.Doom
return true;
}
public LampRoomTelePorter( Serial serial ) : base( serial )
public LampRoomTeleporter( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )

View file

@ -884,25 +884,28 @@ namespace Server.Factions
public const double SkillLossFactor = 1.0 / 3;
public static readonly TimeSpan SkillLossPeriod = TimeSpan.FromMinutes( 20.0 );
private static Hashtable m_SkillLoss = new Hashtable();
private static Dictionary<Mobile, SkillLossContext> m_SkillLoss = new Dictionary<Mobile, SkillLossContext>();
private class SkillLossContext
{
public Timer m_Timer;
public ArrayList m_Mods;
public List<SkillMod> m_Mods;
}
public static bool InSkillLoss( Mobile mob )
{
return m_SkillLoss.ContainsKey( mob );
}
public static void ApplySkillLoss( Mobile mob )
{
SkillLossContext context = (SkillLossContext)m_SkillLoss[mob];
if ( context != null )
if ( InSkillLoss( mob ) )
return;
context = new SkillLossContext();
SkillLossContext context = new SkillLossContext();
m_SkillLoss[mob] = context;
ArrayList mods = context.m_Mods = new ArrayList();
List<SkillMod> mods = context.m_Mods = new List<SkillMod>();
for ( int i = 0; i < mob.Skills.Length; ++i )
{
@ -928,18 +931,17 @@ namespace Server.Factions
public static bool ClearSkillLoss( Mobile mob )
{
SkillLossContext context = (SkillLossContext)m_SkillLoss[mob];
SkillLossContext context;
if ( context == null ) {
if ( !m_SkillLoss.TryGetValue( mob, out context ) )
return false;
}
m_SkillLoss.Remove( mob );
ArrayList mods = context.m_Mods;
List<SkillMod> mods = context.m_Mods;
for ( int i = 0; i < mods.Count; ++i )
mob.RemoveSkillMod( (SkillMod) mods[i] );
mob.RemoveSkillMod( mods[i] );
context.m_Timer.Stop();

View file

@ -673,7 +673,7 @@ namespace Server.Factions
int dexMod = GetStatMod( m_Guard, StatType.Dex );
int intMod = GetStatMod( m_Guard, StatType.Int );
ArrayList types = new ArrayList();
List<Type> types = new List<Type>();
if ( strMod <= 0 )
types.Add( typeof( StrengthSpell ) );
@ -689,7 +689,7 @@ namespace Server.Factions
if ( types.Count > 1 )
spell = new BlessSpell( m_Guard, null );
else if ( types.Count == 1 )
spell = (Spell) Activator.CreateInstance( (Type) types[0], new object[]{ m_Guard, null } );
spell = (Spell) Activator.CreateInstance( types[0], new object[]{ m_Guard, null } );
}
else if ( types.Count > 0 )
{
@ -712,7 +712,7 @@ namespace Server.Factions
int dexMod = GetStatMod( combatant, StatType.Dex );
int intMod = GetStatMod( combatant, StatType.Int );
ArrayList types = new ArrayList();
List<Type> types = new List<Type>();
if ( strMod >= 0 )
types.Add( typeof( WeakenSpell ) );
@ -726,7 +726,7 @@ namespace Server.Factions
if ( types.Count > 1 )
spell = new CurseSpell( m_Guard, null );
else if ( types.Count == 1 )
spell = (Spell) Activator.CreateInstance( (Type) types[0], new object[]{ m_Guard, null } );
spell = (Spell) Activator.CreateInstance( types[0], new object[]{ m_Guard, null } );
}
}
}

View file

@ -1,5 +1,5 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Server;
using Server.Mobiles;
@ -44,8 +44,8 @@ namespace Server.Factions
m_Town.UnregisterVendor( this );
}
private ArrayList m_SBInfos = new ArrayList();
protected override ArrayList SBInfos{ get { return m_SBInfos; } }
private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
public override void InitSBInfo()
{

View file

@ -1,5 +1,5 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Server;
using Server.Items;
using Server.Mobiles;
@ -47,7 +47,7 @@ namespace Server.Factions
public class SBFactionBoard : SBInfo
{
private ArrayList m_BuyInfo = new InternalBuyInfo();
private List<GenericBuyInfo> m_BuyInfo = new InternalBuyInfo();
private IShopSellInfo m_SellInfo = new InternalSellInfo();
public SBFactionBoard()
@ -55,9 +55,9 @@ namespace Server.Factions
}
public override IShopSellInfo SellInfo { get { return m_SellInfo; } }
public override ArrayList BuyInfo { get { return m_BuyInfo; } }
public override List<GenericBuyInfo> BuyInfo { get { return m_BuyInfo; } }
public class InternalBuyInfo : ArrayList
public class InternalBuyInfo : List<GenericBuyInfo>
{
public InternalBuyInfo()
{

View file

@ -1,5 +1,5 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Server;
using Server.Items;
using Server.Mobiles;
@ -52,7 +52,7 @@ namespace Server.Factions
public class SBFactionBottle : SBInfo
{
private ArrayList m_BuyInfo = new InternalBuyInfo();
private List<GenericBuyInfo> m_BuyInfo = new InternalBuyInfo();
private IShopSellInfo m_SellInfo = new InternalSellInfo();
public SBFactionBottle()
@ -60,9 +60,9 @@ namespace Server.Factions
}
public override IShopSellInfo SellInfo { get { return m_SellInfo; } }
public override ArrayList BuyInfo { get { return m_BuyInfo; } }
public override List<GenericBuyInfo> BuyInfo { get { return m_BuyInfo; } }
public class InternalBuyInfo : ArrayList
public class InternalBuyInfo : List<GenericBuyInfo>
{
public InternalBuyInfo()
{

View file

@ -4,6 +4,7 @@ using Server;
using Server.Items;
using Server.Mobiles;
using Server.Network;
using System.Collections.Generic;
namespace Server.Factions
{
@ -55,12 +56,12 @@ namespace Server.Factions
{
}
public override bool OnBuyItems( Mobile buyer, ArrayList list )
public override bool OnBuyItems( Mobile buyer, List<BuyItemResponse> list )
{
return false;
}
public override bool OnSellItems( Mobile seller, ArrayList list )
public override bool OnSellItems( Mobile seller, List<SellItemResponse> list )
{
return false;
}

View file

@ -1,5 +1,5 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Server;
using Server.Items;
using Server.Mobiles;
@ -48,7 +48,7 @@ namespace Server.Factions
public class SBFactionOre : SBInfo
{
private ArrayList m_BuyInfo = new InternalBuyInfo();
private List<GenericBuyInfo> m_BuyInfo = new InternalBuyInfo();
private IShopSellInfo m_SellInfo = new InternalSellInfo();
public SBFactionOre()
@ -56,9 +56,9 @@ namespace Server.Factions
}
public override IShopSellInfo SellInfo { get { return m_SellInfo; } }
public override ArrayList BuyInfo { get { return m_BuyInfo; } }
public override List<GenericBuyInfo> BuyInfo { get { return m_BuyInfo; } }
public class InternalBuyInfo : ArrayList
public class InternalBuyInfo : List<GenericBuyInfo>
{
public InternalBuyInfo()
{

View file

@ -1,5 +1,5 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Server;
using Server.Items;
using Server.Mobiles;
@ -57,7 +57,7 @@ namespace Server.Factions
public class SBFactionReagent : SBInfo
{
private ArrayList m_BuyInfo = new InternalBuyInfo();
private List<GenericBuyInfo> m_BuyInfo = new InternalBuyInfo();
private IShopSellInfo m_SellInfo = new InternalSellInfo();
public SBFactionReagent()
@ -65,9 +65,9 @@ namespace Server.Factions
}
public override IShopSellInfo SellInfo { get { return m_SellInfo; } }
public override ArrayList BuyInfo { get { return m_BuyInfo; } }
public override List<GenericBuyInfo> BuyInfo { get { return m_BuyInfo; } }
public class InternalBuyInfo : ArrayList
public class InternalBuyInfo : List<GenericBuyInfo>
{
public InternalBuyInfo()
{

View file

@ -5,15 +5,16 @@ using Server.Network;
using Server.Targeting;
using Server.Factions;
using Server.Commands;
using System.Collections.Generic;
namespace Server.Engines.PartySystem
{
public class Party : IParty
{
private Mobile m_Leader;
private ArrayList m_Members;
private ArrayList m_Candidates;
private ArrayList m_Listeners; // staff listening
private List<PartyMemberInfo> m_Members;
private List<Mobile> m_Candidates;
private List<Mobile> m_Listeners; // staff listening
public const int Capacity = 10;
@ -148,9 +149,9 @@ namespace Server.Engines.PartySystem
{
m_Leader = leader;
m_Members = new ArrayList();
m_Candidates = new ArrayList();
m_Listeners = new ArrayList();
m_Members = new List<PartyMemberInfo>();
m_Candidates = new List<Mobile>();
m_Listeners = new List<Mobile>();
m_Members.Add( new PartyMemberInfo( leader ) );
}
@ -335,10 +336,10 @@ namespace Server.Engines.PartySystem
for ( int i = 0; i < m_Listeners.Count; ++i )
{
Mobile mob = (Mobile)m_Listeners[i];
Mobile mob = m_Listeners[i];
if ( mob.Party != this )
((Mobile)m_Listeners[i]).SendMessage( "[{0}]: {1}", from.Name, text );
m_Listeners[i].SendMessage( "[{0}]: {1}", from.Name, text );
}
SendToStaffMessage( from, "[Party]: {0}", text );
@ -350,10 +351,10 @@ namespace Server.Engines.PartySystem
for ( int i = 0; i < m_Listeners.Count; ++i )
{
Mobile mob = (Mobile)m_Listeners[i];
Mobile mob = m_Listeners[i];
if ( mob.Party != this )
((Mobile)m_Listeners[i]).SendMessage( "[{0}]->[{1}]: {2}", from.Name, to.Name, text );
m_Listeners[i].SendMessage( "[{0}]->[{1}]: {2}", from.Name, to.Name, text );
}
SendToStaffMessage( from, "[Party]->[{0}]: {1}", to.Name, text );
@ -388,13 +389,13 @@ namespace Server.Engines.PartySystem
p.Acquire();
for ( int i = 0; i < m_Members.Count; ++i )
((PartyMemberInfo)m_Members[i]).Mobile.Send( p );
m_Members[i].Mobile.Send( p );
if ( p is MessageLocalized || p is MessageLocalizedAffix || p is UnicodeMessage || p is AsciiMessage )
{
for ( int i = 0; i < m_Listeners.Count; ++i )
{
Mobile mob = (Mobile)m_Listeners[i];
Mobile mob = m_Listeners[i];
if ( mob.Party != this )
mob.Send( p );
@ -410,7 +411,7 @@ namespace Server.Engines.PartySystem
for ( int i = 0; i < m_Members.Count; ++i )
{
Mobile c = ((PartyMemberInfo)m_Members[i]).Mobile;
Mobile c = m_Members[i].Mobile;
if ( c != m && m.Map == c.Map && Utility.InUpdateRange( c, m ) && c.CanSee( m ) )
{
@ -430,7 +431,7 @@ namespace Server.Engines.PartySystem
for ( int i = 0; i < m_Members.Count; ++i )
{
Mobile c = ((PartyMemberInfo)m_Members[i]).Mobile;
Mobile c = m_Members[i].Mobile;
if ( c != m && m.Map == c.Map && Utility.InUpdateRange( c, m ) && c.CanSee( m ) )
{
@ -458,17 +459,17 @@ namespace Server.Engines.PartySystem
public int Count{ get{ return m_Members.Count; } }
public bool Active{ get{ return m_Members.Count > 1; } }
public Mobile Leader{ get{ return m_Leader; } }
public ArrayList Members{ get{ return m_Members; } }
public ArrayList Candidates{ get{ return m_Candidates; } }
public List<PartyMemberInfo> Members{ get{ return m_Members; } }
public List<Mobile> Candidates { get { return m_Candidates; } }
public PartyMemberInfo this[int index]{ get{ return (PartyMemberInfo)m_Members[index]; } }
public PartyMemberInfo this[int index]{ get{ return m_Members[index]; } }
public PartyMemberInfo this[Mobile m]
{
get
{
for ( int i = 0; i < m_Members.Count; ++i )
if ( ((PartyMemberInfo)m_Members[i]).Mobile == m )
return (PartyMemberInfo)m_Members[i];
if ( m_Members[i].Mobile == m )
return m_Members[i];
return null;
}

View file

@ -28,8 +28,8 @@ namespace Server.Engines.Quests
public abstract class BaseQuester : BaseVendor
{
protected ArrayList m_SBInfos = new ArrayList();
protected override ArrayList SBInfos{ get { return m_SBInfos; } }
protected List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
public override bool IsActiveVendor{ get{ return false; } }
public override bool IsInvulnerable{ get{ return true; } }

View file

@ -1,5 +1,5 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Server;
using Server.Mobiles;
using Server.Items;
@ -161,7 +161,7 @@ namespace Server.Engines.Quests.Haven
public class SBDryad : SBInfo
{
private ArrayList m_BuyInfo = new InternalBuyInfo();
private List<GenericBuyInfo> m_BuyInfo = new InternalBuyInfo();
private IShopSellInfo m_SellInfo = new InternalSellInfo();
public SBDryad()
@ -169,9 +169,9 @@ namespace Server.Engines.Quests.Haven
}
public override IShopSellInfo SellInfo { get { return m_SellInfo; } }
public override ArrayList BuyInfo { get { return m_BuyInfo; } }
public override List<GenericBuyInfo> BuyInfo { get { return m_BuyInfo; } }
public class InternalBuyInfo : ArrayList
public class InternalBuyInfo : List<GenericBuyInfo>
{
public InternalBuyInfo()
{

View file

@ -2,6 +2,7 @@ using System;
using Server;
using Server.Network;
using System.Collections;
using System.Collections.Generic;
using Server.Items;
using Server.Gumps;
using Server.Misc;
@ -192,8 +193,8 @@ namespace Server.Mobiles
public override bool ClickTitle { get { return true; } }
public override bool CanTeach { get { return false; } }
protected ArrayList m_SBInfos = new ArrayList();
protected override ArrayList SBInfos { get { return m_SBInfos; } }
protected List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override List<SBInfo> SBInfos { get { return m_SBInfos; } }
public override void InitSBInfo()
{