Exemplo n.º 1
0
 protected override void ReadData(ESPReader reader)
 {
     using (MemoryStream stream = new MemoryStream(reader.ReadBytes(size)))
         using (ESPReader subReader = new ESPReader(stream, reader.Plugin))
         {
             try
             {
                 CreatureType = subReader.ReadEnum <CreatureType>();
                 CombatSkill  = subReader.ReadByte();
                 MagicSkill   = subReader.ReadByte();
                 StealthSkill = subReader.ReadByte();
                 Health       = subReader.ReadInt16();
                 Unused       = subReader.ReadBytes(2);
                 Damage       = subReader.ReadInt16();
                 Strength     = subReader.ReadByte();
                 Perception   = subReader.ReadByte();
                 Endurance    = subReader.ReadByte();
                 Charisma     = subReader.ReadByte();
                 Intelligence = subReader.ReadByte();
                 Agility      = subReader.ReadByte();
                 Luck         = subReader.ReadByte();
             }
             catch
             {
                 return;
             }
         }
 }
Exemplo n.º 2
0
        protected override void ReadData(ESPReader reader)
        {
            using (MemoryStream stream = new MemoryStream(reader.ReadBytes(size)))
                using (ESPReader subReader = new ESPReader(stream, reader.Plugin))
                {
                    try
                    {
                        Divisor      = subReader.ReadUInt32();
                        MaxDistanceX = subReader.ReadSingle();
                        MaxDistanceY = subReader.ReadSingle();
                        MinX         = subReader.ReadSingle();
                        MinY         = subReader.ReadSingle();
                        MinZ         = subReader.ReadSingle();
                        MaxX         = subReader.ReadSingle();
                        MaxY         = subReader.ReadSingle();
                        MaxZ         = subReader.ReadSingle();

                        for (int i = 0; i < Divisor; i++)
                        {
                            List <short> newList = new List <short>();
                            for (int j = 0; j < (size - 36) / (2 * Divisor); j++)
                            {
                                newList.Add(reader.ReadInt16());
                            }
                            Cell.Add(newList);
                        }
                    }
                    catch
                    {
                        return;
                    }
                }
        }
Exemplo n.º 3
0
 protected override void ReadData(ESPReader reader)
 {
     using (MemoryStream stream = new MemoryStream(reader.ReadBytes(size)))
         using (ESPReader subReader = new ESPReader(stream, reader.Plugin))
         {
             try
             {
                 MinAttenuationDistance        = subReader.ReadByte();
                 MaxAttenuationDistance        = subReader.ReadByte();
                 FrequencyAdjustmentPercentage = subReader.ReadSByte();
                 Unused                   = subReader.ReadByte();
                 SoundDataFlags           = subReader.ReadEnum <SoundDataFlags>();
                 StaticAttenuationcdB     = subReader.ReadInt16();
                 StopTime                 = subReader.ReadByte();
                 StartTime                = subReader.ReadByte();
                 AttenuationCurvePoint1   = subReader.ReadInt16();
                 AttenuationCurvePoint2   = subReader.ReadInt16();
                 AttenuationCurvePoint3   = subReader.ReadInt16();
                 AttenuationCurvePoint4   = subReader.ReadInt16();
                 AttenuationCurvePoint5   = subReader.ReadInt16();
                 ReverbAttenuationControl = subReader.ReadInt16();
                 Priority                 = subReader.ReadInt32();
                 Unknown                  = subReader.ReadBytes(8);
             }
             catch
             {
                 return;
             }
         }
 }
Exemplo n.º 4
0
 protected override void ReadData(ESPReader reader)
 {
     using (MemoryStream stream = new MemoryStream(reader.ReadBytes(size)))
         using (ESPReader subReader = new ESPReader(stream, reader.Plugin))
         {
             try
             {
                 Direct.ReadBinary(subReader);
                 IndirectWorld.ReadBinary(subReader);
                 IndirectGridY = subReader.ReadInt16();
                 IndirectGridX = subReader.ReadInt16();
             }
             catch
             {
                 return;
             }
         }
 }
Exemplo n.º 5
0
 protected override void ReadData(ESPReader reader)
 {
     using (MemoryStream stream = new MemoryStream(reader.ReadBytes(size)))
         using (ESPReader subReader = new ESPReader(stream, reader.Plugin))
         {
             try
             {
                 Level   = subReader.ReadInt16();
                 Unused1 = subReader.ReadBytes(2);
                 Reference.ReadBinary(subReader);
                 Count   = subReader.ReadInt16();
                 Unused2 = subReader.ReadBytes(2);
             }
             catch
             {
                 return;
             }
         }
 }
Exemplo n.º 6
0
 protected override void ReadData(ESPReader reader)
 {
     using (MemoryStream stream = new MemoryStream(reader.ReadBytes(size)))
         using (ESPReader subReader = new ESPReader(stream, reader.Plugin))
         {
             try
             {
                 Point1 = subReader.ReadInt16();
                 Point2 = subReader.ReadInt16();
                 Point3 = subReader.ReadInt16();
                 Point4 = subReader.ReadInt16();
                 Point5 = subReader.ReadInt16();
             }
             catch
             {
                 return;
             }
         }
 }
Exemplo n.º 7
0
 protected override void ReadData(ESPReader reader)
 {
     using (MemoryStream stream = new MemoryStream(reader.ReadBytes(size)))
         using (ESPReader subReader = new ESPReader(stream, reader.Plugin))
         {
             try
             {
                 Unknown1 = subReader.ReadBytes(4);
                 NavigationMesh.ReadBinary(subReader);
                 Location.ReadBinary(subReader);
                 GridX = subReader.ReadInt16();
                 GridY = subReader.ReadInt16();
                 ReadUnknown2Binary(subReader);
             }
             catch
             {
                 return;
             }
         }
 }
Exemplo n.º 8
0
 protected override void ReadData(ESPReader reader)
 {
     using (MemoryStream stream = new MemoryStream(reader.ReadBytes(size)))
         using (ESPReader subReader = new ESPReader(stream, reader.Plugin))
         {
             try
             {
                 UsableXSize = subReader.ReadInt32();
                 UsableYSize = subReader.ReadInt32();
                 MinX        = subReader.ReadInt16();
                 MinY        = subReader.ReadInt16();
                 MaxX        = subReader.ReadInt16();
                 MaxY        = subReader.ReadInt16();
             }
             catch
             {
                 return;
             }
         }
 }
Exemplo n.º 9
0
 protected override void ReadData(ESPReader reader)
 {
     using (MemoryStream stream = new MemoryStream(reader.ReadBytes(size)))
         using (ESPReader subReader = new ESPReader(stream, reader.Plugin))
         {
             try
             {
                 Flags           = subReader.ReadEnum <NPCFlags>();
                 Fatigue         = subReader.ReadUInt16();
                 BarterGold      = subReader.ReadUInt16();
                 Level           = subReader.ReadInt16();
                 CalcMin         = subReader.ReadUInt16();
                 CalcMax         = subReader.ReadUInt16();
                 SpeedMultiplier = subReader.ReadUInt16();
                 Karma           = subReader.ReadSingle();
                 DispositionBase = subReader.ReadInt16();
                 TemplateFlags   = subReader.ReadEnum <ActorTemplateFlags>();
             }
             catch
             {
                 return;
             }
         }
 }
Exemplo n.º 10
0
 protected override void ReadData(ESPReader reader)
 {
     using (MemoryStream stream = new MemoryStream(reader.ReadBytes(size)))
         using (ESPReader subReader = new ESPReader(stream, reader.Plugin))
         {
             try
             {
                 ArmorRating    = subReader.ReadInt16();
                 ModulatesVoice = subReader.ReadEnum <NoYesShort>();
                 Unknown        = subReader.ReadBytes(8);
             }
             catch
             {
                 return;
             }
         }
 }
Exemplo n.º 11
0
 protected override void ReadData(ESPReader reader)
 {
     using (MemoryStream stream = new MemoryStream(reader.ReadBytes(size)))
         using (ESPReader subReader = new ESPReader(stream, reader.Plugin))
         {
             try
             {
                 DamageResistance = subReader.ReadInt16();
                 Flags            = subReader.ReadEnum <ArmorFlags>();
                 DamageThreshold  = subReader.ReadSingle();
                 Unknown          = subReader.ReadBytes(4);
             }
             catch
             {
                 return;
             }
         }
 }
Exemplo n.º 12
0
 protected override void ReadData(ESPReader reader)
 {
     using (MemoryStream stream = new MemoryStream(reader.ReadBytes(size)))
         using (ESPReader subReader = new ESPReader(stream, reader.Plugin))
         {
             try
             {
                 Value      = subReader.ReadInt32();
                 Health     = subReader.ReadInt32();
                 Weight     = subReader.ReadSingle();
                 BaseDamage = subReader.ReadInt16();
                 ClipSize   = subReader.ReadByte();
             }
             catch
             {
                 return;
             }
         }
 }
Exemplo n.º 13
0
 protected override void ReadData(ESPReader reader)
 {
     using (MemoryStream stream = new MemoryStream(reader.ReadBytes(size)))
         using (ESPReader subReader = new ESPReader(stream, reader.Plugin))
         {
             try
             {
                 AnimationGroupSection = subReader.ReadEnum <AnimationGroupSection>();
                 LoopingMin            = subReader.ReadByte();
                 LoopingMax            = subReader.ReadByte();
                 Unused1     = subReader.ReadByte();
                 ReplayDelay = subReader.ReadInt16();
                 Flags       = subReader.ReadEnum <IdleAnimationFlags>();
                 Unused2     = subReader.ReadByte();
             }
             catch
             {
                 return;
             }
         }
 }
Exemplo n.º 14
0
 public void ReadBinary(ESPReader reader)
 {
     try
     {
         Vertex1         = reader.ReadInt16();
         Vertex2         = reader.ReadInt16();
         Vertex3         = reader.ReadInt16();
         EdgeVertices1_2 = reader.ReadInt16();
         EdgeVertices2_3 = reader.ReadInt16();
         EdgeVertices3_1 = reader.ReadInt16();
         Flags           = reader.ReadEnum <NavMeshTriangleFlags>();
     }
     catch
     {
         return;
     }
 }
Exemplo n.º 15
0
        protected override void ReadData(ESPReader reader)
        {
            Type tType    = typeof(T);
            Type readType = tType;

            if (tType.IsEnum)
            {
                readType = Enum.GetUnderlyingType(tType);
            }

            string typeName = readType.FullName;


            switch (typeName)
            {
            case "System.Byte":
                //Debug.Assert(size == 1);
                Value = (T)(object)reader.ReadByte();
                break;

            case "System.SByte":
                Debug.Assert(size == 1);
                Value = (T)(object)reader.ReadSByte();
                break;

            case "System.Char":
                Debug.Assert(size == 1);
                Value = (T)(object)reader.ReadChar();
                break;

            case "System.UInt16":
                Debug.Assert(size == 2);
                Value = (T)(object)reader.ReadUInt16();
                break;

            case "System.Int16":
                Debug.Assert(size == 2);
                Value = (T)(object)reader.ReadInt16();
                break;

            case "System.UInt32":
                Debug.Assert(size == 4);
                Value = (T)(object)reader.ReadUInt32();
                break;

            case "System.Int32":
                Debug.Assert(size == 4);
                Value = (T)(object)reader.ReadInt32();
                break;

            case "System.Single":
                Debug.Assert(size == 4);
                Value = (T)(object)reader.ReadSingle();
                break;

            case "System.UInt64":
                Debug.Assert(size == 8);
                Value = (T)(object)reader.ReadUInt64();
                break;

            case "System.Int64":
                Debug.Assert(size == 8);
                Value = (T)(object)reader.ReadInt64();
                break;

            case "System.Byte[]":
                Value = (T)(object)reader.ReadBytes(size);
                break;

            case "System.Char[]":
                string tempstring = new string(reader.ReadChars(size));
                tempstring = tempstring.Replace("\0", "");
                Value      = (T)(object)tempstring.ToCharArray();
                break;

            case "System.String":
                string outString = new String(reader.ReadChars(size - 1));
                reader.ReadByte();
                Value = (T)(object)(outString.Replace("\0", ""));
                break;

            case "ESPSharp.DataTypes.Color":
                var color = new DataTypes.Color();
                color.ReadBinary(reader);
                Value = (T)(object)color;
                break;

            case "ESPSharp.DataTypes.XYFloat":
                var temp = new DataTypes.XYFloat();
                temp.ReadBinary(reader);
                Value = (T)(object)temp;
                break;

            default:
                throw new NotImplementedException(typeName + " is not yet implemented.");
            }
        }
Exemplo n.º 16
0
        protected override void ReadData(ESPReader reader)
        {
            using (MemoryStream stream = new MemoryStream(reader.ReadBytes(size)))
                using (ESPReader subReader = new ESPReader(stream, reader.Plugin))
                {
                    try
                    {
                        Type      = subReader.ReadEnum <ChallengeType>();
                        Threshold = subReader.ReadUInt32();
                        Flags     = subReader.ReadEnum <ChallengeFlags>();
                        Interval  = subReader.ReadUInt32();

                        switch (Type)
                        {
                        case ChallengeType.KillFromAFormList:
                            Value1 = (ChallengeBodyPart)subReader.ReadInt16();
                            Value2 = (ActorValues)subReader.ReadInt16();
                            Value3 = (WeaponCategory)subReader.ReadInt32();
                            break;

                        case ChallengeType.KillASpecificFormID:
                            Value1 = (ChallengeBodyPart)subReader.ReadInt16();
                            Value2 = (ActorValues)subReader.ReadInt16();
                            Value3 = (WeaponCategory)subReader.ReadInt32();
                            break;

                        case ChallengeType.KillAnyInACategory:
                            Value1 = (ChallengeBodyPart)subReader.ReadInt16();
                            Value2 = (CreatureType)subReader.ReadInt16();
                            Value3 = (WeaponCategory)subReader.ReadInt32();
                            break;

                        case ChallengeType.HitAnEnemy:
                            Value1 = (ChallengeBodyPart)subReader.ReadInt16();
                            Value2 = (ChallengeHitType)subReader.ReadInt16();
                            Value3 = (WeaponCategory)subReader.ReadInt32();
                            break;

                        case ChallengeType.DiscoverAMapMarker:
                            Value1 = subReader.ReadBytes(2);
                            Value2 = subReader.ReadBytes(2);
                            Value3 = subReader.ReadBytes(4);
                            break;

                        case ChallengeType.UseAnItem:
                            Value1 = subReader.ReadBytes(2);
                            Value2 = subReader.ReadBytes(2);
                            Value3 = subReader.ReadBytes(4);
                            break;

                        case ChallengeType.AcquireAnItem:
                            Value1 = subReader.ReadBytes(2);
                            Value2 = subReader.ReadBytes(2);
                            Value3 = subReader.ReadBytes(4);
                            break;

                        case ChallengeType.UseASkill:
                            Value1 = (ChallengeSkillResult)subReader.ReadInt16();
                            Value2 = (SpeechChallengeType)subReader.ReadInt16();
                            Value3 = subReader.ReadBytes(4);
                            break;

                        case ChallengeType.DoDamage:
                            Value1 = (ChallengeBodyPart)subReader.ReadInt16();
                            Value2 = (ActorValues)subReader.ReadInt16();
                            Value3 = (WeaponCategory)subReader.ReadInt32();
                            break;

                        case ChallengeType.UseAnItemFromAList:
                            Value1 = subReader.ReadBytes(2);
                            Value2 = subReader.ReadBytes(2);
                            Value3 = subReader.ReadBytes(4);
                            break;

                        case ChallengeType.AcquireAnItemFromAList:
                            Value1 = subReader.ReadBytes(2);
                            Value2 = subReader.ReadBytes(2);
                            Value3 = subReader.ReadBytes(4);
                            break;

                        case ChallengeType.MiscellaneousStat:
                            Value1 = (MiscStat)subReader.ReadInt16();
                            Value2 = subReader.ReadBytes(2);
                            Value3 = (WeaponCategory)subReader.ReadInt32();
                            break;

                        case ChallengeType.CraftUsingAnItem:
                            Value1 = subReader.ReadBytes(2);
                            Value2 = subReader.ReadBytes(2);
                            Value3 = subReader.ReadBytes(4);
                            break;

                        case ChallengeType.ScriptedChallenge:
                            Value1 = subReader.ReadBytes(2);
                            Value2 = subReader.ReadBytes(2);
                            Value3 = subReader.ReadBytes(4);
                            break;
                        }
                    }
                    catch
                    {
                        return;
                    }
                }
        }