示例#1
0
        public static void AddLeveledEntry(Handle handle, String value, String level, String count)
        {
            var newItem = Elements.AddArrayItem(handle, "Leveled List Entries", @"LVLO\Reference", value);

            ElementValues.SetValue(newItem, @"LVLO\Level", level);
            ElementValues.SetValue(newItem, @"LVLO\Count", count);
        }
示例#2
0
        public static void AddScriptProperty(Handle handle, String value, String type, String flags)
        {
            var newItem = Elements.AddArrayItem(handle, "Properties", "propertyName", value);

            ElementValues.SetValue(newItem, "Type", type);
            ElementValues.SetValue(newItem, "Flags", flags);
        }
示例#3
0
 public static void FilterRecord(Handle handle)
 {
     if (!Functions.FilterRecord(handle))
     {
         throw Helpers.GetException($"Failed to filter record {ElementValues.Name(handle)}");
     }
 }
示例#4
0
 public static void SetFileDescription(Handle handle, String description)
 {
     if (!Elements.HasElement(handle, @"File Header\SNAM"))
     {
         Elements.AddElement(handle, @"File Header\SNAM");
     }
     ElementValues.SetValue(handle, @"File Header\SNAM", description);
 }
示例#5
0
        public static void AddEffect(Handle handle, String value, String magnitude, String area, String duration)
        {
            var newItem = Elements.AddArrayItem(handle, "Effects", "EFID - Base Effect", value);

            ElementValues.SetValue(newItem, @"EFIT\Magnitude", magnitude);
            ElementValues.SetValue(newItem, @"EFIT\Area", area);
            ElementValues.SetValue(newItem, @"EFIT\Duration", duration);
        }
示例#6
0
        public static void Rotate(Handle handle, Double x = 0, Double y = 0, Double z = 0)
        {
            var rotation = Elements.GetElement(handle, @"DATA\Rotation");

            ElementValues.SetFloatValue(rotation, "X", ElementValues.GetFloatValue(rotation, "X") + x);
            ElementValues.SetFloatValue(rotation, "Y", ElementValues.GetFloatValue(rotation, "Y") + y);
            ElementValues.SetFloatValue(rotation, "Z", ElementValues.GetFloatValue(rotation, "Z") + z);
        }
示例#7
0
        public static void AddCondition(Handle handle, String value, String type, String comparisonValue,
                                        String parameterOne)
        {
            var newItem = Elements.AddArrayItem(handle, "Conditions", @"CTDA\Function", value);

            ElementValues.SetValue(newItem, @"CTDA\Type", type);
            ElementValues.SetValue(newItem, @"CTDA\Comparison Value", comparisonValue);
            ElementValues.SetValue(newItem, @"CTDA\Parameter #1", parameterOne);
        }
示例#8
0
        public static String[] GetAvailableMasters(Handle handle)
        {
            var filename       = ElementValues.Name(handle);
            var allMasters     = Setup.GetLoadedFileNames();
            var currentMasters = GetMasterNames(handle);
            var index          = Array.IndexOf(allMasters, filename);

            return(allMasters.Take(index).Except(currentMasters).ToArray());
        }
示例#9
0
        public static void AddAllMasters(Handle handle)
        {
            var filename    = ElementValues.Name(handle);
            var loadedFiles = Setup.GetLoadedFileNames();
            var fileIndex   = Array.IndexOf(loadedFiles, filename);

            for (var i = 0; i < fileIndex; i++)
            {
                if (loadedFiles[i].EndsWith(".Hardcoded.dat"))
                {
                    continue;
                }
                AddMaster(handle, loadedFiles[i]);
            }
        }
示例#10
0
 public static String GetFileDescription(Handle handle)
 {
     return(ElementValues.GetValue(handle, @"File Header\SNAM"));
 }
示例#11
0
        public static void AddScript(Handle handle, String value, String name)
        {
            var newItem = Elements.AddArrayItem(handle, @"VMAD\Scripts", "scriptName", value);

            ElementValues.SetValue(newItem, "Flags", name);
        }
示例#12
0
 public static Handle GetNextObjectId(Handle handle)
 {
     return(ElementValues.GetUIntValue(handle, NextObjectIdPath));
 }
示例#13
0
 public static void SetIsEssential(Handle handle, Boolean state)
 {
     ElementValues.SetFlag(handle, @"ACBS\Flags", "Essential", state);
 }
示例#14
0
 public static void SetArmorRating(Handle handle, Double value)
 {
     ElementValues.SetValue(handle, "DNAM", value.ToString(CultureInfo.InvariantCulture));
 }
示例#15
0
 public static void SetDamage(Handle handle, Double value)
 {
     ElementValues.SetValue(handle, @"DATA\Damage", value.ToString(CultureInfo.InvariantCulture));
 }
示例#16
0
 public static void SetRecordFlag(Handle handle, String name, Boolean state)
 {
     ElementValues.SetFlag(handle, @"Record Header\Record Flags", name, state);
 }
示例#17
0
 public static Boolean GetRecordFlag(Handle handle, String name)
 {
     return(ElementValues.GetFlag(handle, @"Record Header\Record Flags", name));
 }
示例#18
0
 public static String GetFullName(Handle handle)
 {
     return(ElementValues.GetValue(handle, "FULL"));
 }
示例#19
0
 public static Double GetWeight(Handle handle)
 {
     return(Double.Parse(ElementValues.GetValue(handle, @"DATA\Weight")));
 }
示例#20
0
 public static String GetEditorId(Handle handle)
 {
     return(ElementValues.GetValue(handle, "EDID"));
 }
示例#21
0
 public static Double GetDamage(Handle handle)
 {
     return(Double.Parse(ElementValues.GetValue(handle, @"DATA\Damage")));
 }
示例#22
0
 public static void SetIsUnique(Handle handle, Boolean state)
 {
     ElementValues.SetFlag(handle, @"ACBS\Flags", "Unique", state);
 }
示例#23
0
 public static Double GetArmorRating(Handle handle)
 {
     return(Double.Parse(ElementValues.GetValue(handle, "DNAM")));
 }
示例#24
0
 public static void SetFileAuthor(Handle handle, String author)
 {
     ElementValues.SetValue(handle, @"File Header\CNAM", author);
 }
示例#25
0
 public static Boolean GetIsEssential(Handle handle)
 {
     return(ElementValues.GetFlag(handle, @"ACBS\Flags", "Essential"));
 }
示例#26
0
 public static Boolean GetIsEsm(Handle handle)
 {
     return(ElementValues.GetFlag(handle, FileHeaderFlagsPath, "ESM"));
 }
示例#27
0
 public static Boolean GetIsUnique(Handle handle)
 {
     return(ElementValues.GetFlag(handle, @"ACBS\Flags", "Unique"));
 }
示例#28
0
 public static void SetIsEsm(Handle handle, Boolean state)
 {
     ElementValues.SetFlag(handle, FileHeaderFlagsPath, "ESM", state);
 }
示例#29
0
        public static void AddItem(Handle handle, String value, String count)
        {
            var newItem = Elements.AddArrayItem(handle, "Items", @"CNTO\Item", value);

            ElementValues.SetValue(newItem, @"CNTO\Count", count);
        }
示例#30
0
 public static String GetFileAuthor(Handle handle)
 {
     return(ElementValues.GetValue(handle, @"File Header\CNAM"));
 }