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); }
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); }
public static void FilterRecord(Handle handle) { if (!Functions.FilterRecord(handle)) { throw Helpers.GetException($"Failed to filter record {ElementValues.Name(handle)}"); } }
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); }
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); }
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); }
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); }
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()); }
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]); } }
public static String GetFileDescription(Handle handle) { return(ElementValues.GetValue(handle, @"File Header\SNAM")); }
public static void AddScript(Handle handle, String value, String name) { var newItem = Elements.AddArrayItem(handle, @"VMAD\Scripts", "scriptName", value); ElementValues.SetValue(newItem, "Flags", name); }
public static Handle GetNextObjectId(Handle handle) { return(ElementValues.GetUIntValue(handle, NextObjectIdPath)); }
public static void SetIsEssential(Handle handle, Boolean state) { ElementValues.SetFlag(handle, @"ACBS\Flags", "Essential", state); }
public static void SetArmorRating(Handle handle, Double value) { ElementValues.SetValue(handle, "DNAM", value.ToString(CultureInfo.InvariantCulture)); }
public static void SetDamage(Handle handle, Double value) { ElementValues.SetValue(handle, @"DATA\Damage", value.ToString(CultureInfo.InvariantCulture)); }
public static void SetRecordFlag(Handle handle, String name, Boolean state) { ElementValues.SetFlag(handle, @"Record Header\Record Flags", name, state); }
public static Boolean GetRecordFlag(Handle handle, String name) { return(ElementValues.GetFlag(handle, @"Record Header\Record Flags", name)); }
public static String GetFullName(Handle handle) { return(ElementValues.GetValue(handle, "FULL")); }
public static Double GetWeight(Handle handle) { return(Double.Parse(ElementValues.GetValue(handle, @"DATA\Weight"))); }
public static String GetEditorId(Handle handle) { return(ElementValues.GetValue(handle, "EDID")); }
public static Double GetDamage(Handle handle) { return(Double.Parse(ElementValues.GetValue(handle, @"DATA\Damage"))); }
public static void SetIsUnique(Handle handle, Boolean state) { ElementValues.SetFlag(handle, @"ACBS\Flags", "Unique", state); }
public static Double GetArmorRating(Handle handle) { return(Double.Parse(ElementValues.GetValue(handle, "DNAM"))); }
public static void SetFileAuthor(Handle handle, String author) { ElementValues.SetValue(handle, @"File Header\CNAM", author); }
public static Boolean GetIsEssential(Handle handle) { return(ElementValues.GetFlag(handle, @"ACBS\Flags", "Essential")); }
public static Boolean GetIsEsm(Handle handle) { return(ElementValues.GetFlag(handle, FileHeaderFlagsPath, "ESM")); }
public static Boolean GetIsUnique(Handle handle) { return(ElementValues.GetFlag(handle, @"ACBS\Flags", "Unique")); }
public static void SetIsEsm(Handle handle, Boolean state) { ElementValues.SetFlag(handle, FileHeaderFlagsPath, "ESM", state); }
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); }
public static String GetFileAuthor(Handle handle) { return(ElementValues.GetValue(handle, @"File Header\CNAM")); }