- Added High Seas expansion to the expansions list.
- Changed the default expansion to HS. - Changed meer monsters to all be FightMode.Evil. - Added refuse trades option (client 7.0.30.0+). - Added item insurance menu. - Updated context menus to support new clilocs. - Added item properties to gumps. - Reverting items not decaying on spawners, needs to be configurable. - Added AUO features to FeatureProtection. - Tweaked third party authentication to not trigger the character password gump in the client.
This commit is contained in:
parent
fb0368e201
commit
858e86d45b
15 changed files with 512 additions and 57 deletions
|
|
@ -123,7 +123,11 @@ namespace Server.ContextMenus
|
|||
/// </param>
|
||||
public ContextMenuEntry( int number, int range )
|
||||
{
|
||||
m_Number = number;
|
||||
if ( number <= 0x7FFF ) // Legacy code support
|
||||
m_Number = 3000000 + number;
|
||||
else
|
||||
m_Number = number;
|
||||
|
||||
m_Range = range;
|
||||
m_Enabled = true;
|
||||
m_Color = 0xFFFF;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,8 @@ namespace Server
|
|||
AOS,
|
||||
SE,
|
||||
ML,
|
||||
SA
|
||||
SA,
|
||||
HS
|
||||
}
|
||||
|
||||
[Flags]
|
||||
|
|
@ -83,7 +84,8 @@ namespace Server
|
|||
ExpansionAOS = ExpansionLBR | AOS | Unk7,
|
||||
ExpansionSE = ExpansionAOS | SE,
|
||||
ExpansionML = ExpansionSE | ML | Unk2,
|
||||
ExpansionSA = ExpansionML | SA | Gothic | Rustic
|
||||
ExpansionSA = ExpansionML | SA | Gothic | Rustic,
|
||||
ExpansionHS = ExpansionSA
|
||||
}
|
||||
|
||||
[Flags]
|
||||
|
|
@ -113,7 +115,8 @@ namespace Server
|
|||
ExpansionAOS = ContextMenus | AOS,
|
||||
ExpansionSE = ExpansionAOS | SE,
|
||||
ExpansionML = ExpansionSE | ML,
|
||||
ExpansionSA = ExpansionML
|
||||
ExpansionSA = ExpansionML,
|
||||
ExpansionHS = ExpansionSA
|
||||
}
|
||||
|
||||
public class ExpansionInfo
|
||||
|
|
@ -129,7 +132,8 @@ namespace Server
|
|||
new ExpansionInfo( 5, "Age of Shadows", ClientFlags.Malas, FeatureFlags.ExpansionAOS, CharacterListFlags.ExpansionAOS, 0x0000 ),
|
||||
new ExpansionInfo( 6, "Samurai Empire", ClientFlags.Tokuno, FeatureFlags.ExpansionSE, CharacterListFlags.ExpansionSE, 0x00C0 ), // 0x20 | 0x80
|
||||
new ExpansionInfo( 7, "Mondain's Legacy", new ClientVersion( "5.0.0a" ), FeatureFlags.ExpansionML, CharacterListFlags.ExpansionML, 0x02C0 ), // 0x20 | 0x80 | 0x200
|
||||
new ExpansionInfo( 8, "Stygian Abyss", ClientFlags.TerMur, FeatureFlags.ExpansionSA, CharacterListFlags.ExpansionSA, 0xD02C0 ) // 0x20 | 0x80 | 0x200 | 0x10000 | 0x40000 | 0x80000
|
||||
new ExpansionInfo( 8, "Stygian Abyss", ClientFlags.TerMur, FeatureFlags.ExpansionSA, CharacterListFlags.ExpansionSA, 0xD02C0 ), // 0x20 | 0x80 | 0x200 | 0x10000 | 0x40000 | 0x80000
|
||||
new ExpansionInfo( 9, "High Seas", new ClientVersion( "7.0.9.0" ), FeatureFlags.ExpansionHS, CharacterListFlags.ExpansionHS, 0xD02C0 ) // 0x20 | 0x80 | 0x200 | 0x10000 | 0x40000 | 0x80000
|
||||
};
|
||||
|
||||
private string m_Name;
|
||||
|
|
|
|||
|
|
@ -310,6 +310,11 @@ namespace Server.Gumps
|
|||
Add( new GumpTextEntryLimited( x, y, width, height, hue, entryID, initialText, size ) );
|
||||
}
|
||||
|
||||
public void AddItemProperty( int serial )
|
||||
{
|
||||
Add( new GumpItemProperty( serial ) );
|
||||
}
|
||||
|
||||
public void Add( GumpEntry g )
|
||||
{
|
||||
if ( g.Parent != this )
|
||||
|
|
|
|||
60
Server/Gumps/GumpItemProperty.cs
Normal file
60
Server/Gumps/GumpItemProperty.cs
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
/***************************************************************************
|
||||
* GumpItemProperty.cs
|
||||
* -------------------
|
||||
* begin : May 26, 2013
|
||||
* copyright : (C) The RunUO Software Team
|
||||
* email : info@runuo.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
using System;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Gumps
|
||||
{
|
||||
public class GumpItemProperty : GumpEntry
|
||||
{
|
||||
private int m_Serial;
|
||||
|
||||
public GumpItemProperty( int serial )
|
||||
{
|
||||
m_Serial = serial;
|
||||
}
|
||||
|
||||
public int Serial
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Serial;
|
||||
}
|
||||
set
|
||||
{
|
||||
Delta( ref m_Serial, value );
|
||||
}
|
||||
}
|
||||
|
||||
public override string Compile()
|
||||
{
|
||||
return String.Format( "{{ itemproperty {0} }}", m_Serial );
|
||||
}
|
||||
|
||||
private static byte[] m_LayoutName = Gump.StringToBuffer( "itemproperty" );
|
||||
|
||||
public override void AppendTo( IGumpWriter disp )
|
||||
{
|
||||
disp.AppendLayout( m_LayoutName );
|
||||
disp.AppendLayout( m_Serial );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1508,7 +1508,8 @@ namespace Server
|
|||
{
|
||||
get
|
||||
{
|
||||
return (Movable && Visible && Spawner == null);
|
||||
// TODO: Make item decay an option on the spawner
|
||||
return (Movable && Visible/* && Spawner == null*/);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -202,6 +202,11 @@ namespace Server
|
|||
get { return m_Expansion >= Expansion.SA; }
|
||||
}
|
||||
|
||||
public static bool HS
|
||||
{
|
||||
get { return m_Expansion >= Expansion.HS; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public static string ExePath
|
||||
|
|
|
|||
|
|
@ -2784,8 +2784,13 @@ namespace Server
|
|||
{
|
||||
m_ContextMenu = value;
|
||||
|
||||
if( m_ContextMenu != null )
|
||||
Send( new DisplayContextMenu( m_ContextMenu ) );
|
||||
if ( m_ContextMenu != null && m_NetState != null )
|
||||
{
|
||||
if ( m_NetState.NewHaven )
|
||||
Send( new DisplayContextMenu( m_ContextMenu ) );
|
||||
else
|
||||
Send( new DisplayContextMenuOld( m_ContextMenu ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -902,6 +902,8 @@ namespace Server.Network
|
|||
{
|
||||
None = 0x00,
|
||||
Disabled = 0x01,
|
||||
Arrow = 0x02,
|
||||
Highlighted = 0x04,
|
||||
Colored = 0x20
|
||||
}
|
||||
|
||||
|
|
@ -915,6 +917,55 @@ namespace Server.Network
|
|||
|
||||
this.EnsureCapacity( 12 + (length * 8) );
|
||||
|
||||
m_Stream.Write( (short) 0x14 );
|
||||
m_Stream.Write( (short) 0x02 );
|
||||
|
||||
IEntity target = menu.Target as IEntity;
|
||||
|
||||
m_Stream.Write( (int) ( target == null ? Serial.MinusOne : target.Serial ) );
|
||||
|
||||
m_Stream.Write( (byte) length );
|
||||
|
||||
Point3D p;
|
||||
|
||||
if ( target is Mobile )
|
||||
p = target.Location;
|
||||
else if ( target is Item )
|
||||
p = ((Item)target).GetWorldLocation();
|
||||
else
|
||||
p = Point3D.Zero;
|
||||
|
||||
for ( int i = 0; i < length; ++i )
|
||||
{
|
||||
ContextMenuEntry e = entries[i];
|
||||
|
||||
m_Stream.Write( (int) e.Number );
|
||||
m_Stream.Write( (short) i );
|
||||
|
||||
int range = e.Range;
|
||||
|
||||
if ( range == -1 )
|
||||
range = 18;
|
||||
|
||||
CMEFlags flags = (e.Enabled && menu.From.InRange( p, range )) ? CMEFlags.None : CMEFlags.Disabled;
|
||||
|
||||
flags |= e.Flags;
|
||||
|
||||
m_Stream.Write( (short) flags );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class DisplayContextMenuOld : Packet
|
||||
{
|
||||
public DisplayContextMenuOld( ContextMenu menu ) : base( 0xBF )
|
||||
{
|
||||
ContextMenuEntry[] entries = menu.Entries;
|
||||
|
||||
int length = (byte) entries.Length;
|
||||
|
||||
this.EnsureCapacity( 12 + (length * 8) );
|
||||
|
||||
m_Stream.Write( (short) 0x14 );
|
||||
m_Stream.Write( (short) 0x01 );
|
||||
|
||||
|
|
@ -938,7 +989,7 @@ namespace Server.Network
|
|||
ContextMenuEntry e = entries[i];
|
||||
|
||||
m_Stream.Write( (short) i );
|
||||
m_Stream.Write( (ushort) e.Number );
|
||||
m_Stream.Write( (ushort) ( e.Number - 3000000 ) );
|
||||
|
||||
int range = e.Range;
|
||||
|
||||
|
|
@ -3805,9 +3856,9 @@ namespace Server.Network
|
|||
public enum ThirdPartyFeature : ulong
|
||||
{
|
||||
FilterWeather = 1 << 0,
|
||||
FilterLight = 1 << 1,
|
||||
FilterLight = 1 << 1,
|
||||
|
||||
SmartTarget = 1 << 2,
|
||||
SmartTarget = 1 << 2,
|
||||
RangedTarget = 1 << 3,
|
||||
|
||||
AutoOpenDoors = 1 << 4,
|
||||
|
|
@ -3821,14 +3872,24 @@ namespace Server.Network
|
|||
|
||||
UseOnceAgent = 1 << 9,
|
||||
RestockAgent = 1 << 10,
|
||||
SellAgent = 1 << 11,
|
||||
BuyAgent = 1 << 12,
|
||||
SellAgent = 1 << 11,
|
||||
BuyAgent = 1 << 12,
|
||||
|
||||
PotionHotkeys = 1 << 13,
|
||||
|
||||
RandomTargets = 1 << 14,
|
||||
ClosestTargets = 1 << 15, // All closest target hotkeys
|
||||
OverheadHealth = 1 << 16, // Health and Mana/Stam messages shown over player's heads
|
||||
|
||||
AutolootAgent = 1 << 17,
|
||||
BoneCutterAgent = 1 << 18,
|
||||
AdvancedMacros = 1 << 19,
|
||||
AutoRemount = 1 << 20,
|
||||
AutoBandage = 1 << 21,
|
||||
BuffChecks = 1 << 22, // Buff bar checks for macros
|
||||
FilterSeason = 1 << 23,
|
||||
|
||||
All = ulong.MaxValue
|
||||
}
|
||||
|
||||
public static class FeatureProtection
|
||||
|
|
@ -3930,15 +3991,13 @@ namespace Server.Network
|
|||
m_Stream.UnderlyingStream.Flush();
|
||||
|
||||
byte[] hashCode = m_MD5Provider.ComputeHash( m_Stream.UnderlyingStream.GetBuffer(), 0, (int) m_Stream.UnderlyingStream.Length );
|
||||
|
||||
Random rnd = new Random();
|
||||
byte[] buffer = new byte[29];
|
||||
byte[] buffer = new byte[28];
|
||||
|
||||
for ( int i = 0; i < count; ++i )
|
||||
{
|
||||
rnd.NextBytes( buffer );
|
||||
Utility.RandomBytes( buffer );
|
||||
|
||||
m_Stream.Seek( 34 + ( i * 60 ), SeekOrigin.Begin );
|
||||
m_Stream.Seek( 35 + ( i * 60 ), SeekOrigin.Begin );
|
||||
m_Stream.Write( buffer, 0, buffer.Length );
|
||||
}
|
||||
|
||||
|
|
@ -4025,15 +4084,13 @@ namespace Server.Network
|
|||
m_Stream.UnderlyingStream.Flush();
|
||||
|
||||
byte[] hashCode = m_MD5Provider.ComputeHash( m_Stream.UnderlyingStream.GetBuffer(), 0, (int) m_Stream.UnderlyingStream.Length );
|
||||
|
||||
Random rnd = new Random();
|
||||
byte[] buffer = new byte[29];
|
||||
byte[] buffer = new byte[28];
|
||||
|
||||
for ( int i = 0; i < count; ++i )
|
||||
{
|
||||
rnd.NextBytes( buffer );
|
||||
Utility.RandomBytes( buffer );
|
||||
|
||||
m_Stream.Seek( 34 + ( i * 60 ), SeekOrigin.Begin );
|
||||
m_Stream.Seek( 35 + ( i * 60 ), SeekOrigin.Begin );
|
||||
m_Stream.Write( buffer, 0, buffer.Length );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -831,6 +831,11 @@ namespace Server
|
|||
return m_Random.Next( count );
|
||||
}
|
||||
|
||||
public static void RandomBytes( byte[] buffer )
|
||||
{
|
||||
m_Random.NextBytes( buffer );
|
||||
}
|
||||
|
||||
#region Random Hues
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue