Ejemplo n.º 1
0
 private bool ServerMessage_0x08_StatsUpdated(Client client, ServerPacket msg)
 {
     try
     {
         Aisling aisling = client.Base.Me;
         byte    num1    = msg.ReadByte();
         if (((int)num1 & 32) == 32)
         {
             msg.Read(3);
             aisling.Level     = (int)msg.ReadByte();
             aisling.Ability   = (int)msg.ReadByte();
             aisling.MaximumHP = msg.ReadUInt32();
             aisling.MaximumMP = msg.ReadUInt32();
             aisling.Str       = (int)msg.ReadByte();
             aisling.Int       = (int)msg.ReadByte();
             aisling.Wis       = (int)msg.ReadByte();
             aisling.Con       = (int)msg.ReadByte();
             aisling.Dex       = (int)msg.ReadByte();
             bool flag = (int)msg.ReadByte() != 0;
             aisling.AvailablePoints = (int)msg.ReadByte();
             aisling.MaximumWeight   = (int)msg.ReadUInt16();
             aisling.CurrentWeight   = (int)msg.ReadUInt16();
             msg.Read(4);
         }
         if (((int)num1 & 16) == 16)
         {
             aisling.CurrentHP = msg.ReadUInt32();
             aisling.CurrentMP = msg.ReadUInt32();
         }
         if (((int)num1 & 8) == 8)
         {
             aisling.Experience    = msg.ReadUInt32();
             aisling.ToNextLevel   = msg.ReadUInt32();
             aisling.AbilityExp    = msg.ReadUInt32();
             aisling.ToNextAbility = msg.ReadUInt32();
             aisling.GamePoints    = msg.ReadUInt32();
             aisling.Gold          = msg.ReadUInt32();
         }
         if (((int)num1 & 4) == 4)
         {
             aisling.BitMask = (int)msg.ReadUInt16();
             int num2 = (int)msg.ReadByte();
             aisling.AttackElement2  = (int)msg.ReadByte();
             aisling.DefenseElement2 = (int)msg.ReadByte();
             aisling.AttackElement   = (Aisling.Elements)msg.ReadByte();
             aisling.DefenseElement  = (Aisling.Elements)msg.ReadByte();
             aisling.MagicResistance = (int)msg.ReadByte();
             aisling.ArmorClass      = (int)msg.ReadInt16();
             aisling.Damage          = (int)msg.ReadSByte();
             aisling.Hit             = (int)msg.ReadSByte();
         }
         if (aisling.BitMask == 8)
         {
             msg.Data[0] = (byte)0;
         }
         client.Base.Me = aisling;
         return(true);
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message + "\n" + ex.StackTrace);
         return(false);
     }
 }