Пример #1
0
        protected override void ReadDataXML(XElement ele, ElderScrollsPlugin master)
        {
            XElement subEle;

            if (ele.TryPathTo("Flags", false, out subEle))
            {
                Flags = subEle.ToEnum <NPCFlags>();
            }

            if (ele.TryPathTo("Fatigue", false, out subEle))
            {
                Fatigue = subEle.ToUInt16();
            }

            if (ele.TryPathTo("BarterGold", false, out subEle))
            {
                BarterGold = subEle.ToUInt16();
            }

            if (ele.TryPathTo("Level", false, out subEle))
            {
                Level = subEle.ToInt16();
            }

            if (ele.TryPathTo("CalcMin", false, out subEle))
            {
                CalcMin = subEle.ToUInt16();
            }

            if (ele.TryPathTo("CalcMax", false, out subEle))
            {
                CalcMax = subEle.ToUInt16();
            }

            if (ele.TryPathTo("SpeedMultiplier", false, out subEle))
            {
                SpeedMultiplier = subEle.ToUInt16();
            }

            if (ele.TryPathTo("Karma", false, out subEle))
            {
                Karma = subEle.ToSingle();
            }

            if (ele.TryPathTo("DispositionBase", false, out subEle))
            {
                DispositionBase = subEle.ToInt16();
            }

            if (ele.TryPathTo("TemplateFlags", false, out subEle))
            {
                TemplateFlags = subEle.ToEnum <ActorTemplateFlags>();
            }
        }
Пример #2
0
 public NPCBaseStats(NPCBaseStats copyObject)
 {
     Flags           = copyObject.Flags;
     Fatigue         = copyObject.Fatigue;
     BarterGold      = copyObject.BarterGold;
     Level           = copyObject.Level;
     CalcMin         = copyObject.CalcMin;
     CalcMax         = copyObject.CalcMax;
     SpeedMultiplier = copyObject.SpeedMultiplier;
     Karma           = copyObject.Karma;
     DispositionBase = copyObject.DispositionBase;
     TemplateFlags   = copyObject.TemplateFlags;
 }
Пример #3
0
 public NPCBaseStats(NPCFlags Flags, UInt16 Fatigue, UInt16 BarterGold, Int16 Level, UInt16 CalcMin, UInt16 CalcMax, UInt16 SpeedMultiplier, Single Karma, Int16 DispositionBase, ActorTemplateFlags TemplateFlags)
 {
     this.Flags           = Flags;
     this.Fatigue         = Fatigue;
     this.BarterGold      = BarterGold;
     this.Level           = Level;
     this.CalcMin         = CalcMin;
     this.CalcMax         = CalcMax;
     this.SpeedMultiplier = SpeedMultiplier;
     this.Karma           = Karma;
     this.DispositionBase = DispositionBase;
     this.TemplateFlags   = TemplateFlags;
 }
Пример #4
0
 public NPCBaseStats(string Tag = null)
     : base(Tag)
 {
     Flags           = new NPCFlags();
     Fatigue         = new UInt16();
     BarterGold      = new UInt16();
     Level           = new Int16();
     CalcMin         = new UInt16();
     CalcMax         = new UInt16();
     SpeedMultiplier = new UInt16();
     Karma           = new Single();
     DispositionBase = new Int16();
     TemplateFlags   = new ActorTemplateFlags();
 }
Пример #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
             {
                 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;
             }
         }
 }