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

@ -12,23 +12,15 @@ namespace Server
public static void Initialize()
{
//To Ensure that it's sent only AFTER we get the client's version, and right after.
if( Enabled )
{
PacketHandlers.Register( 0xBD, 0, true, new OnPacketReceive
(
delegate( NetState state, PacketReader pvSrc )
{
PacketHandlers.ClientVersion( state, pvSrc );
PlayerMobile pm = state.Mobile as PlayerMobile;
if( pm != null )
{
Timer.DelayCall( TimeSpan.Zero, new TimerCallback( pm.ResendBuffs ) );
}
}
) );
EventSink.ClientVersionRecieved += new ClientVersionRecievedHandler( delegate( ClientVersionRecievedArgs args )
{
PlayerMobile pm = args.State.Mobile as PlayerMobile;
if( pm != null )
Timer.DelayCall( TimeSpan.Zero, pm.ResendBuffs );
} );
}
}
@ -143,6 +135,19 @@ namespace Server
{
m_Args = args;
}
public BuffInfo( BuffIcon iconID, int titleCliloc, TimeSpan length, Mobile m, TextDefinition args, bool retainThroughDeath )
: this( iconID, titleCliloc, titleCliloc + 1, length, m, args, retainThroughDeath )
{
}
public BuffInfo( BuffIcon iconID, int titleCliloc, int secondaryCliloc, TimeSpan length, Mobile m, TextDefinition args, bool retainThroughDeath )
: this( iconID, titleCliloc, secondaryCliloc, length, m )
{
m_Args = args;
m_RetainThroughDeath = retainThroughDeath;
}
#endregion
#region Convience Methods
@ -192,7 +197,7 @@ namespace Server
Mindrot, //*
PainSpike, //*
Strangle,
GiftOfRenewal,
GiftOfRenewal, //*
AttuneWeapon,
Thunderstorm,
EssenceOfWind,

View file

@ -733,8 +733,20 @@ namespace Server.Misc
m_Mobile.SendLocalizedMessage( m_Message );
}
}
private static readonly ClientVersion m_NewHavenClient = new ClientVersion( "6.0.0.0" );
private static readonly CityInfo m_NewHavenInfo = new CityInfo( "New Haven", "The Bountiful Harvest Inn", 3503, 2574, 14, Map.Trammel );
private static CityInfo GetStartLocation( CharacterCreatedEventArgs args, bool isYoung )
{
if( Core.ML )
{
//if( args.State != null && args.State.Version >= m_NewHavenClient )
return m_NewHavenInfo; //We don't get the client Version until AFTER Character creation
//return args.City; TODO: Uncomment when the old quest system is actually phased out
}
bool useHaven = isYoung;
int flags = args.State == null ? 0 : args.State.Flags;
@ -766,7 +778,7 @@ namespace Server.Misc
}
case 5: //Paladin
{
return new CityInfo( "Haven", "Uzeraan's Mansion", 3578, 2589, 0, Map.Trammel );
return m_NewHavenInfo;
}
case 6: //Samurai
{
@ -815,7 +827,7 @@ namespace Server.Misc
}
if( useHaven )
return new CityInfo( "Haven", "Uzeraan's Mansion", 3582, 2587, 0, Map.Trammel );
return m_NewHavenInfo;
else
return args.City;
}
@ -1102,6 +1114,8 @@ namespace Server.Misc
book.LootType = LootType.Blessed;
addSkillItems = false;
break;
}

View file

@ -141,7 +141,8 @@ namespace Server.Misc
|| item is TreasureMap || item is MessageInABottle
|| item is BaseArmor || item is BaseWeapon
|| item is BaseClothing
|| (item is BaseJewel && Core.AOS) )
|| (item is BaseJewel && Core.AOS)
|| (item is BasePotion && Core.ML))
return true;
return false;

View file

@ -2,16 +2,95 @@ using System;
using Server;
using System.Diagnostics;
using System.IO;
using Server.Network;
using Server.Gumps;
namespace Server.Misc
{
public class ClientVerification
{
private static bool m_DetectClientRequirement = false;
private enum OldClientResponse
{
Ignore,
Warn,
Annoy,
Kick
}
private static bool m_DetectClientRequirement = true;
private static OldClientResponse m_OldClientResponse = OldClientResponse.Annoy;
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;
}
}
public static void Initialize()
{
EventSink.ClientVersionRecieved += new ClientVersionRecievedHandler( EventSink_ClientVersionRecieved );
//ClientVersion.Required = null;
//ClientVersion.Required = new ClientVersion( "3.0.8q" );
//Required = new ClientVersion( "6.0.0.0" );
if( m_DetectClientRequirement )
{
@ -23,17 +102,105 @@ namespace Server.Misc
if ( info.FileMajorPart != 0 || info.FileMinorPart != 0 || info.FileBuildPart != 0 || info.FilePrivatePart != 0 )
{
ClientVersion.Required = new ClientVersion( info.FileMajorPart, info.FileMinorPart, info.FileBuildPart, info.FilePrivatePart );
Console.WriteLine( "Restricting client version to {0}", ClientVersion.Required );
Required = new ClientVersion( info.FileMajorPart, info.FileMinorPart, info.FileBuildPart, info.FilePrivatePart );
}
}
}
ClientVersion.AllowGod = true;
ClientVersion.AllowUOTD = true;
ClientVersion.AllowRegular = true;
if( Required != null )
{
Utility.PushColor( ConsoleColor.White );
Console.WriteLine( "Restricting client version to {0}. Action to be taken: {1}", Required, m_OldClientResponse );
Utility.PopColor();
}
}
ClientVersion.KickDelay = TimeSpan.FromSeconds( 10.0 );
private static void EventSink_ClientVersionRecieved( ClientVersionRecievedArgs e )
{
string kickMessage = null;
NetState state = e.State;
ClientVersion version = e.Version;
if( Required != null && m_OldClientResponse == OldClientResponse.Kick && version < Required )
{
kickMessage = String.Format( "This server requires your client version be at least {0}.", Required );
}
else if( !AllowGod || !AllowRegular || !AllowUOTD )
{
if( !AllowGod && version.Type == ClientType.God )
kickMessage = "This server does not allow god clients to connect.";
else if( !AllowRegular && version.Type == ClientType.Regular )
kickMessage = "This server does not allow regular clients to connect.";
else if( !AllowUOTD && state.IsUOTDClient )
kickMessage = "This server does not allow UO:TD clients to connect.";
if( !AllowGod && !AllowRegular && !AllowUOTD )
{
kickMessage = "This server does not allow any clients to connect.";
}
else if( AllowGod && !AllowRegular && !AllowUOTD && version.Type != ClientType.God )
{
kickMessage = "This server requires you to use the god client.";
}
else if( kickMessage != null )
{
if( AllowRegular && AllowUOTD )
kickMessage += " You can use regular or UO:TD clients.";
else if( AllowRegular )
kickMessage += " You can use regular clients.";
else if( 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.", KickDelay.TotalSeconds );
Timer.DelayCall( KickDelay, delegate
{
if( state.Socket != null )
{
Console.WriteLine( "Client: {0}: Disconnecting, bad version", state );
state.Dispose();
}
} );
}
else if( Required != null && version < Required )
{
switch( m_OldClientResponse )
{
case OldClientResponse.Warn:
{
state.Mobile.SendMessage( 0x22, "Your client is out of date. Please update your client.", Required );
state.Mobile.SendMessage( 0x22, "This server reccomends that your client version be at least {0}.", Required );
break;
}
case OldClientResponse.Annoy:
{
SendAnnoyGump( state.Mobile );
break;
}
}
}
}
private static void SendAnnoyGump( Mobile m )
{
if( m.NetState != null && m.NetState.Version < Required )
{
Gump g = new WarningGump( 1060637, 30720, String.Format( "Your client is out of date. Please update your client.<br>This server reccomends that your client version be at least {0}.<br> <br>You are currently using version {1}.<br> <br>To patch, run UOPatch.exe inside your Ultima Online folder.", Required, m.NetState.Version ), 0xFFC000, 480, 360,
delegate( Mobile mob, bool selection, object o )
{
m.SendMessage( "You will be reminded of this again." );
Timer.DelayCall( TimeSpan.FromMinutes( 20 ), delegate { SendAnnoyGump( m ); } );
}, null, false );
g.Dragable = false;
m.SendGump( g );
}
}
}
}

View file

@ -21,7 +21,7 @@ namespace Server.Misc
m_Givers.Add( giver );
}
public static void Configure()
public static void Initialize()
{
EventSink.Login += new LoginEventHandler( EventSink_Login );
}

View file

@ -17,8 +17,8 @@ namespace Server
int luck = killer.Luck;
PlayerMobile pmKiller = killer as PlayerMobile;
if ( pmKiller != null && pmKiller.SentHonorContext != null && pmKiller.SentHonorContext.Target == victim )
pmKiller.SentHonorContext.ApplyPerfectionLuckBonus( ref luck );
if( pmKiller != null && pmKiller.SentHonorContext != null && pmKiller.SentHonorContext.Target == victim )
luck += pmKiller.SentHonorContext.PerfectionLuckBonus;
if ( luck < 0 )
return 0;

View file

@ -16,7 +16,7 @@ namespace Server.Misc
*/
RegisterMap( 0, 0, 0, 7168, 4096, 4, "Felucca", MapRules.FeluccaRules );
RegisterMap( 1, 1, 0, 7168, 4096, 0, "Trammel", MapRules.TrammelRules );
RegisterMap( 1, 1, 1, 7168, 4096, 0, "Trammel", MapRules.TrammelRules );
RegisterMap( 2, 2, 2, 2304, 1600, 1, "Ilshenar", MapRules.TrammelRules );
RegisterMap( 3, 3, 3, 2560, 2048, 1, "Malas", MapRules.TrammelRules );
RegisterMap( 4, 4, 4, 1448, 1448, 1, "Tokuno", MapRules.TrammelRules );
@ -35,6 +35,8 @@ namespace Server.Misc
* - <name> : Reference name for the map, used in props gump, get/set commands, region loading, etc
* - <rules> : Rules and restrictions associated with the map. See documentation for details
*/
TileMatrixPatch.Enabled = false; //OSI client patch 6.0.0.0
}
public static void RegisterMap( int mapIndex, int mapID, int fileIndex, int width, int height, int season, string name, MapRules rules )

View file

@ -10,6 +10,7 @@ using Server.Engines.PartySystem;
using Server.Factions;
using Server.Spells.Necromancy;
using Server.Spells.Ninjitsu;
using Server.Spells;
namespace Server.Misc
{
@ -310,7 +311,7 @@ namespace Server.Misc
if( !(target is BaseCreature && ((BaseCreature)target).InitialInnocent) )
{
if( !target.Body.IsHuman && !target.Body.IsGhost && !IsPet( target as BaseCreature ) && !TransformationSpell.UnderTransformation( target ) && !AnimalForm.UnderTransformation( target ) )
if( !target.Body.IsHuman && !target.Body.IsGhost && !IsPet( target as BaseCreature ) && !TransformationSpellHelper.UnderTransformation( target ) && !AnimalForm.UnderTransformation( target ) )
return Notoriety.CanBeAttacked;
}

View file

@ -87,7 +87,7 @@ namespace Server
protected override void OnTick()
{
if ( (Core.AOS && m_Poison.Level < 4 && TransformationSpell.UnderTransformation( m_Mobile, typeof( VampiricEmbraceSpell ) )) ||
if ( (Core.AOS && m_Poison.Level < 4 && TransformationSpellHelper.UnderTransformation( m_Mobile, typeof( VampiricEmbraceSpell ) )) ||
(m_Poison.Level < 3 && OrangePetals.UnderEffect( m_Mobile )) ||
AnimalForm.UnderTransformation( m_Mobile, typeof( Unicorn ) ) )
{

View file

@ -42,7 +42,7 @@ namespace Server.Misc
private static bool CheckTransform( Mobile m, Type type )
{
return TransformationSpell.UnderTransformation( m, type );
return TransformationSpellHelper.UnderTransformation( m, type );
}
private static bool CheckAnimal( Mobile m, Type type )

View file

@ -6,7 +6,7 @@ namespace Server.Misc
{
public class SkillCheck
{
private static readonly bool AntiMacroCode = true; //Change this to false to disable anti-macro code
private static readonly bool AntiMacroCode = !Core.ML; //Change this to false to disable anti-macro code
public static TimeSpan AntiMacroExpire = TimeSpan.FromMinutes( 5.0 ); //How long do we remember targets/locations?
public const int Allowance = 3; //How many times may we use the same location/target for gain