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

@ -80,15 +80,8 @@
2804 2255 2804 2255
2850 2252 2850 2252
2932 2240 2932 2240
# 3568 2402
# 3702 2825
# 3511 2421
# 3533 2471
# 3417 2675
3425 2723 3425 2723
3476 2761 3476 2761
# 3541 2784
# 3558 2819
3594 2825 3594 2825
4419 3117 4419 3117
4471 3188 4471 3188

View file

@ -225,7 +225,7 @@ namespace Server.Accounting
/// </summary> /// </summary>
public bool Inactive public bool Inactive
{ {
get { return ( ( m_LastLogin + InactiveDuration ) <= DateTime.Now ); } get { return ( ( m_LastLogin + InactiveDuration ) <= DateTime.Now && AccessLevel == AccessLevel.Player ); }
} }
/// <summary> /// <summary>
@ -365,7 +365,7 @@ namespace Server.Accounting
string tagDuration = GetTag( "BanDuration" ); string tagDuration = GetTag( "BanDuration" );
if ( tagTime != null ) if ( tagTime != null )
banTime = Utility.GetDateTime( tagTime, DateTime.MinValue ); banTime = Utility.GetXMLDateTime( tagTime, DateTime.MinValue );
else else
banTime = DateTime.MinValue; banTime = DateTime.MinValue;
@ -657,9 +657,9 @@ namespace Server.Accounting
} }
m_AccessLevel = (AccessLevel)Enum.Parse( typeof( AccessLevel ), Utility.GetText( node["accessLevel"], "Player" ), true ); m_AccessLevel = (AccessLevel)Enum.Parse( typeof( AccessLevel ), Utility.GetText( node["accessLevel"], "Player" ), true );
m_Flags = Utility.GetInt32( Utility.GetText( node["flags"], "0" ), 0 ); m_Flags = Utility.GetXMLInt32( Utility.GetText( node["flags"], "0" ), 0 );
m_Created = Utility.GetDateTime( Utility.GetText( node["created"], null ), DateTime.Now ); m_Created = Utility.GetXMLDateTime( Utility.GetText( node["created"], null ), DateTime.Now );
m_LastLogin = Utility.GetDateTime( Utility.GetText( node["lastLogin"], null ), DateTime.Now ); m_LastLogin = Utility.GetXMLDateTime( Utility.GetText( node["lastLogin"], null ), DateTime.Now );
m_Mobiles = LoadMobiles( node ); m_Mobiles = LoadMobiles( node );
m_Comments = LoadComments( node ); m_Comments = LoadComments( node );
@ -673,7 +673,7 @@ namespace Server.Accounting
m_Mobiles[i].Account = this; m_Mobiles[i].Account = this;
} }
TimeSpan totalGameTime = Utility.GetTimeSpan( Utility.GetText( node["totalGameTime"], null ), TimeSpan.Zero ); TimeSpan totalGameTime = Utility.GetXMLTimeSpan( Utility.GetText( node["totalGameTime"], null ), TimeSpan.Zero );
if ( totalGameTime == TimeSpan.Zero ) if ( totalGameTime == TimeSpan.Zero )
{ {
for ( int i = 0; i < m_Mobiles.Length; i++ ) for ( int i = 0; i < m_Mobiles.Length; i++ )
@ -736,7 +736,7 @@ namespace Server.Accounting
if ( addressList != null ) if ( addressList != null )
{ {
int count = Utility.GetInt32( Utility.GetAttribute( addressList, "count", "0" ), 0 ); int count = Utility.GetXMLInt32( Utility.GetAttribute( addressList, "count", "0" ), 0 );
list = new IPAddress[count]; list = new IPAddress[count];
@ -793,8 +793,8 @@ namespace Server.Accounting
{ {
try try
{ {
int index = Utility.GetInt32( Utility.GetAttribute( ele, "index", "0" ), 0 ); int index = Utility.GetXMLInt32( Utility.GetAttribute( ele, "index", "0" ), 0 );
int serial = Utility.GetInt32( Utility.GetText( ele, "0" ), 0 ); int serial = Utility.GetXMLInt32( Utility.GetText( ele, "0" ), 0 );
if ( index >= 0 && index < list.Length ) if ( index >= 0 && index < list.Length )
list[index] = World.FindMobile( serial ); list[index] = World.FindMobile( serial );

View file

@ -53,7 +53,7 @@ namespace Server.Accounting
public AccountComment( XmlElement node ) public AccountComment( XmlElement node )
{ {
m_AddedBy = Utility.GetAttribute( node, "addedBy", "empty" ); m_AddedBy = Utility.GetAttribute( node, "addedBy", "empty" );
m_LastModified = Utility.GetDateTime( Utility.GetAttribute( node, "lastModified" ), DateTime.Now ); m_LastModified = Utility.GetXMLDateTime( Utility.GetAttribute( node, "lastModified" ), DateTime.Now );
m_Content = Utility.GetText( node, "" ); m_Content = Utility.GetText( node, "" );
} }

View file

@ -266,10 +266,18 @@ namespace Server.Commands
if( !( obj is IConvertible ) ) if( !( obj is IConvertible ) )
return "Property is not IConvertable."; return "Property is not IConvertable.";
long v = (long)Convert.ChangeType( obj, TypeCode.Int64 ); try
v += realValues[i]; {
realProps[i].SetValue( realObjs[i], Convert.ChangeType( v, realProps[i].PropertyType ), null ); long v = (long)Convert.ChangeType( obj, TypeCode.Int64 );
v += realValues[i];
realProps[i].SetValue( realObjs[i], Convert.ChangeType( v, realProps[i].PropertyType ), null );
}
catch
{
return "Value could not be converted";
}
} }
if ( realProps.Length == 1 ) if ( realProps.Length == 1 )

View file

@ -6,6 +6,7 @@ using Server.Gumps;
using Server.Items; using Server.Items;
using Server.Commands; using Server.Commands;
using Server.Targeting; using Server.Targeting;
using System.Collections.Generic;
namespace Server namespace Server
{ {
@ -201,7 +202,7 @@ namespace Server
for ( int i = 0; i < state.m_List.Count; ++i ) for ( int i = 0; i < state.m_List.Count; ++i )
{ {
Item item = (Item)state.m_List[i]; Item item = state.m_List[i];
int xOffset = item.X - (state.m_X * 8); int xOffset = item.X - (state.m_X * 8);
int yOffset = item.Y - (state.m_Y * 8); int yOffset = item.Y - (state.m_Y * 8);
@ -551,13 +552,13 @@ namespace Server
private class DeltaState private class DeltaState
{ {
public int m_X, m_Y; public int m_X, m_Y;
public ArrayList m_List; public List<Item> m_List;
public DeltaState( Point2D p ) public DeltaState( Point2D p )
{ {
m_X = p.X; m_X = p.X;
m_Y = p.Y; m_Y = p.Y;
m_List = new ArrayList(); m_List = new List<Item>();
} }
} }

View file

@ -101,7 +101,7 @@ namespace Server.Engines.Doom
m_Teles = new List<Item>(); m_Teles = new List<Item>();
for (; i<15; i++) 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>(); m_Statues = new List<Item>();
for (; i<19; i++) 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 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 )); l_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 30.0 ), new TimerCallback( ResetPuzzle ));
return; return;

View file

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

View file

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

View file

@ -673,7 +673,7 @@ namespace Server.Factions
int dexMod = GetStatMod( m_Guard, StatType.Dex ); int dexMod = GetStatMod( m_Guard, StatType.Dex );
int intMod = GetStatMod( m_Guard, StatType.Int ); int intMod = GetStatMod( m_Guard, StatType.Int );
ArrayList types = new ArrayList(); List<Type> types = new List<Type>();
if ( strMod <= 0 ) if ( strMod <= 0 )
types.Add( typeof( StrengthSpell ) ); types.Add( typeof( StrengthSpell ) );
@ -689,7 +689,7 @@ namespace Server.Factions
if ( types.Count > 1 ) if ( types.Count > 1 )
spell = new BlessSpell( m_Guard, null ); spell = new BlessSpell( m_Guard, null );
else if ( types.Count == 1 ) 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 ) else if ( types.Count > 0 )
{ {
@ -712,7 +712,7 @@ namespace Server.Factions
int dexMod = GetStatMod( combatant, StatType.Dex ); int dexMod = GetStatMod( combatant, StatType.Dex );
int intMod = GetStatMod( combatant, StatType.Int ); int intMod = GetStatMod( combatant, StatType.Int );
ArrayList types = new ArrayList(); List<Type> types = new List<Type>();
if ( strMod >= 0 ) if ( strMod >= 0 )
types.Add( typeof( WeakenSpell ) ); types.Add( typeof( WeakenSpell ) );
@ -726,7 +726,7 @@ namespace Server.Factions
if ( types.Count > 1 ) if ( types.Count > 1 )
spell = new CurseSpell( m_Guard, null ); spell = new CurseSpell( m_Guard, null );
else if ( types.Count == 1 ) 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;
using System.Collections; using System.Collections.Generic;
using Server; using Server;
using Server.Mobiles; using Server.Mobiles;
@ -44,8 +44,8 @@ namespace Server.Factions
m_Town.UnregisterVendor( this ); m_Town.UnregisterVendor( this );
} }
private ArrayList m_SBInfos = new ArrayList(); private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override ArrayList SBInfos{ get { return m_SBInfos; } } protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
public override void InitSBInfo() public override void InitSBInfo()
{ {

View file

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

View file

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

View file

@ -4,6 +4,7 @@ using Server;
using Server.Items; using Server.Items;
using Server.Mobiles; using Server.Mobiles;
using Server.Network; using Server.Network;
using System.Collections.Generic;
namespace Server.Factions 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; return false;
} }
public override bool OnSellItems( Mobile seller, ArrayList list ) public override bool OnSellItems( Mobile seller, List<SellItemResponse> list )
{ {
return false; return false;
} }

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -2353,11 +2353,9 @@ namespace Server.Gumps
{ {
ArrayList results = new ArrayList(); ArrayList results = new ArrayList();
DateTime minTime = DateTime.Now - Account.InactiveDuration;
foreach ( Account acct in Accounts.GetAccounts() ) foreach ( Account acct in Accounts.GetAccounts() )
{ {
if ( acct.LastLogin <= minTime ) if ( acct.Inactive )
results.Add( acct ); results.Add( acct );
} }

View file

@ -17,7 +17,7 @@ namespace Server.Guilds
{ {
m_ToLeader = toPromoteToLeader; m_ToLeader = toPromoteToLeader;
m_toKick = toKick; m_toKick = toKick;
m_Member = (PlayerMobile)member; m_Member = member;
PopulateGump(); PopulateGump();
} }

View file

@ -284,14 +284,8 @@ namespace Server.Gumps
int price; int price;
try if ( !int.TryParse( text, out price ) )
{ price = -1;
price = Convert.ToInt32( text );
}
catch
{
price = -1;
}
if ( price < 0 ) if ( price < 0 )
{ {
@ -512,14 +506,8 @@ namespace Server.Gumps
int price; int price;
try if ( !int.TryParse( text, out price ) )
{ price = -1;
price = Convert.ToInt32( text );
}
catch
{
price = -1;
}
if ( price < 0 ) if ( price < 0 )
{ {

View file

@ -476,9 +476,9 @@ namespace Server.Items
public override void Deserialize( GenericReader reader ) public override void Deserialize( GenericReader reader )
{ {
if ( CheckType( "PitcherWater" ) || CheckType( "GlassPitcher" ) ) if ( CheckType( "PitcherWater" ) || CheckType( "GlassPitcher" ) )
base.Deserialize( reader, false ); base.InternalDeserialize( reader, false );
else else
base.Deserialize( reader, true ); base.InternalDeserialize( reader, true );
int version = reader.ReadInt(); int version = reader.ReadInt();
@ -1141,10 +1141,10 @@ namespace Server.Items
public override void Deserialize( GenericReader reader ) public override void Deserialize( GenericReader reader )
{ {
Deserialize( reader, true ); InternalDeserialize( reader, true );
} }
public void Deserialize( GenericReader reader, bool read ) protected void InternalDeserialize( GenericReader reader, bool read )
{ {
base.Deserialize( reader ); base.Deserialize( reader );

View file

@ -90,17 +90,160 @@ namespace Server.Items
if ( !Core.SE ) if ( !Core.SE )
return false; return false;
return ( DateTime.Now > m_TimeOfDeath + InstancedCorpseTime ); return ( DateTime.Now < (m_TimeOfDeath + InstancedCorpseTime) );
} }
} }
public override bool IsDecoContainer private Dictionary<Item, InstancedItemInfo> m_InstancedItems;
private class InstancedItemInfo
{
private Mobile m_Mobile;
private Item m_Item;
private bool m_Perpetual; //Needed for Rummaged stuff. CONTRARY to the Patchlog, cause a later FoF contradicts it. Verify on OSI.
public bool Perpetual { get { return m_Perpetual; } set { m_Perpetual = value; } }
public InstancedItemInfo( Item i, Mobile m )
{
m_Item = i;
m_Mobile = m;
}
public bool IsOwner( Mobile m )
{
if ( m_Item.LootType == LootType.Cursed ) //Cursed Items are part of everyone's instanced corpse... (?)
return true;
if ( m == null )
return false; //sanity
if ( m_Mobile == m )
return true;
Party myParty = Party.Get( m_Mobile );
return (myParty != null && myParty == Party.Get( m ));
}
}
public override bool IsChildVisibleTo( Mobile m, Item child )
{
if ( !m.Player || m.AccessLevel > AccessLevel.Player ) //Staff and creatures not subject to instancing.
return true;
if ( m_InstancedItems != null )
{
InstancedItemInfo info;
if ( m_InstancedItems.TryGetValue( child, out info ) && (InstancedCorpse || info.Perpetual) )
{
return info.IsOwner( m ); //IsOwner checks Party stuff.
}
}
return true;
}
private void AssignInstancedLoot()
{
if ( m_Aggressors.Count == 0 || this.Items.Count == 0 )
return;
if ( m_InstancedItems == null )
m_InstancedItems = new Dictionary<Item, InstancedItemInfo>();
List<Item> m_Stackables = new List<Item>();
List<Item> m_Unstackables = new List<Item>();
for ( int i = 0; i < this.Items.Count; i++ )
{
Item item = this.Items[i];
if ( item.LootType != LootType.Cursed ) //Don't have curesd items take up someone's item spot.. (?)
{
if ( item.Stackable )
m_Stackables.Add( item );
else
m_Unstackables.Add( item );
}
}
List<Mobile> attackers = new List<Mobile>( m_Aggressors );
for ( int i = 1; i < attackers.Count -1; i++ ) //randomize
{
int rand = Utility.Random( i + 1 );
Mobile temp = attackers[rand];
attackers[rand] = attackers[i];
attackers[i] = temp;
}
//stackables first, for the remaining stackables, have those be randomly added after
for ( int i = 0; i < m_Stackables.Count; i++ )
{
Item item = m_Stackables[i];
if ( item.Amount >= attackers.Count )
{
int amountPerAttacker = (item.Amount / attackers.Count);
int remainder = (item.Amount % attackers.Count);
for ( int j = 0; j < ((remainder == 0) ? attackers.Count -1 : attackers.Count); j++ )
{
Item splitItem = Mobile.LiftItemDupe( item, item.Amount - amountPerAttacker ); //LiftItemDupe automagically adds it as a child item to the corpse
m_InstancedItems.Add( splitItem, new InstancedItemInfo( splitItem, attackers[j] ) );
//What happens to the remaining portion? TEMP FOR NOW UNTIL OSI VERIFICATION: Treat as Single Item.
}
if ( remainder == 0 )
{
m_InstancedItems.Add( item, new InstancedItemInfo( item, attackers[attackers.Count - 1] ) );
//Add in the original item (which has an equal amount as the others) to the instance for the last attacker, cause it wasn't added above.
}
else
{
m_Unstackables.Add( item );
}
}
else
{
//What happens in this case? TEMP FOR NOW UNTIL OSI VERIFICATION: Treat as Single Item.
m_Unstackables.Add( item );
}
}
for ( int i = 0; i < m_Unstackables.Count; i++ )
{
Mobile m = attackers[i % attackers.Count];
Item item = m_Unstackables[i];
m_InstancedItems.Add( item, new InstancedItemInfo( item, m ) );
}
}
public void AddCarvedItem( Item carved, Mobile carver )
{
this.DropItem( carved );
if ( this.InstancedCorpse )
{
if ( m_InstancedItems == null )
m_InstancedItems = new Dictionary<Item, InstancedItemInfo>();
m_InstancedItems.Add( carved, new InstancedItemInfo( carved, carver ) );
}
}
public override bool IsDecoContainer
{ {
get{ return false; } get{ return false; }
} }
private Dictionary<Mobile, List<Item>> m_InstancedItems;
[CommandProperty( AccessLevel.GameMaster )] [CommandProperty( AccessLevel.GameMaster )]
public DateTime TimeOfDeath public DateTime TimeOfDeath
{ {
@ -310,6 +453,9 @@ namespace Server.Items
if ( owner.Player && Core.AOS ) if ( owner.Player && Core.AOS )
c.SetRestoreInfo( item, item.Location ); c.SetRestoreInfo( item, item.Location );
} }
if ( !owner.Player )
c.AssignInstancedLoot();
} }
else else
{ {
@ -371,7 +517,9 @@ namespace Server.Items
m_EquipItems = equipItems; m_EquipItems = equipItems;
m_Aggressors = new List<Mobile>( owner.Aggressors.Count + owner.Aggressed.Count ); m_Aggressors = new List<Mobile>( owner.Aggressors.Count + owner.Aggressed.Count );
bool addToAggressors = !( owner is BaseCreature ); //bool addToAggressors = !( owner is BaseCreature );
bool isBaseCreature = (owner is BaseCreature);
TimeSpan lastTime = TimeSpan.MaxValue; TimeSpan lastTime = TimeSpan.MaxValue;
@ -385,7 +533,7 @@ namespace Server.Items
lastTime = (DateTime.Now - info.LastCombatTime); lastTime = (DateTime.Now - info.LastCombatTime);
} }
if ( addToAggressors && !info.CriminalAggression ) if ( !isBaseCreature && !info.CriminalAggression )
m_Aggressors.Add( info.Attacker ); m_Aggressors.Add( info.Attacker );
} }
@ -399,11 +547,11 @@ namespace Server.Items
lastTime = (DateTime.Now - info.LastCombatTime); lastTime = (DateTime.Now - info.LastCombatTime);
} }
if ( addToAggressors ) if ( !isBaseCreature )
m_Aggressors.Add( info.Defender ); m_Aggressors.Add( info.Defender );
} }
if ( !addToAggressors ) if ( isBaseCreature )
{ {
BaseCreature bc = (BaseCreature)owner; BaseCreature bc = (BaseCreature)owner;
@ -426,12 +574,6 @@ namespace Server.Items
DevourCorpse(); DevourCorpse();
} }
private void AssignInstancedLoot()
{
if ( m_InstancedItems == null )
m_InstancedItems = new Dictionary<Mobile, List<Item>>();
}
public Corpse( Serial serial ) : base( serial ) public Corpse( Serial serial ) : base( serial )
{ {
} }
@ -713,6 +855,9 @@ namespace Server.Items
if ( !m_Looters.Contains( from ) ) if ( !m_Looters.Contains( from ) )
m_Looters.Add( from ); m_Looters.Add( from );
if ( m_InstancedItems != null && m_InstancedItems.ContainsKey( item ) )
m_InstancedItems.Remove( item );
} }
public override void OnItemLifted( Mobile from, Item item ) public override void OnItemLifted( Mobile from, Item item )
@ -727,6 +872,9 @@ namespace Server.Items
if ( !m_Looters.Contains( from ) ) if ( !m_Looters.Contains( from ) )
m_Looters.Add( from ); m_Looters.Add( from );
if ( m_InstancedItems != null && m_InstancedItems.ContainsKey( item ) )
m_InstancedItems.Remove( item );
} }
private class OpenCorpseEntry : ContextMenuEntry private class OpenCorpseEntry : ContextMenuEntry

View file

@ -52,16 +52,38 @@ namespace Server.Items
} }
} }
private static object[,] m_Table = new object[,] private static TrophyInfo[] m_Table = new TrophyInfo[]
{ {
{ typeof( BrownBear ), 0x1E60, 1041093, 1041107 }, new TrophyInfo( typeof( BrownBear ), 0x1E60, 1041093, 1041107 ),
{ typeof( GreatHart ), 0x1E61, 1041095, 1041109 }, new TrophyInfo( typeof( GreatHart ), 0x1E61, 1041095, 1041109 ),
{ typeof( BigFish ), 0x1E62, 1041096, 1041110 }, new TrophyInfo( typeof( BigFish ), 0x1E62, 1041096, 1041110 ),
{ typeof( Gorilla ), 0x1E63, 1041091, 1041105 }, new TrophyInfo( typeof( Gorilla ), 0x1E63, 1041091, 1041105 ),
{ typeof( Orc ), 0x1E64, 1041090, 1041104 }, new TrophyInfo( typeof( Orc ), 0x1E64, 1041090, 1041104 ),
{ typeof( PolarBear ), 0x1E65, 1041094, 1041108 }, new TrophyInfo( typeof( PolarBear ), 0x1E65, 1041094, 1041108 ),
{ typeof( Troll ), 0x1E66, 1041092, 1041106 } new TrophyInfo( typeof( Troll ), 0x1E66, 1041092, 1041106 )
}; };
public class TrophyInfo
{
public TrophyInfo( Type type, int id, int deedNum, int addonNum )
{
m_CreatureType = type;
m_NorthID = id;
m_DeedNumber = deedNum;
m_AddonNumber = addonNum;
}
private Type m_CreatureType;
private int m_NorthID;
private int m_DeedNumber;
private int m_AddonNumber;
public Type CreatureType { get { return m_CreatureType; } }
public int NorthID { get { return m_NorthID; } }
public int DeedNumber { get { return m_DeedNumber; } }
public int AddonNumber { get { return m_AddonNumber; } }
}
private class CorpseTarget : Target private class CorpseTarget : Target
{ {
@ -100,43 +122,49 @@ namespace Server.Items
if ( obj is Corpse ) if ( obj is Corpse )
obj = ((Corpse)obj).Owner; obj = ((Corpse)obj).Owner;
for ( int i = 0; obj != null && i < m_Table.GetLength( 0 ); ++i ) if ( obj != null )
{ {
if ( m_Table[i, 0] == obj.GetType() ) for ( int i = 0; i < m_Table.Length; i++ )
{ {
Container pack = from.Backpack; if ( m_Table[i].CreatureType == obj.GetType() )
{
Container pack = from.Backpack;
if ( pack != null && pack.ConsumeTotal( typeof( Board ), 10 ) ) if ( pack != null && pack.ConsumeTotal( typeof( Board ), 10 ) )
{ {
from.SendLocalizedMessage( 1042278 ); // You review the corpse and find it worthy of a trophy. from.SendLocalizedMessage( 1042278 ); // You review the corpse and find it worthy of a trophy.
from.SendLocalizedMessage( 1042602 ); // You use your kit up making the trophy. from.SendLocalizedMessage( 1042602 ); // You use your kit up making the trophy.
Mobile hunter = null; Mobile hunter = null;
int weight = 0; int weight = 0;
if ( targeted is BigFish ) if ( targeted is BigFish )
{ {
hunter = ((BigFish)targeted).Fisher; BigFish fish = targeted as BigFish;
weight = (int) ((BigFish)targeted).Weight;
}
from.AddToBackpack( new TrophyDeed( (int)m_Table[i, 1] + 7, (int)m_Table[i, 1], (int)m_Table[i, 2], (int)m_Table[i, 3], hunter, weight ) ); hunter = fish.Fisher;
weight = (int)fish.Weight;
if ( targeted is Corpse ) fish.Consume();
((Corpse)targeted).VisitedByTaxidermist = true; }
else if ( targeted is BigFish )
((BigFish)targeted).Consume();
m_Kit.Delete();
return; from.AddToBackpack( new TrophyDeed( m_Table[i], hunter, weight ) );
}
else if ( targeted is Corpse )
{ ((Corpse)targeted).VisitedByTaxidermist = true;
from.SendLocalizedMessage( 1042598 ); // You do not have enough boards.
return; m_Kit.Delete();
} return;
} }
} else
{
from.SendLocalizedMessage( 1042598 ); // You do not have enough boards.
return;
}
}
}
}
from.SendLocalizedMessage( 1042599 ); // That does not look like something you want hanging on a wall. from.SendLocalizedMessage( 1042599 ); // That does not look like something you want hanging on a wall.
} }
@ -144,6 +172,8 @@ namespace Server.Items
} }
} }
public class TrophyAddon : Item, IAddon public class TrophyAddon : Item, IAddon
{ {
public override bool ForceShowProperties { get { return ObjectPropertyList.Enabled; } } public override bool ForceShowProperties { get { return ObjectPropertyList.Enabled; } }
@ -353,6 +383,11 @@ namespace Server.Items
m_AnimalWeight = animalWeight; m_AnimalWeight = animalWeight;
} }
public TrophyDeed( TaxidermyKit.TrophyInfo info, Mobile hunter, int animalWeight )
: this( info.NorthID + 7, info.NorthID, info.DeedNumber, info.AddonNumber )
{
}
public TrophyDeed( Serial serial ) : base( serial ) public TrophyDeed( Serial serial ) : base( serial )
{ {
} }

View file

@ -191,7 +191,7 @@ namespace Server.Items
{ {
Item gems = null; Item gems = null;
switch ( Utility.Random( 17 ) ) switch ( Utility.Random( 15 ) )
{ {
case 0: gems = new Amber(); break; case 0: gems = new Amber(); break;
case 1: gems = new Amethyst(); break; case 1: gems = new Amethyst(); break;
@ -208,10 +208,8 @@ namespace Server.Items
case 10: gems = new DarkSapphire(); break; case 10: gems = new DarkSapphire(); break;
case 11: gems = new Turquoise(); break; case 11: gems = new Turquoise(); break;
case 12: gems = new EcruCitrine(); break; case 12: gems = new EcruCitrine(); break;
case 13: gems = new WhitePearl(); break; case 13: gems = new FireRuby(); break;
case 14: gems = new FireRuby(); break; case 14: gems = new BlueDiamond(); break;
case 15: gems = new BlueDiamond(); break;
case 16: gems = new BrilliantAmber(); break;
} }
int amount = Math.Min( 5, m_Gems ); int amount = Math.Min( 5, m_Gems );

View file

@ -36,6 +36,8 @@ namespace Server.Misc
string pathReg = GetExePath( "Ultima Online" ); string pathReg = GetExePath( "Ultima Online" );
string pathTD = GetExePath( "Ultima Online Third Dawn" ); //These refer to 2D & 3D, not the Third Dawn expansion string pathTD = GetExePath( "Ultima Online Third Dawn" ); //These refer to 2D & 3D, not the Third Dawn expansion
string newPath = GetExePath("Ultima Online", "KR Legacy Beta"); //After KR, This is the new registry key for the 2D client
if ( CustomPath != null ) if ( CustomPath != null )
Core.DataDirectories.Add( CustomPath ); Core.DataDirectories.Add( CustomPath );
@ -43,7 +45,10 @@ namespace Server.Misc
Core.DataDirectories.Add( pathReg ); Core.DataDirectories.Add( pathReg );
if ( pathTD != null ) if ( pathTD != null )
Core.DataDirectories.Add( pathTD ); Core.DataDirectories.Add( pathTD );
if ( newPath != null )
Core.DataDirectories.Add( newPath );
if ( Core.DataDirectories.Count == 0 && !Core.Service ) if ( Core.DataDirectories.Count == 0 && !Core.Service )
{ {
@ -54,18 +59,23 @@ namespace Server.Misc
} }
} }
private static string GetExePath( string subName ) private static string GetExePath( string subName )
{
return GetExePath( subName, "1.0" );
}
private static string GetExePath( string subName, string version )
{ {
try try
{ {
String keyString; String keyString;
if( Core.Is64Bit ) if( Core.Is64Bit )
keyString = @"SOFTWARE\Wow6432Node\Origin Worlds Online\{0}\1.0"; keyString = @"SOFTWARE\Wow6432Node\Origin Worlds Online\{0}\{1}";
else else
keyString = @"SOFTWARE\Origin Worlds Online\{0}\1.0"; keyString = @"SOFTWARE\Origin Worlds Online\{0}\{1}";
using( RegistryKey key = Registry.LocalMachine.OpenSubKey( String.Format( keyString, subName ) ) ) using( RegistryKey key = Registry.LocalMachine.OpenSubKey( String.Format( keyString, subName, version ) ) )
{ {
if( key == null ) if( key == null )
return null; return null;

View file

@ -603,9 +603,10 @@ namespace Server.Guilds
{ {
Guild g = null; Guild g = null;
int id = Utility.GetInt32( arg, -1 ); int id;
if( id != -1 )
g = Guild.Find( id ) as Guild; if( int.TryParse( arg, out id ) )
g = Guild.Find( id ) as Guild;
if( g == null ) if( g == null )
{ {
@ -615,11 +616,13 @@ namespace Server.Guilds
g = Guild.FindByName( arg ) as Guild; g = Guild.FindByName( arg ) as Guild;
} }
if( g != null ) if ( g != null )
{
from.SendGump( new PropertiesGump( from, g ) ); from.SendGump( new PropertiesGump( from, g ) );
if( NewGuildSystem && from.AccessLevel >= AccessLevel.GameMaster && from is PlayerMobile ) if ( NewGuildSystem && from.AccessLevel >= AccessLevel.GameMaster && from is PlayerMobile )
from.SendGump( new GuildInfoGump( (PlayerMobile)from, g ) ); from.SendGump( new GuildInfoGump( (PlayerMobile)from, g ) );
}
} }
} }
@ -1607,7 +1610,6 @@ namespace Server.Guilds
public void CalculateGuildmaster() public void CalculateGuildmaster()
{ {
//Hashtable votes = new Hashtable();
Dictionary<Mobile, int> votes = new Dictionary<Mobile, int>(); Dictionary<Mobile, int> votes = new Dictionary<Mobile, int>();
int votingMembers = 0; int votingMembers = 0;
@ -1621,7 +1623,6 @@ namespace Server.Guilds
Mobile m = memb.GuildFealty; Mobile m = memb.GuildFealty;
//if ( m == null || m.Deleted || m.Guild != this )
if( !CanBeVotedFor( m ) ) if( !CanBeVotedFor( m ) )
{ {
if ( m_Leader != null && !m_Leader.Deleted && m_Leader.Guild == this ) if ( m_Leader != null && !m_Leader.Deleted && m_Leader.Guild == this )
@ -1639,13 +1640,6 @@ namespace Server.Guilds
votes[m] = 1; votes[m] = 1;
else else
votes[m] = v + 1; votes[m] = v + 1;
/*
if ( votes[m] == null )
votes[m] = (int)1;
else
votes[m] = (int)(votes[m]) + 1;
* */
votingMembers++; votingMembers++;
} }

View file

@ -20,6 +20,7 @@ namespace Server
private string m_VCDescription; private string m_VCDescription;
private string m_Language; private string m_Language;
private string m_Unknown; private string m_Unknown;
private DateTime m_TimeReceived;
[CommandProperty( AccessLevel.GameMaster )] [CommandProperty( AccessLevel.GameMaster )]
public int CpuModel{ get{ return m_CpuModel; } } public int CpuModel{ get{ return m_CpuModel; } }
@ -96,6 +97,9 @@ namespace Server
[CommandProperty( AccessLevel.GameMaster )] [CommandProperty( AccessLevel.GameMaster )]
public string Unknown{ get{ return m_Unknown; } } public string Unknown{ get{ return m_Unknown; } }
[CommandProperty( AccessLevel.GameMaster )]
public DateTime TimeReceived { get { return m_TimeReceived; } }
public static void Initialize() public static void Initialize()
{ {
PacketHandlers.Register( 0xD9, 0x10C, false, new OnPacketReceive( OnReceive ) ); PacketHandlers.Register( 0xD9, 0x10C, false, new OnPacketReceive( OnReceive ) );
@ -174,6 +178,8 @@ namespace Server
info.m_Language = pvSrc.ReadUnicodeStringLESafe( 4 ); info.m_Language = pvSrc.ReadUnicodeStringLESafe( 4 );
info.m_Unknown = pvSrc.ReadStringSafe( 64 ); info.m_Unknown = pvSrc.ReadStringSafe( 64 );
info.m_TimeReceived = DateTime.Now;
Account acct = state.Account as Account; Account acct = state.Account as Account;
if ( acct != null ) if ( acct != null )

View file

@ -295,7 +295,7 @@ namespace Server.Misc
return Notoriety.Enemy; return Notoriety.Enemy;
} }
if ( target.Kills >= 5 || ( target.Body.IsMonster && IsSummoned( target as BaseCreature ) && !( target is BaseFamiliar ) && !( target is ArcaneFey ) && !( target is Golem ) ) || ( target is BaseCreature && ( ( (BaseCreature)target ).AlwaysMurderer || ( (BaseCreature)target ).IsAnimatedDead ) ) ) if ( target.Kills >= 5 || ( target.Body.IsMonster && IsSummoned( target as BaseCreature ) && !( target is BaseFamiliar ) && !( target is ArcaneFey ) && !( target is Golem ) ) || ( target is BaseCreature && ( ( (BaseCreature)target ).AlwaysMurderer || ( (BaseCreature)target ).IsAnimatedDead ) ) )
return Notoriety.Murderer; return Notoriety.Murderer;
if( target.Criminal ) if( target.Criminal )
@ -327,7 +327,7 @@ namespace Server.Misc
if( CheckHouseFlag( source, target, target.Location, target.Map ) ) if( CheckHouseFlag( source, target, target.Location, target.Map ) )
return Notoriety.CanBeAttacked; return Notoriety.CanBeAttacked;
if( !(target is BaseCreature && ((BaseCreature)target).InitialInnocent) ) if( !(target is BaseCreature && ((BaseCreature)target).InitialInnocent) ) //If Target is NOT A baseCreature, OR it's a BC and the BC is initial innocent...
{ {
if( !target.Body.IsHuman && !target.Body.IsGhost && !IsPet( target as BaseCreature ) && !(target is PlayerMobile) || !Core.ML && !target.CanBeginAction( typeof( Server.Spells.Seventh.PolymorphSpell ) ) ) if( !target.Body.IsHuman && !target.Body.IsGhost && !IsPet( target as BaseCreature ) && !(target is PlayerMobile) || !Core.ML && !target.CanBeginAction( typeof( Server.Spells.Seventh.PolymorphSpell ) ) )
return Notoriety.CanBeAttacked; return Notoriety.CanBeAttacked;

View file

@ -1,6 +1,7 @@
using System; using System;
using Server; using Server;
using Server.Mobiles; using Server.Mobiles;
using Server.Factions;
namespace Server.Misc namespace Server.Misc
{ {
@ -179,6 +180,9 @@ namespace Server.Misc
private static bool AllowGain( Mobile from, Skill skill, object obj ) private static bool AllowGain( Mobile from, Skill skill, object obj )
{ {
if ( Core.AOS && Faction.InSkillLoss( from ) ) //Changed some time between the introduction of AoS and SE.
return false;
if ( AntiMacroCode && from is PlayerMobile && UseAntiMacro[skill.Info.SkillID] ) if ( AntiMacroCode && from is PlayerMobile && UseAntiMacro[skill.Info.SkillID] )
return ((PlayerMobile)from).AntiMacroCheck( skill, obj ); return ((PlayerMobile)from).AntiMacroCheck( skill, obj );
else else

View file

@ -127,7 +127,7 @@ namespace Server.Misc
} }
} }
public static string[] HarrowerTitles = new string[] { "Spite", "Opponent", "Hunter", "Venom", "Executioner", "Annihilator", "Champion" }; public static string[] HarrowerTitles = new string[] { "Spite", "Opponent", "Hunter", "Venom", "Executioner", "Annihilator", "Champion", "Assailant", "Purifier", "Nullifier" };
public static string ComputeTitle( Mobile beholder, Mobile beheld ) public static string ComputeTitle( Mobile beholder, Mobile beheld )
{ {

View file

@ -51,6 +51,7 @@ namespace Server
} }
catch catch
{ {
Console.WriteLine( "Warning: Error in Line '{0}' of Data/treasure.cfg", line );
} }
} }
} }

View file

@ -1359,24 +1359,24 @@ namespace Server.Mobiles
if ( feathers != 0 ) if ( feathers != 0 )
{ {
corpse.DropItem( new Feather( feathers ) ); corpse.AddCarvedItem( new Feather( feathers ), from );
from.SendLocalizedMessage( 500479 ); // You pluck the bird. The feathers are now on the corpse. from.SendLocalizedMessage( 500479 ); // You pluck the bird. The feathers are now on the corpse.
} }
if ( wool != 0 ) if ( wool != 0 )
{ {
corpse.DropItem( new Wool( wool ) ); corpse.AddCarvedItem( new Wool( wool ), from );
from.SendLocalizedMessage( 500483 ); // You shear it, and the wool is now on the corpse. from.SendLocalizedMessage( 500483 ); // You shear it, and the wool is now on the corpse.
} }
if ( meat != 0 ) if ( meat != 0 )
{ {
if ( MeatType == MeatType.Ribs ) if ( MeatType == MeatType.Ribs )
corpse.DropItem( new RawRibs( meat ) ); corpse.AddCarvedItem( new RawRibs( meat ), from );
else if ( MeatType == MeatType.Bird ) else if ( MeatType == MeatType.Bird )
corpse.DropItem( new RawBird( meat ) ); corpse.AddCarvedItem( new RawBird( meat ), from );
else if ( MeatType == MeatType.LambLeg ) else if ( MeatType == MeatType.LambLeg )
corpse.DropItem( new RawLambLeg( meat ) ); corpse.AddCarvedItem( new RawLambLeg( meat ), from );
from.SendLocalizedMessage( 500467 ); // You carve some meat, which remains on the corpse. from.SendLocalizedMessage( 500467 ); // You carve some meat, which remains on the corpse.
} }
@ -1428,20 +1428,20 @@ namespace Server.Mobiles
switch ( sc ) switch ( sc )
{ {
case ScaleType.Red: corpse.DropItem( new RedScales( scales ) ); break; case ScaleType.Red: corpse.AddCarvedItem( new RedScales( scales ), from ); break;
case ScaleType.Yellow: corpse.DropItem( new YellowScales( scales ) ); break; case ScaleType.Yellow: corpse.AddCarvedItem( new YellowScales( scales ), from ); break;
case ScaleType.Black: corpse.DropItem( new BlackScales( scales ) ); break; case ScaleType.Black: corpse.AddCarvedItem( new BlackScales( scales ), from ); break;
case ScaleType.Green: corpse.DropItem( new GreenScales( scales ) ); break; case ScaleType.Green: corpse.AddCarvedItem( new GreenScales( scales ), from ); break;
case ScaleType.White: corpse.DropItem( new WhiteScales( scales ) ); break; case ScaleType.White: corpse.AddCarvedItem( new WhiteScales( scales ), from ); break;
case ScaleType.Blue: corpse.DropItem( new BlueScales( scales ) ); break; case ScaleType.Blue: corpse.AddCarvedItem( new BlueScales( scales ), from ); break;
case ScaleType.All: case ScaleType.All:
{ {
corpse.DropItem( new RedScales( scales ) ); corpse.AddCarvedItem( new RedScales( scales ), from );
corpse.DropItem( new YellowScales( scales ) ); corpse.AddCarvedItem( new YellowScales( scales ), from );
corpse.DropItem( new BlackScales( scales ) ); corpse.AddCarvedItem( new BlackScales( scales ), from );
corpse.DropItem( new GreenScales( scales ) ); corpse.AddCarvedItem( new GreenScales( scales ), from );
corpse.DropItem( new WhiteScales( scales ) ); corpse.AddCarvedItem( new WhiteScales( scales ), from );
corpse.DropItem( new BlueScales( scales ) ); corpse.AddCarvedItem( new BlueScales( scales ), from );
break; break;
} }
} }
@ -2456,7 +2456,7 @@ namespace Server.Mobiles
} }
set set
{ {
if ( m_ControlMaster == value ) if ( m_ControlMaster == value || this == value )
return; return;
RemoveFollowers(); RemoveFollowers();
@ -2478,7 +2478,7 @@ namespace Server.Mobiles
} }
set set
{ {
if ( m_SummonMaster == value ) if ( m_SummonMaster == value || this == value )
return; return;
RemoveFollowers(); RemoveFollowers();
@ -4260,11 +4260,6 @@ namespace Server.Mobiles
} }
public static List<DamageStore> GetLootingRights( List<DamageEntry> damageEntries, int hitsMax ) public static List<DamageStore> GetLootingRights( List<DamageEntry> damageEntries, int hitsMax )
{
return GetLootingRights( damageEntries, hitsMax, false );
}
public static List<DamageStore> GetLootingRights( List<DamageEntry> damageEntries, int hitsMax, bool partyAsIndividual )
{ {
List<DamageStore> rights = new List<DamageStore>(); List<DamageStore> rights = new List<DamageStore>();
@ -4960,6 +4955,7 @@ namespace Server.Mobiles
{ {
// *rummages through a corpse and takes an item* // *rummages through a corpse and takes an item*
PublicOverheadMessage( MessageType.Emote, 0x3B2, 1008086 ); PublicOverheadMessage( MessageType.Emote, 0x3B2, 1008086 );
//TODO: Instancing of Rummaged stuff.
return true; return true;
} }
} }

View file

@ -1,32 +0,0 @@
using System;
using System.Collections;
using Server.Targeting;
using Server.Network;
/*
* NPC could use a team objets..
*
* -List of members
* -List of ennemy teams
* -List of ally team
* -Team could be set automaticaly at mobile creation by the region system
* -Team could be the owner of a common timer instead of one by creature
*
*
*
*/
namespace Server.Mobiles
{
public class Team
{
//private ArrayList m_arAlly;
//private ArrayList m_arFoe;
//private ArrayList m_arMember;
public static void Initialize()
{
}
}
}

View file

@ -1,29 +0,0 @@
using System;
using System.Collections;
using Server.Targeting;
using Server.Network;
/*
* NPC could use a faction objets..
*
* -List of members
* -List of ennemy factions
* -List of neutral factions
* -List of ally faction
* -Team could be set automaticaly at mobile creation by the region system
* -Team could be the owner of a common timer instead of one by creature
*
*
*
*/
namespace Server.Mobiles
{
public class TeamRegistry
{
//private ArrayList m_arTeam;
public static void Initialize()
{
}
}
}

View file

@ -1,5 +1,5 @@
using System; using System;
using System.Collections; using System.Collections.Generic;
using Server; using Server;
using Server.Misc; using Server.Misc;
using Server.Items; using Server.Items;
@ -9,8 +9,8 @@ namespace Server.Mobiles
{ {
public abstract class BaseHealer : BaseVendor public abstract class BaseHealer : BaseVendor
{ {
private ArrayList m_SBInfos = new ArrayList(); private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override ArrayList SBInfos{ get { return m_SBInfos; } } protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
public override bool IsActiveVendor{ get{ return false; } } public override bool IsActiveVendor{ get{ return false; } }
public override bool IsInvulnerable{ get{ return false; } } public override bool IsInvulnerable{ get{ return false; } }

View file

@ -108,20 +108,5 @@ namespace Server.Mobiles
base.Deserialize( reader ); base.Deserialize( reader );
int version = reader.ReadInt(); int version = reader.ReadInt();
} }
private class InternalTimer : Timer
{
private Mobile m_From;
private Mobile m_Mobile;
private int m_Count;
public InternalTimer( Mobile from, Mobile m ) : base( TimeSpan.FromSeconds( 1.0 ), TimeSpan.FromSeconds( 1.0 ) )
{
m_From = from;
m_Mobile = m;
Priority = TimerPriority.TwoFiftyMS;
}
}
} }
} }

View file

@ -25,7 +25,7 @@ namespace Server.Mobiles
{ {
Name = "an energy vortex"; Name = "an energy vortex";
if( Core.SE && 0.02 > Utility.RandomDouble() ) // Tested on OSI, but is this right? Who knows. if( Core.SE && 0.002 > Utility.RandomDouble() ) // Per OSI FoF, it's a 1/500 chance.
{ {
// Llama vortex! // Llama vortex!
Body = 0xDC; Body = 0xDC;

View file

@ -229,7 +229,10 @@ namespace Server.Mobiles
private void IncreaseHits( int hp ) private void IncreaseHits( int hp )
{ {
int maxhits = (int)(2000 * (IsParagon ? Paragon.HitsBuff : 1)); int maxhits = 2000;
if ( this.IsParagon )
maxhits = (int)(maxhits * Paragon.HitsBuff);
if( hp < 1000 && !Core.AOS ) if( hp < 1000 && !Core.AOS )
hp = (hp * 100) / 60; hp = (hp * 100) / 60;
@ -237,7 +240,10 @@ namespace Server.Mobiles
if( HitsMaxSeed >= maxhits ) if( HitsMaxSeed >= maxhits )
{ {
HitsMaxSeed = maxhits; HitsMaxSeed = maxhits;
Hits += hp + Utility.RandomMinMax( 10, 20 ); // increase the hp until it hits if it goes over it'll max at 2000
int newHits = this.Hits + hp + Utility.RandomMinMax( 10, 20 ); // increase the hp until it hits if it goes over it'll max at 2000
this.Hits = Math.Min( maxhits, newHits );
// Also provide heal for each devour on top of the hp increase // Also provide heal for each devour on top of the hp increase
} }
else else

View file

@ -31,25 +31,21 @@ namespace Server.Mobiles
[Flags] [Flags]
public enum PlayerFlag // First 16 bits are reserved for default-distro use, start custom flags at 0x00010000 public enum PlayerFlag // First 16 bits are reserved for default-distro use, start custom flags at 0x00010000
{ {
None = 0x00000000, None = 0x00000000,
Glassblowing = 0x00000001, Glassblowing = 0x00000001,
Masonry = 0x00000002, Masonry = 0x00000002,
SandMining = 0x00000004, SandMining = 0x00000004,
StoneMining = 0x00000008, StoneMining = 0x00000008,
ToggleMiningStone = 0x00000010, ToggleMiningStone = 0x00000010,
KarmaLocked = 0x00000020, KarmaLocked = 0x00000020,
AutoRenewInsurance = 0x00000040, AutoRenewInsurance = 0x00000040,
UseOwnFilter = 0x00000080, UseOwnFilter = 0x00000080,
PublicMyRunUO = 0x00000100, PublicMyRunUO = 0x00000100,
PagingSquelched = 0x00000200, PagingSquelched = 0x00000200,
Young = 0x00000400, Young = 0x00000400,
AcceptGuildInvites = 0x00000800, AcceptGuildInvites = 0x00000800,
DisplayChampionTitle = 0x00001000, DisplayChampionTitle = 0x00001000,
HasStatReward = 0x00002000, HasStatReward = 0x00002000
#region Scroll of Alacrity
AcceleratedSkill = 0x00080000,
#endregion
} }
public enum NpcGuild public enum NpcGuild

View file

@ -1,5 +1,4 @@
using System; using System;
using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using Server.Items; using Server.Items;
using Server.ContextMenus; using Server.ContextMenus;
@ -10,8 +9,8 @@ namespace Server.Mobiles
{ {
public class Banker : BaseVendor public class Banker : BaseVendor
{ {
private ArrayList m_SBInfos = new ArrayList(); private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override ArrayList SBInfos{ get { return m_SBInfos; } } protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
public override NpcGuild NpcGuild{ get{ return NpcGuild.MerchantsGuild; } } public override NpcGuild NpcGuild{ get{ return NpcGuild.MerchantsGuild; } }
@ -250,14 +249,8 @@ namespace Server.Mobiles
{ {
int amount; int amount;
try if ( !int.TryParse( split[1], out amount ) )
{ break;
amount = Convert.ToInt32( split[1] );
}
catch
{
break;
}
if ( amount > 5000 ) if ( amount > 5000 )
{ {
@ -331,14 +324,8 @@ namespace Server.Mobiles
{ {
int amount; int amount;
try if ( !int.TryParse( split[1], out amount ) )
{ break;
amount = Convert.ToInt32( split[1] );
}
catch
{
break;
}
if ( amount < 5000 ) if ( amount < 5000 )
{ {

View file

@ -25,7 +25,7 @@ namespace Server.Mobiles
{ {
private const int MaxSell = 500; private const int MaxSell = 500;
protected abstract ArrayList SBInfos { get; } protected abstract List<SBInfo> SBInfos { get; }
private ArrayList m_ArmorBuyInfo = new ArrayList(); private ArrayList m_ArmorBuyInfo = new ArrayList();
private ArrayList m_ArmorSellInfo = new ArrayList(); private ArrayList m_ArmorSellInfo = new ArrayList();
@ -547,11 +547,11 @@ namespace Server.Mobiles
UpdateBuyInfo(); UpdateBuyInfo();
int count = 0; int count = 0;
ArrayList list; List<BuyItemState> list;
IBuyItemInfo[] buyInfo = this.GetBuyInfo(); IBuyItemInfo[] buyInfo = this.GetBuyInfo();
IShopSellInfo[] sellInfo = this.GetSellInfo(); IShopSellInfo[] sellInfo = this.GetSellInfo();
list = new ArrayList( buyInfo.Length ); list = new List<BuyItemState>( buyInfo.Length );
Container cont = this.BuyPack; Container cont = this.BuyPack;
List<ObjectPropertyList> opls = null; List<ObjectPropertyList> opls = null;
@ -798,7 +798,7 @@ namespace Server.Mobiles
return null; return null;
} }
private void ProcessSinglePurchase( BuyItemResponse buy, IBuyItemInfo bii, ArrayList validBuy, ref int controlSlots, ref bool fullPurchase, ref int totalCost ) private void ProcessSinglePurchase( BuyItemResponse buy, IBuyItemInfo bii, List<BuyItemResponse> validBuy, ref int controlSlots, ref bool fullPurchase, ref int totalCost )
{ {
int amount = buy.Amount; int amount = buy.Amount;
@ -895,7 +895,7 @@ namespace Server.Mobiles
} }
} }
public virtual bool OnBuyItems( Mobile buyer, ArrayList list ) public virtual bool OnBuyItems( Mobile buyer, List<BuyItemResponse> list )
{ {
if ( !IsActiveSeller ) if ( !IsActiveSeller )
return false; return false;
@ -914,7 +914,7 @@ namespace Server.Mobiles
IBuyItemInfo[] buyInfo = this.GetBuyInfo(); IBuyItemInfo[] buyInfo = this.GetBuyInfo();
IShopSellInfo[] info = GetSellInfo(); IShopSellInfo[] info = GetSellInfo();
int totalCost = 0; int totalCost = 0;
ArrayList validBuy = new ArrayList( list.Count ); List<BuyItemResponse> validBuy = new List<BuyItemResponse>( list.Count );
Container cont; Container cont;
bool bought = false; bool bought = false;
bool fromBank = false; bool fromBank = false;
@ -1125,7 +1125,7 @@ namespace Server.Mobiles
return true; return true;
} }
public virtual bool OnSellItems( Mobile seller, ArrayList list ) public virtual bool OnSellItems( Mobile seller, List<SellItemResponse> list )
{ {
if ( !IsActiveBuyer ) if ( !IsActiveBuyer )
return false; return false;
@ -1146,8 +1146,6 @@ namespace Server.Mobiles
int GiveGold = 0; int GiveGold = 0;
int Sold = 0; int Sold = 0;
Container cont; Container cont;
ArrayList delete = new ArrayList();
ArrayList drop = new ArrayList();
foreach ( SellItemResponse resp in list ) foreach ( SellItemResponse resp in list )
{ {
@ -1277,12 +1275,12 @@ namespace Server.Mobiles
writer.Write( (int)1 ); // version writer.Write( (int)1 ); // version
ArrayList sbInfos = this.SBInfos; List<SBInfo> sbInfos = this.SBInfos;
for ( int i = 0; sbInfos != null && i < sbInfos.Count; ++i ) for ( int i = 0; sbInfos != null && i < sbInfos.Count; ++i )
{ {
SBInfo sbInfo = (SBInfo)sbInfos[i]; SBInfo sbInfo = sbInfos[i];
ArrayList buyInfo = sbInfo.BuyInfo; List<GenericBuyInfo> buyInfo = sbInfo.BuyInfo;
for ( int j = 0; buyInfo != null && j < buyInfo.Count; ++j ) for ( int j = 0; buyInfo != null && j < buyInfo.Count; ++j )
{ {
@ -1320,7 +1318,7 @@ namespace Server.Mobiles
LoadSBInfo(); LoadSBInfo();
ArrayList sbInfos = this.SBInfos; List<SBInfo> sbInfos = this.SBInfos;
switch ( version ) switch ( version )
{ {
@ -1340,8 +1338,8 @@ namespace Server.Mobiles
if ( sbInfoIndex >= 0 && sbInfoIndex < sbInfos.Count ) if ( sbInfoIndex >= 0 && sbInfoIndex < sbInfos.Count )
{ {
SBInfo sbInfo = (SBInfo)sbInfos[sbInfoIndex]; SBInfo sbInfo = sbInfos[sbInfoIndex];
ArrayList buyInfo = sbInfo.BuyInfo; List<GenericBuyInfo> buyInfo = sbInfo.BuyInfo;
if ( buyInfo != null && buyInfoIndex >= 0 && buyInfoIndex < buyInfo.Count ) if ( buyInfo != null && buyInfoIndex >= 0 && buyInfoIndex < buyInfo.Count )
{ {

View file

@ -1,13 +1,13 @@
using System; using System;
using System.Collections; using System.Collections.Generic;
using Server; using Server;
namespace Server.Mobiles namespace Server.Mobiles
{ {
public class Alchemist : BaseVendor public class Alchemist : BaseVendor
{ {
private ArrayList m_SBInfos = new ArrayList(); private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override ArrayList SBInfos{ get { return m_SBInfos; } } protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
public override NpcGuild NpcGuild{ get{ return NpcGuild.MagesGuild; } } public override NpcGuild NpcGuild{ get{ return NpcGuild.MagesGuild; } }

View file

@ -1,5 +1,4 @@
using System; using System;
using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using Server; using Server;
using Server.ContextMenus; using Server.ContextMenus;
@ -12,8 +11,8 @@ namespace Server.Mobiles
{ {
public class AnimalTrainer : BaseVendor public class AnimalTrainer : BaseVendor
{ {
private ArrayList m_SBInfos = new ArrayList(); private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override ArrayList SBInfos{ get { return m_SBInfos; } } protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
[Constructable] [Constructable]
public AnimalTrainer() : base( "the animal trainer" ) public AnimalTrainer() : base( "the animal trainer" )
@ -217,19 +216,10 @@ namespace Server.Mobiles
if ( pet == null || pet.Deleted || from.Map != this.Map || !from.InRange( this, 14 ) || !from.Stabled.Contains( pet ) || !from.CheckAlive() ) if ( pet == null || pet.Deleted || from.Map != this.Map || !from.InRange( this, 14 ) || !from.Stabled.Contains( pet ) || !from.CheckAlive() )
return; return;
if ( (from.Followers + pet.ControlSlots) <= from.FollowersMax ) if ( CanClaim( from, pet ) )
{ {
pet.SetControlMaster( from ); DoClaim( from, pet );
if ( pet.Summoned )
pet.SummonMaster = from;
pet.ControlTarget = from;
pet.ControlOrder = OrderType.Follow;
pet.MoveToWorld( from.Location, from.Map );
pet.IsStabled = false;
from.Stabled.Remove( pet ); from.Stabled.Remove( pet );
SayTo( from, 1042559 ); // Here you go... and good day to you! SayTo( from, 1042559 ); // Here you go... and good day to you!
@ -322,7 +312,12 @@ namespace Server.Mobiles
} }
} }
public void Claim( Mobile from ) public void Claim( Mobile from )
{
Claim( from, null );
}
public void Claim( Mobile from, string petName )
{ {
if ( Deleted || !from.CheckAlive() ) if ( Deleted || !from.CheckAlive() )
return; return;
@ -344,22 +339,9 @@ namespace Server.Mobiles
++stabled; ++stabled;
if ( (from.Followers + pet.ControlSlots) <= from.FollowersMax ) if ( CanClaim( from, pet ) )
{ {
pet.SetControlMaster( from ); DoClaim( from, pet );
if ( pet.Summoned )
pet.SummonMaster = from;
pet.ControlTarget = from;
pet.ControlOrder = OrderType.Follow;
pet.MoveToWorld( from.Location, from.Map );
pet.IsStabled = false;
if ( Core.SE )
pet.Loyalty = BaseCreature.MaxLoyalty; // Wonderfully Happy
from.Stabled.RemoveAt( i ); from.Stabled.RemoveAt( i );
--i; --i;
@ -378,6 +360,29 @@ namespace Server.Mobiles
SayTo( from, 502671 ); // But I have no animals stabled with me at the moment! SayTo( from, 502671 ); // But I have no animals stabled with me at the moment!
} }
public bool CanClaim( Mobile from, BaseCreature pet )
{
return ((from.Followers + pet.ControlSlots) <= from.FollowersMax);
}
private void DoClaim( Mobile from, BaseCreature pet )
{
pet.SetControlMaster( from );
if ( pet.Summoned )
pet.SummonMaster = from;
pet.ControlTarget = from;
pet.ControlOrder = OrderType.Follow;
pet.MoveToWorld( from.Location, from.Map );
pet.IsStabled = false;
if ( Core.SE )
pet.Loyalty = BaseCreature.MaxLoyalty; // Wonderfully Happy
}
public override bool HandlesOnSpeech( Mobile from ) public override bool HandlesOnSpeech( Mobile from )
{ {
return true; return true;
@ -394,10 +399,34 @@ namespace Server.Mobiles
{ {
e.Handled = true; e.Handled = true;
if ( !Insensitive.Equals( e.Speech, "claim" ) ) if (!Insensitive.Equals( e.Speech, "claim" ))
BeginClaimList( e.Mobile ); {
else bool showList = true;
Claim( e.Mobile );
if ( e.Speech.Length > 6 ) //sanity
{
string name = e.Speech.Substring( 6 ).Trim();
for ( int i = 0; i < e.Mobile.Stabled.Count; ++i )
{
if ( Insensitive.Equals( e.Mobile.Stabled[i].Name, name ) ) //Similar names?
{
showList = false;
break;
}
}
//What about pets with the same name, or 'similar' names, ie Fluffy 1, Fluffy 2?? - Similar names don't work.. what about identicals?
//What if you try and claim a pet that doesn't exist? -- GUMP
}
if ( showList )
BeginClaimList( e.Mobile );
}
else
{
Claim( e.Mobile );
}
} }
else else
{ {

View file

@ -1,13 +1,13 @@
using System; using System;
using System.Collections; using System.Collections.Generic;
using Server; using Server;
namespace Server.Mobiles namespace Server.Mobiles
{ {
public class Architect : BaseVendor public class Architect : BaseVendor
{ {
private ArrayList m_SBInfos = new ArrayList(); private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override ArrayList SBInfos{ get { return m_SBInfos; } } protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
public override NpcGuild NpcGuild{ get{ return NpcGuild.TinkersGuild; } } public override NpcGuild NpcGuild{ get{ return NpcGuild.TinkersGuild; } }

View file

@ -1,13 +1,13 @@
using System; using System;
using System.Collections; using System.Collections.Generic;
using Server; using Server;
namespace Server.Mobiles namespace Server.Mobiles
{ {
public class Armorer : BaseVendor public class Armorer : BaseVendor
{ {
private ArrayList m_SBInfos = new ArrayList(); private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override ArrayList SBInfos{ get { return m_SBInfos; } } protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
[Constructable] [Constructable]
public Armorer() : base( "the armorer" ) public Armorer() : base( "the armorer" )

View file

@ -1,13 +1,13 @@
using System; using System;
using System.Collections; using System.Collections.Generic;
using Server; using Server;
namespace Server.Mobiles namespace Server.Mobiles
{ {
public class Baker : BaseVendor public class Baker : BaseVendor
{ {
private ArrayList m_SBInfos = new ArrayList(); private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override ArrayList SBInfos{ get { return m_SBInfos; } } protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
[Constructable] [Constructable]
public Baker() : base( "the baker" ) public Baker() : base( "the baker" )

View file

@ -1,13 +1,13 @@
using System; using System;
using System.Collections; using System.Collections.Generic;
using Server; using Server;
namespace Server.Mobiles namespace Server.Mobiles
{ {
public class Bard : BaseVendor public class Bard : BaseVendor
{ {
private ArrayList m_SBInfos = new ArrayList(); private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override ArrayList SBInfos{ get { return m_SBInfos; } } protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
public override NpcGuild NpcGuild{ get{ return NpcGuild.BardsGuild; } } public override NpcGuild NpcGuild{ get{ return NpcGuild.BardsGuild; } }

View file

@ -1,5 +1,5 @@
using System; using System;
using System.Collections; using System.Collections.Generic;
using Server; using Server;
using Server.Items; using Server.Items;
using Server.Gumps; using Server.Gumps;
@ -11,8 +11,8 @@ namespace Server.Mobiles
{ {
public class Barkeeper : BaseVendor public class Barkeeper : BaseVendor
{ {
private ArrayList m_SBInfos = new ArrayList(); private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override ArrayList SBInfos{ get { return m_SBInfos; } } protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
public override void InitSBInfo() public override void InitSBInfo()
{ {

View file

@ -1,13 +1,13 @@
using System; using System;
using System.Collections; using System.Collections.Generic;
using Server; using Server;
namespace Server.Mobiles namespace Server.Mobiles
{ {
public class Beekeeper : BaseVendor public class Beekeeper : BaseVendor
{ {
private ArrayList m_SBInfos = new ArrayList(); private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override ArrayList SBInfos{ get { return m_SBInfos; } } protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
[Constructable] [Constructable]
public Beekeeper() : base( "the beekeeper" ) public Beekeeper() : base( "the beekeeper" )

View file

@ -1,5 +1,5 @@
using System; using System;
using System.Collections; using System.Collections.Generic;
using Server; using Server;
using Server.Engines.BulkOrders; using Server.Engines.BulkOrders;
@ -7,8 +7,8 @@ namespace Server.Mobiles
{ {
public class Blacksmith : BaseVendor public class Blacksmith : BaseVendor
{ {
private ArrayList m_SBInfos = new ArrayList(); private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override ArrayList SBInfos{ get { return m_SBInfos; } } protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
public override NpcGuild NpcGuild{ get{ return NpcGuild.BlacksmithsGuild; } } public override NpcGuild NpcGuild{ get{ return NpcGuild.BlacksmithsGuild; } }

View file

@ -1,5 +1,5 @@
using System; using System;
using System.Collections; using System.Collections.Generic;
using Server; using Server;
namespace Server.Mobiles namespace Server.Mobiles
@ -7,8 +7,8 @@ namespace Server.Mobiles
[TypeAlias( "Server.Mobiles.Bower" )] [TypeAlias( "Server.Mobiles.Bower" )]
public class Bowyer : BaseVendor public class Bowyer : BaseVendor
{ {
private ArrayList m_SBInfos = new ArrayList(); private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override ArrayList SBInfos{ get { return m_SBInfos; } } protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
[Constructable] [Constructable]
public Bowyer() : base( "the bowyer" ) public Bowyer() : base( "the bowyer" )

View file

@ -1,13 +1,13 @@
using System; using System;
using System.Collections; using System.Collections.Generic;
using Server; using Server;
namespace Server.Mobiles namespace Server.Mobiles
{ {
public class Butcher : BaseVendor public class Butcher : BaseVendor
{ {
private ArrayList m_SBInfos = new ArrayList(); private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override ArrayList SBInfos{ get { return m_SBInfos; } } protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
[Constructable] [Constructable]
public Butcher() : base( "the butcher" ) public Butcher() : base( "the butcher" )

View file

@ -1,13 +1,13 @@
using System; using System;
using System.Collections; using System.Collections.Generic;
using Server; using Server;
namespace Server.Mobiles namespace Server.Mobiles
{ {
public class Carpenter : BaseVendor public class Carpenter : BaseVendor
{ {
private ArrayList m_SBInfos = new ArrayList(); private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override ArrayList SBInfos{ get { return m_SBInfos; } } protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
public override NpcGuild NpcGuild{ get{ return NpcGuild.TinkersGuild; } } public override NpcGuild NpcGuild{ get{ return NpcGuild.TinkersGuild; } }

View file

@ -1,13 +1,13 @@
using System; using System;
using System.Collections; using System.Collections.Generic;
using Server; using Server;
namespace Server.Mobiles namespace Server.Mobiles
{ {
public class Cobbler : BaseVendor public class Cobbler : BaseVendor
{ {
private ArrayList m_SBInfos = new ArrayList(); private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override ArrayList SBInfos{ get { return m_SBInfos; } } protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
[Constructable] [Constructable]
public Cobbler() : base( "the cobbler" ) public Cobbler() : base( "the cobbler" )

View file

@ -1,13 +1,13 @@
using System; using System;
using System.Collections; using System.Collections.Generic;
using Server; using Server;
namespace Server.Mobiles namespace Server.Mobiles
{ {
public class Cook : BaseVendor public class Cook : BaseVendor
{ {
private ArrayList m_SBInfos = new ArrayList(); private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override ArrayList SBInfos{ get { return m_SBInfos; } } protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
[Constructable] [Constructable]
public Cook() : base( "the cook" ) public Cook() : base( "the cook" )

View file

@ -1,5 +1,6 @@
using System; using System;
using System.Collections; using System.Collections;
using System.Collections.Generic;
using Server; using Server;
using Server.Items; using Server.Items;
using Server.Gumps; using Server.Gumps;
@ -9,15 +10,15 @@ namespace Server.Mobiles
{ {
public class CustomHairstylist : BaseVendor public class CustomHairstylist : BaseVendor
{ {
private ArrayList m_SBInfos = new ArrayList(); private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override ArrayList SBInfos{ get { return m_SBInfos; } } protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
public override bool ClickTitle{ get{ return false; } } public override bool ClickTitle{ get{ return false; } }
public override bool IsActiveBuyer{ get{ return false; } } public override bool IsActiveBuyer{ get{ return false; } }
public override bool IsActiveSeller{ get{ return true; } } public override bool IsActiveSeller{ get{ return true; } }
public override bool OnBuyItems( Mobile buyer, ArrayList list ) public override bool OnBuyItems( Mobile buyer, List<BuyItemResponse> list )
{ {
return false; return false;
} }

View file

@ -1,13 +1,13 @@
using System; using System;
using System.Collections; using System.Collections.Generic;
using Server; using Server;
namespace Server.Mobiles namespace Server.Mobiles
{ {
public class Farmer : BaseVendor public class Farmer : BaseVendor
{ {
private ArrayList m_SBInfos = new ArrayList(); private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override ArrayList SBInfos{ get { return m_SBInfos; } } protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
[Constructable] [Constructable]
public Farmer() : base( "the farmer" ) public Farmer() : base( "the farmer" )

View file

@ -1,13 +1,13 @@
using System; using System;
using System.Collections; using System.Collections.Generic;
using Server; using Server;
namespace Server.Mobiles namespace Server.Mobiles
{ {
public class Fisherman : BaseVendor public class Fisherman : BaseVendor
{ {
private ArrayList m_SBInfos = new ArrayList(); private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override ArrayList SBInfos{ get { return m_SBInfos; } } protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
public override NpcGuild NpcGuild{ get{ return NpcGuild.FishermensGuild; } } public override NpcGuild NpcGuild{ get{ return NpcGuild.FishermensGuild; } }

View file

@ -1,13 +1,13 @@
using System; using System;
using System.Collections; using System.Collections.Generic;
using Server; using Server;
namespace Server.Mobiles namespace Server.Mobiles
{ {
public class Furtrader : BaseVendor public class Furtrader : BaseVendor
{ {
private ArrayList m_SBInfos = new ArrayList(); private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override ArrayList SBInfos{ get { return m_SBInfos; } } protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
[Constructable] [Constructable]
public Furtrader() : base( "the furtrader" ) public Furtrader() : base( "the furtrader" )

View file

@ -1,5 +1,5 @@
using System; using System;
using System.Collections; using System.Collections.Generic;
using Server; using Server;
namespace Server.Mobiles namespace Server.Mobiles
@ -7,8 +7,8 @@ namespace Server.Mobiles
[TypeAlias( "Server.Mobiles.GargoyleAlchemist" )] [TypeAlias( "Server.Mobiles.GargoyleAlchemist" )]
public class Glassblower : BaseVendor public class Glassblower : BaseVendor
{ {
private ArrayList m_SBInfos = new ArrayList(); private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override ArrayList SBInfos{ get { return m_SBInfos; } } protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
public override NpcGuild NpcGuild{ get{ return NpcGuild.MagesGuild; } } public override NpcGuild NpcGuild{ get{ return NpcGuild.MagesGuild; } }

View file

@ -1,5 +1,5 @@
using System; using System;
using System.Collections; using System.Collections.Generic;
using Server; using Server;
using Server.Items; using Server.Items;
@ -7,8 +7,8 @@ namespace Server.Mobiles
{ {
public class GolemCrafter : BaseVendor public class GolemCrafter : BaseVendor
{ {
private ArrayList m_SBInfos = new ArrayList(); private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override ArrayList SBInfos{ get { return m_SBInfos; } } protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
[Constructable] [Constructable]
public GolemCrafter() : base( "the golem crafter" ) public GolemCrafter() : base( "the golem crafter" )

View file

@ -1,5 +1,5 @@
using System; using System;
using System.Collections; using System.Collections.Generic;
using Server; using Server;
using Server.Items; using Server.Items;
using Server.Network; using Server.Network;
@ -8,8 +8,8 @@ namespace Server.Mobiles
{ {
public abstract class BaseGuildmaster : BaseVendor public abstract class BaseGuildmaster : BaseVendor
{ {
private ArrayList m_SBInfos = new ArrayList(); private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override ArrayList SBInfos{ get { return m_SBInfos; } } protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
public override bool IsActiveVendor{ get{ return false; } } public override bool IsActiveVendor{ get{ return false; } }

View file

@ -1,5 +1,5 @@
using System; using System;
using System.Collections; using System.Collections.Generic;
using Server; using Server;
using Server.Gumps; using Server.Gumps;
using Server.Items; using Server.Items;
@ -11,8 +11,8 @@ namespace Server.Mobiles
{ {
public class GypsyMaiden : BaseVendor public class GypsyMaiden : BaseVendor
{ {
private ArrayList m_SBInfos = new ArrayList(); private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override ArrayList SBInfos{ get { return m_SBInfos; } } protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
[Constructable] [Constructable]
public GypsyMaiden() : base( "the gypsy maiden" ) public GypsyMaiden() : base( "the gypsy maiden" )

View file

@ -1,13 +1,13 @@
using System; using System;
using System.Collections; using System.Collections.Generic;
using Server; using Server;
namespace Server.Mobiles namespace Server.Mobiles
{ {
public class HairStylist : BaseVendor public class HairStylist : BaseVendor
{ {
private ArrayList m_SBInfos = new ArrayList(); private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override ArrayList SBInfos{ get { return m_SBInfos; } } protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
[Constructable] [Constructable]
public HairStylist() : base( "the hair stylist" ) public HairStylist() : base( "the hair stylist" )

View file

@ -1,13 +1,13 @@
using System; using System;
using System.Collections; using System.Collections.Generic;
using Server; using Server;
namespace Server.Mobiles namespace Server.Mobiles
{ {
public class Herbalist : BaseVendor public class Herbalist : BaseVendor
{ {
private ArrayList m_SBInfos = new ArrayList(); private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override ArrayList SBInfos{ get { return m_SBInfos; } } protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
public override NpcGuild NpcGuild{ get{ return NpcGuild.MagesGuild; } } public override NpcGuild NpcGuild{ get{ return NpcGuild.MagesGuild; } }

View file

@ -1,5 +1,5 @@
using System; using System;
using System.Collections; using System.Collections.Generic;
using Server; using Server;
using Server.Items; using Server.Items;
@ -7,8 +7,8 @@ namespace Server.Mobiles
{ {
public class HolyMage : BaseVendor public class HolyMage : BaseVendor
{ {
private ArrayList m_SBInfos = new ArrayList(); private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override ArrayList SBInfos{ get { return m_SBInfos; } } protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
[Constructable] [Constructable]
public HolyMage() : base( "the Holy Mage" ) public HolyMage() : base( "the Holy Mage" )

View file

@ -1,13 +1,13 @@
using System; using System;
using System.Collections; using System.Collections.Generic;
using Server; using Server;
namespace Server.Mobiles namespace Server.Mobiles
{ {
public class InnKeeper : BaseVendor public class InnKeeper : BaseVendor
{ {
private ArrayList m_SBInfos = new ArrayList(); private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override ArrayList SBInfos{ get { return m_SBInfos; } } protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
[Constructable] [Constructable]
public InnKeeper() : base( "the innkeeper" ) public InnKeeper() : base( "the innkeeper" )

View file

@ -1,5 +1,5 @@
using System; using System;
using System.Collections; using System.Collections.Generic;
using Server; using Server;
using Server.Items; using Server.Items;
@ -7,8 +7,8 @@ namespace Server.Mobiles
{ {
public class IronWorker : BaseVendor public class IronWorker : BaseVendor
{ {
private ArrayList m_SBInfos = new ArrayList(); private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override ArrayList SBInfos{ get { return m_SBInfos; } } protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
[Constructable] [Constructable]
public IronWorker() : base( "the iron worker" ) public IronWorker() : base( "the iron worker" )

View file

@ -1,13 +1,13 @@
using System; using System;
using System.Collections; using System.Collections.Generic;
using Server; using Server;
namespace Server.Mobiles namespace Server.Mobiles
{ {
public class Jeweler : BaseVendor public class Jeweler : BaseVendor
{ {
private ArrayList m_SBInfos = new ArrayList(); private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override ArrayList SBInfos{ get { return m_SBInfos; } } protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
[Constructable] [Constructable]
public Jeweler() : base( "the jeweler" ) public Jeweler() : base( "the jeweler" )

View file

@ -1,5 +1,5 @@
using System; using System;
using System.Collections; using System.Collections.Generic;
using Server; using Server;
using Server.Items; using Server.Items;
@ -7,8 +7,8 @@ namespace Server.Mobiles
{ {
public class KeeperOfChivalry : BaseVendor public class KeeperOfChivalry : BaseVendor
{ {
private ArrayList m_SBInfos = new ArrayList(); private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override ArrayList SBInfos{ get { return m_SBInfos; } } protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
[Constructable] [Constructable]
public KeeperOfChivalry() : base( "the Keeper of Chivalry" ) public KeeperOfChivalry() : base( "the Keeper of Chivalry" )

View file

@ -1,13 +1,13 @@
using System; using System;
using System.Collections; using System.Collections.Generic;
using Server; using Server;
namespace Server.Mobiles namespace Server.Mobiles
{ {
public class LeatherWorker : BaseVendor public class LeatherWorker : BaseVendor
{ {
private ArrayList m_SBInfos = new ArrayList(); private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override ArrayList SBInfos{ get { return m_SBInfos; } } protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
[Constructable] [Constructable]
public LeatherWorker() : base( "the leather worker" ) public LeatherWorker() : base( "the leather worker" )

View file

@ -1,13 +1,13 @@
using System; using System;
using System.Collections; using System.Collections.Generic;
using Server; using Server;
namespace Server.Mobiles namespace Server.Mobiles
{ {
public class Mage : BaseVendor public class Mage : BaseVendor
{ {
private ArrayList m_SBInfos = new ArrayList(); private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override ArrayList SBInfos{ get { return m_SBInfos; } } protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
public override NpcGuild NpcGuild{ get{ return NpcGuild.MagesGuild; } } public override NpcGuild NpcGuild{ get{ return NpcGuild.MagesGuild; } }

View file

@ -1,13 +1,13 @@
using System; using System;
using System.Collections; using System.Collections.Generic;
using Server; using Server;
namespace Server.Mobiles namespace Server.Mobiles
{ {
public class Mapmaker : BaseVendor public class Mapmaker : BaseVendor
{ {
private ArrayList m_SBInfos = new ArrayList(); private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override ArrayList SBInfos{ get { return m_SBInfos; } } protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
[Constructable] [Constructable]
public Mapmaker() : base( "the mapmaker" ) public Mapmaker() : base( "the mapmaker" )

View file

@ -1,13 +1,13 @@
using System; using System;
using System.Collections; using System.Collections.Generic;
using Server; using Server;
namespace Server.Mobiles namespace Server.Mobiles
{ {
public class Miller : BaseVendor public class Miller : BaseVendor
{ {
private ArrayList m_SBInfos = new ArrayList(); private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override ArrayList SBInfos{ get { return m_SBInfos; } } protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
[Constructable] [Constructable]
public Miller() : base( "the miller" ) public Miller() : base( "the miller" )

View file

@ -1,13 +1,13 @@
using System; using System;
using System.Collections; using System.Collections.Generic;
using Server; using Server;
namespace Server.Mobiles namespace Server.Mobiles
{ {
public class Miner : BaseVendor public class Miner : BaseVendor
{ {
private ArrayList m_SBInfos = new ArrayList(); private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override ArrayList SBInfos{ get { return m_SBInfos; } } protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
[Constructable] [Constructable]
public Miner() : base( "the miner" ) public Miner() : base( "the miner" )

View file

@ -1,6 +1,6 @@
using System; using System;
using System.Collections; using System.Collections.Generic;
using Server; using Server;
using Server.Items; using Server.Items;
@ -8,8 +8,8 @@ namespace Server.Mobiles
{ {
public class Monk : BaseVendor public class Monk : BaseVendor
{ {
private ArrayList m_SBInfos = new ArrayList(); private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override ArrayList SBInfos{ get { return m_SBInfos; } } protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
[Constructable] [Constructable]
public Monk() : base( "the Monk" ) public Monk() : base( "the Monk" )

View file

@ -1,13 +1,13 @@
using System; using System;
using System.Collections; using System.Collections.Generic;
using Server; using Server;
namespace Server.Mobiles namespace Server.Mobiles
{ {
public class Provisioner : BaseVendor public class Provisioner : BaseVendor
{ {
private ArrayList m_SBInfos = new ArrayList(); private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override ArrayList SBInfos{ get { return m_SBInfos; } } protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
[Constructable] [Constructable]
public Provisioner() : base( "the provisioner" ) public Provisioner() : base( "the provisioner" )

View file

@ -1,5 +1,5 @@
using System; using System;
using System.Collections; using System.Collections.Generic;
using Server; using Server;
using Server.Gumps; using Server.Gumps;
using Server.Items; using Server.Items;
@ -11,8 +11,8 @@ namespace Server.Mobiles
{ {
public class Rancher : BaseVendor public class Rancher : BaseVendor
{ {
private ArrayList m_SBInfos = new ArrayList(); private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override ArrayList SBInfos{ get { return m_SBInfos; } } protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
[Constructable] [Constructable]
public Rancher() : base( "the rancher" ) public Rancher() : base( "the rancher" )

View file

@ -1,13 +1,13 @@
using System; using System;
using System.Collections; using System.Collections.Generic;
using Server; using Server;
namespace Server.Mobiles namespace Server.Mobiles
{ {
public class Ranger : BaseVendor public class Ranger : BaseVendor
{ {
private ArrayList m_SBInfos = new ArrayList(); private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override ArrayList SBInfos{ get { return m_SBInfos; } } protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
[Constructable] [Constructable]
public Ranger() : base( "the ranger" ) public Ranger() : base( "the ranger" )

View file

@ -1,5 +1,5 @@
using System; using System;
using System.Collections; using System.Collections.Generic;
using Server; using Server;
using Server.Items; using Server.Items;
using Server.Multis; using Server.Multis;
@ -11,8 +11,8 @@ namespace Server.Mobiles
{ {
public class RealEstateBroker : BaseVendor public class RealEstateBroker : BaseVendor
{ {
private ArrayList m_SBInfos = new ArrayList(); private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override ArrayList SBInfos{ get { return m_SBInfos; } } protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
[Constructable] [Constructable]
public RealEstateBroker() : base( "the real estate broker" ) public RealEstateBroker() : base( "the real estate broker" )

View file

@ -1,13 +1,13 @@
using System; using System;
using System.Collections; using System.Collections.Generic;
using Server; using Server;
namespace Server.Mobiles namespace Server.Mobiles
{ {
public class Scribe : BaseVendor public class Scribe : BaseVendor
{ {
private ArrayList m_SBInfos = new ArrayList(); private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override ArrayList SBInfos{ get { return m_SBInfos; } } protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
public override NpcGuild NpcGuild{ get{ return NpcGuild.MagesGuild; } } public override NpcGuild NpcGuild{ get{ return NpcGuild.MagesGuild; } }

View file

@ -1,13 +1,13 @@
using System; using System;
using System.Collections; using System.Collections.Generic;
using Server; using Server;
namespace Server.Mobiles namespace Server.Mobiles
{ {
public class Shipwright : BaseVendor public class Shipwright : BaseVendor
{ {
private ArrayList m_SBInfos = new ArrayList(); private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override ArrayList SBInfos{ get { return m_SBInfos; } } protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
[Constructable] [Constructable]
public Shipwright() : base( "the shipwright" ) public Shipwright() : base( "the shipwright" )

View file

@ -1,5 +1,5 @@
using System; using System;
using System.Collections; using System.Collections.Generic;
using Server; using Server;
namespace Server.Mobiles namespace Server.Mobiles
@ -7,8 +7,8 @@ namespace Server.Mobiles
[TypeAlias( "Server.Mobiles.GargoyleStonecrafter" )] [TypeAlias( "Server.Mobiles.GargoyleStonecrafter" )]
public class StoneCrafter : BaseVendor public class StoneCrafter : BaseVendor
{ {
private ArrayList m_SBInfos = new ArrayList(); private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override ArrayList SBInfos{ get { return m_SBInfos; } } protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
public override NpcGuild NpcGuild{ get{ return NpcGuild.TinkersGuild; } } public override NpcGuild NpcGuild{ get{ return NpcGuild.TinkersGuild; } }

View file

@ -1,5 +1,5 @@
using System; using System;
using System.Collections; using System.Collections.Generic;
using Server; using Server;
using Server.Engines.BulkOrders; using Server.Engines.BulkOrders;
@ -7,8 +7,8 @@ namespace Server.Mobiles
{ {
public class Tailor : BaseVendor public class Tailor : BaseVendor
{ {
private ArrayList m_SBInfos = new ArrayList(); private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override ArrayList SBInfos{ get { return m_SBInfos; } } protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
public override NpcGuild NpcGuild{ get{ return NpcGuild.TailorsGuild; } } public override NpcGuild NpcGuild{ get{ return NpcGuild.TailorsGuild; } }

View file

@ -1,13 +1,13 @@
using System; using System;
using System.Collections; using System.Collections.Generic;
using Server; using Server;
namespace Server.Mobiles namespace Server.Mobiles
{ {
public class Tanner : BaseVendor public class Tanner : BaseVendor
{ {
private ArrayList m_SBInfos = new ArrayList(); private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override ArrayList SBInfos{ get { return m_SBInfos; } } protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
[Constructable] [Constructable]
public Tanner() : base( "the tanner" ) public Tanner() : base( "the tanner" )

View file

@ -1,13 +1,13 @@
using System; using System;
using System.Collections; using System.Collections.Generic;
using Server; using Server;
namespace Server.Mobiles namespace Server.Mobiles
{ {
public class TavernKeeper : BaseVendor public class TavernKeeper : BaseVendor
{ {
private ArrayList m_SBInfos = new ArrayList(); private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override ArrayList SBInfos{ get { return m_SBInfos; } } protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
[Constructable] [Constructable]
public TavernKeeper() : base( "the tavern keeper" ) public TavernKeeper() : base( "the tavern keeper" )

View file

@ -1,13 +1,13 @@
using System; using System;
using System.Collections; using System.Collections.Generic;
using Server; using Server;
namespace Server.Mobiles namespace Server.Mobiles
{ {
public class Thief : BaseVendor public class Thief : BaseVendor
{ {
private ArrayList m_SBInfos = new ArrayList(); private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override ArrayList SBInfos{ get { return m_SBInfos; } } protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
[Constructable] [Constructable]
public Thief() : base( "the thief" ) public Thief() : base( "the thief" )

View file

@ -1,13 +1,13 @@
using System; using System;
using System.Collections; using System.Collections.Generic;
using Server; using Server;
namespace Server.Mobiles namespace Server.Mobiles
{ {
public class Tinker : BaseVendor public class Tinker : BaseVendor
{ {
private ArrayList m_SBInfos = new ArrayList(); private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override ArrayList SBInfos{ get { return m_SBInfos; } } protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
public override NpcGuild NpcGuild{ get{ return NpcGuild.TinkersGuild; } } public override NpcGuild NpcGuild{ get{ return NpcGuild.TinkersGuild; } }

View file

@ -1,5 +1,5 @@
using System; using System;
using System.Collections; using System.Collections.Generic;
using Server; using Server;
using Server.Items; using Server.Items;
@ -7,8 +7,8 @@ namespace Server.Mobiles
{ {
public class Vagabond : BaseVendor public class Vagabond : BaseVendor
{ {
private ArrayList m_SBInfos = new ArrayList(); private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override ArrayList SBInfos{ get { return m_SBInfos; } } protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
[Constructable] [Constructable]
public Vagabond() : base( "the vagabond" ) public Vagabond() : base( "the vagabond" )

View file

@ -1,13 +1,13 @@
using System; using System;
using System.Collections; using System.Collections.Generic;
using Server; using Server;
namespace Server.Mobiles namespace Server.Mobiles
{ {
public class VarietyDealer : BaseVendor public class VarietyDealer : BaseVendor
{ {
private ArrayList m_SBInfos = new ArrayList(); private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override ArrayList SBInfos{ get { return m_SBInfos; } } protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
[Constructable] [Constructable]
public VarietyDealer() : base( "the variety dealer" ) public VarietyDealer() : base( "the variety dealer" )

View file

@ -1,5 +1,5 @@
using System; using System;
using System.Collections; using System.Collections.Generic;
using Server; using Server;
using Server.Gumps; using Server.Gumps;
using Server.Items; using Server.Items;
@ -11,8 +11,8 @@ namespace Server.Mobiles
{ {
public class Veterinarian : BaseVendor public class Veterinarian : BaseVendor
{ {
private ArrayList m_SBInfos = new ArrayList(); private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override ArrayList SBInfos{ get { return m_SBInfos; } } protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
[Constructable] [Constructable]
public Veterinarian() : base( "the vet" ) public Veterinarian() : base( "the vet" )

View file

@ -1,13 +1,13 @@
using System; using System;
using System.Collections; using System.Collections.Generic;
using Server; using Server;
namespace Server.Mobiles namespace Server.Mobiles
{ {
public class Waiter : BaseVendor public class Waiter : BaseVendor
{ {
private ArrayList m_SBInfos = new ArrayList(); private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override ArrayList SBInfos{ get { return m_SBInfos; } } protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
[Constructable] [Constructable]
public Waiter() : base( "the waiter" ) public Waiter() : base( "the waiter" )

View file

@ -1,5 +1,5 @@
using System; using System;
using System.Collections; using System.Collections.Generic;
using Server; using Server;
using Server.Engines.BulkOrders; using Server.Engines.BulkOrders;
@ -7,8 +7,8 @@ namespace Server.Mobiles
{ {
public class Weaponsmith : BaseVendor public class Weaponsmith : BaseVendor
{ {
private ArrayList m_SBInfos = new ArrayList(); private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override ArrayList SBInfos{ get { return m_SBInfos; } } protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
[Constructable] [Constructable]
public Weaponsmith() : base( "the weaponsmith" ) public Weaponsmith() : base( "the weaponsmith" )

View file

@ -1,5 +1,5 @@
using System; using System;
using System.Collections; using System.Collections.Generic;
using Server; using Server;
using Server.Engines.BulkOrders; using Server.Engines.BulkOrders;
@ -7,8 +7,8 @@ namespace Server.Mobiles
{ {
public class Weaver : BaseVendor public class Weaver : BaseVendor
{ {
private ArrayList m_SBInfos = new ArrayList(); private List<SBInfo> m_SBInfos = new List<SBInfo>();
protected override ArrayList SBInfos{ get { return m_SBInfos; } } protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
public override NpcGuild NpcGuild{ get{ return NpcGuild.TailorsGuild; } } public override NpcGuild NpcGuild{ get{ return NpcGuild.TailorsGuild; } }

View file

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

View file

@ -1468,20 +1468,18 @@ namespace Server.Mobiles
int price; int price;
string description; string description;
try if ( int.TryParse( firstWord, out price ) )
{ {
price = Convert.ToInt32( firstWord ); if ( sep >= 0 )
description = text.Substring( sep + 1 ).Trim();
if ( sep >= 0 ) else
description = text.Substring( sep + 1 ).Trim(); description = "";
else }
description = ""; else
} {
catch price = -1;
{ description = text.Trim();
price = -1; }
description = text.Trim();
}
SetInfo( from, price, Utility.FixHtml( description ) ); SetInfo( from, price, Utility.FixHtml( description ) );
} }
@ -1561,14 +1559,9 @@ namespace Server.Mobiles
text = text.Trim(); text = text.Trim();
int amount; int amount;
try
{ if ( !int.TryParse( text, out amount ) )
amount = Convert.ToInt32( text ); amount = 0;
}
catch
{
amount = 0;
}
GiveGold( from, amount ); GiveGold( from, amount );
} }

View file

@ -318,14 +318,9 @@ namespace Server.Mobiles
text = text.Trim(); text = text.Trim();
int amount; int amount;
try
{ if ( !int.TryParse( text, out amount ) )
amount = Convert.ToInt32( text ); amount = -1;
}
catch
{
amount = -1;
}
Mobile owner = m_Vendor.Owner; Mobile owner = m_Vendor.Owner;
if ( owner == null ) if ( owner == null )

View file

@ -1,12 +1,12 @@
using System; using System;
using System.Collections; using System.Collections.Generic;
using Server.Items; using Server.Items;
namespace Server.Mobiles namespace Server.Mobiles
{ {
public class SBChainmailArmor: SBInfo public class SBChainmailArmor: SBInfo
{ {
private ArrayList m_BuyInfo = new InternalBuyInfo(); private List<GenericBuyInfo> m_BuyInfo = new InternalBuyInfo();
private IShopSellInfo m_SellInfo = new InternalSellInfo(); private IShopSellInfo m_SellInfo = new InternalSellInfo();
public SBChainmailArmor() public SBChainmailArmor()
@ -14,9 +14,9 @@ namespace Server.Mobiles
} }
public override IShopSellInfo SellInfo { get { return m_SellInfo; } } 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() public InternalBuyInfo()
{ {

Some files were not shown because too many files have changed in this diff Show more