Exemplo n.º 1
0
 public NonPlayerCharacter()
 {
     EditorID                  = new SimpleSubrecord <String>("EDID");
     ObjectBounds              = new ObjectBounds("OBND");
     Model                     = new Model();
     BaseStats                 = new NPCBaseStats("ACBS");
     VoiceType                 = new RecordReference("VTCK");
     Race                      = new RecordReference("RNAM");
     UnarmedAttackAnimation    = new SimpleSubrecord <UInt16>("EAMT");
     AIData                    = new AIData("AIDT");
     Class                     = new RecordReference("CNAM");
     Data                      = new NPCData("DATA");
     HairColor                 = new SimpleSubrecord <Color>("HCLR");
     ImpactMaterialType        = new SimpleSubrecord <MaterialTypeUInt>("NAM4");
     FaceGenGeometrySymmetric  = new SimpleSubrecord <byte[]>("FGGS", new byte[4]);
     FaceGenGeometryAsymmetric = new SimpleSubrecord <byte[]>("FGGA", new byte[4]);
     FaceGenTexture            = new SimpleSubrecord <byte[]>("FGTS", new byte[4]);
     Unknown                   = new SimpleSubrecord <UInt16>("NAM5");
     Height                    = new SimpleSubrecord <Single>("NAM6");
     Weight                    = new SimpleSubrecord <Single>("NAM7");
 }
Exemplo n.º 2
0
        public override void ReadDataXML(XElement ele, ElderScrollsPlugin master)
        {
            XElement subEle;

            if (ele.TryPathTo("EditorID", false, out subEle))
            {
                if (EditorID == null)
                {
                    EditorID = new SimpleSubrecord <String>();
                }

                EditorID.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("ObjectBounds", false, out subEle))
            {
                if (ObjectBounds == null)
                {
                    ObjectBounds = new ObjectBounds();
                }

                ObjectBounds.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Name", false, out subEle))
            {
                if (Name == null)
                {
                    Name = new SimpleSubrecord <String>();
                }

                Name.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Model", false, out subEle))
            {
                if (Model == null)
                {
                    Model = new Model();
                }

                Model.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("BaseStats", false, out subEle))
            {
                if (BaseStats == null)
                {
                    BaseStats = new NPCBaseStats();
                }

                BaseStats.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Factions", false, out subEle))
            {
                if (Factions == null)
                {
                    Factions = new List <FactionMembership>();
                }

                foreach (XElement e in subEle.Elements())
                {
                    FactionMembership tempSNAM = new FactionMembership();
                    tempSNAM.ReadXML(e, master);
                    Factions.Add(tempSNAM);
                }
            }
            if (ele.TryPathTo("DeathItem", false, out subEle))
            {
                if (DeathItem == null)
                {
                    DeathItem = new RecordReference();
                }

                DeathItem.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("VoiceType", false, out subEle))
            {
                if (VoiceType == null)
                {
                    VoiceType = new RecordReference();
                }

                VoiceType.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Template", false, out subEle))
            {
                if (Template == null)
                {
                    Template = new RecordReference();
                }

                Template.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Race", false, out subEle))
            {
                if (Race == null)
                {
                    Race = new RecordReference();
                }

                Race.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("ActorEffects", false, out subEle))
            {
                if (ActorEffects == null)
                {
                    ActorEffects = new List <RecordReference>();
                }

                foreach (XElement e in subEle.Elements())
                {
                    RecordReference tempSPLO = new RecordReference();
                    tempSPLO.ReadXML(e, master);
                    ActorEffects.Add(tempSPLO);
                }
            }
            if (ele.TryPathTo("Unarmed/AttackEffect", false, out subEle))
            {
                if (UnarmedAttackEffect == null)
                {
                    UnarmedAttackEffect = new RecordReference();
                }

                UnarmedAttackEffect.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Unarmed/AttackAnimation", false, out subEle))
            {
                if (UnarmedAttackAnimation == null)
                {
                    UnarmedAttackAnimation = new SimpleSubrecord <UInt16>();
                }

                UnarmedAttackAnimation.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Destructable", false, out subEle))
            {
                if (Destructable == null)
                {
                    Destructable = new Destructable();
                }

                Destructable.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Script", false, out subEle))
            {
                if (Script == null)
                {
                    Script = new RecordReference();
                }

                Script.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Contents", false, out subEle))
            {
                if (Contents == null)
                {
                    Contents = new List <InventoryItem>();
                }

                foreach (XElement e in subEle.Elements())
                {
                    InventoryItem tempCNTO = new InventoryItem();
                    tempCNTO.ReadXML(e, master);
                    Contents.Add(tempCNTO);
                }
            }
            if (ele.TryPathTo("AIData", false, out subEle))
            {
                if (AIData == null)
                {
                    AIData = new AIData();
                }

                AIData.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Packages", false, out subEle))
            {
                if (Packages == null)
                {
                    Packages = new List <RecordReference>();
                }

                foreach (XElement e in subEle.Elements())
                {
                    RecordReference tempPKID = new RecordReference();
                    tempPKID.ReadXML(e, master);
                    Packages.Add(tempPKID);
                }
            }
            if (ele.TryPathTo("Class", false, out subEle))
            {
                if (Class == null)
                {
                    Class = new RecordReference();
                }

                Class.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Data", false, out subEle))
            {
                if (Data == null)
                {
                    Data = new NPCData();
                }

                Data.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Skills", false, out subEle))
            {
                if (Skills == null)
                {
                    Skills = new NPCSkills();
                }

                Skills.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("HeadParts", false, out subEle))
            {
                if (HeadParts == null)
                {
                    HeadParts = new List <RecordReference>();
                }

                foreach (XElement e in subEle.Elements())
                {
                    RecordReference tempPNAM = new RecordReference();
                    tempPNAM.ReadXML(e, master);
                    HeadParts.Add(tempPNAM);
                }
            }
            if (ele.TryPathTo("Hair/Type", false, out subEle))
            {
                if (HairType == null)
                {
                    HairType = new RecordReference();
                }

                HairType.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Hair/Length", false, out subEle))
            {
                if (HairLength == null)
                {
                    HairLength = new SimpleSubrecord <Single>();
                }

                HairLength.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Eyes", false, out subEle))
            {
                if (Eyes == null)
                {
                    Eyes = new RecordReference();
                }

                Eyes.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Hair/Color", false, out subEle))
            {
                if (HairColor == null)
                {
                    HairColor = new SimpleSubrecord <Color>();
                }

                HairColor.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("CombatStyle", false, out subEle))
            {
                if (CombatStyle == null)
                {
                    CombatStyle = new RecordReference();
                }

                CombatStyle.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("ImpactMaterialType", false, out subEle))
            {
                if (ImpactMaterialType == null)
                {
                    ImpactMaterialType = new SimpleSubrecord <MaterialTypeUInt>();
                }

                ImpactMaterialType.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("FaceGen/Geometry/Symmetric", false, out subEle))
            {
                if (FaceGenGeometrySymmetric == null)
                {
                    FaceGenGeometrySymmetric = new SimpleSubrecord <Byte[]>();
                }

                FaceGenGeometrySymmetric.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("FaceGen/Geometry/Asymmetric", false, out subEle))
            {
                if (FaceGenGeometryAsymmetric == null)
                {
                    FaceGenGeometryAsymmetric = new SimpleSubrecord <Byte[]>();
                }

                FaceGenGeometryAsymmetric.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("FaceGen/Texture", false, out subEle))
            {
                if (FaceGenTexture == null)
                {
                    FaceGenTexture = new SimpleSubrecord <Byte[]>();
                }

                FaceGenTexture.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Unknown", false, out subEle))
            {
                if (Unknown == null)
                {
                    Unknown = new SimpleSubrecord <UInt16>();
                }

                Unknown.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Height", false, out subEle))
            {
                if (Height == null)
                {
                    Height = new SimpleSubrecord <Single>();
                }

                Height.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Weight", false, out subEle))
            {
                if (Weight == null)
                {
                    Weight = new SimpleSubrecord <Single>();
                }

                Weight.ReadXML(subEle, master);
            }
        }
Exemplo n.º 3
0
        public override void ReadData(ESPReader reader, long dataEnd)
        {
            while (reader.BaseStream.Position < dataEnd)
            {
                string subTag = reader.PeekTag();

                switch (subTag)
                {
                case "EDID":
                    if (EditorID == null)
                    {
                        EditorID = new SimpleSubrecord <String>();
                    }

                    EditorID.ReadBinary(reader);
                    break;

                case "OBND":
                    if (ObjectBounds == null)
                    {
                        ObjectBounds = new ObjectBounds();
                    }

                    ObjectBounds.ReadBinary(reader);
                    break;

                case "FULL":
                    if (Name == null)
                    {
                        Name = new SimpleSubrecord <String>();
                    }

                    Name.ReadBinary(reader);
                    break;

                case "MODL":
                    if (Model == null)
                    {
                        Model = new Model();
                    }

                    Model.ReadBinary(reader);
                    break;

                case "ACBS":
                    if (BaseStats == null)
                    {
                        BaseStats = new NPCBaseStats();
                    }

                    BaseStats.ReadBinary(reader);
                    break;

                case "SNAM":
                    if (Factions == null)
                    {
                        Factions = new List <FactionMembership>();
                    }

                    FactionMembership tempSNAM = new FactionMembership();
                    tempSNAM.ReadBinary(reader);
                    Factions.Add(tempSNAM);
                    break;

                case "INAM":
                    if (DeathItem == null)
                    {
                        DeathItem = new RecordReference();
                    }

                    DeathItem.ReadBinary(reader);
                    break;

                case "VTCK":
                    if (VoiceType == null)
                    {
                        VoiceType = new RecordReference();
                    }

                    VoiceType.ReadBinary(reader);
                    break;

                case "TPLT":
                    if (Template == null)
                    {
                        Template = new RecordReference();
                    }

                    Template.ReadBinary(reader);
                    break;

                case "RNAM":
                    if (Race == null)
                    {
                        Race = new RecordReference();
                    }

                    Race.ReadBinary(reader);
                    break;

                case "SPLO":
                    if (ActorEffects == null)
                    {
                        ActorEffects = new List <RecordReference>();
                    }

                    RecordReference tempSPLO = new RecordReference();
                    tempSPLO.ReadBinary(reader);
                    ActorEffects.Add(tempSPLO);
                    break;

                case "EITM":
                    if (UnarmedAttackEffect == null)
                    {
                        UnarmedAttackEffect = new RecordReference();
                    }

                    UnarmedAttackEffect.ReadBinary(reader);
                    break;

                case "EAMT":
                    if (UnarmedAttackAnimation == null)
                    {
                        UnarmedAttackAnimation = new SimpleSubrecord <UInt16>();
                    }

                    UnarmedAttackAnimation.ReadBinary(reader);
                    break;

                case "DEST":
                    if (Destructable == null)
                    {
                        Destructable = new Destructable();
                    }

                    Destructable.ReadBinary(reader);
                    break;

                case "SCRI":
                    if (Script == null)
                    {
                        Script = new RecordReference();
                    }

                    Script.ReadBinary(reader);
                    break;

                case "CNTO":
                    if (Contents == null)
                    {
                        Contents = new List <InventoryItem>();
                    }

                    InventoryItem tempCNTO = new InventoryItem();
                    tempCNTO.ReadBinary(reader);
                    Contents.Add(tempCNTO);
                    break;

                case "AIDT":
                    if (AIData == null)
                    {
                        AIData = new AIData();
                    }

                    AIData.ReadBinary(reader);
                    break;

                case "PKID":
                    if (Packages == null)
                    {
                        Packages = new List <RecordReference>();
                    }

                    RecordReference tempPKID = new RecordReference();
                    tempPKID.ReadBinary(reader);
                    Packages.Add(tempPKID);
                    break;

                case "CNAM":
                    if (Class == null)
                    {
                        Class = new RecordReference();
                    }

                    Class.ReadBinary(reader);
                    break;

                case "DATA":
                    if (Data == null)
                    {
                        Data = new NPCData();
                    }

                    Data.ReadBinary(reader);
                    break;

                case "DNAM":
                    if (Skills == null)
                    {
                        Skills = new NPCSkills();
                    }

                    Skills.ReadBinary(reader);
                    break;

                case "PNAM":
                    if (HeadParts == null)
                    {
                        HeadParts = new List <RecordReference>();
                    }

                    RecordReference tempPNAM = new RecordReference();
                    tempPNAM.ReadBinary(reader);
                    HeadParts.Add(tempPNAM);
                    break;

                case "HNAM":
                    if (HairType == null)
                    {
                        HairType = new RecordReference();
                    }

                    HairType.ReadBinary(reader);
                    break;

                case "LNAM":
                    if (HairLength == null)
                    {
                        HairLength = new SimpleSubrecord <Single>();
                    }

                    HairLength.ReadBinary(reader);
                    break;

                case "ENAM":
                    if (Eyes == null)
                    {
                        Eyes = new RecordReference();
                    }

                    Eyes.ReadBinary(reader);
                    break;

                case "HCLR":
                    if (HairColor == null)
                    {
                        HairColor = new SimpleSubrecord <Color>();
                    }

                    HairColor.ReadBinary(reader);
                    break;

                case "ZNAM":
                    if (CombatStyle == null)
                    {
                        CombatStyle = new RecordReference();
                    }

                    CombatStyle.ReadBinary(reader);
                    break;

                case "NAM4":
                    if (ImpactMaterialType == null)
                    {
                        ImpactMaterialType = new SimpleSubrecord <MaterialTypeUInt>();
                    }

                    ImpactMaterialType.ReadBinary(reader);
                    break;

                case "FGGS":
                    if (FaceGenGeometrySymmetric == null)
                    {
                        FaceGenGeometrySymmetric = new SimpleSubrecord <Byte[]>();
                    }

                    FaceGenGeometrySymmetric.ReadBinary(reader);
                    break;

                case "FGGA":
                    if (FaceGenGeometryAsymmetric == null)
                    {
                        FaceGenGeometryAsymmetric = new SimpleSubrecord <Byte[]>();
                    }

                    FaceGenGeometryAsymmetric.ReadBinary(reader);
                    break;

                case "FGTS":
                    if (FaceGenTexture == null)
                    {
                        FaceGenTexture = new SimpleSubrecord <Byte[]>();
                    }

                    FaceGenTexture.ReadBinary(reader);
                    break;

                case "NAM5":
                    if (Unknown == null)
                    {
                        Unknown = new SimpleSubrecord <UInt16>();
                    }

                    Unknown.ReadBinary(reader);
                    break;

                case "NAM6":
                    if (Height == null)
                    {
                        Height = new SimpleSubrecord <Single>();
                    }

                    Height.ReadBinary(reader);
                    break;

                case "NAM7":
                    if (Weight == null)
                    {
                        Weight = new SimpleSubrecord <Single>();
                    }

                    Weight.ReadBinary(reader);
                    break;

                default:
                    throw new Exception();
                }
            }
        }
Exemplo n.º 4
0
 public NonPlayerCharacter(SimpleSubrecord <String> EditorID, ObjectBounds ObjectBounds, SimpleSubrecord <String> Name, Model Model, NPCBaseStats BaseStats, List <FactionMembership> Factions, RecordReference DeathItem, RecordReference VoiceType, RecordReference Template, RecordReference Race, List <RecordReference> ActorEffects, RecordReference UnarmedAttackEffect, SimpleSubrecord <UInt16> UnarmedAttackAnimation, Destructable Destructable, RecordReference Script, List <InventoryItem> Contents, AIData AIData, List <RecordReference> Packages, RecordReference Class, NPCData Data, NPCSkills Skills, List <RecordReference> HeadParts, RecordReference HairType, SimpleSubrecord <Single> HairLength, RecordReference Eyes, SimpleSubrecord <Color> HairColor, RecordReference CombatStyle, SimpleSubrecord <MaterialTypeUInt> ImpactMaterialType, SimpleSubrecord <Byte[]> FaceGenGeometrySymmetric, SimpleSubrecord <Byte[]> FaceGenGeometryAsymmetric, SimpleSubrecord <Byte[]> FaceGenTexture, SimpleSubrecord <UInt16> Unknown, SimpleSubrecord <Single> Height, SimpleSubrecord <Single> Weight)
 {
     this.EditorID                  = EditorID;
     this.ObjectBounds              = ObjectBounds;
     this.Model                     = Model;
     this.BaseStats                 = BaseStats;
     this.VoiceType                 = VoiceType;
     this.Race                      = Race;
     this.UnarmedAttackAnimation    = UnarmedAttackAnimation;
     this.AIData                    = AIData;
     this.Class                     = Class;
     this.Data                      = Data;
     this.HairColor                 = HairColor;
     this.ImpactMaterialType        = ImpactMaterialType;
     this.FaceGenGeometrySymmetric  = FaceGenGeometrySymmetric;
     this.FaceGenGeometryAsymmetric = FaceGenGeometryAsymmetric;
     this.FaceGenTexture            = FaceGenTexture;
     this.Unknown                   = Unknown;
     this.Height                    = Height;
     this.Weight                    = Weight;
 }