character creation, healthbar (poison/yellow), etc
This commit is contained in:
parent
30fe26bc15
commit
33ffc0f070
5 changed files with 229 additions and 54 deletions
|
|
@ -201,7 +201,9 @@ namespace Server.Network {
|
|||
set {
|
||||
m_Version = value;
|
||||
|
||||
if ( value >= m_Version60142 ) {
|
||||
if ( value >= m_Version7000 ) {
|
||||
m_Post7000 = m_Post60142 = m_Post6017 = true;
|
||||
} else if ( value >= m_Version60142 ) {
|
||||
m_Post60142 = m_Post6017 = true;
|
||||
} else if ( value >= m_Version6017 ) {
|
||||
m_Post6017 = true;
|
||||
|
|
@ -224,9 +226,11 @@ namespace Server.Network {
|
|||
|
||||
private static ClientVersion m_Version6017 = new ClientVersion( "6.0.1.7" );
|
||||
private static ClientVersion m_Version60142 = new ClientVersion( "6.0.14.2" );
|
||||
private static ClientVersion m_Version7000 = new ClientVersion( "7.0.0.0" );
|
||||
|
||||
private bool m_Post6017;
|
||||
private bool m_Post60142;
|
||||
private bool m_Post7000;
|
||||
|
||||
public bool IsPost6017 {
|
||||
get {
|
||||
|
|
@ -240,6 +244,12 @@ namespace Server.Network {
|
|||
}
|
||||
}
|
||||
|
||||
public bool IsPost7000 {
|
||||
get {
|
||||
return m_Post7000;
|
||||
}
|
||||
}
|
||||
|
||||
public List<SecureTrade> Trades {
|
||||
get {
|
||||
return m_Trades;
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ namespace Server.Network
|
|||
Register( 0xD1, 2, true, new OnPacketReceive( LogoutReq ) );
|
||||
Register( 0xD6, 0, true, new OnPacketReceive( BatchQueryProperties ) );
|
||||
Register( 0xD7, 0, true, new OnPacketReceive( EncodedCommand ) );
|
||||
Register( 0xEF, 21, false, new OnPacketReceive( LoginServerSeed ) );
|
||||
Register( 0xEF, 21, false, new OnPacketReceive( LoginServerSeed ) );
|
||||
|
||||
Register6017( 0x08, 15, true, new OnPacketReceive( DropReq6017 ) );
|
||||
|
||||
|
|
@ -2024,9 +2024,28 @@ namespace Server.Network
|
|||
int shirtHue = pvSrc.ReadInt16();
|
||||
int pantsHue = pvSrc.ReadInt16();
|
||||
|
||||
/*
|
||||
Pre-7.0.0.0:
|
||||
0x00, 0x01 -> Human Male, Human Female
|
||||
0x02, 0x03 -> Elf Male, Elf Female
|
||||
|
||||
Post-7.0.0.0:
|
||||
0x00, 0x01
|
||||
0x02, 0x03 -> Human Male, Human Female
|
||||
0x04, 0x05 -> Elf Male, Elf Female
|
||||
0x05, 0x06 -> Gargoyle Male, Gargoyle Female
|
||||
*/
|
||||
|
||||
bool female = ((genderRace % 2) != 0);
|
||||
|
||||
Race race = Race.Races[(byte)(genderRace / 2)];
|
||||
Race race = null;
|
||||
|
||||
if ( state.IsPost7000 ) {
|
||||
byte raceID = (byte)(genderRace < 4 ? 0 : ((genderRace / 2) - 1));
|
||||
race = Race.Races[raceID];
|
||||
} else {
|
||||
race = Race.Races[(byte)(genderRace / 2)];
|
||||
}
|
||||
|
||||
if( race == null )
|
||||
race = Race.DefaultRace;
|
||||
|
|
|
|||
|
|
@ -2734,10 +2734,9 @@ namespace Server.Network
|
|||
string name = m.Name;
|
||||
if ( name == null ) name = "";
|
||||
|
||||
bool sendMaxWeight = (Core.ML && ns != null && ns.SupportsExpansion( Expansion.ML ));
|
||||
bool sendMLExtended = (Core.ML && ns != null && ns.SupportsExpansion( Expansion.ML ));
|
||||
|
||||
|
||||
this.EnsureCapacity( sendMaxWeight ? 91 :88 );
|
||||
this.EnsureCapacity( sendMLExtended ? 91 : 88 );
|
||||
|
||||
m_Stream.Write( (int) m.Serial );
|
||||
m_Stream.WriteAsciiFixed( name, 30 );
|
||||
|
|
@ -2747,7 +2746,7 @@ namespace Server.Network
|
|||
|
||||
m_Stream.Write( m.CanBeRenamedBy( m ) );
|
||||
|
||||
m_Stream.Write( (byte)(sendMaxWeight ? 0x05 : Core.AOS ? 0x04 : 0x03) ); // type
|
||||
m_Stream.Write( (byte)(sendMLExtended ? 0x05 : Core.AOS ? 0x04 : 0x03) ); // type
|
||||
|
||||
m_Stream.Write( m.Female );
|
||||
|
||||
|
|
@ -2765,7 +2764,7 @@ namespace Server.Network
|
|||
m_Stream.Write( (short) (Core.AOS ? m.PhysicalResistance : (int)(m.ArmorRating + 0.5)) );
|
||||
m_Stream.Write( (short) (Mobile.BodyWeight + m.TotalWeight) );
|
||||
|
||||
if( sendMaxWeight )
|
||||
if( sendMLExtended )
|
||||
{
|
||||
m_Stream.Write( (short)m.MaxWeight );
|
||||
m_Stream.Write( (byte)(m.Race.RaceID + 1)); // Would be 0x00 if it's a non-ML enabled account but...
|
||||
|
|
@ -2810,9 +2809,9 @@ namespace Server.Network
|
|||
string name = beheld.Name;
|
||||
if ( name == null ) name = "";
|
||||
|
||||
bool sendMaxWeight = (Core.ML && ns != null && ns.SupportsExpansion( Expansion.ML ));
|
||||
bool sendMLExtended = (Core.ML && ns != null && ns.SupportsExpansion( Expansion.ML ));
|
||||
|
||||
this.EnsureCapacity( 43 + (beholder == beheld ? (sendMaxWeight ? 48 : 45) : 0) );
|
||||
this.EnsureCapacity( 43 + (beholder == beheld ? (sendMLExtended ? 48 : 45) : 0) );
|
||||
|
||||
m_Stream.Write( beheld.Serial );
|
||||
|
||||
|
|
@ -2827,7 +2826,7 @@ namespace Server.Network
|
|||
|
||||
if ( beholder == beheld )
|
||||
{
|
||||
m_Stream.Write( (byte)(sendMaxWeight ? 0x05 : Core.AOS ? 0x04 : 0x03) ); // type
|
||||
m_Stream.Write( (byte)(sendMLExtended ? 0x05 : Core.AOS ? 0x04 : 0x03) ); // type
|
||||
|
||||
m_Stream.Write( beheld.Female );
|
||||
|
||||
|
|
@ -2842,7 +2841,7 @@ namespace Server.Network
|
|||
m_Stream.Write( (short) (Core.AOS ? beheld.PhysicalResistance : (int)(beheld.ArmorRating + 0.5)) );
|
||||
m_Stream.Write( (short) (Mobile.BodyWeight + beheld.TotalWeight) );
|
||||
|
||||
if( sendMaxWeight )
|
||||
if( sendMLExtended )
|
||||
{
|
||||
m_Stream.Write( (short)beheld.MaxWeight );
|
||||
m_Stream.Write( (byte)(beheld.Race.RaceID + 1) ); // Would be 0x00 if it's a non-ML enabled account but...
|
||||
|
|
@ -2892,6 +2891,46 @@ namespace Server.Network
|
|||
}
|
||||
}
|
||||
|
||||
public sealed class HealthbarPoison : Packet
|
||||
{
|
||||
public HealthbarUpdatePoison( Mobile m ) : base( 0x17 )
|
||||
{
|
||||
EnsureCapacity( 12 );
|
||||
|
||||
m_Stream.Write( (int) m.Serial );
|
||||
m_Stream.Write( (short) 0 );
|
||||
|
||||
m_Stream.Write( (short) 1 );
|
||||
|
||||
Poison p = m.Poison;
|
||||
|
||||
if ( p != null ) {
|
||||
m_Stream.Write( (byte) p.Level + 1 );
|
||||
} else {
|
||||
m_Stream.Write( (byte) 0 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class HealthbarYellow : Packet
|
||||
{
|
||||
public HealthbarUpdateYellow( Mobile m ) : base( 0x17 )
|
||||
{
|
||||
EnsureCapacity( 12 );
|
||||
|
||||
m_Stream.Write( (int) m.Serial );
|
||||
m_Stream.Write( (short) 0 );
|
||||
|
||||
m_Stream.Write( (short) 2 );
|
||||
|
||||
if ( m.Blessed || m.YellowHealthbar ) {
|
||||
m_Stream.Write( (byte) 1 );
|
||||
} else {
|
||||
m_Stream.Write( (byte) 0 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class MobileUpdate : Packet
|
||||
{
|
||||
public MobileUpdate( Mobile m ) : base( 0x20, 19 )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue