Lots of fixes, changes, rewrites of various things, including but not limited to:

Logging of staff crafting items,
Fixes for the OSI client changes
The potion stacking stuff
BaseWeapon fix, so that damage increase things don't multiply themselves.
admin gump fixes for Firewall
Various display tweaks for weight
SoS no longer spawn in Tokuno
Hiryu hues happified to OSI standards
staff now see alliance chat correctly
Play barkeeper text increased per OSI
Various other OSI skill requirement changes
Various unimplemented features of the SE moves
EventSink for when the client version is received from client.
Client validation moved out of the core.
Client version validation now has options to ignore/kick/warn/annoy.  Automagically tries to detect current client.
Reverted the delayeddamagecontext back to OSI standards.
Can no longer use bags of sending in jail.

MagerySpell implemented. Now only Magery spells have a circle, and various other properties of 'em.
TransformationSpellHelper now implemented.  Things moved around for this.
Spells now need a Timespan for the cast delay, instead of arbitrarily based on Circle.  Circle doesn't make sense for non-Magery spells!
Alot of the spellweaving spells added to OSI standards.
This commit is contained in:
asayre 2007-05-26 03:12:41 +00:00
parent f12e9745c6
commit 2ad37d54aa
214 changed files with 4881 additions and 1243 deletions

View file

@ -33,70 +33,6 @@ namespace Server
public class ClientVersion : IComparable, IComparer
{
private static ClientVersion m_Required;
private static bool m_AllowRegular = true, m_AllowUOTD = true, m_AllowGod = true;
private static TimeSpan m_KickDelay = TimeSpan.FromSeconds( 10.0 );
public static ClientVersion Required
{
get
{
return m_Required;
}
set
{
m_Required = value;
}
}
public static bool AllowRegular
{
get
{
return m_AllowRegular;
}
set
{
m_AllowRegular = value;
}
}
public static bool AllowUOTD
{
get
{
return m_AllowUOTD;
}
set
{
m_AllowUOTD = value;
}
}
public static bool AllowGod
{
get
{
return m_AllowGod;
}
set
{
m_AllowGod = value;
}
}
public static TimeSpan KickDelay
{
get
{
return m_KickDelay;
}
set
{
m_KickDelay = value;
}
}
private int m_Major, m_Minor, m_Revision, m_Patch;
private ClientType m_Type;
private string m_SourceString;

View file

@ -72,6 +72,22 @@ namespace Server
public delegate BaseGuild CreateGuildHandler( CreateGuildEventArgs e );
public delegate void GuildGumpRequestHandler( GuildGumpRequestArgs e );
public delegate void QuestGumpRequestHandler( QuestGumpRequestArgs e );
public delegate void ClientVersionRecievedHandler( ClientVersionRecievedArgs e );
public class ClientVersionRecievedArgs : EventArgs
{
private NetState m_State;
private ClientVersion m_Version;
public NetState State { get { return m_State; } }
public ClientVersion Version { get { return m_Version; } }
public ClientVersionRecievedArgs( NetState state, ClientVersion cv )
{
m_State = state;
m_Version = cv;
}
}
public class CreateGuildEventArgs : EventArgs
{
@ -816,6 +832,13 @@ namespace Server
public static event ServerStartedEventHandler ServerStarted;
public static event GuildGumpRequestHandler GuildGumpRequest;
public static event QuestGumpRequestHandler QuestGumpRequest;
public static event ClientVersionRecievedHandler ClientVersionRecieved;
public static void InvokeClientVersionRecieved( ClientVersionRecievedArgs e )
{
if( ClientVersionRecieved != null )
ClientVersionRecieved( e );
}
public static void InvokeServerStarted()
{

View file

@ -77,6 +77,8 @@ namespace Server
new ExpansionInfo( 1, "Age of Shadows" , 0x08, 0x801F, 0x028, 0x20 ),
new ExpansionInfo( 2, "Samurai Empire" , 0x10, 0x805F, 0x0A8, 0x60 ), //0x40 | 0x20 = 0x60
new ExpansionInfo( 3, "Mondain's Legacy", new ClientVersion( "5.0.0a" ), 0x82DF, 0x1A8, 0x2E0 ) //0x280 | 0x60 = 0x2E0
//0x200 + 0x400 for KR?
};
public static ExpansionInfo GetInfo( Expansion ex )

View file

@ -687,7 +687,8 @@ namespace Server
Stackable = 0x08,
InQueue = 0x10,
Insured = 0x20,
PayedInsurance = 0x40
PayedInsurance = 0x40,
QuestItem = 0x80
}
private class CompactInfo
@ -1034,13 +1035,24 @@ namespace Server
if ( DisplayLootType )
AddLootTypeProperty( list );
if ( DisplayWeight ) {
if ( DisplayWeight )
AddWeightProperty( list );
}
if( QuestItem )
AddQuestItemProperty( list );
AppendChildNameProperties( list );
}
/// <summary>
/// Overridable. Adds the "Quest Item" property to the given <see cref="ObjectPropertyList" />.
/// </summary>
public virtual void AddQuestItemProperty( ObjectPropertyList list )
{
list.Add( 1072351 ); // Quest Item
}
/// <summary>
/// Overridable. Adds the "Locked Down & Secure" property to the given <see cref="ObjectPropertyList" />.
/// </summary>
@ -1204,6 +1216,8 @@ namespace Server
return DeathMoveResult.MoveToBackpack;
else if ( CheckNewbied() && parent.Kills < 5 )
return DeathMoveResult.MoveToBackpack;
else if( parent.Player && Nontransferable )
return DeathMoveResult.MoveToBackpack;
else
return DeathMoveResult.MoveToCorpse;
}
@ -1218,6 +1232,8 @@ namespace Server
return DeathMoveResult.MoveToBackpack;
else if ( CheckNewbied() && parent.Kills < 5 )
return DeathMoveResult.MoveToBackpack;
else if( parent.Player && Nontransferable )
return DeathMoveResult.MoveToBackpack;
else
return DeathMoveResult.MoveToCorpse;
}
@ -1491,7 +1507,7 @@ namespace Server
}
}
public virtual bool StackWith( Mobile from, Item dropped )
public bool StackWith( Mobile from, Item dropped )
{
return StackWith( from, dropped, true );
}
@ -1969,7 +1985,7 @@ namespace Server
}
}
ImplFlag implFlags = ( m_Flags & ( ImplFlag.Visible | ImplFlag.Movable | ImplFlag.Stackable | ImplFlag.Insured | ImplFlag.PayedInsurance ) );
ImplFlag implFlags = ( m_Flags & ( ImplFlag.Visible | ImplFlag.Movable | ImplFlag.Stackable | ImplFlag.Insured | ImplFlag.PayedInsurance | ImplFlag.QuestItem ) );
if ( implFlags != ( ImplFlag.Visible | ImplFlag.Movable ) )
flags |= SaveFlag.ImplFlags;
@ -2738,7 +2754,7 @@ namespace Server
{
get
{
return m_Hue;
return (QuestItem ? QuestItemHue : m_Hue);
}
set
{
@ -2752,6 +2768,22 @@ namespace Server
}
}
public virtual int QuestItemHue
{
get { return 0x04EA; } //HMMMM... For EA?
}
public virtual bool Nontransferable
{
get { return QuestItem; }
}
public virtual void HandleInvalidTransfer( Mobile from )
{
if( QuestItem )
from.SendLocalizedMessage( 1074769 ); // An item must be in your backpack (and not in a container within) to be toggled as a quest item.
}
[CommandProperty( AccessLevel.GameMaster )]
public virtual Layer Layer
{
@ -2807,6 +2839,30 @@ namespace Server
}
}
public bool ParentsContain<T>() where T : Item
{
object p = m_Parent;
while( p is Item )
{
if( p is T )
return true;
Item item = (Item)p;
if( item.m_Parent == null )
{
break;
}
else
{
p = item.m_Parent;
}
}
return false;
}
public virtual void AddItem( Item item )
{
if ( item == null || item.Deleted || item.m_Parent == this )
@ -3289,7 +3345,7 @@ namespace Server
}
}
public virtual void OnAfterDuped( Item newItem )
public virtual void OnAfterDuped( Item newItem )
{
}
@ -3352,6 +3408,8 @@ namespace Server
}
}
#region Location Location Location!
public virtual void OnLocationChange( Point3D oldLocation )
{
}
@ -3463,6 +3521,7 @@ namespace Server
get{ return m_Location.m_Z; }
set{ Location = new Point3D( m_Location.m_X, m_Location.m_Y, value ); }
}
#endregion
[CommandProperty( AccessLevel.GameMaster )]
public virtual int ItemID
@ -3633,6 +3692,12 @@ namespace Server
public virtual bool OnDroppedToMobile( Mobile from, Mobile target )
{
if( Nontransferable && from.Player && from.AccessLevel <= AccessLevel.GameMaster )
{
HandleInvalidTransfer( from );
return false;
}
return true;
}
@ -3656,8 +3721,15 @@ namespace Server
public virtual bool OnDroppedInto( Mobile from, Container target, Point3D p )
{
if ( !from.OnDroppedItemInto( this, target, p ) )
if( !from.OnDroppedItemInto( this, target, p ) )
{
return false;
}
else if( Nontransferable && from.Player && target != from.Backpack && from.AccessLevel <= AccessLevel.GameMaster )
{
HandleInvalidTransfer( from );
return false;
}
return target.OnDragDropInto( from, this, p );
}
@ -3674,6 +3746,11 @@ namespace Server
return false;
else if ( !from.OnDroppedItemOnto( this, target ) )
return false;
else if( Nontransferable && from.Player && from.AccessLevel <= AccessLevel.GameMaster )
{
HandleInvalidTransfer( from );
return false;
}
else
return target.OnDragDrop( from, this );
}
@ -3703,6 +3780,12 @@ namespace Server
public virtual bool OnDroppedToWorld( Mobile from, Point3D p )
{
if( Nontransferable && from.Player && from.AccessLevel <= AccessLevel.GameMaster )
{
HandleInvalidTransfer( from );
return false;
}
return true;
}
@ -4023,6 +4106,8 @@ namespace Server
to.Send( new MessageLocalizedAffix( Serial, ItemID, MessageType.Regular, 0x3B2, 3, number, "", affixType, affix, args ) );
}
#region OnDoubleClick[...]
public virtual void OnDoubleClick( Mobile from )
{
}
@ -4049,6 +4134,7 @@ namespace Server
{
from.SendLocalizedMessage( 500447 ); // That is not accessible.
}
#endregion
public virtual void OnSnoop( Mobile from )
{
@ -4330,6 +4416,22 @@ namespace Server
this.Delete();
}
[CommandProperty( AccessLevel.GameMaster )]
public bool QuestItem
{
get { return GetFlag( ImplFlag.QuestItem ); }
set
{
SetFlag( ImplFlag.QuestItem, value );
InvalidateProperties();
Packet.Release( ref m_WorldPacket );
Delta( ItemDelta.Update );
}
}
public bool Insured
{
get{ return GetFlag( ImplFlag.Insured ); }
@ -4454,41 +4556,4 @@ namespace Server
{
}
}
/* public class EmptyArrayList : ArrayList
{
public override bool IsReadOnly{ get{ return true; } }
public override bool IsFixedSize{ get{ return true; } }
private void OnPopulate()
{
Console.WriteLine( "Warning: Attempted to populate a static empty ArrayList" );
Console.WriteLine( new System.Diagnostics.StackTrace() );
}
public override int Add( object value )
{
OnPopulate();
return -1;
}
public override void AddRange( ICollection c )
{
OnPopulate();
}
public override void InsertRange( int index, ICollection c )
{
OnPopulate();
}
public override void Insert( int index, object value )
{
OnPopulate();
}
public override void SetRange( int index, ICollection c )
{
OnPopulate();
}
}*/
}

View file

@ -1673,8 +1673,22 @@ namespace Server.Items
{
base.GetProperties( list );
if ( DisplaysContent )//CheckContentDisplay( from ) )
list.Add( 1050044, "{0}\t{1}", TotalItems, TotalWeight );
if( DisplaysContent )//CheckContentDisplay( from ) )
{
if( Core.ML )
{
if( ParentsContain<BankBox>() ) //Root Parent is the Mobile. Parent could be another containter.
list.Add( 1073841, "{0}\t{1}\t{2}", TotalItems, MaxItems, TotalWeight ); // Contents: ~1_COUNT~/~2_MAXCOUNT~ items, ~3_WEIGHT~ stones
else
list.Add( 1072241, "{0}\t{1}\t{2}\t{3}", TotalItems, MaxItems, TotalWeight, MaxWeight ); // Contents: ~1_COUNT~/~2_MAXCOUNT~ items, ~3_WEIGHT~/~4_MAXWEIGHT~ stones
//TODO: Where do the other clilocs come into play? 1073839 & 1073840?
}
else
{
list.Add( 1050044, "{0}\t{1}", TotalItems, TotalWeight ); // ~1_COUNT~ items, ~2_WEIGHT~ stones
}
}
}
public override void OnDoubleClick( Mobile from )

View file

@ -5187,10 +5187,15 @@ namespace Server
public void Heal( int amount )
{
Heal( amount, true );
Heal( amount, this, true );
}
public void Heal( int amount, bool message )
public void Heal( int amount, Mobile from )
{
Heal( amount, from, true );
}
public void Heal( int amount, Mobile from, bool message )
{
if( !Alive || IsDeadBondedPet )
return;
@ -5198,6 +5203,8 @@ namespace Server
if( !Region.OnHeal( this, ref amount ) )
return;
OnHeal( ref amount, from );
if( (Hits + amount) > HitsMax )
{
amount = HitsMax - Hits;
@ -5209,6 +5216,10 @@ namespace Server
m_NetState.Send( new MessageLocalizedAffix( Serial.MinusOne, -1, MessageType.Label, 0x3B2, 3, 1008158, "", AffixType.Append | AffixType.System, amount.ToString(), "" ) );
}
public virtual void OnHeal( ref int amount, Mobile from )
{
}
public void UsedStuckMenu()
{
if( m_StuckMenuUses == null )

View file

@ -1759,66 +1759,8 @@ namespace Server.Network
public static void ClientVersion( NetState state, PacketReader pvSrc )
{
CV version = state.Version = new CV( pvSrc.ReadString() );
string kickMessage = null;
if ( CV.Required != null && version < CV.Required )
{
kickMessage = String.Format( "This server requires your client version be at least {0}.", CV.Required );
}
else if ( !CV.AllowGod || !CV.AllowRegular || !CV.AllowUOTD )
{
if ( !CV.AllowGod && version.Type == ClientType.God )
kickMessage = "This server does not allow god clients to connect.";
else if ( !CV.AllowRegular && version.Type == ClientType.Regular )
kickMessage = "This server does not allow regular clients to connect.";
else if ( !CV.AllowUOTD && state.IsUOTDClient )
kickMessage = "This server does not allow UO:TD clients to connect.";
if ( !CV.AllowGod && !CV.AllowRegular && !CV.AllowUOTD )
{
kickMessage = "This server does not allow any clients to connect.";
}
else if ( CV.AllowGod && !CV.AllowRegular && !CV.AllowUOTD && version.Type != ClientType.God )
{
kickMessage = "This server requires you to use the god client.";
}
else if ( kickMessage != null )
{
if ( CV.AllowRegular && CV.AllowUOTD )
kickMessage += " You can use regular or UO:TD clients.";
else if ( CV.AllowRegular )
kickMessage += " You can use regular clients.";
else if ( CV.AllowUOTD )
kickMessage += " You can use UO:TD clients.";
}
}
if ( kickMessage != null )
{
state.Mobile.SendMessage( 0x22, kickMessage );
state.Mobile.SendMessage( 0x22, "You will be disconnected in {0} seconds.", CV.KickDelay.TotalSeconds );
new KickTimer( state, CV.KickDelay ).Start();
}
}
private class KickTimer : Timer
{
private NetState m_State;
public KickTimer( NetState state, TimeSpan delay ) : base( delay )
{
m_State = state;
}
protected override void OnTick()
{
if ( m_State.Socket != null )
{
Console.WriteLine( "Client: {0}: Disconnecting, bad version", m_State );
m_State.Dispose();
}
}
EventSink.InvokeClientVersionRecieved( new ClientVersionRecievedArgs( state, version ) );
}
public static void MobileQuery( NetState state, PacketReader pvSrc )

View file

@ -634,23 +634,19 @@ namespace Server.Network
}
}
public sealed class SpeedBoost : Packet
public sealed class SpeedControl : Packet
{
public static readonly Packet Enabled = Packet.SetStatic( new SpeedBoost( true ) );
public static readonly Packet Disabled = Packet.SetStatic( new SpeedBoost( false ) );
public static readonly Packet WalkSpeed = Packet.SetStatic( new SpeedControl( 2 ) );
public static readonly Packet MountSpeed = Packet.SetStatic( new SpeedControl( 1 ) );
public static readonly Packet Disable = Packet.SetStatic( new SpeedControl( 0 ) );
public static Packet Instantiate( bool enable )
{
return (enable ? Enabled : Disabled);
}
public SpeedBoost( bool enable )
public SpeedControl( int speedControl )
: base( 0xBF )
{
EnsureCapacity( 3 );
m_Stream.Write( (short)0x26 );
m_Stream.Write( (bool)enable );
m_Stream.Write( (byte)speedControl );
}
}

View file

@ -468,6 +468,8 @@ namespace Server
return TimerPriority.EveryTick;
}
#region DelayCall(..)
public static Timer DelayCall( TimeSpan delay, TimerCallback callback )
{
return DelayCall( delay, TimeSpan.Zero, 1, callback );
@ -515,8 +517,9 @@ namespace Server
return t;
}
#endregion
#region DelayCall<T>(..)
public static Timer DelayCall<T>( TimeSpan delay, TimerStateCallback<T> callback, T state )
{
return DelayCall( delay, TimeSpan.Zero, 1, callback, state );
@ -540,7 +543,9 @@ namespace Server
return t;
}
#endregion
#region DelayCall Timers
private class DelayCallTimer : Timer
{
private TimerCallback m_Callback;
@ -625,6 +630,7 @@ namespace Server
return String.Format( "DelayStateCall[{0}]", FormatDelegate( m_Callback ) );
}
}
#endregion
public void Start()
{