├── .gitattributes ├── .gitignore ├── LICENSE ├── README.md └── Scripts ├── Add Factions (FLST) - Simplified.pas ├── Add Factions (FLST).pas ├── Add Keyword.pas ├── Add Keywords (FLST).pas ├── Add New Records.pas ├── Add prefix or suffix to FULL.pas ├── Conversion - Anything to COBJ.pas ├── Conversion - MSTT to MISC.pas ├── Conversion - STAT to CONT.pas ├── Conversion - STAT to MISC.pas ├── Copy References (FLST).pas ├── Copy and Edit References (Campfire Cooking).pas ├── Copy and Edit References (Dynamic Torches).pas ├── Copy, Edit, and Flag References (Cobwebs).pas ├── Copy, Edit, and Flag References (Dynamic Torches Empty).pas ├── Copy, Edit, and Flag References (Dynamic Torches).pas ├── Copy, Edit, and Flag References.pas ├── Delete Referenced By In File.pas ├── Export AMMO, ARMO, COBJ, MISC, and WEAP Records.pas ├── Find and Replace References (FLST).pas ├── Form ARMO - Create matching COBJ.pas ├── Form BNAM - Change to CraftingCookpot.pas ├── Form BNAM - Change to CraftingSmelter.pas ├── Form BNAM - Change to CraftingSmithingArmorTable.pas ├── Form BNAM - Change to CraftingSmithingForge.pas ├── Form BNAM - Change to CraftingSmithingSharpeningWheel.pas ├── Form BNAM - Change to CraftingSmithingSkyforge.pas ├── Form BNAM - Change to CraftingTanningRack.pas ├── Form BNAM - Change to _DS_CraftingScrimshaw.pas ├── Form BOOK - Add Teaches Skill Flag.pas ├── Form BOOK - Change FULL.pas ├── Form BOOK - Strip HTML and Count Characters.pas ├── Form CELL - Copy and Update Owner to Parent XOWN.pas ├── Form CELL - Update Owner to Parent XOWN.pas ├── Form CELL - Update Owner.pas ├── Form CNAM - Change to Bits of Bone.pas ├── Form CNAM - Change to Bone Meal.pas ├── Form COBJ - Add Condition (GetItemCount).pas ├── Form COBJ - Decrease Value, Increase Weight.pas ├── Form ECZN - Disable Combat Boundaries.pas ├── Form FLST - Add Forms to FLST.pas ├── Form FLST - Add LNAM.pas ├── Form FLST - Create COBJ (FLST).pas ├── Form FLST - List FormID Items.pas ├── Form FLST - Sort Alphabetically.pas ├── Form FURN - Add and edit Alternate Textures.pas ├── Form FURN - Change FNAM to Ignored By Sandbox.pas ├── Form FURN - Change to Entry Point to Front.pas ├── Form FURN - Change to Uses Skill to Alchemy.pas ├── Form FURN - Change to Uses Skill to None.pas ├── Form GLOB - Set Value.pas ├── Form MGEF, SPEL - Change Master Spells ETYP to EitherHand .pas ├── Form NPC_ - Add Faction.pas ├── Form NPC_ - Add Flag (Use Def Pack List).pas ├── Form NPC_ - Add Package.pas ├── Form NPC_ - Change CNAM to CombatWarrior1H.pas ├── Form NPC_ - Change RNAM to DefaultRace.pas ├── Form NPC_ - Update AIDT.pas ├── Form NPC_ - Update Aggro Behavior.pas ├── Form NPC_ - Update DOBJ.pas ├── Form NPC_ - Update Level Mult and Calc Max Level.pas ├── Form OTFT - List Outfit Items.pas ├── Form PROJ - Change Speed.pas ├── Form RACE - List Health Regen Rates.pas ├── Form RACE - Renumber TIRS subrecords.pas ├── Form REFR - Change Lock Level.pas ├── Form REFR - Count Doors.pas ├── Form REFR - Delete Reference with Keyword in Name.pas ├── Form REFR - Disable and Position with Keyword in EDID.pas ├── Form REFR - Disable and Position with Keyword in Name.pas ├── Form SPEL - List Base Effects.pas ├── Generate Bash Tags.pas ├── Generate Tags for Wrye Bash.pas ├── Increase H-M-S in NPC Records.pas ├── Keyword Search - Dialog Topic - NAM1.pas ├── Keyword Search - EDID.pas ├── Keyword Search - FULL.pas ├── Keyword Search - Location.pas ├── Keyword Search - Map Marker.pas ├── Keyword Search - Model Filenames.pas ├── Keyword Search - NAME.pas ├── Keyword Search - Reference Names.pas ├── Keyword Search - XLRT.pas ├── Keyword Search for Scripts.pas ├── List Armor Data.pas ├── List FormID Items.pas ├── List FormIDs with EDID Query.pas ├── List FormIDs.pas ├── List Items.pas ├── List Model Paths.pas ├── List Outfit Items.pas ├── List Outfits.pas ├── List Package Items.pas ├── List Races.pas ├── List Reference Names.pas ├── List Reference Records.pas ├── List Referenced By.pas ├── List References.pas ├── List Tab-Delimited Data.pas ├── List Value and Weight.pas ├── List Winning Override.pas ├── NPC Add Flag (Auto-Calc Stats).pas ├── NPC Add Flag (Essential).pas ├── NPC Add Flag (PC Level Mult).pas ├── NPC Add Flag (Protected).pas ├── NPC Add Flag (Unique).pas ├── NPC Add Flags.pas ├── Quick Scripts - Convert to COBJ.pas ├── Quick Scripts - Find Doors and Add Keys (FLST).pas ├── Quick Scripts - Find Keyless Locked Doors.pas ├── Quick Scripts - Find and Replace COBJ References (FLST).pas ├── Quick Scripts - Find and Replace References (FLST).pas ├── Quick Scripts - Resolve Errors.pas ├── Quick Scripts - Unlevel Leveled List.pas ├── Recount KSIZ, COCT, LLCT, PKCU, PRKZ, SPCT, INAM, and QNAM subrecords.pas ├── Remove DNAM.pas ├── Replace Substring.pas ├── Resolve Errors.pas ├── Reweigh Items.pas ├── dubh - Bash Tagger v1_5_1_2.pas └── dubhFunctions.pas /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.sln.docstates 8 | 9 | # Build results 10 | 11 | [Dd]ebug/ 12 | [Rr]elease/ 13 | x64/ 14 | build/ 15 | [Bb]in/ 16 | [Oo]bj/ 17 | 18 | # Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets 19 | !packages/*/build/ 20 | 21 | # MSTest test Results 22 | [Tt]est[Rr]esult*/ 23 | [Bb]uild[Ll]og.* 24 | 25 | *_i.c 26 | *_p.c 27 | *.ilk 28 | *.meta 29 | *.obj 30 | *.pch 31 | *.pdb 32 | *.pgc 33 | *.pgd 34 | *.rsp 35 | *.sbr 36 | *.tlb 37 | *.tli 38 | *.tlh 39 | *.tmp 40 | *.tmp_proj 41 | *.log 42 | *.vspscc 43 | *.vssscc 44 | .builds 45 | *.pidb 46 | *.log 47 | *.scc 48 | 49 | # Visual C++ cache files 50 | ipch/ 51 | *.aps 52 | *.ncb 53 | *.opensdf 54 | *.sdf 55 | *.cachefile 56 | 57 | # Visual Studio profiler 58 | *.psess 59 | *.vsp 60 | *.vspx 61 | 62 | # Guidance Automation Toolkit 63 | *.gpState 64 | 65 | # ReSharper is a .NET coding add-in 66 | _ReSharper*/ 67 | *.[Rr]e[Ss]harper 68 | 69 | # TeamCity is a build add-in 70 | _TeamCity* 71 | 72 | # DotCover is a Code Coverage Tool 73 | *.dotCover 74 | 75 | # NCrunch 76 | *.ncrunch* 77 | .*crunch*.local.xml 78 | 79 | # Installshield output folder 80 | [Ee]xpress/ 81 | 82 | # DocProject is a documentation generator add-in 83 | DocProject/buildhelp/ 84 | DocProject/Help/*.HxT 85 | DocProject/Help/*.HxC 86 | DocProject/Help/*.hhc 87 | DocProject/Help/*.hhk 88 | DocProject/Help/*.hhp 89 | DocProject/Help/Html2 90 | DocProject/Help/html 91 | 92 | # Click-Once directory 93 | publish/ 94 | 95 | # Publish Web Output 96 | *.Publish.xml 97 | 98 | # NuGet Packages Directory 99 | ## TODO: If you have NuGet Package Restore enabled, uncomment the next line 100 | #packages/ 101 | 102 | # Windows Azure Build Output 103 | csx 104 | *.build.csdef 105 | 106 | # Windows Store app package directory 107 | AppPackages/ 108 | 109 | # Others 110 | sql/ 111 | *.Cache 112 | ClientBin/ 113 | [Ss]tyle[Cc]op.* 114 | ~$* 115 | *~ 116 | *.dbmdl 117 | *.[Pp]ublish.xml 118 | *.pfx 119 | *.publishsettings 120 | 121 | # RIA/Silverlight projects 122 | Generated_Code/ 123 | 124 | # Backup & report files from converting an old project file to a newer 125 | # Visual Studio version. Backup files are not needed, because we have git ;-) 126 | _UpgradeReport_Files/ 127 | Backup*/ 128 | UpgradeLog*.XML 129 | UpgradeLog*.htm 130 | 131 | # SQL Server files 132 | App_Data/*.mdf 133 | App_Data/*.ldf 134 | 135 | 136 | #LightSwitch generated files 137 | GeneratedArtifacts/ 138 | _Pvt_Extensions/ 139 | ModelManifest.xml 140 | 141 | # ========================= 142 | # Windows detritus 143 | # ========================= 144 | 145 | # Windows image file caches 146 | Thumbs.db 147 | ehthumbs.db 148 | 149 | # Folder config file 150 | Desktop.ini 151 | 152 | # Recycle Bin used on file shares 153 | $RECYCLE.BIN/ 154 | 155 | # Mac desktop service store files 156 | .DS_Store 157 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | xEditScripts 2 | ============ 3 | 4 | A collection of xEdit scripts for experienced xEdit users 5 | 6 | Please note that not all script descriptions are up-to-date. 7 | -------------------------------------------------------------------------------- /Scripts/Add Factions (FLST) - Simplified.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Add Factions from Formlist 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | var 11 | formlist, item: IInterface; 12 | fileFormList: iwbFile; 13 | slFactions: TStringList; 14 | i: integer; 15 | 16 | function Initialize: integer; 17 | var 18 | s: string; 19 | begin 20 | Result := 0; 21 | 22 | //if not InputQuery('Enter', 'Formlist Form ID', s) then begin 23 | // Result := 1; 24 | // exit; 25 | //end; 26 | 27 | s := '01000800'; 28 | 29 | AddMessage(''); 30 | 31 | fileFormList := FileByLoadOrder(StrToInt('$' + Copy(s, 1, 2))); 32 | formlist := RecordByFormID(fileFormList, StrToInt('$' + s), true); 33 | 34 | slFactions := TStringList.Create; 35 | slFactions.Duplicates := dupIgnore; 36 | slFactions.Sorted := true; 37 | 38 | end; 39 | 40 | function Process(e: IInterface): integer; 41 | var 42 | factions, faction: IInterface; 43 | 44 | begin 45 | 46 | AddMessage('Processing:' + FullPath(e)); 47 | 48 | // remove 'Factions' group when incomplete 49 | factions := ElementByPath(e, 'Factions'); 50 | if ElementCount(factions) = 0 then 51 | Remove(factions); 52 | 53 | // add preset factions from formlist to list 54 | factions := ElementByPath(formlist, 'FormIDs'); 55 | 56 | for i := 0 to ElementCount(factions) - 1 do begin 57 | 58 | // check fo 59 | if Signature(LinksTo(ElementByIndex(factions, i))) <> 'FACT' then begin 60 | 61 | AddMessage(#13#10 + '-------------------------------------------------------------------------------'); 62 | AddMessage('Error: ' + Name(formlist) + ' must contain only FACT references!'); 63 | AddMessage('-------------------------------------------------------------------------------' + #13#10); 64 | 65 | exit; 66 | 67 | end; 68 | 69 | // add preset factions from formlist to list 70 | slFactions.Add(GetEditValue(ElementByIndex(factions, i))); 71 | 72 | end; 73 | 74 | // this could be simpler 75 | factions := ElementByPath(e, 'Factions'); 76 | 77 | if ElementCount(factions) > 0 then begin 78 | 79 | // add existing factions to list 80 | for i := 0 to ElementCount(factions) - 1 do 81 | slFactions.Add(GetEditValue(ElementByPath(ElementByIndex(factions, i), 'Faction'))); 82 | 83 | // remove factions group to start fresh 84 | Remove(factions); 85 | 86 | // add factions group back 87 | factions := Add(e, 'Factions', true); 88 | 89 | // add some number of empty faction entries 90 | for i := 0 to slFactions.Count - 1 do 91 | faction := ElementAssign(factions, HighInteger, nil, false); 92 | 93 | // edit empty faction entries according to list 94 | factions := ElementByPath(e, 'Factions'); 95 | 96 | for i := 0 to slFactions.Count - 1 do begin 97 | 98 | faction := ElementByIndex(factions, 0); 99 | 100 | SetEditValue( ElementByPath(faction, 'Faction'), slFactions[i] ); 101 | 102 | end; 103 | 104 | // clear away null references 105 | factions := ElementByPath(e, 'Factions'); 106 | 107 | for i := 0 to ElementCount(factions) - 1 do begin 108 | 109 | faction := ElementByIndex(factions, i); 110 | 111 | if CompareStr('NULL - Null Reference [00000000]', GetEditValue(ElementByPath(faction, 'Faction'))) = 0 then 112 | Remove(faction); 113 | 114 | end; 115 | 116 | end; 117 | 118 | // clear factions 119 | slFactions.Clear; 120 | 121 | end; 122 | 123 | function Finalize: integer; 124 | begin 125 | Result := 1; 126 | end; 127 | 128 | end. -------------------------------------------------------------------------------- /Scripts/Add Factions (FLST).pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Add Factions from Formlist 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | var 11 | slFactionsToAdd, slFactionsToFilter, slFactionsToDelete: TStringList; 12 | formlist: IInterface; 13 | fileFormList: iwbFile; 14 | h, i, j, k, l, m, n, o: integer; 15 | 16 | function Initialize: integer; 17 | var 18 | s: string; 19 | begin 20 | Result := 0; 21 | 22 | if not InputQuery('Enter', 'Formlist Form ID', s) then begin 23 | Result := 1; 24 | exit; 25 | end; 26 | 27 | AddMessage(''); 28 | 29 | fileFormList := FileByLoadOrder(StrToInt('$' + Copy(s, 1, 2))); 30 | formlist := RecordByFormID(fileFormList, StrToInt('$' + s), true); 31 | 32 | slFactionsToAdd := TStringList.Create; 33 | slFactionsToFilter := TStringList.Create; 34 | slFactionsToDelete := TStringList.Create; 35 | 36 | end; 37 | 38 | function Process(e: IInterface): integer; 39 | var 40 | factionsToAdd, factionsToFilter, factions, faction, listitem: IInterface; 41 | 42 | begin 43 | Result := 0; 44 | 45 | AddMessage('Processing:' + FullPath(e)); 46 | 47 | factions := ElementByPath(e, 'Factions'); 48 | 49 | if ElementCount(factions) = 0 then 50 | Remove(factions); 51 | 52 | // add factions to add from formlist to a formlist 53 | factionsToAdd := ElementByPath(formlist, 'FormIDs'); 54 | 55 | for i := 0 to ElementCount(factionsToAdd) - 1 do begin 56 | 57 | if Signature(LinksTo(ElementByIndex(factionsToAdd, i))) <> 'FACT' then begin 58 | AddMessage(#13#10 + '-------------------------------------------------------------------------------'); 59 | AddMessage('Error: ' + Name(formlist) + ' must contain only FACT references!'); 60 | AddMessage('-------------------------------------------------------------------------------' + #13#10); 61 | exit; 62 | end; 63 | 64 | slFactionsToAdd.Add( GetEditValue(ElementByIndex(factionsToAdd, i)) ); 65 | 66 | end; 67 | 68 | // filter existing factions from a formlist 69 | factionsToFilter := ElementByPath(e, 'Factions'); 70 | 71 | if ElementCount(factionsToFilter) > 0 then begin 72 | 73 | for j := 0 to ElementCount(factionsToFilter) - 1 do 74 | slFactionsToFilter.Add( GetEditValue(ElementByPath(ElementByIndex(factionsToFilter, j), 'Faction')) ); 75 | 76 | for k := slFactionsToAdd.Count - 1 downto 0 do begin 77 | 78 | for l := slFactionsToFilter.Count - 1 downto 0 do begin 79 | 80 | if CompareStr(slFactionsToFilter[l], slFactionsToAdd[k]) = 0 then 81 | slFactionsToDelete.Add(IntToStr(k)); 82 | 83 | end; 84 | 85 | end; 86 | 87 | for o := 0 to slFactionsToDelete.Count - 1 do begin 88 | 89 | slFactionsToAdd.Delete(StrToInt(slFactionsToDelete[o])); 90 | 91 | end; 92 | 93 | end; 94 | 95 | // add filtered list of factions to record 96 | factions := ElementByPath(e, 'Factions'); 97 | 98 | if not Assigned(factions) then 99 | factions := Add(e, 'Factions', true); 100 | 101 | if slFactionsToAdd.Count > 0 then begin 102 | 103 | for m := 0 to slFactionsToAdd.Count - 1 do begin 104 | 105 | faction := ElementAssign(factions, HighInteger, ElementByPath(factions, 'SNAM'), false); 106 | 107 | SetEditValue(ElementByPath(faction, 'Faction'), slFactionsToAdd[m]); 108 | 109 | AddMessage('Added faction: ' + GetEditValue(ElementByPath(faction, 'Faction'))); 110 | 111 | end; 112 | 113 | end; 114 | 115 | // remove null references 116 | factions := ElementByPath(e, 'Factions'); 117 | for n := 0 to ElementCount(factions) - 1 do begin 118 | 119 | if CompareStr('NULL - Null Reference [00000000]', GetEditValue(ElementByPath(ElementByIndex(factions, n), 'Faction'))) = 0 then 120 | Remove(ElementByIndex(factions, n)); 121 | 122 | end; 123 | 124 | AddMessage(''); 125 | 126 | slFactionsToAdd.Clear; 127 | slFactionsToFilter.Clear; 128 | slFactionsToDelete.Clear; 129 | 130 | end; 131 | 132 | function Finalize: integer; 133 | 134 | begin 135 | 136 | Result := 1; 137 | 138 | end; 139 | 140 | end. -------------------------------------------------------------------------------- /Scripts/Add Keyword.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Add Keyword 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | 7 | Keywords: 8 | VendorItemAnimalPart [KYWD:000914EB] 9 | VendorItemClutter [KYWD:000914E9] 10 | VendorItemTool [KYWD:000914EE] 11 | } 12 | 13 | unit UserScript; 14 | 15 | var 16 | formid: string; 17 | 18 | function Initialize: integer; 19 | begin 20 | 21 | Result := 0; 22 | 23 | if not InputQuery('Enter', 'Form ID', formid) then begin 24 | Result := 1; 25 | exit; 26 | end; 27 | 28 | if formid = 'animalpart' then 29 | formid := 'VendorItemAnimalPart [KYWD:000914EB]' 30 | else if formid = 'clutter' then 31 | formid := 'VendorItemClutter [KYWD:000914E9]' 32 | else if formid = 'tool' then 33 | formid := 'VendorItemTool [KYWD:000914EE]'; 34 | 35 | end; 36 | 37 | function Process(e: IInterface): integer; 38 | var 39 | kwda, keyword: IInterface; 40 | begin 41 | 42 | Result := 0; 43 | 44 | AddMessage('Processing: ' + FullPath(e)); 45 | 46 | kwda := ElementByName(e, 'KWDA'); 47 | 48 | if not Assigned(kwda) then 49 | Add(e, 'KWDA', true); 50 | 51 | keyword := ElementByPath(e, 'KWDA\Keyword'); 52 | 53 | SetEditValue(keyword, formid); 54 | 55 | end; 56 | 57 | function Finalize: integer; 58 | begin 59 | Result := 0; 60 | end; 61 | 62 | end. 63 | -------------------------------------------------------------------------------- /Scripts/Add Keywords (FLST).pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Add Keywords from Formlist 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | var 11 | slKeywordsToAdd, slKeywordsToFilter, slKeywordsToDelete: TStringList; 12 | formlist: IInterface; 13 | fileFormList: iwbFile; 14 | h, i, j, k, l, m, n, o: integer; 15 | 16 | function Initialize: integer; 17 | var 18 | s: string; 19 | 20 | begin 21 | Result := 0; 22 | 23 | if not InputQuery('Enter', 'Formlist Form ID', s) then begin 24 | Result := 1; 25 | exit; 26 | end; 27 | 28 | AddMessage(''); 29 | 30 | fileFormList := FileByLoadOrder(StrToInt('$' + Copy(s, 1, 2))); 31 | formlist := RecordByFormID(fileFormList, StrToInt('$' + s), true); 32 | 33 | slKeywordsToAdd := TStringList.Create; 34 | slKeywordsToFilter := TStringList.Create; 35 | slKeywordsToDelete := TStringList.Create; 36 | 37 | end; 38 | 39 | function Process(e: IInterface): integer; 40 | var 41 | keywordsToAdd, keywordsToFilter, keywords, keyword, listitem: IInterface; 42 | 43 | begin 44 | Result := 0; 45 | 46 | AddMessage('Processing:' + FullPath(e)); 47 | 48 | keywords := ElementByPath(e, 'KWDA'); 49 | if ElementCount(keywords) = 0 then 50 | Remove(keywords); 51 | 52 | // add keywords to add from formlist to a formlist 53 | keywordsToAdd := ElementByPath(formlist, 'FormIDs'); 54 | 55 | for i := 0 to ElementCount(keywordsToAdd) - 1 do begin 56 | 57 | if Signature(LinksTo(ElementByIndex(keywordsToAdd, i))) <> 'KYWD' then begin 58 | AddMessage(#13#10 + '-------------------------------------------------------------------------------'); 59 | AddMessage('Error: ' + Name(formlist) + ' must contain only KYWD references!'); 60 | AddMessage('-------------------------------------------------------------------------------' + #13#10); 61 | exit; 62 | end; 63 | 64 | slKeywordsToAdd.Add( GetEditValue(ElementByIndex(keywordsToAdd, i)) ); 65 | 66 | end; 67 | 68 | // filter existing keywords from a formlist 69 | keywordsToFilter := ElementByPath(e, 'KWDA'); 70 | 71 | if ElementCount(keywordsToFilter) > 0 then begin 72 | 73 | for j := 0 to ElementCount(keywordsToFilter) - 1 do 74 | slKeywordsToFilter.Add( GetEditValue(ElementByIndex(keywordsToFilter, j)) ); 75 | 76 | for k := slKeywordsToAdd.Count - 1 downto 0 do begin 77 | 78 | for l := slKeywordsToFilter.Count - 1 downto 0 do begin 79 | 80 | if CompareStr(slKeywordsToFilter[l], slKeywordsToAdd[k]) = 0 then 81 | slKeywordsToDelete.Add(IntToStr(k)); 82 | 83 | end; 84 | 85 | end; 86 | 87 | for o := 0 to slKeywordsToDelete.Count - 1 do begin 88 | 89 | slKeywordsToAdd.Delete(StrToInt(slKeywordsToDelete[o])); 90 | 91 | end; 92 | 93 | end; 94 | 95 | // add filtered list of keywords to record 96 | keywords := ElementByPath(e, 'KWDA'); 97 | 98 | if not Assigned(ElementByPath(e, 'KWDA')) then 99 | keywords := Add(e, 'KWDA', true); 100 | 101 | if slKeywordsToAdd.Count > 0 then begin 102 | 103 | for m := 0 to slKeywordsToAdd.Count - 1 do begin 104 | 105 | keyword := ElementAssign(keywords, 0, ElementByPath(keywords, 'Keyword'), false); 106 | 107 | SetEditValue(keyword, slKeywordsToAdd[m]); 108 | 109 | AddMessage('Added Keyword: ' + slKeywordsToAdd[m]); 110 | 111 | end; 112 | 113 | end; 114 | 115 | // remove null references 116 | keywords := ElementByPath(e, 'KWDA'); 117 | for n := 0 to ElementCount(keywords) - 1 do begin 118 | 119 | if CompareStr('NULL - Null Reference [00000000]', GetEditValue(ElementByIndex(keywords, n))) = 0 then 120 | Remove(ElementByIndex(keywords, n)); 121 | 122 | end; 123 | 124 | AddMessage(''); 125 | 126 | slKeywordsToAdd.Clear; 127 | slKeywordsToFilter.Clear; 128 | slKeywordsToDelete.Clear; 129 | 130 | end; 131 | 132 | function Finalize: integer; 133 | 134 | begin 135 | 136 | Result := 1; 137 | 138 | end; 139 | 140 | end. 141 | -------------------------------------------------------------------------------- /Scripts/Add New Records.pas: -------------------------------------------------------------------------------- 1 | { 2 | New script template, only shows processed records 3 | Assigning any nonzero value to Result will terminate script 4 | } 5 | unit userscript; 6 | 7 | // Called before processing 8 | // You can remove it if script doesn't require initialization code 9 | function Initialize: integer; 10 | begin 11 | Result := 0; 12 | end; 13 | 14 | // called for every record selected in xEdit 15 | function Process(e: IInterface): integer; 16 | begin 17 | Result := 0; 18 | 19 | // comment this out if you don't want those messages 20 | Add(e, 'MESG'); 21 | 22 | // processing code goes here 23 | 24 | end; 25 | 26 | // Called after processing 27 | // You can remove it if script doesn't require finalization code 28 | function Finalize: integer; 29 | begin 30 | Result := 0; 31 | end; 32 | 33 | end. 34 | -------------------------------------------------------------------------------- /Scripts/Add prefix or suffix to FULL.pas: -------------------------------------------------------------------------------- 1 | { 2 | This script will prepend or append supplied value to the FULL field 3 | of every selected record. 4 | } 5 | unit UserScript; 6 | 7 | var 8 | DoPrepend: boolean; 9 | s: string; 10 | 11 | function Initialize: integer; 12 | var 13 | i: integer; 14 | begin 15 | Result := 0; 16 | // ask for prefix or suffix mode 17 | i := MessageDlg('Prepend [YES] or append [NO] to Editor ID?', mtConfirmation, [mbYes, mbNo, mbCancel], 0); 18 | if i = mrYes then DoPrepend := true else 19 | if i = mrNo then DoPrepend := false else begin 20 | Result := 1; 21 | Exit; 22 | end; 23 | // ask for string 24 | if not InputQuery('Enter', 'Prefix/suffix', s) then begin 25 | Result := 2; 26 | Exit; 27 | end; 28 | // empty string - do nothing 29 | if s = '' then 30 | Result := 3; 31 | end; 32 | 33 | function Process(e: IInterface): integer; 34 | var 35 | elEditorID: IInterface; 36 | begin 37 | Result := 0; 38 | //AddMessage('Processing: ' + Name(e)); 39 | elEditorID := ElementByName(e, 'FULL - Name'); 40 | if Assigned(elEditorID) then begin 41 | if DoPrepend then 42 | SetEditValue(elEditorID, s + GetEditValue(elEditorID)) 43 | else 44 | SetEditValue(elEditorID, GetEditValue(elEditorID) + s); 45 | end; 46 | end; 47 | 48 | end. 49 | -------------------------------------------------------------------------------- /Scripts/Conversion - Anything to COBJ.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Convert STAT to MISC 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | 7 | 1. Create a new plugin 8 | 2. Copy STAT records to new plugin AS NEW RECORDS 9 | 3. Select STAT records in new plugin 10 | 4. Apply script 11 | } 12 | 13 | unit UserScript; 14 | 15 | var 16 | baserecord, formlist, items: IInterface; 17 | sPrefix, sSuffix: string; 18 | destination, fileBaseRecord, fileFormList: iwbFile; 19 | fileLoadOrder1, fileLoadOrder2: string; 20 | 21 | //============================================================================ 22 | function Initialize: integer; 23 | 24 | begin 25 | 26 | // base record is the template to copy? 27 | // BasicKnife01 [MISC:00104B40] 28 | fileLoadOrder1 := '$09'; // Hunterborn.esp 29 | fileLoadOrder2 := '$0A'; // Target 30 | 31 | fileBaseRecord := FileByLoadOrder(StrToInt(fileLoadOrder1)); 32 | fileFormList := FileByLoadOrder(StrToInt(fileLoadOrder2)); 33 | 34 | baserecord := RecordByFormID(fileBaseRecord, StrToInt(fileLoadOrder1 + '015D8E'), true); 35 | formlist := RecordByFormID(fileFormList, StrToInt(fileLoadOrder2 + 'FF0800'), true); 36 | 37 | sPrefix := '_DS_Recipe_Bone_Bits_'; 38 | sSuffix := ''; 39 | 40 | destination := FileByLoadOrder(StrToInt(fileLoadOrder2)); 41 | 42 | if not Assigned(baserecord) then begin 43 | AddMessage('Cannot find base record'); 44 | Result := 1; 45 | Exit; 46 | end; 47 | 48 | end; 49 | 50 | //============================================================================ 51 | function Process(e: IInterface): integer; 52 | 53 | var 54 | r, origin, conditions, condition2: IInterface; 55 | formid: cardinal; 56 | i: integer; 57 | 58 | begin 59 | 60 | AddRequiredElementMasters(GetFile(e), destination, false); 61 | 62 | // Copy base record to file 63 | r := wbCopyElementToFile(baserecord, destination, true, true); 64 | 65 | if not Assigned(r) then begin 66 | AddMessage('Cannot copy base record as new'); 67 | exit; 68 | end; 69 | 70 | SetElementEditValues(r, 'EDID', sPrefix + GetElementEditValues(e, 'EDID') + sSuffix); 71 | 72 | items := ElementByName(formlist, 'FormIDs'); 73 | 74 | for i := 0 to ElementCount(items) - 1 do begin 75 | 76 | origin := ElementByIndex(items, i); 77 | 78 | if pos( GetElementEditValues(LinksTo(origin), 'EDID'), GetElementEditValues(r, 'EDID') ) > 0 then begin 79 | 80 | SetElementEditValues(r, 'Items\Item\CNTO\Item', GetElementEditValues(LinksTo(origin), 'Record Header\FormID')); 81 | 82 | condition2 := ElementByIndex(ElementByPath(r, 'Conditions'), 1); 83 | 84 | SetElementEditValues(condition2, 'CTDA\Inventory Object', GetElementEditValues(LinksTo(origin), 'Record Header\FormID')); 85 | 86 | end; 87 | 88 | end; 89 | 90 | // todo: create new formid instead of using the current formid and removing the node 91 | // for now, manually change the formid of the new record 92 | formid := GetLoadOrderFormID(e); 93 | 94 | RemoveNode(e); 95 | 96 | SetLoadOrderFormID(r, formid); 97 | 98 | end; 99 | 100 | function Finalize: integer; 101 | 102 | begin 103 | 104 | Result := 1; 105 | exit; 106 | 107 | end; 108 | 109 | end. 110 | -------------------------------------------------------------------------------- /Scripts/Conversion - MSTT to MISC.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Create matching MISC from MSTT 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | 7 | 1. Create a new plugin 8 | 2. Copy MSTT records to new plugin AS NEW RECORDS 9 | 3. Select MSTT records in new plugin 10 | 4. Apply script 11 | } 12 | 13 | unit UserScript; 14 | 15 | var 16 | baserecord: IInterface; 17 | 18 | //============================================================================ 19 | function Initialize: integer; 20 | begin 21 | // base record is the template to copy? 22 | // BasicKnife01 [MISC:00104B40] 23 | baserecord := RecordByFormID(FileByIndex(0), $00104B40, true); // FileByIndex(0) = Skyrim.esm 24 | if not Assigned(baserecord) then begin 25 | AddMessage('Cannot find base record'); 26 | Result := 1; 27 | Exit; 28 | end; 29 | end; 30 | 31 | //============================================================================ 32 | function Process(e: IInterface): integer; 33 | var 34 | r: IInterface; 35 | formid: cardinal; 36 | i: integer; 37 | 38 | begin 39 | if Signature(e) <> 'MSTT' then 40 | Exit; 41 | 42 | r := wbCopyElementToFile(baserecord, GetFile(e), true, true); 43 | if not Assigned(r) then begin 44 | AddMessage('Can''t copy base record as new'); 45 | Result := 1; 46 | Exit; 47 | end; 48 | 49 | SetElementEditValues(r, 'EDID - Editor ID', GetElementEditValues(e, 'EDID - Editor ID') + 'MISC'); 50 | SetElementEditValues(r, 'OBND - Object Bounds\X1', GetElementEditValues(e, 'OBND - Object Bounds\X1')); 51 | SetElementEditValues(r, 'OBND - Object Bounds\Y1', GetElementEditValues(e, 'OBND - Object Bounds\Y1')); 52 | SetElementEditValues(r, 'OBND - Object Bounds\Z1', GetElementEditValues(e, 'OBND - Object Bounds\Z1')); 53 | SetElementEditValues(r, 'OBND - Object Bounds\X2', GetElementEditValues(e, 'OBND - Object Bounds\X2')); 54 | SetElementEditValues(r, 'OBND - Object Bounds\Y2', GetElementEditValues(e, 'OBND - Object Bounds\Y2')); 55 | SetElementEditValues(r, 'OBND - Object Bounds\Z2', GetElementEditValues(e, 'OBND - Object Bounds\Z2')); 56 | SetElementEditValues(r, 'FULL - Name', GetElementEditValues(e, 'FULL - Name')); 57 | SetElementEditValues(r, 'Model\MODL - Model Filename', GetElementEditValues(e, 'Model\MODL - Model Filename')); // issue: why are the Model\MODS alternate texture subrecords obliterated? 58 | SetElementEditValues(r, 'DATA - Data\Value', '1'); 59 | SetElementEditValues(r, 'DATA - Data\Weight', '1'); 60 | 61 | // todo: create new formid instead of using the current formid and removing the node 62 | // for now, manually change the formid of the new record 63 | formid := GetLoadOrderFormID(e); 64 | //RemoveNode(e); 65 | SetLoadOrderFormID(r, formid); 66 | end; 67 | 68 | function Finalize: integer; 69 | begin 70 | Result := 1; 71 | exit; 72 | end; 73 | 74 | end. 75 | -------------------------------------------------------------------------------- /Scripts/Conversion - STAT to CONT.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Convert STAT to CONT 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | 7 | 1. Create a new plugin 8 | 2. Copy STAT records to new plugin AS NEW RECORDS 9 | 3. Select STAT records in new plugin 10 | 4. Apply script 11 | } 12 | 13 | unit UserScript; 14 | 15 | var 16 | baserecord: IInterface; 17 | 18 | //============================================================================ 19 | function Initialize: integer; 20 | begin 21 | 22 | // base record is the template to copy? 23 | // BarrelIngredientCommon01 "Barrel" [CONT:00092B10] 24 | baserecord := RecordByFormID(FileByIndex(0), $00092B10, true); // FileByIndex(0) = Skyrim.esm 25 | 26 | if not Assigned(baserecord) then begin 27 | AddMessage('Cannot find base record'); 28 | Result := 1; 29 | Exit; 30 | end; 31 | 32 | end; 33 | 34 | //============================================================================ 35 | function Process(e: IInterface): integer; 36 | var 37 | r, items: IInterface; 38 | formid: cardinal; 39 | i: integer; 40 | 41 | begin 42 | 43 | if Signature(e) <> 'STAT' then 44 | Exit; 45 | 46 | r := wbCopyElementToFile(baserecord, GetFile(e), true, true); 47 | 48 | if not Assigned(r) then begin 49 | AddMessage('Can''t copy base record as new'); 50 | Result := 1; 51 | Exit; 52 | end; 53 | 54 | // Editor ID 55 | SetElementEditValues(r, 'EDID', GetElementEditValues(e, 'EDID') + 'CONT'); 56 | 57 | // Object Bounds 58 | SetElementEditValues(r, 'OBND\X1', GetElementEditValues(e, 'OBND\X1')); 59 | SetElementEditValues(r, 'OBND\Y1', GetElementEditValues(e, 'OBND\Y1')); 60 | SetElementEditValues(r, 'OBND\Z1', GetElementEditValues(e, 'OBND\Z1')); 61 | SetElementEditValues(r, 'OBND\X2', GetElementEditValues(e, 'OBND\X2')); 62 | SetElementEditValues(r, 'OBND\Y2', GetElementEditValues(e, 'OBND\Y2')); 63 | SetElementEditValues(r, 'OBND\Z2', GetElementEditValues(e, 'OBND\Z2')); 64 | 65 | // Name 66 | SetElementEditValues(r, 'FULL', GetElementEditValues(e, 'EDID') + 'CONT'); 67 | 68 | // Model 69 | SetElementEditValues(r, 'Model\MODL', GetElementEditValues(e, 'Model\MODL')); // issue: why are the Model\MODS alternate texture subrecords obliterated? 70 | 71 | // Items 72 | //items := ElementByName(e, 'Items'); 73 | //SetElementEditValues(items, 'Item\CNTO\Item', ''); 74 | 75 | // Data 76 | SetElementEditValues(r, 'DATA\Value', '1'); 77 | SetElementEditValues(r, 'DATA\Weight', '1'); 78 | 79 | // todo: create new formid instead of using the current formid and removing the node 80 | // for now, manually change the formid of the new record 81 | formid := GetLoadOrderFormID(e); 82 | RemoveNode(e); 83 | SetLoadOrderFormID(r, formid); 84 | 85 | end; 86 | 87 | function Finalize: integer; 88 | begin 89 | 90 | Result := 1; 91 | exit; 92 | 93 | end; 94 | 95 | end. 96 | -------------------------------------------------------------------------------- /Scripts/Conversion - STAT to MISC.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Convert STAT to MISC 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | 7 | 1. Create a new plugin 8 | 2. Copy STAT records to new plugin AS NEW RECORDS 9 | 3. Select STAT records in new plugin 10 | 4. Apply script 11 | } 12 | 13 | unit UserScript; 14 | 15 | var 16 | baserecord: IInterface; 17 | 18 | //============================================================================ 19 | function Initialize: integer; 20 | begin 21 | 22 | // base record is the template to copy? 23 | // BasicKnife01 [MISC:00104B40] 24 | baserecord := RecordByFormID(FileByIndex(0), $00104B40, true); // FileByIndex(0) = Skyrim.esm 25 | 26 | if not Assigned(baserecord) then begin 27 | AddMessage('Cannot find base record'); 28 | Result := 1; 29 | Exit; 30 | end; 31 | 32 | end; 33 | 34 | //============================================================================ 35 | function Process(e: IInterface): integer; 36 | var 37 | r: IInterface; 38 | formid: cardinal; 39 | i: integer; 40 | 41 | begin 42 | 43 | if Signature(e) <> 'STAT' then 44 | Exit; 45 | 46 | r := wbCopyElementToFile(baserecord, GetFile(e), true, true); 47 | 48 | if not Assigned(r) then begin 49 | AddMessage('Can''t copy base record as new'); 50 | Result := 1; 51 | Exit; 52 | end; 53 | 54 | SetElementEditValues(r, 'EDID - Editor ID', GetElementEditValues(e, 'EDID - Editor ID') + 'MISC'); 55 | SetElementEditValues(r, 'OBND - Object Bounds\X1', GetElementEditValues(e, 'OBND - Object Bounds\X1')); 56 | SetElementEditValues(r, 'OBND - Object Bounds\Y1', GetElementEditValues(e, 'OBND - Object Bounds\Y1')); 57 | SetElementEditValues(r, 'OBND - Object Bounds\Z1', GetElementEditValues(e, 'OBND - Object Bounds\Z1')); 58 | SetElementEditValues(r, 'OBND - Object Bounds\X2', GetElementEditValues(e, 'OBND - Object Bounds\X2')); 59 | SetElementEditValues(r, 'OBND - Object Bounds\Y2', GetElementEditValues(e, 'OBND - Object Bounds\Y2')); 60 | SetElementEditValues(r, 'OBND - Object Bounds\Z2', GetElementEditValues(e, 'OBND - Object Bounds\Z2')); 61 | SetElementEditValues(r, 'Model\MODL - Model Filename', GetElementEditValues(e, 'Model\MODL - Model Filename')); // issue: why are the Model\MODS alternate texture subrecords obliterated? 62 | SetElementEditValues(r, 'DATA - Data\Value', '1'); 63 | SetElementEditValues(r, 'DATA - Data\Weight', '1'); 64 | 65 | // todo: create new formid instead of using the current formid and removing the node 66 | // for now, manually change the formid of the new record 67 | formid := GetLoadOrderFormID(e); 68 | RemoveNode(e); 69 | SetLoadOrderFormID(r, formid); 70 | 71 | end; 72 | 73 | function Finalize: integer; 74 | begin 75 | 76 | Result := 1; 77 | exit; 78 | 79 | end; 80 | 81 | end. 82 | -------------------------------------------------------------------------------- /Scripts/Copy References (FLST).pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Find and Replace References (FLST) 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | var 11 | slRefsOrigin, slRefsDestination: TStringList; 12 | 13 | flstRefsRecOrigin, flstRefsOrigin: IInterface; 14 | flstRefsRecDestination, flstRefsDestination: IInterface; 15 | 16 | loadorder, patchmode: integer; 17 | f: IInterface; 18 | 19 | function Initialize: integer; 20 | var 21 | s: string; 22 | 23 | begin 24 | Result := 0; 25 | 26 | // ------------------------------------------------------------ 27 | 28 | slRefsOrigin := TStringList.Create; 29 | slRefsDestination := TStringList.Create; 30 | 31 | flstRefsRecOrigin := RecordByFormID(FileByLoadOrder(04), $04000800, true); 32 | 33 | // ------------------------------------------------------------ 34 | 35 | if MessageDlg('Create a new patch file [YES] or modify existing plugins [NO]?', mtConfirmation, [mbYes, mbNo], 0) = mrYes then 36 | PatchMode := 1 37 | else 38 | PatchMode := 0; 39 | 40 | if patchmode = 0 then begin 41 | 42 | if not InputQuery('Enter', 'Load Order', s) then begin 43 | Result := 1; 44 | exit; 45 | end; 46 | 47 | loadorder := StrToInt(s); 48 | 49 | AddMessage('-------------------------------------------------------------------------------'); 50 | AddMessage( 'Processing: ' + GetFileName(FileByLoadOrder(loadorder))); 51 | AddMessage('-------------------------------------------------------------------------------'); 52 | 53 | end; 54 | 55 | if patchmode = 1 then begin 56 | 57 | f := AddNewFile; 58 | if not Assigned(f) then begin 59 | Result := 1; 60 | exit; 61 | end; 62 | 63 | loadorder := GetLoadOrder(f); 64 | 65 | AddMessage('-------------------------------------------------------------------------------'); 66 | AddMessage( 'Processing: ' + GetFileName(f)); 67 | AddMessage('-------------------------------------------------------------------------------'); 68 | 69 | end; 70 | 71 | end; 72 | 73 | function Process(e: IInterface): integer; 74 | var 75 | r, origin, dest: IInterface; 76 | query, formid, name, checkname, flags: string; 77 | i, j, refcount: integer; 78 | destination: iwbFile; 79 | 80 | begin 81 | Result := 0; 82 | 83 | // Get cell or worldspace data 84 | formid := GetEditValue(ElementByPath(e, 'Record Header\FormID')); 85 | 86 | //if Signature(e) == 'ACHR' or Signature(e) == 'REFR' then 87 | // name := GetEditValue(ElementByPath(e, 'NAME - Base')); 88 | 89 | //if Signature(e) <> 'ACHR' and Signature(e) <> 'REFR' then 90 | name := formid; 91 | 92 | destination := FileByLoadOrder(loadorder); 93 | flags := 'Record Header\Record Flags'; 94 | 95 | // Add origin references to list 96 | flstRefsOrigin := ElementByName(flstRefsRecOrigin, 'FormIDs'); 97 | 98 | if slRefsOrigin.Count = 0 then begin 99 | 100 | if Assigned(flstRefsOrigin) then begin 101 | 102 | for i := 0 to ElementCount(flstRefsOrigin) - 1 do begin 103 | 104 | origin := LinksTo(ElementByIndex(flstRefsOrigin, i)); 105 | slRefsOrigin.Add(GetElementEditValues(origin, 'EDID')); 106 | 107 | end; 108 | 109 | end; 110 | 111 | end; 112 | 113 | // Replace origin references with destination references from lists 114 | for j := 0 to slRefsOrigin.Count - 1 do begin 115 | 116 | //AddMessage('Record 1: ' + slRefsOrigin[j] ); 117 | //AddMessage('Record 2: ' + name ); 118 | 119 | if (pos(slRefsOrigin[j], name) > 0) then begin 120 | 121 | try 122 | 123 | if patchmode = 1 then 124 | AddRequiredElementMasters(GetFile(e), destination, false); 125 | 126 | AddMessage('Copying: ' + formid); 127 | r := wbCopyElementToFile(e, destination, true, true); 128 | 129 | if not Assigned(r) then begin 130 | AddMessage('Cannot copy record as new'); 131 | Result := 1; 132 | Exit; 133 | end; 134 | 135 | SetLoadOrderFormID(r, GetLoadOrderFormID(e)); // copies load order for overrides 136 | 137 | except 138 | 139 | //AddMessage('Record exists. Skipping.'); 140 | 141 | end; // end try 142 | 143 | end; // end if 144 | 145 | end; // end for 146 | 147 | end; 148 | 149 | function Finalize: integer; 150 | begin 151 | AddMessage('-------------------------------------------------------------------------------'); 152 | slRefsOrigin.Clear; 153 | slRefsDestination.Clear; 154 | Result := 1; 155 | end; 156 | 157 | end. 158 | -------------------------------------------------------------------------------- /Scripts/Copy and Edit References (Campfire Cooking).pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: List model paths 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | var 11 | slReferences: TStringList; 12 | 13 | function Initialize: integer; 14 | begin 15 | Result := 0; 16 | 17 | slReferences := TStringList.Create; 18 | slReferences.Add('00035F49'); // Campfire01Burning 19 | slReferences.Add('00035F47'); // Campfire01LandBurning 20 | slReferences.Add('000A9230'); // Campfire01LandBurning_Heavy_SN 21 | slReferences.Add('00090CA4'); // Campfire01LandBurning_ReachDirt01 22 | slReferences.Add('0010D820'); // Campfire01LandBurningCaveBaseGround02 23 | slReferences.Add('000C2BF1'); // Campfire01LandBurningCoastalBeach01 24 | slReferences.Add('000DB682'); // Campfire01LandBurningDirt01 25 | slReferences.Add('000C6918'); // Campfire01LandBurningFallForestDirt01 26 | slReferences.Add('000FB9B0'); // Campfire01LandBurningFieldGrass01 27 | slReferences.Add('000CBB23'); // Campfire01LandBurningFrozenMarshDirtSlope01 28 | slReferences.Add('000B6C08'); // Campfire01LandBurningPineForest01 29 | slReferences.Add('000951D8'); // Campfire01LandBurningReachDirt01 30 | slReferences.Add('000E7C9A'); // Campfire01LandBurningRiverBedEdge01 31 | slReferences.Add('000CBB2F'); // Campfire01LandBurningRocks01 32 | slReferences.Add('00101A51'); // Campfire01LandBurningTundra01 33 | end; 34 | 35 | function Process(e: IInterface): integer; 36 | var 37 | r, rec: IInterface; 38 | query, formid, name, checkname: string; 39 | j, refcount: integer; 40 | begin 41 | Result := 0; 42 | 43 | if Signature(e) <> 'REFR' then 44 | exit; 45 | 46 | formid := GetEditValue(ElementByPath(e, 'Record Header\FormID')); 47 | name := GetEditValue(ElementByPath(e, 'NAME')); 48 | refcount := slReferences.Count - 1; 49 | 50 | for j := 0 to refcount do begin 51 | 52 | if (pos(slReferences[j], name) > 0) then begin 53 | 54 | AddMessage('Copying: ' + formid); 55 | r := wbCopyElementToFile(e, FileByLoadOrder(04), true, true); // Change this to the right file 56 | 57 | if not Assigned(r) then begin 58 | AddMessage('Can''t copy record as new'); 59 | Result := 1; 60 | Exit; 61 | end; 62 | 63 | if (pos(slReferences[0], name) > 0) then 64 | SetElementEditValues(r, 'NAME', 'dubhBenchCampfire01Burning [FURN:02FF1234]'); 65 | if (pos(slReferences[1], name) > 0) then 66 | SetElementEditValues(r, 'NAME', 'dubhBenchCampfire01LandBurning [FURN:02FF1235]'); 67 | if (pos(slReferences[2], name) > 0) then 68 | SetElementEditValues(r, 'NAME', 'dubhBenchCampfire01LandBurning_Heavy_SN [FURN:02FF1241]'); 69 | if (pos(slReferences[3], name) > 0) then 70 | SetElementEditValues(r, 'NAME', 'dubhBenchCampfire01LandBurning_ReachDirt01 [FURN:02FF1242]'); 71 | if (pos(slReferences[4], name) > 0) then 72 | SetElementEditValues(r, 'NAME', 'dubhBenchCampfire01LandBurningCaveBaseGround02 [FURN:02FF1236]'); 73 | if (pos(slReferences[5], name) > 0) then 74 | SetElementEditValues(r, 'NAME', 'dubhBenchCampfire01LandBurningCoastalBeach01 [FURN:02FF1237]'); 75 | if (pos(slReferences[6], name) > 0) then 76 | SetElementEditValues(r, 'NAME', 'dubhBenchCampfire01LandBurningDirt01 [FURN:02FF1238]'); 77 | if (pos(slReferences[7], name) > 0) then 78 | SetElementEditValues(r, 'NAME', 'dubhBenchCampfire01LandBurningFallForestDirt01 [FURN:02FF1239]'); 79 | if (pos(slReferences[8], name) > 0) then 80 | SetElementEditValues(r, 'NAME', 'dubhBenchCampfire01LandBurningFieldGrass01 [FURN:02FF123A]'); 81 | if (pos(slReferences[9], name) > 0) then 82 | SetElementEditValues(r, 'NAME', 'dubhBenchCampfire01LandBurningFrozenMarshDirtSlope01 [FURN:02FF123B]'); 83 | if (pos(slReferences[10], name) > 0) then 84 | SetElementEditValues(r, 'NAME', 'dubhBenchCampfire01LandBurningPineForest01 [FURN:02FF123C]'); 85 | if (pos(slReferences[11], name) > 0) then 86 | SetElementEditValues(r, 'NAME', 'dubhBenchCampfire01LandBurningReachDirt01 [FURN:02FF123D]'); 87 | if (pos(slReferences[12], name) > 0) then 88 | SetElementEditValues(r, 'NAME', 'dubhBenchCampfire01LandBurningRiverBedEdge01 [FURN:02FF123E]'); 89 | if (pos(slReferences[13], name) > 0) then 90 | SetElementEditValues(r, 'NAME', 'dubhBenchCampfire01LandBurningRocks01 [FURN:02FF123F]'); 91 | if (pos(slReferences[14], name) > 0) then 92 | SetElementEditValues(r, 'NAME', 'dubhBenchCampfire01LandBurningTundra01 [FURN:02FF1240]'); 93 | 94 | SetLoadOrderFormID(r, GetLoadOrderFormID(e)); // copies load order for overrides 95 | 96 | end; 97 | end; 98 | 99 | end; 100 | 101 | function Finalize: integer; 102 | begin 103 | Result := 0; 104 | end; 105 | 106 | end. 107 | -------------------------------------------------------------------------------- /Scripts/Copy and Edit References (Dynamic Torches).pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Copy and Edit References (Dynamic Torches) 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | 7 | Instructions: 8 | 1. Add input references to slReferences (e.g., MSTT.) 9 | 2. Add output references to SetElementEditValues (e.g, ACTI.) 10 | 3. Change the load order to the file where you want the records copied. 11 | 4. Apply Script on Cell or Worldspace. 12 | } 13 | 14 | unit UserScript; 15 | 16 | var 17 | slReferences: TStringList; 18 | 19 | function Initialize: integer; 20 | begin 21 | Result := 0; 22 | 23 | slReferences := TStringList.Create; 24 | 25 | // INPUT REFERENCES 26 | // Reminder: Use only the FormID. 27 | 28 | slReferences.Add('00101592'); // TorchPermanantOn [MSTT:00101592] 29 | // TorchPermanentOff [STAT:00090728] 30 | end; 31 | 32 | function Process(e: IInterface): integer; 33 | var 34 | r, rec: IInterface; 35 | query, formid, name, checkname: string; 36 | j, refcount: integer; 37 | begin 38 | Result := 0; 39 | 40 | if Signature(e) <> 'REFR' then 41 | exit; 42 | 43 | formid := GetEditValue(ElementByPath(e, 'Record Header\FormID')); 44 | name := GetEditValue(ElementByPath(e, 'NAME')); 45 | refcount := slReferences.Count - 1; 46 | 47 | for j := 0 to refcount do begin 48 | 49 | if (pos(slReferences[j], name) > 0) then begin 50 | 51 | AddMessage('Copying: ' + formid); 52 | r := wbCopyElementToFile(e, FileByLoadOrder(09), true, true); // Change this to the right file 53 | 54 | if not Assigned(r) then begin 55 | AddMessage('Can''t copy record as new'); 56 | Result := 1; 57 | Exit; 58 | end; 59 | 60 | // OUTPUT REFERENCES 61 | // REMINDER: Don't forget to increment the slReferences[0...99] index. 62 | 63 | if (pos(slReferences[0], name) > 0) then 64 | SetElementEditValues(r, 'NAME', 'RemovableTorchSconce01 "Torch Sconce" [ACTI:0009151E]'); // RemovableTorchSconce01 "Torch Sconce" [ACTI:0009151E] 65 | 66 | SetLoadOrderFormID(r, GetLoadOrderFormID(e)); // copies load order for overrides 67 | 68 | end; 69 | end; 70 | 71 | end; 72 | 73 | function Finalize: integer; 74 | begin 75 | Result := 0; 76 | end; 77 | 78 | end. 79 | -------------------------------------------------------------------------------- /Scripts/Copy, Edit, and Flag References (Cobwebs).pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Copy, Edit, and Flag References (Cobwebs) 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | 7 | Instructions: 8 | 1. Add origin references to slReferences (e.g., MSTT.) 9 | 2. Add destination references to SetElementEditValues (e.g, ACTI.) 10 | 3. Change the load order to the destination file. (Line 53) 11 | 4. Apply Script on Cell or Worldspace. 12 | } 13 | 14 | unit UserScript; 15 | 16 | var 17 | slReferences: TStringList; 18 | loadorder, patchmode: integer; 19 | f: IInterface; 20 | 21 | function Initialize: integer; 22 | var 23 | s: string; 24 | 25 | begin 26 | Result := 0; 27 | 28 | slReferences := TStringList.Create; 29 | 30 | // ------------------------------------------------------------ 31 | // ORIGIN REFERENCES 32 | // Reminder: Use only the FormID. 33 | // ------------------------------------------------------------ 34 | 35 | slReferences.Add('0002F5A0'); // FXcobwebCorner01 [STAT:0002F5A0] 36 | slReferences.Add('0002F5A6'); // FXcobwebCorner02 [STAT:0002F5A6] 37 | slReferences.Add('0002F5A8'); // FXcobwebDoorOpen [STAT:0002F5A8] 38 | slReferences.Add('0002F59A'); // FXcobwebWall01 [STAT:0002F59A] 39 | 40 | slReferences.Add('0002F5B2'); // FXcobwebDangle01 [MSTT:0002F5B2] 41 | slReferences.Add('0002F5B1'); // FXcobwebDangle02 [MSTT:0002F5B1] 42 | slReferences.Add('0005DD38'); // FXCobWebDAngle01MovableStatic [MSTT:0005DD38] 43 | 44 | // ------------------------------------------------------------ 45 | 46 | if MessageDlg('Create a new patch file [YES] or modify existing plugins [NO]?', mtConfirmation, [mbYes, mbNo], 0) = mrYes then 47 | PatchMode := 1 48 | else 49 | PatchMode := 0; 50 | 51 | if patchmode = 0 then begin 52 | 53 | if not InputQuery('Enter', 'Load Order', s) then begin 54 | Result := 1; 55 | exit; 56 | end; 57 | 58 | loadorder := StrToInt(s); 59 | 60 | end; 61 | 62 | if patchmode = 1 then begin 63 | 64 | f := AddNewFile; 65 | if not Assigned(f) then begin 66 | Result := 1; 67 | exit; 68 | end; 69 | 70 | loadorder := GetLoadOrder(f); 71 | 72 | AddMessage('-------------------------------------------------------------------------------'); 73 | AddMessage( 'Working ' + GetFileName(f) + ' ...' ); 74 | AddMessage('-------------------------------------------------------------------------------'); 75 | 76 | end; 77 | 78 | end; 79 | 80 | function Process(e: IInterface): integer; 81 | var 82 | r, rec: IInterface; 83 | query, formid, name, checkname, flags: string; 84 | j, refcount: integer; 85 | destination: iwbFile; 86 | 87 | begin 88 | Result := 0; 89 | 90 | if Signature(e) <> 'REFR' then 91 | exit; 92 | 93 | formid := GetEditValue(ElementByPath(e, 'Record Header\FormID')); 94 | name := GetEditValue(ElementByPath(e, 'NAME')); 95 | refcount := slReferences.Count - 1; 96 | 97 | destination := FileByLoadOrder(loadorder); 98 | flags := 'Record Header\Record Flags'; 99 | 100 | for j := 0 to refcount do begin 101 | 102 | if (pos(slReferences[j], name) > 0) then begin 103 | 104 | try 105 | 106 | if patchmode = 1 then 107 | AddRequiredElementMasters(GetFile(e), destination, false); 108 | 109 | AddMessage('Copying: ' + formid); 110 | r := wbCopyElementToFile(e, destination, true, true); 111 | 112 | if not Assigned(r) then begin 113 | AddMessage('Cannot copy record as new'); 114 | Result := 1; 115 | Exit; 116 | end; 117 | 118 | // ------------------------------------------------------------ 119 | // DESTINATION REFERENCES 120 | // Reminder: Increment slReferences[0...99] index. 121 | // ------------------------------------------------------------ 122 | 123 | //if (pos(slReferences[0], name) > 0) then 124 | // SetElementNativeValues(r, flags, GetElementNativeValues(r, flags) or 1024); // Flag: PersistentReference QuestItem DisplaysInMainMenu 125 | 126 | if (pos(slReferences[0], name) > 0) then 127 | SetElementEditValues(r, 'NAME', 'dubhFXcobwebCorner01 [ACTI:07000800]'); 128 | 129 | if (pos(slReferences[1], name) > 0) then 130 | SetElementEditValues(r, 'NAME', 'dubhFXcobwebCorner02 [ACTI:07000801]'); 131 | 132 | if (pos(slReferences[2], name) > 0) then 133 | SetElementEditValues(r, 'NAME', 'dubhFXcobwebDoorOpen [ACTI:07000804]'); 134 | 135 | if (pos(slReferences[3], name) > 0) then 136 | SetElementEditValues(r, 'NAME', 'dubhFXcobwebWall01 [ACTI:07000806]'); 137 | 138 | if (pos(slReferences[4], name) > 0) then 139 | SetElementEditValues(r, 'NAME', 'dubhFXcobwebDangle01 [ACTI:07000802]'); 140 | 141 | if (pos(slReferences[5], name) > 0) then 142 | SetElementEditValues(r, 'NAME', 'dubhFXcobwebDangle02 [ACTI:07000803]'); 143 | 144 | if (pos(slReferences[6], name) > 0) then 145 | SetElementEditValues(r, 'NAME', 'dubhFXcobwebDangle01MSTT [ACTI:07000805]'); 146 | 147 | // ------------------------------------------------------------ 148 | 149 | SetLoadOrderFormID(r, GetLoadOrderFormID(e)); // copies load order for overrides 150 | 151 | except 152 | 153 | //AddMessage('Record exists. Skipping.'); 154 | 155 | end; // end try 156 | 157 | end; // end if 158 | 159 | end; // end for 160 | 161 | end; 162 | 163 | function Finalize: integer; 164 | begin 165 | AddMessage('-------------------------------------------------------------------------------'); 166 | Result := 1; 167 | end; 168 | 169 | end. 170 | -------------------------------------------------------------------------------- /Scripts/Copy, Edit, and Flag References (Dynamic Torches Empty).pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Copy, Edit, and Flag References (Dynamic Torches) 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | 7 | Instructions: 8 | 1. Add origin references to slReferences (e.g., MSTT.) 9 | 2. Add destination references to SetElementEditValues (e.g, ACTI.) 10 | 3. Change the load order to the destination file. (Line 53) 11 | 4. Apply Script on Cell or Worldspace. 12 | } 13 | 14 | unit UserScript; 15 | 16 | var 17 | slReferences: TStringList; 18 | loadorder, patchmode: integer; 19 | f: IInterface; 20 | 21 | function Initialize: integer; 22 | var 23 | s: string; 24 | 25 | begin 26 | Result := 0; 27 | 28 | slReferences := TStringList.Create; 29 | 30 | // ------------------------------------------------------------ 31 | // ORIGIN REFERENCES 32 | // Reminder: Use only the FormID. 33 | // ------------------------------------------------------------ 34 | 35 | //slReferences.Add('000BCC9D'); // DefaultTorch01NS_Fast [LIGH:000BCC9D] 36 | slReferences.Add('00090728'); // TorchPermanentOff [STAT:00090728] 37 | 38 | // ------------------------------------------------------------ 39 | 40 | if MessageDlg('Create a new patch file [YES] or modify existing plugins [NO]?', mtConfirmation, [mbYes, mbNo], 0) = mrYes then 41 | PatchMode := 1 42 | else 43 | PatchMode := 0; 44 | 45 | if patchmode = 0 then begin 46 | 47 | if not InputQuery('Enter', 'Load Order', s) then begin 48 | Result := 1; 49 | exit; 50 | end; 51 | 52 | loadorder := StrToInt(s); 53 | 54 | end; 55 | 56 | if patchmode = 1 then begin 57 | 58 | f := AddNewFile; 59 | if not Assigned(f) then begin 60 | Result := 1; 61 | exit; 62 | end; 63 | 64 | loadorder := GetLoadOrder(f); 65 | 66 | AddMessage('-------------------------------------------------------------------------------'); 67 | AddMessage( 'Working ' + GetFileName(f) + ' ...' ); 68 | AddMessage('-------------------------------------------------------------------------------'); 69 | 70 | end; 71 | 72 | end; 73 | 74 | function Process(e: IInterface): integer; 75 | var 76 | r, rec: IInterface; 77 | query, formid, name, checkname, flags: string; 78 | j, refcount: integer; 79 | destination: iwbFile; 80 | 81 | begin 82 | Result := 0; 83 | 84 | if Signature(e) <> 'REFR' then 85 | exit; 86 | 87 | formid := GetEditValue(ElementByPath(e, 'Record Header\FormID')); 88 | name := GetEditValue(ElementByPath(e, 'NAME')); 89 | refcount := slReferences.Count - 1; 90 | 91 | destination := FileByLoadOrder(loadorder); 92 | flags := 'Record Header\Record Flags'; 93 | 94 | for j := 0 to refcount do begin 95 | 96 | if (pos(slReferences[j], name) > 0) then begin 97 | 98 | try 99 | 100 | if patchmode = 1 then 101 | AddRequiredElementMasters(GetFile(e), destination, false); 102 | 103 | AddMessage('Copying: ' + formid); 104 | r := wbCopyElementToFile(e, destination, true, true); 105 | 106 | if not Assigned(r) then begin 107 | AddMessage('Cannot copy record as new'); 108 | Result := 1; 109 | Exit; 110 | end; 111 | 112 | // ------------------------------------------------------------ 113 | // DESTINATION REFERENCES 114 | // Reminder: Increment slReferences[0...99] index. 115 | // ------------------------------------------------------------ 116 | 117 | //if (pos(slReferences[0], name) > 0) then 118 | // SetElementNativeValues(r, flags, GetElementNativeValues(r, flags) or 1024); // Flag: PersistentReference QuestItem DisplaysInMainMenu 119 | 120 | if (pos(slReferences[0], name) > 0) then 121 | SetElementEditValues(r, 'NAME', 'RemovableTorchSconce02 "Torch Sconce" [ACTI:05000D1F]'); // RemovableTorchSconce02 "Torch Sconce" [ACTI:05000D1F] 122 | 123 | // ------------------------------------------------------------ 124 | 125 | SetLoadOrderFormID(r, GetLoadOrderFormID(e)); // copies load order for overrides 126 | 127 | except 128 | 129 | //AddMessage('Record exists. Skipping.'); 130 | 131 | end; // end try 132 | 133 | end; // end if 134 | 135 | end; // end for 136 | 137 | end; 138 | 139 | function Finalize: integer; 140 | begin 141 | AddMessage('-------------------------------------------------------------------------------'); 142 | Result := 1; 143 | end; 144 | 145 | end. 146 | -------------------------------------------------------------------------------- /Scripts/Copy, Edit, and Flag References.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Copy, Edit, and Flag References (Cobwebs) 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | 7 | Instructions: 8 | 1. Add origin references to slRefMatchAgainst (e.g., MSTT.) 9 | 2. Add destination references to SetElementEditValues (e.g, ACTI.) 10 | 3. Change the load order to the destination file. (Line 53) 11 | 4. Apply Script on Cell or Worldspace. 12 | } 13 | 14 | unit UserScript; 15 | 16 | var 17 | slRefMatchAgainst, slRefReplaceWith: TStringList; 18 | loadorder, patchmode: integer; 19 | f: IInterface; 20 | 21 | function Initialize: integer; 22 | var 23 | s: string; 24 | 25 | begin 26 | Result := 0; 27 | 28 | slRefMatchAgainst := TStringList.Create; 29 | slRefReplaceWith := TStringList.Create; 30 | 31 | // ------------------------------------------------------------ 32 | // ORIGIN REFERENCES 33 | // Reminder: Use only the FormID. 34 | // ------------------------------------------------------------ 35 | 36 | // [0] 37 | slRefMatchAgainst.Add('FXcobwebCorner01 [STAT:0002F5A0]'); 38 | slRefReplaceWith.Add('dubhFXcobwebCorner01 [ACTI:07000800]'); 39 | // [1] 40 | slRefMatchAgainst.Add('FXcobwebCorner02 [STAT:0002F5A6]'); 41 | slRefReplaceWith.Add('dubhFXcobwebCorner02 [ACTI:07000801]'); 42 | // [2] 43 | slRefMatchAgainst.Add('FXcobwebDoorOpen [STAT:0002F5A8]'); 44 | slRefReplaceWith.Add('dubhFXcobwebDoorOpen [ACTI:07000804]'); 45 | // [3] 46 | slRefMatchAgainst.Add('FXcobwebWall01 [STAT:0002F59A]'); 47 | slRefReplaceWith.Add('dubhFXcobwebWall01 [ACTI:07000806]'); 48 | // [4] 49 | slRefMatchAgainst.Add('FXcobwebDangle01 [MSTT:0002F5B2]'); 50 | slRefReplaceWith.Add('dubhFXcobwebDangle01 [ACTI:07000802]'); 51 | // [5] 52 | slRefMatchAgainst.Add('FXcobwebDangle02 [MSTT:0002F5B1]'); 53 | slRefReplaceWith.Add('dubhFXcobwebDangle02 [ACTI:07000803]'); 54 | // [6] 55 | slRefMatchAgainst.Add('FXCobWebDAngle01MovableStatic [MSTT:0005DD38]'); 56 | slRefReplaceWith.Add('dubhFXcobwebDangle01MSTT [ACTI:07000805]'); 57 | 58 | // ------------------------------------------------------------ 59 | 60 | if MessageDlg('Create a new patch file [YES] or modify existing plugins [NO]?', mtConfirmation, [mbYes, mbNo], 0) = mrYes then 61 | PatchMode := 1 62 | else 63 | PatchMode := 0; 64 | 65 | if patchmode = 0 then begin 66 | 67 | if not InputQuery('Enter', 'Load Order', s) then begin 68 | Result := 1; 69 | exit; 70 | end; 71 | 72 | loadorder := StrToInt(s); 73 | 74 | end; 75 | 76 | if patchmode = 1 then begin 77 | 78 | f := AddNewFile; 79 | if not Assigned(f) then begin 80 | Result := 1; 81 | exit; 82 | end; 83 | 84 | loadorder := GetLoadOrder(f); 85 | 86 | AddMessage('-------------------------------------------------------------------------------'); 87 | AddMessage( 'Working ' + GetFileName(f) + ' ...' ); 88 | AddMessage('-------------------------------------------------------------------------------'); 89 | 90 | end; 91 | 92 | end; 93 | 94 | function Process(e: IInterface): integer; 95 | var 96 | r, rec: IInterface; 97 | query, formid, name, checkname, flags: string; 98 | j, refcount: integer; 99 | destination: iwbFile; 100 | 101 | begin 102 | Result := 0; 103 | 104 | if Signature(e) <> 'REFR' then 105 | exit; 106 | 107 | formid := GetEditValue(ElementByPath(e, 'Record Header\FormID')); 108 | name := GetEditValue(ElementByPath(e, 'NAME')); 109 | refcount := slRefMatchAgainst.Count - 1; 110 | 111 | destination := FileByLoadOrder(loadorder); 112 | flags := 'Record Header\Record Flags'; 113 | 114 | for j := 0 to refcount do begin 115 | 116 | if (pos(slRefMatchAgainst[j], name) > 0) then begin 117 | 118 | try 119 | 120 | if patchmode = 1 then 121 | AddRequiredElementMasters(GetFile(e), destination, false); 122 | 123 | AddMessage('Copying: ' + formid); 124 | r := wbCopyElementToFile(e, destination, true, true); 125 | 126 | if not Assigned(r) then begin 127 | AddMessage('Cannot copy record as new'); 128 | Result := 1; 129 | Exit; 130 | end; 131 | 132 | // ------------------------------------------------------------ 133 | // DESTINATION REFERENCES 134 | // Reminder: Increment slRefMatchAgainst[0...99] index. 135 | // ------------------------------------------------------------ 136 | 137 | //if (pos(slRefMatchAgainst[0], name) > 0) then 138 | // SetElementNativeValues(r, flags, GetElementNativeValues(r, flags) or 1024); // Flag: PersistentReference QuestItem DisplaysInMainMenu 139 | 140 | for i := 0 to slRefMatchAgainst.Count - 1 do begin 141 | 142 | // Replace REFR 143 | if (pos(slRefMatchAgainst[i], name) > 0) then 144 | SetElementEditValues(r, 'NAME', slRefReplaceWith[i]); 145 | 146 | // Flag REFR 147 | if (pos(slRefMatchAgainst[i], name) > 0) then 148 | SetElementNativeValues(r, flags, GetElementNativeValues(r, flags) or 1024); // Flag: PersistentReference QuestItem DisplaysInMainMenu 149 | 150 | end; 151 | 152 | // ------------------------------------------------------------ 153 | 154 | SetLoadOrderFormID(r, GetLoadOrderFormID(e)); // copies load order for overrides 155 | 156 | except 157 | 158 | //AddMessage('Record exists. Skipping.'); 159 | 160 | end; // end try 161 | 162 | end; // end if 163 | 164 | end; // end for 165 | 166 | end; 167 | 168 | function Finalize: integer; 169 | begin 170 | AddMessage('-------------------------------------------------------------------------------'); 171 | Result := 1; 172 | end; 173 | 174 | end. 175 | -------------------------------------------------------------------------------- /Scripts/Delete Referenced By In File.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Delete Referenced By In File 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | function Initialize: integer; 11 | begin 12 | Result := 0; 13 | end; 14 | 15 | function Process(e: IInterface): integer; 16 | var 17 | ref: IInterface; 18 | formid, name, sFileRef, sFileSel: string; 19 | i, refcount: integer; 20 | begin 21 | Result := 0; 22 | 23 | refcount := ReferencedByCount(MasterOrSelf(e)); 24 | 25 | if refcount > 0 then begin 26 | 27 | for i := 0 to refcount - 1 do begin 28 | 29 | ref := ReferencedByIndex(MasterOrSelf(e), i); 30 | formid := GetEditValue(ElementByPath(ref, 'Record Header\FormID')); 31 | 32 | sFileRef := GetFileName(GetFile(ref)); 33 | sFileSel := GetFileName(GetFile(e)); 34 | 35 | if refcount > 1 && sFileRef = sFileSel then begin 36 | 37 | RemoveNode(ref); 38 | AddMessage( 'Removed: ' + GetEditValue(ElementByPath(ref, 'Record Header\FormID')) ); 39 | 40 | end; 41 | 42 | end; 43 | 44 | end; 45 | 46 | end; 47 | 48 | function Finalize: integer; 49 | begin 50 | Result := 0; 51 | end; 52 | 53 | end. 54 | -------------------------------------------------------------------------------- /Scripts/Form ARMO - Create matching COBJ.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Create matching COBJ from MISC 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | var 11 | baserecord: IInterface; 12 | 13 | //============================================================================ 14 | function Initialize: integer; 15 | begin 16 | // RecipeIngotIron [COBJ:000A30C3] 17 | baserecord := RecordByFormID(FileByIndex(0), $000A30C3, true); 18 | if not Assigned(baserecord) then begin 19 | AddMessage('Can not find base record'); 20 | Result := 1; 21 | Exit; 22 | end; 23 | end; 24 | 25 | //============================================================================ 26 | function Process(e: IInterface): integer; 27 | var 28 | r, kwda: IInterface; 29 | formid: Cardinal; 30 | keyword, bnam, cnam: string; 31 | i, iMaterials: integer; 32 | 33 | begin 34 | if Signature(e) <> 'ARMO' then 35 | Exit; 36 | 37 | iMaterials := 0; 38 | 39 | kwda := ElementBySignature(e, 'KWDA'); 40 | for i := 0 to ElementCount(kwda) - 1 do begin 41 | keyword := lowercase(GetEditValue(ElementByIndex(kwda, i))); 42 | AddMessage(keyword); 43 | 44 | if (pos('daedric', keyword) > 0) then begin 45 | iMaterials := iMaterials + 1; 46 | bnam := 'CraftingSmelter [KYWD:000A5CCE]'; 47 | cnam := 'OreEbony "Ebony Ore" [MISC:0005ACDC]'; 48 | end; 49 | 50 | if (pos('dragonplate', keyword) > 0) then begin 51 | iMaterials := iMaterials + 1; 52 | bnam := 'CraftingSmelter [KYWD:000A5CCE]'; 53 | cnam := 'DragonBone "Dragon Bone" [MISC:0003ADA4]'; 54 | end; 55 | 56 | if (pos('dragonscale', keyword) > 0) then begin 57 | iMaterials := iMaterials + 1; 58 | bnam := 'CraftingSmelter [KYWD:000A5CCE]'; 59 | cnam := 'DragonScales "Dragon Scales" [MISC:0003ADA3]'; 60 | end; 61 | 62 | if (pos('dwarven', keyword) > 0) then begin 63 | iMaterials := iMaterials + 1; 64 | bnam := 'CraftingSmelter [KYWD:000A5CCE]'; 65 | cnam := 'DwarvenScrapBent "Bent Dwemer Scrap Metal" [MISC:000C886C]'; 66 | end; 67 | 68 | if (pos('ebony', keyword) > 0) then begin 69 | iMaterials := iMaterials + 1; 70 | bnam := 'CraftingSmelter [KYWD:000A5CCE]'; 71 | cnam := 'OreEbony "Ebony Ore" [MISC:0005ACDC]'; 72 | end; 73 | 74 | if (pos('elven', keyword) > 0) then begin 75 | iMaterials := iMaterials + 1; 76 | bnam := 'CraftingSmelter [KYWD:000A5CCE]'; 77 | cnam := 'OreMoonstone "Moonstone Ore" [MISC:0005ACE0]'; 78 | end; 79 | 80 | if (pos('glass', keyword) > 0) then begin 81 | iMaterials := iMaterials + 1; 82 | bnam := 'CraftingSmelter [KYWD:000A5CCE]'; 83 | cnam := 'OreMalachite "Malachite Ore" [MISC:0005ACE1]'; 84 | end; 85 | 86 | if (pos('iron', keyword) > 0) then begin 87 | iMaterials := iMaterials + 1; 88 | bnam := 'CraftingSmelter [KYWD:000A5CCE]'; 89 | cnam := 'OreIron "Iron Ore" [MISC:00071CF3]'; 90 | end; 91 | 92 | if (pos('leather', keyword) > 0) then begin 93 | iMaterials := iMaterials + 1; 94 | bnam := 'CraftingTanningRack [KYWD:0007866A]'; 95 | cnam := 'Leather01 "Leather" [MISC:000DB5D2]'; 96 | end; 97 | 98 | if (pos('hide', keyword) > 0) then begin 99 | iMaterials := iMaterials + 1; 100 | bnam := 'CraftingTanningRack [KYWD:0007866A]'; 101 | cnam := 'Leather01 "Leather" [MISC:000DB5D2]'; 102 | end; 103 | 104 | if (pos('orcish', keyword) > 0) then begin 105 | iMaterials := iMaterials + 1; 106 | bnam := 'CraftingSmelter [KYWD:000A5CCE]'; 107 | cnam := 'OreOrichalcum "Orichalcum Ore" [MISC:0005ACDD]'; 108 | end; 109 | 110 | if (pos('steel', keyword) > 0) or (pos('advanced', keyword) > 0) then begin 111 | iMaterials := iMaterials + 1; 112 | bnam := 'CraftingSmelter [KYWD:000A5CCE]'; 113 | cnam := 'OreCorundum "CorundumOre" [MISC:0005ACDB]'; 114 | end; 115 | 116 | end; 117 | 118 | AddMessage(IntToStr(iMaterials) + ' materials found...'); 119 | 120 | r := wbCopyElementToFile(baserecord, GetFile(e), true, true); 121 | if not Assigned(r) then begin 122 | AddMessage('Can''t copy base record as new'); 123 | Result := 1; 124 | Exit; 125 | end; 126 | 127 | SetElementEditValues(r, 'EDID', 'dubhBreakdown' + GetElementEditValues(e, 'EDID')); 128 | SetElementEditValues(r, 'COCT', 1); 129 | SetElementEditValues(r, 'DESC', GetElementEditValues(e, 'FULL')); 130 | SetElementEditValues(r, 'Items\Item\CNTO\Item', GetEditValue(ElementByPath(e, 'Record Header\FormID'))); 131 | SetElementEditValues(r, 'Items\Item\CNTO\Count', 1); 132 | 133 | if (iMaterials > 0)) then begin 134 | SetElementEditValues(r, 'CNAM', cnam); 135 | SetElementEditValues(r, 'BNAM', bnam); 136 | SetElementEditValues(r, 'NAM1', 1); 137 | end; 138 | if (iMaterials = 0) then begin 139 | SetElementEditValues(r, 'CNAM', 'IngotIron "Iron Ingot" [MISC:0005ACE4]'); 140 | SetElementEditValues(r, 'BNAM', 'CraftingSmelter [KYWD:000A5CCE]'); 141 | SetElementEditValues(r, 'NAM1', 1); 142 | end; 143 | 144 | formid := GetLoadOrderFormID(e); 145 | RemoveNode(e); 146 | SetLoadOrderFormID(r, formid); 147 | end; 148 | 149 | //function Finalize: integer; 150 | // begin 151 | // AddMessage(' '); 152 | // Result := 1; 153 | // end; 154 | 155 | end. -------------------------------------------------------------------------------- /Scripts/Form BNAM - Change to CraftingCookpot.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Change BNAM to CraftingTanningRack 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | function Process(e: IInterface): integer; 11 | var 12 | rec: IInterface; 13 | 14 | begin 15 | Result := 0; 16 | 17 | rec := Signature(e); 18 | 19 | AddMessage('Processing: ' + FullPath(e)); 20 | AddMessage('-------------------------------------------------------------------------------'); 21 | AddMessage(' '); 22 | 23 | if rec <> 'COBJ' then begin 24 | 25 | SetElementEditValues(e, 'BNAM', 'CraftingCookpot [KYWD:000A5CB3]'); 26 | //SetElementEditValues(e, 'BNAM', 'CraftingSmelter [KYWD:000A5CCE]'); 27 | //SetElementEditValues(e, 'BNAM', 'CraftingSmithingArmorTable [KYWD:000ADB78]'); 28 | //SetElementEditValues(e, 'BNAM', 'CraftingSmithingForge [KYWD:00088105]'); 29 | //SetElementEditValues(e, 'BNAM', 'CraftingSmithingSharpeningWheel [KYWD:00088108]'); 30 | //SetElementEditValues(e, 'BNAM', 'CraftingSmithingSkyforge [KYWD:000F46CE]'); 31 | //SetElementEditValues(e, 'BNAM', 'CraftingTanningRack [KYWD:0007866A]'); 32 | 33 | end; 34 | 35 | end; 36 | 37 | function Finalize: integer; 38 | begin 39 | AddMessage(' '); 40 | Result := 1; 41 | end; 42 | 43 | end. 44 | -------------------------------------------------------------------------------- /Scripts/Form BNAM - Change to CraftingSmelter.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Change BNAM to CraftingTanningRack 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | function Process(e: IInterface): integer; 11 | var 12 | rec: IInterface; 13 | 14 | begin 15 | Result := 0; 16 | 17 | rec := Signature(e); 18 | 19 | AddMessage('Processing: ' + FullPath(e)); 20 | AddMessage('-------------------------------------------------------------------------------'); 21 | AddMessage(' '); 22 | 23 | if rec <> 'COBJ' then begin 24 | 25 | //SetElementEditValues(e, 'BNAM', 'CraftingCookpot [KYWD:000A5CB3]'); 26 | SetElementEditValues(e, 'BNAM', 'CraftingSmelter [KYWD:000A5CCE]'); 27 | //SetElementEditValues(e, 'BNAM', 'CraftingSmithingArmorTable [KYWD:000ADB78]'); 28 | //SetElementEditValues(e, 'BNAM', 'CraftingSmithingForge [KYWD:00088105]'); 29 | //SetElementEditValues(e, 'BNAM', 'CraftingSmithingSharpeningWheel [KYWD:00088108]'); 30 | //SetElementEditValues(e, 'BNAM', 'CraftingSmithingSkyforge [KYWD:000F46CE]'); 31 | //SetElementEditValues(e, 'BNAM', 'CraftingTanningRack [KYWD:0007866A]'); 32 | 33 | end; 34 | 35 | end; 36 | 37 | function Finalize: integer; 38 | begin 39 | AddMessage(' '); 40 | Result := 1; 41 | end; 42 | 43 | end. 44 | -------------------------------------------------------------------------------- /Scripts/Form BNAM - Change to CraftingSmithingArmorTable.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Change BNAM to CraftingTanningRack 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | function Process(e: IInterface): integer; 11 | var 12 | rec: IInterface; 13 | 14 | begin 15 | Result := 0; 16 | 17 | rec := Signature(e); 18 | 19 | AddMessage('Processing: ' + FullPath(e)); 20 | AddMessage('-------------------------------------------------------------------------------'); 21 | AddMessage(' '); 22 | 23 | if rec <> 'COBJ' then begin 24 | 25 | //SetElementEditValues(e, 'BNAM', 'CraftingCookpot [KYWD:000A5CB3]'); 26 | //SetElementEditValues(e, 'BNAM', 'CraftingSmelter [KYWD:000A5CCE]'); 27 | SetElementEditValues(e, 'BNAM', 'CraftingSmithingArmorTable [KYWD:000ADB78]'); 28 | //SetElementEditValues(e, 'BNAM', 'CraftingSmithingForge [KYWD:00088105]'); 29 | //SetElementEditValues(e, 'BNAM', 'CraftingSmithingSharpeningWheel [KYWD:00088108]'); 30 | //SetElementEditValues(e, 'BNAM', 'CraftingSmithingSkyforge [KYWD:000F46CE]'); 31 | //SetElementEditValues(e, 'BNAM', 'CraftingTanningRack [KYWD:0007866A]'); 32 | 33 | end; 34 | 35 | end; 36 | 37 | function Finalize: integer; 38 | begin 39 | AddMessage(' '); 40 | Result := 1; 41 | end; 42 | 43 | end. 44 | -------------------------------------------------------------------------------- /Scripts/Form BNAM - Change to CraftingSmithingForge.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Change BNAM to CraftingTanningRack 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | function Process(e: IInterface): integer; 11 | var 12 | rec: IInterface; 13 | 14 | begin 15 | Result := 0; 16 | 17 | rec := Signature(e); 18 | 19 | AddMessage('Processing: ' + FullPath(e)); 20 | AddMessage('-------------------------------------------------------------------------------'); 21 | AddMessage(' '); 22 | 23 | if rec <> 'COBJ' then begin 24 | 25 | //SetElementEditValues(e, 'BNAM', 'CraftingCookpot [KYWD:000A5CB3]'); 26 | //SetElementEditValues(e, 'BNAM', 'CraftingSmelter [KYWD:000A5CCE]'); 27 | //SetElementEditValues(e, 'BNAM', 'CraftingSmithingArmorTable [KYWD:000ADB78]'); 28 | SetElementEditValues(e, 'BNAM', 'CraftingSmithingForge [KYWD:00088105]'); 29 | //SetElementEditValues(e, 'BNAM', 'CraftingSmithingSharpeningWheel [KYWD:00088108]'); 30 | //SetElementEditValues(e, 'BNAM', 'CraftingSmithingSkyforge [KYWD:000F46CE]'); 31 | //SetElementEditValues(e, 'BNAM', 'CraftingTanningRack [KYWD:0007866A]'); 32 | 33 | end; 34 | 35 | end; 36 | 37 | function Finalize: integer; 38 | begin 39 | AddMessage(' '); 40 | Result := 1; 41 | end; 42 | 43 | end. 44 | -------------------------------------------------------------------------------- /Scripts/Form BNAM - Change to CraftingSmithingSharpeningWheel.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Change BNAM to CraftingTanningRack 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | function Process(e: IInterface): integer; 11 | var 12 | rec: IInterface; 13 | 14 | begin 15 | Result := 0; 16 | 17 | rec := Signature(e); 18 | 19 | AddMessage('Processing: ' + FullPath(e)); 20 | AddMessage('-------------------------------------------------------------------------------'); 21 | AddMessage(' '); 22 | 23 | if rec <> 'COBJ' then begin 24 | 25 | //SetElementEditValues(e, 'BNAM', 'CraftingCookpot [KYWD:000A5CB3]'); 26 | //SetElementEditValues(e, 'BNAM', 'CraftingSmelter [KYWD:000A5CCE]'); 27 | //SetElementEditValues(e, 'BNAM', 'CraftingSmithingArmorTable [KYWD:000ADB78]'); 28 | //SetElementEditValues(e, 'BNAM', 'CraftingSmithingForge [KYWD:00088105]'); 29 | SetElementEditValues(e, 'BNAM', 'CraftingSmithingSharpeningWheel [KYWD:00088108]'); 30 | //SetElementEditValues(e, 'BNAM', 'CraftingSmithingSkyforge [KYWD:000F46CE]'); 31 | //SetElementEditValues(e, 'BNAM', 'CraftingTanningRack [KYWD:0007866A]'); 32 | 33 | end; 34 | 35 | end; 36 | 37 | function Finalize: integer; 38 | begin 39 | AddMessage(' '); 40 | Result := 1; 41 | end; 42 | 43 | end. 44 | -------------------------------------------------------------------------------- /Scripts/Form BNAM - Change to CraftingSmithingSkyforge.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Change BNAM to CraftingTanningRack 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | function Process(e: IInterface): integer; 11 | var 12 | rec: IInterface; 13 | 14 | begin 15 | Result := 0; 16 | 17 | rec := Signature(e); 18 | 19 | AddMessage('Processing: ' + FullPath(e)); 20 | AddMessage('-------------------------------------------------------------------------------'); 21 | AddMessage(' '); 22 | 23 | if rec <> 'COBJ' then begin 24 | 25 | //SetElementEditValues(e, 'BNAM', 'CraftingCookpot [KYWD:000A5CB3]'); 26 | //SetElementEditValues(e, 'BNAM', 'CraftingSmelter [KYWD:000A5CCE]'); 27 | //SetElementEditValues(e, 'BNAM', 'CraftingSmithingArmorTable [KYWD:000ADB78]'); 28 | //SetElementEditValues(e, 'BNAM', 'CraftingSmithingForge [KYWD:00088105]'); 29 | //SetElementEditValues(e, 'BNAM', 'CraftingSmithingSharpeningWheel [KYWD:00088108]'); 30 | SetElementEditValues(e, 'BNAM', 'CraftingSmithingSkyforge [KYWD:000F46CE]'); 31 | //SetElementEditValues(e, 'BNAM', 'CraftingTanningRack [KYWD:0007866A]'); 32 | 33 | end; 34 | 35 | end; 36 | 37 | function Finalize: integer; 38 | begin 39 | AddMessage(' '); 40 | Result := 1; 41 | end; 42 | 43 | end. 44 | -------------------------------------------------------------------------------- /Scripts/Form BNAM - Change to CraftingTanningRack.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Change BNAM to CraftingTanningRack 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | function Process(e: IInterface): integer; 11 | var 12 | rec: IInterface; 13 | 14 | begin 15 | Result := 0; 16 | 17 | rec := Signature(e); 18 | 19 | AddMessage('Processing: ' + FullPath(e)); 20 | AddMessage('-------------------------------------------------------------------------------'); 21 | AddMessage(' '); 22 | 23 | if rec <> 'COBJ' then begin 24 | 25 | //SetElementEditValues(e, 'BNAM', 'CraftingCookpot [KYWD:000A5CB3]'); 26 | //SetElementEditValues(e, 'BNAM', 'CraftingSmelter [KYWD:000A5CCE]'); 27 | //SetElementEditValues(e, 'BNAM', 'CraftingSmithingArmorTable [KYWD:000ADB78]'); 28 | //SetElementEditValues(e, 'BNAM', 'CraftingSmithingForge [KYWD:00088105]'); 29 | //SetElementEditValues(e, 'BNAM', 'CraftingSmithingSharpeningWheel [KYWD:00088108]'); 30 | //SetElementEditValues(e, 'BNAM', 'CraftingSmithingSkyforge [KYWD:000F46CE]'); 31 | SetElementEditValues(e, 'BNAM', 'CraftingTanningRack [KYWD:0007866A]'); 32 | 33 | end; 34 | 35 | end; 36 | 37 | function Finalize: integer; 38 | begin 39 | AddMessage(' '); 40 | Result := 1; 41 | end; 42 | 43 | end. 44 | -------------------------------------------------------------------------------- /Scripts/Form BNAM - Change to _DS_CraftingScrimshaw.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Change BNAM to _DS_CraftingScrimshaw 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | function Process(e: IInterface): integer; 11 | var 12 | rec: IInterface; 13 | 14 | begin 15 | Result := 0; 16 | 17 | rec := Signature(e); 18 | 19 | AddMessage('Processing: ' + FullPath(e)); 20 | AddMessage('-------------------------------------------------------------------------------'); 21 | AddMessage(' '); 22 | 23 | SetElementEditValues(e, 'BNAM', '_DS_CraftingScrimshaw [KYWD:04025C09]'); 24 | 25 | end; 26 | 27 | function Finalize: integer; 28 | begin 29 | AddMessage(' '); 30 | Result := 1; 31 | end; 32 | 33 | end. 34 | -------------------------------------------------------------------------------- /Scripts/Form BOOK - Add Teaches Skill Flag.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Make NPCs Protected 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | var 11 | a, b, c: integer; 12 | 13 | // Called before processing 14 | function Initialize: integer; 15 | begin 16 | 17 | end; 18 | 19 | // Processing 20 | function Process(e: IInterface): integer; 21 | var 22 | rec: IInterface; 23 | sPath, sPathFlags: string; 24 | 25 | begin 26 | 27 | Result := 0; 28 | 29 | rec := Signature(e); 30 | sPath := Name(e); 31 | 32 | if (rec = 'BOOK') then begin 33 | 34 | 35 | 36 | sPathFlags := 'DATA\Flags'; 37 | 38 | if (GetElementEditValues(e, 'DATA\Type') = 'Note/Scroll') then 39 | 40 | RemoveNode(e) 41 | 42 | //else if pos('Recipe:', GetElementEditValues(e, 'FULL')) > 0 then 43 | // 44 | // RemoveNode(e) 45 | // 46 | //else if (GetElementNativeValues(e, sPathFlags) = 1) and (GetElementEditValues(e, 'DATA\Skill') <> 'Smithing') then 47 | // 48 | // RemoveNode(e) 49 | // 50 | //else if (GetElementNativeValues(e, sPathFlags) = 4) then 51 | // 52 | // RemoveNode(e) 53 | 54 | else if (GetElementEditValues(e, 'DATA\Type') = 'Book/Tome') then begin 55 | 56 | if GetElementEditValues(e, 'DATA\Skill') <> 'Speech' then begin 57 | 58 | SetElementNativeValues(e, sPathFlags, GetElementNativeValues(e, sPathFlags) or 1); 59 | SetElementEditValues(e, 'DATA\Skill', 'Speech'); 60 | AddMessage(sPath + ' now flagged Teaches Skill: Speech'); 61 | 62 | end; 63 | 64 | end; 65 | 66 | end; // end condition 67 | 68 | end; // end function 69 | 70 | // Cleanup 71 | function Finalize: integer; 72 | begin 73 | 74 | Result := 1; 75 | 76 | end; // end function 77 | 78 | end. // end script 79 | -------------------------------------------------------------------------------- /Scripts/Form BOOK - Change FULL.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Change FULL 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | function Process(e: IInterface): integer; 11 | var 12 | s, edid, this, that: string; 13 | begin 14 | Result := 0; 15 | 16 | edid := GetElementEditValues(e, 'FULL'); 17 | 18 | this := 'Thirty-Six'; 19 | that := '36'; 20 | 21 | AddMessage('Processing: ' + FullPath(e)); 22 | 23 | if pos(lowercase(this), lowercase(edid)) > 0 then begin 24 | s := StringReplace(edid, this, that, [rfReplaceAll, rfIgnoreCase]); 25 | SetElementEditValues(e, 'FULL', s); 26 | end; 27 | 28 | end; 29 | 30 | function Finalize: integer; 31 | begin 32 | Result := 1; 33 | end; 34 | 35 | end. 36 | -------------------------------------------------------------------------------- /Scripts/Form BOOK - Strip HTML and Count Characters.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Make NPCs Protected 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | var 11 | a, b, c: integer; 12 | 13 | // Called before processing 14 | function Initialize: integer; 15 | begin 16 | AddMessage('-------------------------------------------------------------------------------'); 17 | end; 18 | 19 | function StripHTML(S: string): string; 20 | var 21 | TagBegin, TagEnd, TagLength: integer; 22 | begin 23 | TagBegin := Pos('<', S); 24 | 25 | while (TagBegin > 0) do begin 26 | TagEnd := Pos('>', S); 27 | TagLength := TagEnd - TagBegin + 1; 28 | Delete(S, TagBegin, TagLength); 29 | TagBegin := Pos('<', S); 30 | end; 31 | 32 | Result := S; 33 | end; 34 | 35 | function StripPageBreak(S: string): string; 36 | var 37 | TagBegin, TagEnd, TagLength: integer; 38 | begin 39 | TagBegin := Pos('[', S); 40 | 41 | while (TagBegin > 0) do begin 42 | TagEnd := Pos(']', S); 43 | TagLength := TagEnd - TagBegin + 1; 44 | Delete(S, TagBegin, TagLength); 45 | TagBegin := Pos('[', S); 46 | end; 47 | 48 | Result := S; 49 | end; 50 | 51 | function DeleteSpaces(Str: string): string; 52 | var 53 | i: Integer; 54 | begin 55 | i:=0; 56 | while i<=Length(Str) do 57 | if Str[i]=' ' then Delete(Str, i, 1) 58 | else Inc(i); 59 | Result:=Str; 60 | end; 61 | 62 | // Processing 63 | function Process(e: IInterface): integer; 64 | var 65 | rec: IInterface; 66 | sID, sPath, sPathDesc, sDesc: string; 67 | i, iCharacterCount: integer; 68 | 69 | begin 70 | 71 | Result := 0; 72 | 73 | rec := Signature(e); 74 | sPath := Name(e); 75 | 76 | if (rec = 'BOOK') then begin 77 | 78 | sPathDesc := 'DESC'; 79 | 80 | //sDesc := GetElementEditValues(e, sPathDesc); 81 | //iCharacterCount := Length(sDesc); 82 | //AddMessage(IntToStr(iCharacterCount) + ' characters before stripping tags'); 83 | 84 | sDesc := StripHTML(GetElementEditValues(e, sPathDesc)); 85 | //iCharacterCount := Length(sDesc); 86 | //AddMessage(IntToStr(iCharacterCount) + ' characters after stripping HTML'); 87 | 88 | sDesc := StripPageBreak(sDesc); 89 | //iCharacterCount := Length(sDesc); 90 | //AddMessage(IntToStr(iCharacterCount) + ' characters after stripping page breaks'); 91 | 92 | sDesc := Trim(sDesc); 93 | sDesc := StringReplace(sDesc,#9,' ',[rfReplaceAll]); 94 | sDesc := StringReplace(sDesc,#13,' ',[rfReplaceAll]); 95 | sDesc := StringReplace(sDesc,#10,' ',[rfReplaceAll]); 96 | sDesc := DeleteSpaces(sDesc); 97 | 98 | iCharacterCount := Length(sDesc); 99 | sID := GetElementEditValues(e, 'EDID'); 100 | //AddMessage(sID + ' ' + IntToStr(iCharacterCount) + ' ' + IntToStr(iCharacterCount / 4.8)); 101 | AddMessage(sID + ' ' + IntToStr(iCharacterCount)); 102 | //AddMessage(sDesc); 103 | 104 | end; // end condition 105 | 106 | end; // end function 107 | 108 | // Cleanup 109 | function Finalize: integer; 110 | begin 111 | 112 | AddMessage('-------------------------------------------------------------------------------'); 113 | Result := 1; 114 | 115 | end; // end function 116 | 117 | end. // end script 118 | -------------------------------------------------------------------------------- /Scripts/Form CNAM - Change to Bits of Bone.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Change CNAM to Bone Meal 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | function Process(e: IInterface): integer; 11 | begin 12 | Result := 0; 13 | 14 | // comment this out if you don't want those messages 15 | AddMessage('Processing: ' + FullPath(e)); 16 | 17 | // processing code goes here 18 | SetElementEditValues(e, 'CNAM', '_DS_BoneBits "Bits of Bone" [MISC:04006953]'); 19 | SetElementNativeValues(e, 'NAM1', 1); 20 | 21 | end; 22 | 23 | function Finalize: integer; 24 | begin 25 | Result := 1; 26 | end; 27 | 28 | end. 29 | -------------------------------------------------------------------------------- /Scripts/Form CNAM - Change to Bone Meal.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Change CNAM to Bone Meal 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | // Called before processing 11 | // You can remove it if script doesn't require initialization code 12 | function Initialize: integer; 13 | begin 14 | Result := 0; 15 | end; 16 | 17 | // called for every record selected in xEdit 18 | function Process(e: IInterface): integer; 19 | var 20 | test: string; 21 | begin 22 | Result := 0; 23 | 24 | // comment this out if you don't want those messages 25 | AddMessage('Processing: ' + FullPath(e)); 26 | 27 | // processing code goes here 28 | SetElementEditValues(e, 'CNAM', 'BoneMeal "Bone Meal" [INGR:00034CDD]'); 29 | SetElementNativeValues(e, 'NAM1', 1); 30 | 31 | end; 32 | 33 | // Called after processing 34 | // You can remove it if script doesn't require finalization code 35 | function Finalize: integer; 36 | begin 37 | Result := 0; 38 | end; 39 | 40 | end. 41 | -------------------------------------------------------------------------------- /Scripts/Form COBJ - Add Condition (GetItemCount).pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Add GetItemCount condition to COBJ 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | function Process(e: IInterface): integer; 11 | var 12 | rec, item, conditions, condition, ctda, lastcondition, lastctda, checkcondition, checkctda: IInterface; 13 | i, iLastIndex, iResults: integer; 14 | sFunction, sInvObject, sInvObjectCheck: string; 15 | bAssigned: boolean; 16 | 17 | begin 18 | Result := 0; 19 | 20 | rec := Signature(e); 21 | 22 | AddMessage(' '); 23 | AddMessage('--------------------------------------------------------------------------------'); 24 | AddMessage('Processing: ' + FullPath(e)); 25 | AddMessage('--------------------------------------------------------------------------------'); 26 | 27 | if rec <> 'COBJ' then 28 | exit; 29 | 30 | item := ElementByPath(e, 'Items\Item\CNTO'); 31 | 32 | bAssigned := false; 33 | conditions := ElementByName(e, 'Conditions'); 34 | if not Assigned(conditions) then begin 35 | conditions := Add(e, 'Conditions', true); 36 | ctda := ElementByPath(e, 'Conditions\Condition\CTDA'); 37 | 38 | SetEditValue(ElementByIndex(ctda, 0), '11000000'); 39 | SetNativeValue(ElementByIndex(ctda, 2), GetNativeValue(ElementByPath(e, 'Items\Item\CNTO\Count'))); 40 | SetEditValue(ElementByIndex(ctda, 3), 'GetItemCount'); 41 | SetEditValue(ElementByName(ctda, 'Inventory Object'), GetEditValue(ElementByIndex(item, 0))); 42 | SetNativeValue(ElementByIndex(ctda, 9), -1); 43 | 44 | bAssigned := true; 45 | end; 46 | 47 | if bAssigned <> true and Assigned(conditions) then begin 48 | 49 | conditions := ElementByName(e, 'Conditions'); 50 | iLastIndex := ElementCount(conditions) - 1; 51 | iResults := 0; 52 | 53 | if Assigned(conditions) then begin 54 | for i := 0 to iLastIndex do begin 55 | checkcondition := ElementByIndex(conditions, i); 56 | checkctda := ElementBySignature(ElementByIndex(conditions, i), 'CTDA'); 57 | sFunction := GetEditValue(ElementByIndex(checkctda, 3)); 58 | sInvObject := GetEditValue(ElementByName(checkctda, 'Inventory Object')); 59 | sInvObjectCheck := GetEditValue(ElementByIndex(item, 0)); 60 | 61 | if (sFunction = 'GetItemCount') and (sInvObject = sInvObjectCheck) then 62 | iResults := iResults + 1; 63 | end; 64 | end; 65 | 66 | if iResults = 0 then begin 67 | condition := ElementAssign(conditions, HighInteger, nil, true); 68 | conditions := ElementByName(e, 'Conditions'); 69 | iLastIndex := ElementCount(conditions) - 1; 70 | lastcondition := ElementByIndex(conditions, iLastIndex); 71 | lastctda := ElementBySignature(ElementByIndex(conditions, iLastIndex), 'CTDA'); 72 | 73 | SetEditValue(ElementByIndex(lastctda, 0), '11000000'); 74 | SetNativeValue(ElementByIndex(lastctda, 2), GetNativeValue(ElementByName(item, 'Count'))); 75 | SetEditValue(ElementByIndex(lastctda, 3), 'GetItemCount'); 76 | SetEditValue(ElementByName(lastctda, 'Inventory Object'), GetEditValue(ElementByIndex(item, 0))); 77 | SetNativeValue(ElementByIndex(lastctda, 9), -1); 78 | end; 79 | 80 | end; 81 | 82 | end; 83 | 84 | function Finalize: integer; 85 | begin 86 | AddMessage(' '); 87 | Result := 1; 88 | end; 89 | 90 | end. 91 | -------------------------------------------------------------------------------- /Scripts/Form COBJ - Decrease Value, Increase Weight.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Decrease Value, Increase Weight 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | function Initialize: integer; 11 | 12 | begin 13 | 14 | ClearMessages(); 15 | 16 | end; 17 | 18 | function Process(e: IInterface): integer; 19 | var 20 | input, output: IInterface; 21 | 22 | output_quantity: integer; 23 | output_value: integer; 24 | output_weight: float; 25 | 26 | begin 27 | Result := 0; 28 | 29 | // Exit if cell or worldspace is not selected 30 | if Signature(e) <> 'COBJ' then 31 | exit; 32 | 33 | e := WinningOverride(e); 34 | 35 | AddMessage(FullPath(e)); 36 | 37 | input := ElementByPath(e, 'Items\Item\CNTO\Item'); 38 | 39 | output := ElementByPath(e, 'CNAM'); 40 | output_quantity := GetElementEditValues(e, 'NAM1'); 41 | 42 | if Signature(WinningOverride(LinksTo(output))) <> 'ALCH' then begin 43 | 44 | output_value := GetElementEditValues(WinningOverride(LinksTo(output)), 'DATA\Value'); 45 | if output_value = 0 then 46 | output_value := 1; 47 | 48 | output_weight := GetElementEditValues(WinningOverride(LinksTo(output)), 'DATA\Weight'); 49 | if output_weight = 0.0 then 50 | output_weight := 0.1; 51 | 52 | SetElementEditValues(WinningOverride(LinksTo(input)), 'DATA\Value', round(output_quantity * (output_value / 1.5))); 53 | 54 | SetElementEditValues(WinningOverride(LinksTo(input)), 'DATA\Weight', output_quantity * (output_weight * 2.5)); 55 | 56 | end; 57 | 58 | if Signature(WinningOverride(LinksTo(output))) = 'ALCH' then begin 59 | 60 | output_weight := GetElementEditValues(WinningOverride(LinksTo(output)), 'DATA - Weight'); 61 | if output_weight = 0.0 then 62 | output_weight := 0.1; 63 | 64 | SetElementEditValues(WinningOverride(LinksTo(input)), 'DATA - Weight', output_quantity * (output_weight * 2)); 65 | 66 | end; 67 | 68 | end; // end function 69 | 70 | function Finalize: integer; 71 | 72 | begin 73 | Result := 1; 74 | end; 75 | 76 | end. 77 | -------------------------------------------------------------------------------- /Scripts/Form ECZN - Disable Combat Boundaries.pas: -------------------------------------------------------------------------------- 1 | { 2 | New script template, only shows processed records 3 | Assigning any nonzero value to Result will terminate script 4 | } 5 | unit userscript; 6 | 7 | // Called before processing 8 | // You can remove it if script doesn't require initialization code 9 | function Initialize: integer; 10 | begin 11 | Result := 0; 12 | end; 13 | 14 | // called for every record selected in xEdit 15 | function Process(e: IInterface): integer; 16 | begin 17 | Result := 0; 18 | 19 | // comment this out if you don't want those messages 20 | AddMessage('Processing: ' + FullPath(e)); 21 | 22 | // processing code goes here 23 | SetElementNativeValues(e, 'DATA\Flags', GetElementNativeValues(e, 'DATA\Flags') or 4); 24 | 25 | end; 26 | 27 | // Called after processing 28 | // You can remove it if script doesn't require finalization code 29 | function Finalize: integer; 30 | begin 31 | Result := 0; 32 | end; 33 | 34 | end. 35 | -------------------------------------------------------------------------------- /Scripts/Form FLST - Add Forms to FLST.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Add LNAM to FLST 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | var 11 | slFormlist: TStringList; 12 | loadorder, patchmode: integer; 13 | f, formlist: IInterface; 14 | fileFormList: iwbFile; 15 | 16 | function Initialize: integer; 17 | var 18 | s: string; 19 | begin 20 | Result := 0; 21 | 22 | slFormlist := TStringList.Create; 23 | fileFormList := FileByLoadOrder(StrToInt('$06')); 24 | formlist := RecordByFormID(fileFormList, $06FF0321, true); 25 | 26 | end; 27 | 28 | function Process(e: IInterface): integer; 29 | begin 30 | Result := 0; 31 | 32 | //AddRequiredElementMasters(GetFile(e), fileFormList, false); 33 | 34 | slFormlist.Add(GetElementEditValues(e, 'Record Header\FormID')); 35 | 36 | end; 37 | 38 | function Finalize: integer; 39 | var 40 | formids, lastlnam: IInterface; 41 | i, iLastIndex: integer; 42 | sItem, sInputItem: string; 43 | begin 44 | 45 | formids := ElementByName(formlist, 'FormIDs'); 46 | 47 | if not Assigned(formids) then 48 | formids := Add(formlist, 'FormIDs', true); 49 | 50 | if Assigned(formids) then begin 51 | 52 | for i := 0 to slFormlist.Count - 1 do begin 53 | 54 | formids := ElementAssign(formids, HighInteger, nil, true); 55 | formids := ElementByName(formlist, 'FormIDs'); 56 | iLastIndex := ElementCount(formids) - 2; 57 | lastlnam := ElementByIndex(formids, iLastIndex); 58 | 59 | sInputItem := slFormlist[i]; 60 | 61 | SetEditValue(lastlnam, sInputItem); 62 | AddMessage('Added: ' + sInputItem); 63 | 64 | end; 65 | 66 | end; 67 | 68 | Result := 1; 69 | end; 70 | 71 | end. 72 | -------------------------------------------------------------------------------- /Scripts/Form FLST - Add LNAM.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Add LNAM to FLST 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | var 11 | slFormlist: TStringList; 12 | loadorder, patchmode: integer; 13 | f: IInterface; 14 | 15 | function Initialize: integer; 16 | var 17 | s: string; 18 | begin 19 | Result := 0; 20 | 21 | slFormlist := TStringList.Create; 22 | 23 | slFormlist.Add('[REFR:000ECF49] (places MapMarker [STAT:00000010] in GRUP Cell Persistent Children of [CELL:00000D74] (in Tamriel "Skyrim" [WRLD:0000003C] at 0,0))'); 24 | slFormlist.Add('[REFR:000ECF49] (places MapMarker [STAT:00000010] in GRUP Cell Persistent Children of [CELL:00000D74] (in Tamriel "Skyrim" [WRLD:0000003C] at 0,0))'); 25 | 26 | end; 27 | 28 | function Process(e: IInterface): integer; 29 | var 30 | rec, formlist, lnam, item, lastlnam: IInterface; 31 | i, iLastIndex, iResults: integer; 32 | sItem, sInputItem: string; 33 | bAssigned: boolean; 34 | begin 35 | Result := 0; 36 | 37 | rec := Signature(e); 38 | 39 | if rec <> 'FLST' then 40 | exit; 41 | 42 | formlist := ElementByName(e, 'FormIDs'); 43 | 44 | if Assigned(formlist) then begin 45 | 46 | for i := 0 to slFormlist.Count - 1 do begin 47 | 48 | formlist := ElementAssign(formlist, HighInteger, nil, true); 49 | formlist := ElementByName(e, 'FormIDs'); 50 | iLastIndex := ElementCount(formlist) - 1; 51 | lastlnam := ElementByIndex(formlist, iLastIndex); 52 | 53 | sInputItem := slFormlist[i]; 54 | 55 | SetEditValue(lastlnam, sInputItem); 56 | AddMessage('Added: ' + sInputItem); 57 | 58 | end; 59 | 60 | end; 61 | 62 | 63 | end; 64 | 65 | function Finalize: integer; 66 | begin 67 | Result := 0; 68 | end; 69 | 70 | end. 71 | -------------------------------------------------------------------------------- /Scripts/Form FLST - List FormID Items.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: List LNAM subrecords 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | function Initialize: integer; 11 | begin 12 | Result := 0; 13 | end; 14 | 15 | function Process(e: IInterface): integer; 16 | var 17 | rec, list, listitem: IInterface; 18 | lnam, formid: string; 19 | i: integer; 20 | begin 21 | Result := 0; 22 | 23 | list := ElementByName(e, 'FormIDs'); 24 | 25 | for i := 0 to ElementCount(list) - 1 do begin 26 | //lnam := GetEditValue(ElementByIndex(list, i)); 27 | listitem := ElementByIndex(list, i); 28 | formid := IntToHex(FixedFormID(LinksTo(listitem)), 8); 29 | AddMessage(GetElementEditValues(LinksTo(listitem), 'Record Header\FormID')); 30 | end; 31 | 32 | end; 33 | 34 | function Finalize: integer; 35 | begin 36 | Result := 0; 37 | end; 38 | 39 | end. 40 | -------------------------------------------------------------------------------- /Scripts/Form FLST - Sort Alphabetically.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Sort FLST alphabetically 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | var 11 | listUnsorted, listSorted: TStringList; 12 | i: integer; 13 | 14 | // Called before processing 15 | function Initialize: integer; 16 | begin 17 | listUnsorted := TStringList.Create; 18 | listSorted := TStringList.Create; 19 | listUnsorted.Sorted := True; 20 | listUnsorted.Duplicates := dupIgnore; 21 | listSorted.Sorted := True; 22 | listSorted.Duplicates := dupIgnore; 23 | end; 24 | 25 | // called for every record selected in xEdit 26 | function Process(e: IInterface): integer; 27 | var 28 | items, item, rec: IInterface; 29 | itemCount, itemCountNew: integer; 30 | 31 | begin 32 | Result := 0; 33 | 34 | rec := Signature(e); 35 | 36 | AddMessage('--------------------------------------------------------------------------------'); 37 | AddMessage('Processing: ' + FullPath(e)); 38 | AddMessage('--------------------------------------------------------------------------------'); 39 | 40 | // Process FLST record 41 | if (rec = 'FLST') then begin 42 | 43 | items := ElementByName(e, 'FormIDs'); 44 | itemCount := ElementCount(items); 45 | 46 | AddMessage('Items: ' + IntToStr(itemCount)); 47 | 48 | // Create list of unsorted items 49 | for i := itemCount - 1 downto 0 do begin 50 | 51 | // Add items to TFormList 52 | item := GetEditValue(ElementByIndex(items, i)); 53 | listUnsorted.Add(item); 54 | 55 | // Sort 56 | listUnsorted.Sort; 57 | 58 | // Remove items from FLST 59 | RemoveByIndex(items, i, true); 60 | 61 | end; 62 | 63 | // Create new list of sorted items 64 | for i := 0 to listUnsorted.Count - 1 do begin 65 | 66 | // Add items to TFormList 67 | listSorted.Add(listUnsorted[i]); 68 | 69 | // Add items to FLST 70 | items := ElementByPath(e, 'FormIDs'); 71 | item := ElementAssign(items, HighInteger, nil, false); 72 | SetEditValue(item, listSorted[i]); 73 | 74 | end; 75 | 76 | listUnsorted.Clear; 77 | listSorted.Clear; 78 | 79 | // How many duplicates were removed? 80 | itemCountNew := ElementCount(items); 81 | if itemCountNew < itemCount then begin 82 | AddMessage('Duplicates Removed: ' + IntToStr(itemCount - itemCountNew)); 83 | end; 84 | if itemCountNew > itemCount then begin 85 | AddMessage('Duplicates Removed: ' + IntToStr(itemCountNew - itemCount)); 86 | end; 87 | if itemCountNew = itemCount then begin 88 | AddMessage('No duplicates found.'); 89 | end; 90 | 91 | end; 92 | 93 | end; 94 | 95 | // Cleanup 96 | function Finalize: integer; 97 | begin 98 | AddMessage('--------------------------------------------------------------------------------'); 99 | 100 | listUnsorted.Free; 101 | listSorted.Free; 102 | 103 | Result := 1; 104 | end; 105 | 106 | end. 107 | -------------------------------------------------------------------------------- /Scripts/Form FURN - Add and edit Alternate Textures.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Add and edit Alternate Textures 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | //============================================================================ 11 | function Initialize: integer; 12 | begin 13 | 14 | end; 15 | 16 | //============================================================================ 17 | function Process(e: IInterface): integer; 18 | var 19 | model, mods: IInterface; 20 | 21 | begin 22 | 23 | model := ElementByName(e, 'Model'); 24 | if not ElementExists(model, 'MODS') then 25 | AddMessage('MODS added'); 26 | Add(model, 'MODS', true); 27 | 28 | if ElementExists(model, 'MODS') then begin 29 | AddMessage('MODS exists'); 30 | mods := ElementBySignature(model, 'MODS'); 31 | ElementAssign(mods, HighInteger, nil, true); 32 | end; 33 | 34 | end; 35 | 36 | function Finalize: integer; 37 | begin 38 | AddMessage(' '); 39 | Result := 1; 40 | exit; 41 | end; 42 | 43 | end. -------------------------------------------------------------------------------- /Scripts/Form FURN - Change FNAM to Ignored By Sandbox.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Change FNAM to Ignored By Sandbox 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | function Process(e: IInterface): integer; 11 | var 12 | rec: IInterface; 13 | 14 | begin 15 | Result := 0; 16 | 17 | rec := Signature(e); 18 | 19 | AddMessage('Processing: ' + FullPath(e)); 20 | SetElementEditValues(e, 'FNAM', '01'); 21 | 22 | end; 23 | 24 | function Finalize: integer; 25 | begin 26 | Result := 1; 27 | end; 28 | 29 | end. 30 | -------------------------------------------------------------------------------- /Scripts/Form FURN - Change to Entry Point to Front.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Change FNPR Entry Points to Front 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | function Process(e: IInterface): integer; 11 | var 12 | rec: IInterface; 13 | 14 | begin 15 | Result := 0; 16 | 17 | rec := Signature(e); 18 | 19 | AddMessage('Processing: ' + FullPath(e)); 20 | SetElementNativeValues(e, 'Marker Entry Points\FNPR\Entry Points', 1); 21 | 22 | end; 23 | 24 | function Finalize: integer; 25 | begin 26 | Result := 1; 27 | end; 28 | 29 | end. 30 | -------------------------------------------------------------------------------- /Scripts/Form FURN - Change to Uses Skill to Alchemy.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Change WBDT Uses Skill to None 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | function Process(e: IInterface): integer; 11 | var 12 | rec: IInterface; 13 | 14 | begin 15 | Result := 0; 16 | 17 | rec := Signature(e); 18 | 19 | AddMessage('Processing: ' + FullPath(e)); 20 | AddMessage('-------------------------------------------------------------------------------'); 21 | AddMessage(' '); 22 | 23 | SetElementEditValues(e, 'WBDT\Uses Skill', 'Alchemy'); 24 | 25 | end; 26 | 27 | function Finalize: integer; 28 | begin 29 | AddMessage(' '); 30 | Result := 1; 31 | end; 32 | 33 | end. 34 | -------------------------------------------------------------------------------- /Scripts/Form FURN - Change to Uses Skill to None.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Change WBDT Uses Skill to None 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | function Process(e: IInterface): integer; 11 | var 12 | rec: IInterface; 13 | 14 | begin 15 | Result := 0; 16 | 17 | rec := Signature(e); 18 | 19 | AddMessage('Processing: ' + FullPath(e)); 20 | AddMessage('-------------------------------------------------------------------------------'); 21 | AddMessage(' '); 22 | 23 | SetElementEditValues(e, 'WBDT\Uses Skill', 'None'); 24 | 25 | end; 26 | 27 | function Finalize: integer; 28 | begin 29 | AddMessage(' '); 30 | Result := 1; 31 | end; 32 | 33 | end. 34 | -------------------------------------------------------------------------------- /Scripts/Form GLOB - Set Value.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Set FLTV value 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | function Process(e: IInterface): integer; 11 | begin 12 | Result := 0; 13 | 14 | if GetElementNativeValues(e, 'FLTV') > 1 then 15 | SetElementNativeValues(e, 'FLTV', 1); 16 | 17 | end; 18 | 19 | function Finalize: integer; 20 | begin 21 | Result := 1; 22 | end; 23 | 24 | end. 25 | -------------------------------------------------------------------------------- /Scripts/Form MGEF, SPEL - Change Master Spells ETYP to EitherHand .pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Make master spells one-handed and dual castable 3 | - MGEF: Remove RitualSpellEffect keyword 4 | - SPEL: Change BothHands to EitherHands 5 | Game: The Elder Scrolls V: Skyrim 6 | Author: fireundubh 7 | Version: 0.1 8 | } 9 | 10 | unit UserScript; 11 | 12 | var 13 | a, b, c: integer; 14 | 15 | function Initialize: integer; 16 | begin 17 | 18 | end; 19 | 20 | function Process(e: IInterface): integer; 21 | var 22 | rec: IInterface; 23 | sPath: string; 24 | 25 | // MGEF 26 | keywords, keyword: IInterface; 27 | sPathKeywords, sPathKeyword, sKeyword: string; 28 | iKeywords: integer; 29 | 30 | // SPEL 31 | sPathName, sPathHands, sPathDualCast, sName, sHands: string; 32 | iDualCast: integer; 33 | 34 | begin 35 | 36 | Result := 0; 37 | 38 | rec := Signature(e); 39 | sPath := Name(e); 40 | 41 | if (rec = 'MGEF') then begin 42 | 43 | // Path Reference 44 | sPathKeywords := 'KWDA - Keywords'; 45 | sPathKeyword := 'KWDA - Keywords\Keyword'; 46 | 47 | // Get keywords as an element to check actual keyword count 48 | keywords := ElementByPath(e, sPathKeywords); 49 | iKeywords := ElementCount(keywords); 50 | 51 | // Update the KSIZ subrecord to the actual keyword count 52 | //SetElementEditValues(e, 'KSIZ - Keyword Count', iKeywords); 53 | 54 | // Remove specific keyword from keywords element 55 | // Note: Indices change when removing, so use downto 56 | for a := iKeywords - 1 downto 0 do begin 57 | 58 | keyword := ElementByIndex(keywords, a); 59 | sKeyword := GetEditValue(keyword); 60 | 61 | if sKeyword = 'RitualSpellEffect [KYWD:000806E1]' then begin 62 | AddMessage('--------------------------------------------------------------------------------'); 63 | AddMessage(sPath); 64 | AddMessage('--------------------------------------------------------------------------------'); 65 | 66 | Remove(keyword); 67 | AddMessage('Removed keyword ' + sKeyword + ' at index ' + IntToStr(a)); 68 | 69 | end; 70 | 71 | end; 72 | 73 | // Update the KSIZ subrecord to the new actual keyword count 74 | iKeywords := ElementCount(keywords); 75 | SetElementEditValues(e, 'KSIZ - Keyword Count', iKeywords); 76 | AddMessage('Updated keyword count to ' + IntToStr(iKeywords) + '...'); 77 | 78 | // If the KSIZ subrecord equals zero, remove the KWDA and KSIZ subrecords 79 | iKeywords := ElementCount(keywords); 80 | if iKeywords = 0 then begin 81 | RemoveElement(e, 'KWDA - Keywords'); 82 | RemoveElement(e, 'KSIZ - Keyword Count'); 83 | AddMessage('Removed KSIZ and KWDA subrecords because keyword count was zero...'); 84 | end; 85 | 86 | AddMessage(' '); 87 | 88 | end; // end condition 89 | 90 | if (rec = 'SPEL') then begin 91 | 92 | // Path References 93 | sPathName := 'FULL - Name'; 94 | sPathHands := 'ETYP - Equipment Type'; 95 | sPathDualCast := 'SPIT - Data\Flags\No Dual Cast Modification'; 96 | 97 | // Variable Substitutions 98 | sName := GetElementEditValues(e, sPathName); 99 | sHands := GetElementEditValues(e, sPathHands); 100 | iDualCast := GetElementNativeValues(e, sPathDualCast); 101 | //AddMessage('No Dual Cast Modification Flag: ' + IntToStr(iDualCast)); 102 | 103 | // Modify Elements 104 | if sHands = 'BothHands [EQUP:00013F45]' then begin 105 | AddMessage('--------------------------------------------------------------------------------'); 106 | AddMessage(sPath); 107 | AddMessage('--------------------------------------------------------------------------------'); 108 | SetElementEditValues(e, sPathHands, 'EitherHand [EQUP:00013F44]'); 109 | AddMessage('+ Equipment Type updated to EitherHand [EQUP:00013F44]'); 110 | if iDualCast = -1 then begin 111 | SetElementNativeValues(e, sPathDualCast, 0); 112 | AddMessage('- Removed No Dual Cast Modification flag'); 113 | end; 114 | AddMessage(' '); 115 | end; 116 | 117 | end; // end condition 118 | 119 | end; // end function 120 | 121 | function Finalize: integer; 122 | begin 123 | 124 | Result := 1; 125 | 126 | end; // end function 127 | 128 | end. // end script -------------------------------------------------------------------------------- /Scripts/Form NPC_ - Add Faction.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: NPC - Add Faction 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | var 11 | sInputFaction: string; 12 | 13 | function Process(e: IInterface): integer; 14 | var 15 | rec, faction, factions, snam, firstsnam: IInterface; 16 | i, iLastIndex, iResults: integer; 17 | sFaction, sFlagUseFactions: string; 18 | bAssigned: boolean; 19 | 20 | begin 21 | Result := 0; 22 | 23 | rec := Signature(e); 24 | 25 | AddMessage(' '); 26 | AddMessage('Processing: ' + FullPath(e)); 27 | AddMessage('---------------------------------------------------------------'); 28 | 29 | if rec <> 'NPC_' then 30 | exit; 31 | 32 | //sInputFaction := 'ForswornFaction "Forsworn Faction" [FACT:00043599]'; 33 | //sInputFaction := 'PenitusOculatusFaction "Penitus Oculatus Faction" [FACT:0002584B]'; 34 | sInputFaction := 'ThalmorFaction "Thalmor" [FACT:00039F26]'; 35 | //sInputFaction := 'VigilantOfStendarrFaction "Vigilant of Stendarr Faction" [FACT:000B3292]'; 36 | //sInputFaction := 'NecromancerFaction [FACT:00034B74]'; 37 | //sInputFaction := 'SilverHandFaction [FACT:000AA0A4]'; 38 | //sInputFaction := 'CWSonsFactionNPC "NPC faction (creates hostility to enemy)" [FACT:0001C9FD]'; 39 | //sInputFaction := 'CWImperialFactionNPC "NPC faction (creates hostility to enemy)" [FACT:0001C9FC]'; 40 | //sInputFaction := 'WerewolfFaction "Werewolf Faction" [FACT:00043594]'; 41 | //sInputFaction := 'VampireFaction [FACT:00027242]'; 42 | 43 | 44 | factions := ElementByName(e, 'Factions'); 45 | sFlagUseFactions := 'ACBS\Template Flags\Use Factions'; 46 | 47 | if Assigned(factions) then begin 48 | AddMessage('Factions exist!'); 49 | 50 | iResults := 0; 51 | for i := 0 to ElementCount(factions) - 1 do begin 52 | snam := ElementByIndex(factions, i); 53 | sFaction := GetEditValue(ElementByIndex(snam, 0)); 54 | 55 | if (sFaction = sInputFaction) then begin 56 | iResults := iResults + 1; 57 | end; 58 | 59 | if iResults > 1 then 60 | AddMessage('There are duplicates of the faction you tried to add in this record.'); 61 | end; 62 | 63 | if iResults = 0 then begin 64 | faction := ElementAssign(factions, HighInteger, nil, true); 65 | factions := ElementByName(e, 'Factions'); 66 | firstsnam := ElementByIndex(factions, 0); 67 | 68 | SetEditValue(ElementByIndex(firstsnam, 0), sInputFaction); 69 | AddMessage('Added new faction!'); 70 | end; 71 | 72 | end; 73 | 74 | if not Assigned(factions) then begin 75 | factions := Add(e, 'Factions', true); 76 | snam := ElementByPath(e, 'Factions\SNAM'); 77 | SetEditValue(ElementByIndex(snam, 0), sInputFaction); 78 | AddMessage('Added new faction!'); 79 | end; 80 | 81 | if (GetElementEditValues(e, sFlagUseFactions) = '1') then 82 | SetElementEditValues(e, sFlagUseFactions, '0'); 83 | 84 | end; 85 | 86 | function Finalize: integer; 87 | begin 88 | AddMessage('---------------------------------------------------------------'); 89 | AddMessage(' '); 90 | Result := 1; 91 | end; 92 | 93 | end. 94 | -------------------------------------------------------------------------------- /Scripts/Form NPC_ - Add Flag (Use Def Pack List).pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Make NPCs Protected 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | var 11 | a, b, c: integer; 12 | 13 | // Called before processing 14 | function Initialize: integer; 15 | begin 16 | 17 | end; 18 | 19 | // Processing 20 | function Process(e: IInterface): integer; 21 | var 22 | rec: IInterface; 23 | sPath, sPathFlags: string; 24 | 25 | begin 26 | 27 | Result := 0; 28 | 29 | rec := Signature(e); 30 | sPath := Name(e); 31 | 32 | if (rec = 'NPC_') then begin 33 | 34 | sPathFlags := 'ACBS\Template Flags'; 35 | 36 | SetElementNativeValues(e, sPathFlags, GetElementNativeValues(e, sPathFlags) or 1024); 37 | AddMessage(sPath + ' now flagged something'); 38 | 39 | end; // end condition 40 | 41 | end; // end function 42 | 43 | // Cleanup 44 | function Finalize: integer; 45 | begin 46 | 47 | Result := 1; 48 | 49 | end; // end function 50 | 51 | end. // end script 52 | -------------------------------------------------------------------------------- /Scripts/Form NPC_ - Add Package.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: NPC - Add Package 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | var 11 | sInputFaction: string; 12 | 13 | function Process(e: IInterface): integer; 14 | var 15 | rec, package, packages, lastpackage: IInterface; 16 | i, iPackages, iLastIndex, iResults: integer; 17 | sPackage, sInput: string; 18 | bAssigned: boolean; 19 | 20 | begin 21 | Result := 0; 22 | 23 | rec := Signature(e); 24 | 25 | AddMessage(' '); 26 | AddMessage('Processing: ' + FullPath(e)); 27 | AddMessage('---------------------------------------------------------------'); 28 | 29 | if rec <> 'NPC_' then 30 | exit; 31 | 32 | sInput := 'dubhGuardArrestPackage [PACK:020244C6]'; 33 | 34 | packages := ElementByName(e, 'Packages'); 35 | 36 | if Assigned(packages) then begin 37 | AddMessage('Packages exist!'); 38 | 39 | iPackages := ElementCount(packages) - 1; 40 | 41 | iResults := 0; 42 | for i := 0 to iPackages do begin 43 | 44 | package := ElementByIndex(packages, i); 45 | sPackage := GetEditValue(package); 46 | 47 | if (sPackage = sInput) then begin 48 | iResults := iResults + 1; 49 | end; 50 | 51 | if iResults > 1 then 52 | AddMessage('There are duplicates of the package you tried to add in this record.'); 53 | end; 54 | 55 | if iResults = 0 then begin 56 | package := ElementAssign(packages, HighInteger, nil, true); 57 | 58 | packages := ElementByName(e, 'Packages'); 59 | iPackages := ElementCount(packages) - 1; 60 | lastpackage := ElementByIndex(packages, iPackages); 61 | 62 | SetEditValue(lastpackage, sInput); 63 | AddMessage('Added new package!'); 64 | end; 65 | 66 | end; 67 | 68 | if not Assigned(packages) then begin 69 | packages := Add(e, 'Packages', true); 70 | package := ElementByPath(e, 'Packages\PKID'); 71 | SetEditValue(package, sInput); 72 | AddMessage('Added new package!'); 73 | end; 74 | 75 | end; 76 | 77 | function Finalize: integer; 78 | begin 79 | AddMessage('---------------------------------------------------------------'); 80 | AddMessage(' '); 81 | Result := 1; 82 | end; 83 | 84 | end. 85 | -------------------------------------------------------------------------------- /Scripts/Form NPC_ - Change CNAM to CombatWarrior1H.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Change NPC Class to CombatWarrior1H 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | function Process(e: IInterface): integer; 11 | begin 12 | Result := 0; 13 | 14 | AddMessage('Processing: ' + FullPath(e)); 15 | 16 | //SetElementEditValues(e, 'CNAM', 'CombatRanger "Ranger" [CLAS:00013181]'); 17 | //SetElementEditValues(e, 'CNAM', 'CombatWarrior1H "Warrior" [CLAS:00013176]'); 18 | //SetElementEditValues(e, 'CNAM', 'CombatWarrior2H "Warrior" [CLAS:0001CE15]'); 19 | SetElementEditValues(e, 'CNAM', 'GuardImperial "Guard" [CLAS:000253F2]'); 20 | //SetElementEditValues(e, 'CNAM', 'GuardSonsSkyrim "Guard" [CLAS:000253F3]'); 21 | 22 | end; 23 | 24 | function Finalize: integer; 25 | begin 26 | Result := 1; 27 | end; 28 | 29 | end. 30 | -------------------------------------------------------------------------------- /Scripts/Form NPC_ - Change RNAM to DefaultRace.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Change NPC_ to DefaultRace 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | function Process(e: IInterface): integer; 11 | begin 12 | Result := 0; 13 | 14 | // comment this out if you don't want those messages 15 | AddMessage('Processing: ' + FullPath(e)); 16 | 17 | // processing code goes here 18 | //SetElementEditValues(e, 'RNAM', 'DefaultRace "Default Race" [RACE:00000019]'); 19 | //SetElementEditValues(e, 'RNAM', 'ImperialRace "Imperial" [RACE:00013744]'); 20 | //SetElementEditValues(e, 'RNAM', 'NordRace "Nord" [RACE:00013746]'); 21 | //SetElementEditValues(e, 'RNAM', 'BretonRace "Breton" [RACE:00013741]'); 22 | SetElementEditValues(e, 'RNAM', 'HighElfRace "High Elf" [RACE:00013743]'); 23 | 24 | end; 25 | 26 | function Finalize: integer; 27 | begin 28 | Result := 1; 29 | end; 30 | 31 | end. 32 | -------------------------------------------------------------------------------- /Scripts/Form NPC_ - Update AIDT.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Update AIDT 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | function Process(e: IInterface): integer; 11 | begin 12 | Result := 0; 13 | 14 | // comment this out if you don't want those messages 15 | AddMessage('Processing: ' + FullPath(e)); 16 | 17 | // processing code goes here 18 | SetElementEditValues(e, 'AIDT\Aggression', 'Aggressive'); 19 | //SetElementEditValues(e, 'AIDT\Confidence', 'Average'); 20 | SetElementEditValues(e, 'AIDT\Confidence', 'Brave'); 21 | SetElementEditValues(e, 'AIDT\Responsibility', 'No crime'); 22 | SetElementEditValues(e, 'AIDT\Assistance', 'Helps Friends and Allies'); 23 | 24 | end; 25 | 26 | function Finalize: integer; 27 | begin 28 | Result := 1; 29 | end; 30 | 31 | end. 32 | -------------------------------------------------------------------------------- /Scripts/Form NPC_ - Update Aggro Behavior.pas: -------------------------------------------------------------------------------- 1 | { 2 | This is where you should describe your script and add any general notes. 3 | } 4 | 5 | unit UserScript; 6 | 7 | var 8 | // you set global script variables here 9 | 10 | // this runs once when you apply the script 11 | // best used for creating TStringLists, dialog prompts, etc. 12 | function Initialize: integer; 13 | var 14 | // you set local function variables here 15 | 16 | begin 17 | 18 | Result := 0; 19 | 20 | // i like to do this because it makes reading the messages window easier 21 | AddMessage('-------------------------------------------------------------------------------'); 22 | 23 | end; 24 | 25 | // this is usually where all operations go 26 | function Process(e: IInterface): integer; 27 | var 28 | // you set local function variables here 29 | formid, pathAggro1, pathAggro2, pathAggro3, pathAggro4, pathAggro5: string; 30 | 31 | begin 32 | 33 | Result := 0; 34 | 35 | // this prints the full path to the record you're editing 36 | // example: Processing: \ [01] test.esp \ [1] GRUP Top "NPC_" \ [0] BolgeirBearclaw "Bolgeir Bearclaw" [NPC_:00013264] 37 | AddMessage('Processing: ' + FullPath(e)); 38 | 39 | // this turns the record's formid into an 8-digit string 40 | // example: 00013264 41 | formid := IntToHex(FixedFormID(e), 8); 42 | 43 | // these string variables contain the paths to the data you want to change 44 | pathAggro1 := 'AIDT\Aggro\Aggro Radius Behavior'; 45 | pathAggro2 := 'AIDT\Aggro\Unknown'; 46 | pathAggro3 := 'AIDT\Aggro\Warn'; 47 | pathAggro4 := 'AIDT\Aggro\Warn/Attack'; 48 | pathAggro5 := 'AIDT\Aggro\Attack'; 49 | 50 | // use edit for strings and native for numbers 51 | // other operations can be found here: http://www.creationkit.com/TES5Edit_Scripting_Functions 52 | SetElementEditValues(e, pathAggro1, 'True'); 53 | SetElementNativeValues(e, pathAggro2, 0); 54 | SetElementNativeValues(e, pathAggro3, 0); 55 | SetElementNativeValues(e, pathAggro4, 0); 56 | SetElementNativeValues(e, pathAggro5, 0); 57 | 58 | // these print strings to the Messages window 59 | // tip: anything you want to print must be a string or turned into one 60 | // tip: you can use the tab if you want to copy and paste into Excel 61 | AddMessage(formid + ' : Aggro Radius Behavior was changed to ' + GetElementEditValues(e, pathAggro1)); 62 | AddMessage(formid + ' : Aggro Unknown was changed to ' + GetElementEditValues(e, pathAggro2)); 63 | AddMessage(formid + ' : Aggro Warn was changed to ' + GetElementEditValues(e, pathAggro3)); 64 | AddMessage(formid + ' : Aggro Warn/Attack was changed to ' + GetElementEditValues(e, pathAggro4)); 65 | AddMessage(formid + ' : Aggro Attack was changed to ' + GetElementEditValues(e, pathAggro5)); 66 | 67 | end; 68 | 69 | // this runs after Process() 70 | function Finalize: integer; 71 | var 72 | // you set local function variables here 73 | 74 | begin 75 | 76 | // i like to do this because it makes reading the messages window easier 77 | AddMessage('-------------------------------------------------------------------------------'); 78 | 79 | // any time Result = 1, the script terminates 80 | // the script will terminate after Finalize anyway 81 | Result := 1; 82 | 83 | end; 84 | 85 | end. 86 | -------------------------------------------------------------------------------- /Scripts/Form NPC_ - Update DOBJ.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: NPC - Update DOBJ 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | var 11 | sInput: string; 12 | 13 | function Initialize: integer; 14 | begin 15 | Result := 0; 16 | 17 | sInput := 'GuardOutfitRift [OTFT:00047382]'; 18 | 19 | AddMessage('Form ID' + ' ' + 'Name' + ' ' + 'Editor ID' + ' ' + 'Outfit'); 20 | end; 21 | 22 | function Process(e: IInterface): integer; 23 | var 24 | rec: IInterface; 25 | sFormID, sName, sEditorID, sOutfit: string; 26 | begin 27 | Result := 0; 28 | 29 | sFormID := IntToHex(FormID(e),8); 30 | sName := GetEditValue(ElementByPath(e, 'FULL')); 31 | sEditorID := GetEditValue(ElementByPath(e, 'EDID')); 32 | sOutfit := GetEditValue(ElementByPath(e, 'DOFT')); 33 | if sOutfit = '' then begin 34 | SetElementEditValues(e, 'DOFT', sInput); 35 | end; 36 | AddMessage(sFormID + ' ' + sName + ' ' + sEditorID + ' ' + sOutfit); 37 | end; 38 | 39 | function Finalize: integer; 40 | begin 41 | Result := 0; 42 | end; 43 | 44 | end. 45 | -------------------------------------------------------------------------------- /Scripts/Form NPC_ - Update Level Mult and Calc Max Level.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Make NPC Level with Player 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | var 11 | a, b, c: integer; 12 | //fMult: float; 13 | 14 | // Called before processing 15 | function Initialize: integer; 16 | begin 17 | 18 | //fMult := (InputBox('Set Multiplier', 'Mult:', 1.5)); 19 | 20 | end; 21 | 22 | function Process(e: IInterface): integer; 23 | var 24 | rec: IInterface; 25 | sPath, sPathLevelMult, sPathMaxLevel: string; 26 | iLevelMult, iMaxLevel: integer; 27 | 28 | begin 29 | 30 | Result := 0; 31 | 32 | rec := Signature(e); 33 | sPath := Name(e); 34 | 35 | if (rec = 'NPC_') then begin 36 | 37 | sPathLevelMult := 'ACBS\Level Mult'; 38 | sPathMaxLevel := 'ACBS\Calc max level'; 39 | 40 | iLevelMult := GetElementNativeValues(e, sPathLevelMult); 41 | if iLevelMult <> 1.0 then begin 42 | SetElementNativeValues(e, sPathLevelMult, 1.0); 43 | AddMessage(sPath + ' now matches the level of the player'); 44 | end; 45 | 46 | iMaxLevel := GetElementNativeValues(e, sPathMaxLevel); 47 | if iMaxLevel <> 80 then begin 48 | SetElementNativeValues(e, sPathMaxLevel, 80); 49 | AddMessage(sPath + ' now can reach Level 80'); 50 | end; 51 | 52 | end; // end condition 53 | 54 | end; // end function 55 | 56 | // Cleanup 57 | function Finalize: integer; 58 | begin 59 | 60 | Result := 1; 61 | 62 | end; // end function 63 | 64 | end. // end script -------------------------------------------------------------------------------- /Scripts/Form OTFT - List Outfit Items.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: OTFT - List INAM Items 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | function Initialize: integer; 11 | begin 12 | Result := 0; 13 | end; 14 | 15 | function Process(e: IInterface): integer; 16 | var 17 | rec, list, ref, item: IInterface; 18 | formid, edid, full, itemid: string; 19 | i: integer; 20 | begin 21 | Result := 0; 22 | 23 | list := ElementByName(e, 'INAM - Items'); 24 | 25 | AddMessage('-------------------------------------------------------------------------------'); 26 | 27 | for i := 0 to ElementCount(list) - 1 do begin 28 | item := ElementByIndex(list, i); 29 | ref := LinksTo(item); 30 | formid := IntToHex(FixedFormID(ref), 8); 31 | edid := GetElementEditValues(ref, 'EDID'); 32 | full := GetElementEditValues(ref, 'FULL'); 33 | itemid := GetEditValue(item); 34 | 35 | AddMessage(itemid); 36 | end; 37 | 38 | AddMessage('-------------------------------------------------------------------------------'); 39 | 40 | end; 41 | 42 | function Finalize: integer; 43 | begin 44 | Result := 1; 45 | end; 46 | 47 | end. 48 | -------------------------------------------------------------------------------- /Scripts/Form PROJ - Change Speed.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Change CNAM to Bone Meal 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | function Process(e: IInterface): integer; 11 | begin 12 | Result := 0; 13 | 14 | // comment this out if you don't want those messages 15 | AddMessage('Processing: ' + FullPath(e)); 16 | 17 | // processing code goes here 18 | SetElementEditValues(e, 'DATA\Gravity', '0.2'); 19 | SetElementEditValues(e, 'DATA\Speed', '7200'); 20 | 21 | end; 22 | 23 | function Finalize: integer; 24 | begin 25 | Result := 1; 26 | end; 27 | 28 | end. 29 | -------------------------------------------------------------------------------- /Scripts/Form RACE - List Health Regen Rates.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Change CNAM to Bone Meal 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | function Process(e: IInterface): integer; 11 | var 12 | kwda: IInterface; 13 | full, keyword: string; 14 | hpregen: float; 15 | i: integer; 16 | begin 17 | Result := 0; 18 | 19 | full := GetElementEditValues(e, 'FULL'); 20 | hpregen := GetElementEditValues(e, 'DATA\Health Regen'); 21 | 22 | kwda := ElementBySignature(e, 'KWDA'); 23 | for i := 0 to ElementCount(kwda) - 1 do begin 24 | keyword := lowercase(GetEditValue(ElementByIndex(kwda, i))); 25 | if pos('animal', keyword) > 0 then begin 26 | AddMessage(full + ' ' + IntToStr(hpregen)); 27 | end; 28 | end; 29 | 30 | end; 31 | 32 | function Finalize: integer; 33 | begin 34 | Result := 1; 35 | end; 36 | 37 | end. 38 | -------------------------------------------------------------------------------- /Scripts/Form RACE - Renumber TIRS subrecords.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Renumber TIRS subrecords in RACE records 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | var 11 | 12 | i, j, k, l, m, n, o, p: integer; 13 | lPresets: TStringList; 14 | bGender: boolean; 15 | sGender: string; 16 | 17 | // Called before processing 18 | function Initialize: integer; 19 | begin 20 | 21 | lPresets := TStringList.Create; 22 | 23 | bGender := (MessageDlg('Male (YES) or Female (NO)?', mtConfirmation, [mbYes, mbNo], 0) = mrYes); 24 | if bGender = TRUE then begin 25 | sGender := 'Male'; 26 | end; 27 | if bGender = FALSE then begin 28 | sGender := 'Female'; 29 | end; 30 | 31 | end; 32 | 33 | function Process(e: IInterface): integer; 34 | var 35 | 36 | rec, assets, preset, presets: IInterface; 37 | sPath, sAssets, sPresets: string; 38 | iAssets, iStart: integer; 39 | fProgress: extended; 40 | runOnce: boolean; 41 | 42 | begin 43 | 44 | Result := 0; 45 | 46 | rec := Signature(e); 47 | sPath := FullPath(e); 48 | 49 | AddMessage('------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------'); 50 | AddMessage('Processing: ' + sPath); 51 | AddMessage('------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------'); 52 | AddMessage(' '); 53 | 54 | if (rec = 'RACE') then begin 55 | 56 | sAssets := 'Head Data\' + sGender + ' Head Data\Tint Masks'; 57 | 58 | // Count number of Tint Assets 59 | iAssets := ElementCount(ElementByPath(e, sAssets)); 60 | //AddMessage('Found ' + IntToStr(iAssets) + ' Tint Assets...'); 61 | 62 | // Initialize the runOnce variable 63 | runOnce := false; 64 | 65 | // Loop through Tint Assets collections 66 | for i := 0 to iAssets - 1 do begin 67 | 68 | // Get each Tint Assets collection as an element 69 | assets := ElementByIndex(ElementByPath(e, sAssets), i); 70 | 71 | // Get the number of assets in each collection 72 | j := ElementCount(assets); 73 | //AddMessage('Found ' + IntToStr(j) + ' Tint Layer/Presets pairs...'); 74 | 75 | for k := 0 to j - 2 do begin 76 | 77 | // Get each Presets collection 78 | presets := ElementByIndex(assets, 1); // 0: Tint Layer, 1: Presets 79 | 80 | // Get the number of presets in each collection 81 | l := ElementCount(presets); 82 | //AddMessage('Found ' + IntToStr(l) + ' Presets...'); 83 | AddMessage('------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------'); 84 | AddMessage(FullPath(presets)); 85 | AddMessage('------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------'); 86 | 87 | for m := 0 to l - 1 do begin 88 | 89 | // Sets fProgress for use in showing progress as a percentage 90 | fProgress := ((m / (l - 1)) * 100); 91 | 92 | // Get each Preset as an element 93 | preset := ElementByIndex(presets, m); // m is the index of each Preset 94 | 95 | // Initially, get the value of the first TIRS subrecord 96 | if runOnce = false then begin 97 | 98 | n := GetNativeValue(ElementByIndex(preset, 2)); 99 | 100 | // Terminate if the first TIRS subrecord has a zero value 101 | // TODO: Ask for user input instead 102 | if n < 1 then begin 103 | 104 | AddMessage('Error: The first TIRS subrecord must have a value greater than 0.'); 105 | Exit; 106 | 107 | end; 108 | 109 | end; 110 | 111 | // After the first TIRS subrecord is updated, update the remaining TIRS subrecords 112 | // NOTE: Due to variable reuse, order is intentional! 113 | if runOnce = true then begin 114 | 115 | o := o + 1; 116 | SetNativeValue(ElementByIndex(preset, 2), o); 117 | 118 | AddMessage('Updated: ' + FullPath(preset) + ' \ [2] TIRS = ' + IntToStr(o) + ' (Progress: ' + FormatFloat('0.00', fProgress) + '%)'); 119 | 120 | end; 121 | 122 | // Initially, update the first TIRS subrecord 123 | if runOnce = false and n <> 0 then begin 124 | 125 | lPresets.Add(n); 126 | o := lPresets[0]; 127 | SetNativeValue(ElementByIndex(preset, 2), o); 128 | 129 | AddMessage('Updated: ' + FullPath(preset) + ' \ [2] TIRS = ' + IntToStr(o) + ' (Progress: ' + FormatFloat('0.00', fProgress) + '%)'); 130 | runOnce := true; 131 | 132 | end; 133 | 134 | end; // end loop through individual presets 135 | 136 | end; // end loop through individual assets 137 | 138 | end; // end loop through tint asset collections 139 | 140 | end; // end condition 141 | 142 | end; // end function 143 | 144 | // Cleanup 145 | function Finalize: integer; 146 | begin 147 | 148 | AddMessage('------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------'); 149 | AddMessage('IMPORTANT! REMEMBER TO APPLY THE SCRIPT TO THE OTHER GENDER IF YOU HAVEN''T ALREADY!'); 150 | AddMessage('------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------'); 151 | 152 | lPresets.Clear; 153 | lPresets.Free; 154 | 155 | Result := 1; 156 | 157 | end; // end function 158 | 159 | end. // end script -------------------------------------------------------------------------------- /Scripts/Form REFR - Change Lock Level.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Reference - Change Lock Level 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | var 11 | slResults: TStringList; 12 | sQuery: string; 13 | 14 | function Initialize: integer; 15 | begin 16 | 17 | Result := 0; 18 | 19 | slResults := TStringList.Create; 20 | slResults.Sorted := True; 21 | slResults.Duplicates := dupIgnore; 22 | 23 | if not InputQuery('Enter', 'Lock Level:', sQuery) then begin 24 | Result := 1; 25 | exit; 26 | end; // end if 27 | 28 | if sQuery = '' then begin 29 | Result := 1; 30 | exit; 31 | end; // end if 32 | 33 | AddMessage('-------------------------------------------------------------------------------'); 34 | 35 | end; // end begin 36 | 37 | function Process(e: IInterface): integer; 38 | var 39 | FORMID, NAME, GROUP, LOCKLEVEL, KEY: IInterface; 40 | sFormID, sName, sGroupFormID, sGroupEditorID, sGroupName: string; 41 | sPosX, sPosY, sPosZ, sRotX, sRotY, sRotZ: string; 42 | s: string; 43 | runOnce: integer; 44 | 45 | begin 46 | Result := 0; 47 | 48 | s := Signature(e); 49 | 50 | if (s <> 'ACHR') and (s <> 'REFR') then 51 | exit; 52 | 53 | if not (ElementExists(e, 'XLOC - Lock Data')) then 54 | exit; 55 | 56 | FORMID := FixedFormID(e); 57 | LOCKLEVEL := ElementByPath(e, 'XLOC - Lock Data\Level'); 58 | KEY := ElementByPath(e, 'XLOC - Lock Data\Key'); 59 | 60 | if not (ElementExists(e, 'XLOC - Lock Data\Key')) or (pos('NULL', GetEditValue(KEY)) > 0) then begin 61 | SetEditValue(LOCKLEVEL, sQuery); 62 | AddMessage('Modified: ' + IntToHex(FORMID, 8) + ' ' + GetEditValue(LOCKLEVEL)); 63 | end; 64 | 65 | end; 66 | 67 | function Finalize: integer; 68 | begin 69 | AddMessage('-------------------------------------------------------------------------------'); 70 | Result := 1; 71 | end; 72 | 73 | end. 74 | -------------------------------------------------------------------------------- /Scripts/Form REFR - Count Doors.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Count Doors 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.2 6 | } 7 | 8 | unit UserScript; 9 | 10 | var 11 | i: integer; 12 | 13 | function GetElement(x: IInterface; s: string): IInterface; 14 | begin 15 | if (pos('[', s) > 0) then 16 | Result := ElementByIP(x, s) 17 | else if (pos('\', s) > 0) then 18 | Result := ElementByPath(x, s) 19 | else if (s = Uppercase(s)) then 20 | Result := ElementBySignature(x, s) 21 | else 22 | Result := ElementByName(x, s); 23 | end; 24 | 25 | function Initialize: integer; 26 | begin 27 | i := 0; 28 | end; 29 | 30 | function Process(e: IInterface): integer; 31 | var 32 | r, xt: IInterface; 33 | rn: string; 34 | begin 35 | if Signature(e) = 'REFR' then begin 36 | if IsMaster(e) then begin 37 | r := GetElement(e, 'NAME'); 38 | rn := GetEditValue(r); 39 | 40 | if pos('DOOR:', rn) > 0 then begin 41 | xt := GetElement(e, 'XTEL'); 42 | if Assigned(GetElement(xt, 'Door')) then 43 | i := i + 1; 44 | end; 45 | end; 46 | end; 47 | end; 48 | 49 | function Finalize: integer; 50 | begin 51 | AddMessage('Found ' + IntToStr(i) + ' doors.'); 52 | end; 53 | 54 | end. 55 | -------------------------------------------------------------------------------- /Scripts/Form REFR - Delete Reference with Keyword in Name.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Copy, Edit, and Flag References (Dynamic Torches) 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | 7 | Instructions: 8 | 1. Add origin references to slReferences (e.g., MSTT.) 9 | 2. Add destination references to SetElementEditValues (e.g, ACTI.) 10 | 3. Change the load order to the destination file. (Line 53) 11 | 4. Apply Script on Cell or Worldspace. 12 | } 13 | 14 | unit UserScript; 15 | 16 | var 17 | slResults: TStringList; 18 | sQuery: string; 19 | 20 | function Initialize: integer; 21 | begin 22 | 23 | Result := 0; 24 | 25 | slResults := TStringList.Create; 26 | slResults.Sorted := True; 27 | slResults.Duplicates := dupIgnore; 28 | 29 | if not InputQuery('Enter', 'Search Query:', sQuery) then begin 30 | Result := 1; 31 | exit; 32 | end; // end if 33 | 34 | if sQuery = '' then begin 35 | Result := 1; 36 | exit; 37 | end; // end if 38 | 39 | AddMessage('-------------------------------------------------------------------------------'); 40 | 41 | end; // end begin 42 | 43 | function Process(e: IInterface): integer; 44 | var 45 | FORMID, NAME, GROUP: IInterface; 46 | sFormID, sName, sGroupFormID, sGroupEditorID, sGroupName: string; 47 | sPosX, sPosY, sPosZ, sRotX, sRotY, sRotZ: string; 48 | s: string; 49 | runOnce: integer; 50 | 51 | begin 52 | Result := 0; 53 | 54 | s := Signature(e); 55 | 56 | if (s <> 'ACHR') and (s <> 'REFR') then 57 | exit; 58 | 59 | FORMID := FixedFormID(e); 60 | NAME := ElementByPath(e, 'NAME - Base'); 61 | 62 | sFormID := IntToHex(FORMID, 8); 63 | sName := GetEditValue(NAME); 64 | 65 | if pos(lowercase(sQuery), lowercase(sName)) > 0 then begin 66 | AddMessage('Removed: ' + sFormID + ' ' + sName); 67 | RemoveNode(e); 68 | end; 69 | 70 | end; 71 | 72 | function Finalize: integer; 73 | begin 74 | AddMessage('-------------------------------------------------------------------------------'); 75 | Result := 1; 76 | end; 77 | 78 | end. 79 | -------------------------------------------------------------------------------- /Scripts/Form REFR - Disable and Position with Keyword in EDID.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Disable and Position with Keyword in EDID 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | var 11 | slResults: TStringList; 12 | sQuery: string; 13 | 14 | function Initialize: integer; 15 | begin 16 | 17 | Result := 0; 18 | 19 | slResults := TStringList.Create; 20 | slResults.Sorted := True; 21 | slResults.Duplicates := dupIgnore; 22 | 23 | if not InputQuery('Enter', 'Search Query:', sQuery) then begin 24 | Result := 1; 25 | exit; 26 | end; // end if 27 | 28 | if sQuery = '' then begin 29 | Result := 1; 30 | exit; 31 | end; // end if 32 | 33 | AddMessage('-------------------------------------------------------------------------------'); 34 | 35 | end; // end begin 36 | 37 | function Process(e: IInterface): integer; 38 | var 39 | FORMID, NAME, GROUP, xesp: IInterface; 40 | sFormID, sName, sGroupFormID, sGroupEditorID, sGroupName: string; 41 | sPosX, sPosY, sPosZ, sRotX, sRotY, sRotZ: string; 42 | s: string; 43 | runOnce: integer; 44 | 45 | begin 46 | Result := 0; 47 | 48 | s := Signature(e); 49 | 50 | if (s <> 'ACHR') or (s <> 'REFR') then 51 | exit; 52 | 53 | FORMID := FixedFormID(e); 54 | NAME := ElementByPath(e, 'EDID - Editor ID'); 55 | 56 | sFormID := IntToHex(FORMID, 8); 57 | sName := GetEditValue(NAME); 58 | 59 | if pos(lowercase(sQuery), lowercase(sName)) > 0 then begin 60 | SetElementNativeValues(e, 'DATA\Position\Z', -30000); 61 | RemoveElement(e, 'Enable Parent'); 62 | RemoveElement(e, 'XTEL'); 63 | SetIsInitiallyDisabled(e, true); 64 | xesp := Add(e, 'XESP', true); 65 | if Assigned(xesp) then begin 66 | SetElementNativeValues(xesp, 'Reference', $14); // Player ref 67 | SetElementNativeValues(xesp, 'Flags', 1); // opposite of parent flag 68 | end; 69 | //SetElementNativeValues(e, 'Record Header\Record Flags', GetElementNativeValues(e, 'Record Header\Record Flags') or 2048); // Flag: InitiallyDisabled 70 | 71 | end; 72 | 73 | end; 74 | 75 | function Finalize: integer; 76 | begin 77 | AddMessage('-------------------------------------------------------------------------------'); 78 | Result := 1; 79 | end; 80 | 81 | end. 82 | -------------------------------------------------------------------------------- /Scripts/Form REFR - Disable and Position with Keyword in Name.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Disable and Position with Keyword in Name 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | var 11 | slResults: TStringList; 12 | sQuery: string; 13 | 14 | function Initialize: integer; 15 | begin 16 | 17 | Result := 0; 18 | 19 | slResults := TStringList.Create; 20 | slResults.Sorted := True; 21 | slResults.Duplicates := dupIgnore; 22 | 23 | if not InputQuery('Enter', 'Search Query:', sQuery) then begin 24 | Result := 1; 25 | exit; 26 | end; // end if 27 | 28 | if sQuery = '' then begin 29 | Result := 1; 30 | exit; 31 | end; // end if 32 | 33 | AddMessage('-------------------------------------------------------------------------------'); 34 | 35 | end; // end begin 36 | 37 | function Process(e: IInterface): integer; 38 | var 39 | FORMID, NAME, GROUP, xesp: IInterface; 40 | sFormID, sName, sGroupFormID, sGroupEditorID, sGroupName: string; 41 | sPosX, sPosY, sPosZ, sRotX, sRotY, sRotZ: string; 42 | s: string; 43 | runOnce: integer; 44 | 45 | begin 46 | Result := 0; 47 | 48 | s := Signature(e); 49 | 50 | //if (s <> 'ACHR') or (s <> 'REFR') then 51 | // exit; 52 | 53 | FORMID := FixedFormID(e); 54 | NAME := ElementByPath(e, 'NAME - Base'); 55 | 56 | sFormID := IntToHex(FORMID, 8); 57 | sName := GetEditValue(NAME); 58 | 59 | if pos(lowercase(sQuery), lowercase(sName)) > 0 then begin 60 | SetElementNativeValues(e, 'DATA\Position\Z', -30000); 61 | RemoveElement(e, 'Enable Parent'); 62 | RemoveElement(e, 'XTEL'); 63 | SetIsInitiallyDisabled(e, true); 64 | xesp := Add(e, 'XESP', true); 65 | if Assigned(xesp) then begin 66 | SetElementNativeValues(xesp, 'Reference', $14); // Player ref 67 | SetElementNativeValues(xesp, 'Flags', 1); // opposite of parent flag 68 | end; 69 | //SetElementNativeValues(e, 'Record Header\Record Flags', GetElementNativeValues(e, 'Record Header\Record Flags') or 2048); // Flag: InitiallyDisabled 70 | 71 | end; 72 | 73 | end; 74 | 75 | function Finalize: integer; 76 | begin 77 | AddMessage('-------------------------------------------------------------------------------'); 78 | Result := 1; 79 | end; 80 | 81 | end. 82 | -------------------------------------------------------------------------------- /Scripts/Form SPEL - List Base Effects.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: List spell base effects 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | var 11 | a, b, c: integer; 12 | lBaseEffects: TStringList; 13 | 14 | function Initialize: integer; 15 | begin 16 | 17 | lBaseEffects := TStringList.Create; 18 | lBaseEffects.Sorted := True; 19 | lBaseEffects.Duplicates := dupIgnore; 20 | 21 | end; 22 | 23 | function Process(e: IInterface): integer; 24 | var 25 | rec: IInterface; 26 | sPath: string; 27 | 28 | // MGEF 29 | effects, effect, base: IInterface; 30 | sPathEffects, sBase: string; 31 | iEffects, iEffect: integer; 32 | 33 | begin 34 | 35 | Result := 0; 36 | 37 | rec := Signature(e); 38 | sPath := Name(e); 39 | 40 | if (rec = 'SPEL') then begin 41 | 42 | effects := ElementByPath(e, 'Effects'); 43 | iEffects := ElementCount(effects); 44 | 45 | for a := 0 to iEffects - 1 do begin 46 | 47 | effect := ElementByIndex(effects, a); 48 | 49 | iEffect := ElementCount(effect); 50 | 51 | for b := 0 to iEffect - 1 do begin 52 | 53 | base := ElementByIndex(effect, b); 54 | sBase := GetEditValue(base); 55 | 56 | lBaseEffects.Add(sBase); 57 | 58 | end; 59 | 60 | end; 61 | 62 | end; // end condition 63 | 64 | end; // end function 65 | 66 | function Finalize: integer; 67 | begin 68 | 69 | lBaseEffects.Sort; 70 | 71 | for c := 0 to lBaseEffects.Count - 1 do begin 72 | 73 | AddMessage(lBaseEffects[c]); 74 | 75 | end; 76 | 77 | lBaseEffects.Clear; 78 | 79 | Result := 1; 80 | 81 | end; // end function 82 | 83 | end. // end script -------------------------------------------------------------------------------- /Scripts/Increase H-M-S in NPC Records.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Increase H-M-S in NPC_ records 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | var 11 | a, b, c: integer; 12 | fMult: float; 13 | 14 | // Called before processing 15 | function Initialize: integer; 16 | begin 17 | 18 | fMult := (InputBox('Set Multiplier', 'Mult:', 1.5)); 19 | 20 | end; 21 | 22 | function Process(e: IInterface): integer; 23 | var 24 | rec: IInterface; 25 | sPath, sPathHealth, sPathMagicka, sPathStamina: string; 26 | iHealth, iMagicka, iStamina, iHealthNew, iMagickaNew, iStaminaNew: integer; 27 | 28 | begin 29 | 30 | Result := 0; 31 | 32 | rec := Signature(e); 33 | sPath := Name(e); 34 | 35 | AddMessage('--------------------------------------------------------------------------------'); 36 | AddMessage(sPath); 37 | AddMessage('--------------------------------------------------------------------------------'); 38 | 39 | if (rec = 'NPC_') then begin 40 | 41 | sPathHealth := 'DNAM - Player Skills\Health'; 42 | sPathMagicka := 'DNAM - Player Skills\Magicka'; 43 | sPathStamina := 'DNAM - Player Skills\Stamina'; 44 | 45 | iHealth := GetElementNativeValues(e, sPathHealth); 46 | iMagicka := GetElementNativeValues(e, sPathMagicka); 47 | iStamina := GetElementNativeValues(e, sPathStamina); 48 | 49 | AddMessage('[list]'); 50 | if iHealth > 0 then begin 51 | iHealthNew := iHealth * fMult; 52 | SetElementNativeValues(e, sPathHealth, iHealthNew); 53 | AddMessage('[*] Health increased from ' + IntToStr(iHealth) + ' to ' + IntToStr(iHealthNew)); 54 | end; 55 | 56 | if iMagicka > 0 then begin 57 | iMagickaNew := iMagicka * fMult; 58 | SetElementNativeValues(e, sPathMagicka, iMagickaNew); 59 | AddMessage('[*] Magicka increased from ' + IntToStr(iMagicka) + ' to ' + IntToStr(iMagickaNew)); 60 | end; 61 | 62 | if iStamina > 0 then begin 63 | iStaminaNew := iStamina * fMult; 64 | SetElementNativeValues(e, sPathStamina, iStaminaNew); 65 | AddMessage('[*] Stamina increased from ' + IntToStr(iStamina) + ' to ' + IntToStr(iStaminaNew)); 66 | end; 67 | 68 | AddMessage('[/list]'); 69 | AddMessage(' '); 70 | 71 | end; // end condition 72 | 73 | end; // end function 74 | 75 | // Cleanup 76 | function Finalize: integer; 77 | begin 78 | 79 | Result := 1; 80 | 81 | end; // end function 82 | 83 | end. // end script -------------------------------------------------------------------------------- /Scripts/Keyword Search - Dialog Topic - NAM1.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Keyword Search - Dialog Topic - NAM1 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | var 11 | slResultsForms, slResultsModels: TStringList; 12 | sQuery: string; 13 | 14 | function Initialize: integer; 15 | begin 16 | 17 | Result := 0; 18 | 19 | slResultsForms := TStringList.Create; 20 | slResultsModels := TStringList.Create; 21 | slResultsModels.Sorted := True; 22 | slResultsModels.Duplicates := dupIgnore; 23 | 24 | if not InputQuery('Enter', 'Search Query:', sQuery) then begin 25 | Result := 1; 26 | exit; 27 | end; // end if 28 | 29 | if sQuery = '' then begin 30 | Result := 1; 31 | exit; 32 | end; // end if 33 | 34 | AddMessage('-------------------------------------------------------------------------------'); 35 | 36 | end; // end begin 37 | 38 | function Process(e: IInterface): integer; 39 | var 40 | RECORD_FORMID, MODEL_FILENAME: IInterface; 41 | sRecordFormID, sModelFilename: string; 42 | 43 | begin 44 | Result := 0; 45 | 46 | //if Signature(e) <> 'STAT' then 47 | // exit; 48 | 49 | RECORD_FORMID := ElementByPath(e, 'Record Header\FormID'); 50 | MODEL_FILENAME := ElementByPath(e, 'Responses\Response\NAM1'); 51 | 52 | sRecordFormID := GetEditValue(RECORD_FORMID); 53 | sModelFilename := GetEditValue(MODEL_FILENAME); 54 | 55 | if pos(lowercase(sQuery), lowercase(sModelFilename)) > 0 then begin 56 | //AddMessage('Match: ' + sRecordFormID + ' ' + sModelFilename); 57 | slResultsModels.Add(sRecordFormID); 58 | end; 59 | 60 | end; 61 | 62 | function Finalize: integer; 63 | var 64 | i: integer; 65 | begin 66 | 67 | slResultsModels.Sort(); 68 | 69 | //AddMessage('-------------------------------------------------------------------------------'); 70 | 71 | for i := 0 to slResultsModels.Count - 1 do begin 72 | 73 | AddMessage(slResultsModels[i]); 74 | 75 | end; 76 | 77 | slResultsModels.Clear; 78 | 79 | AddMessage('-------------------------------------------------------------------------------'); 80 | Result := 1; 81 | end; 82 | 83 | end. 84 | -------------------------------------------------------------------------------- /Scripts/Keyword Search - EDID.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Keyword Search - EDID 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | var 11 | slResults: TStringList; 12 | sQuery: string; 13 | 14 | function Initialize: integer; 15 | begin 16 | 17 | Result := 0; 18 | 19 | ClearMessages(); 20 | 21 | slResults := TStringList.Create; 22 | slResults.Sorted := True; 23 | slResults.Duplicates := dupIgnore; 24 | 25 | if not InputQuery('Enter', 'Search Query:', sQuery) then begin 26 | Result := 1; 27 | exit; 28 | end; // end if 29 | 30 | if sQuery = '' then begin 31 | Result := 1; 32 | exit; 33 | end; // end if 34 | 35 | AddMessage('-------------------------------------------------------------------------------'); 36 | 37 | end; // end begin 38 | 39 | function Process(e: IInterface): integer; 40 | var 41 | sFormID, sName: string; 42 | 43 | begin 44 | 45 | Result := 0; 46 | 47 | sFormID := IntToHex(FixedFormID(e),8); 48 | sName := GetEditValue(ElementByPath(e, 'EDID')); 49 | 50 | if pos(lowercase(sQuery), lowercase(sName)) > 0 then begin 51 | slResults.Add('[' + Signature(e) + ':' + sFormID + '] ' + sName ); 52 | end; 53 | 54 | end; 55 | 56 | function Finalize: integer; 57 | var 58 | i: integer; 59 | begin 60 | 61 | slResults.Sort(); 62 | 63 | for i := 0 to slResults.Count - 1 do begin 64 | 65 | AddMessage(slResults[i]); 66 | 67 | end; 68 | 69 | slResults.Clear; 70 | 71 | AddMessage('-------------------------------------------------------------------------------'); 72 | Result := 1; 73 | 74 | end; 75 | 76 | end. 77 | -------------------------------------------------------------------------------- /Scripts/Keyword Search - FULL.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Keyword Search - FULL 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | var 11 | slResults: TStringList; 12 | sQuery: string; 13 | 14 | function Initialize: integer; 15 | begin 16 | 17 | Result := 0; 18 | 19 | slResults := TStringList.Create; 20 | slResults.Sorted := True; 21 | slResults.Duplicates := dupIgnore; 22 | 23 | if not InputQuery('Enter', 'Search Query:', sQuery) then begin 24 | Result := 1; 25 | exit; 26 | end; // end if 27 | 28 | if sQuery = '' then begin 29 | Result := 1; 30 | exit; 31 | end; // end if 32 | 33 | AddMessage('-------------------------------------------------------------------------------'); 34 | 35 | end; // end begin 36 | 37 | function Process(e: IInterface): integer; 38 | var 39 | FORMID, NAME: IInterface; 40 | sFormID, sName: string; 41 | 42 | begin 43 | Result := 0; 44 | 45 | if Signature(e) <> 'WEAP' then 46 | exit; 47 | 48 | FORMID := ElementByPath(e, 'Record Header\FormID'); 49 | NAME := ElementByPath(e, 'FULL'); 50 | 51 | sFormID := GetEditValue(FORMID); 52 | sName := GetEditValue(NAME); 53 | 54 | if pos(lowercase(sQuery), lowercase(sName)) > 0 then begin 55 | slResults.Add('Match: ' + sFormID + ' ' + sName); 56 | //RemoveNode(e); 57 | end; 58 | 59 | end; 60 | 61 | function Finalize: integer; 62 | var 63 | i: integer; 64 | begin 65 | 66 | slResults.Sort(); 67 | 68 | for i := 0 to slResults.Count - 1 do begin 69 | 70 | AddMessage(slResults[i]); 71 | 72 | end; 73 | 74 | slResults.Clear; 75 | 76 | AddMessage('-------------------------------------------------------------------------------'); 77 | Result := 1; 78 | 79 | end; 80 | 81 | end. 82 | -------------------------------------------------------------------------------- /Scripts/Keyword Search - Location.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Keyword Search - Location 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | var 11 | sQuery: string; 12 | 13 | function Initialize: integer; 14 | begin 15 | 16 | Result := 0; 17 | 18 | if not InputQuery('Enter', 'Search Query:', sQuery) then begin 19 | Result := 1; 20 | exit; 21 | end; // end if 22 | 23 | if sQuery = '' then begin 24 | Result := 1; 25 | exit; 26 | end; // end if 27 | 28 | AddMessage('-------------------------------------------------------------------------------'); 29 | 30 | end; // end begin 31 | 32 | function Process(e: IInterface): integer; 33 | var 34 | FORM, TARGET, NAME: IInterface; 35 | sForm, sName, sTarget: string; 36 | 37 | begin 38 | Result := 0; 39 | 40 | //if Signature(e) <> 'REFR' then 41 | // exit; 42 | 43 | FORM := ElementByPath(e, 'Record Header\FormID'); 44 | NAME := ElementByPath(e, 'EDID'); 45 | TARGET := ElementByPath(e, 'DATA\Location'); 46 | 47 | sForm := GetEditValue(FORM); 48 | sName := GetEditValue(NAME); 49 | sTarget := GetEditValue(TARGET); 50 | 51 | if pos(lowercase(sQuery), lowercase(sTarget)) > 0 then begin 52 | AddMessage('Match: ' + sName + ' ' + sForm); 53 | end; 54 | 55 | end; 56 | 57 | function Finalize: integer; 58 | var 59 | i: integer; 60 | begin 61 | 62 | AddMessage('-------------------------------------------------------------------------------'); 63 | Result := 1; 64 | end; 65 | 66 | end. 67 | -------------------------------------------------------------------------------- /Scripts/Keyword Search - Map Marker.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Keyword Search - Map Marker 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | var 11 | sQuery: string; 12 | 13 | function Initialize: integer; 14 | begin 15 | 16 | Result := 0; 17 | 18 | if not InputQuery('Enter', 'Search Query:', sQuery) then begin 19 | Result := 1; 20 | exit; 21 | end; // end if 22 | 23 | if sQuery = '' then begin 24 | Result := 1; 25 | exit; 26 | end; // end if 27 | 28 | AddMessage('-------------------------------------------------------------------------------'); 29 | 30 | end; // end begin 31 | 32 | function Process(e: IInterface): integer; 33 | var 34 | FORM, TARGET: IInterface; 35 | sForm, sTarget: string; 36 | 37 | begin 38 | Result := 0; 39 | 40 | //if Signature(e) <> 'REFR' then 41 | // exit; 42 | 43 | FORM := ElementByPath(e, 'Record Header\FormID'); 44 | TARGET := ElementByPath(e, 'Map Marker\FULL'); 45 | 46 | sForm := GetEditValue(FORM); 47 | sTarget := GetEditValue(TARGET); 48 | 49 | if pos(lowercase(sQuery), lowercase(sTarget)) > 0 then begin 50 | AddMessage('Match: ' + sForm); 51 | end; 52 | 53 | end; 54 | 55 | function Finalize: integer; 56 | var 57 | i: integer; 58 | begin 59 | 60 | AddMessage('-------------------------------------------------------------------------------'); 61 | Result := 1; 62 | end; 63 | 64 | end. 65 | -------------------------------------------------------------------------------- /Scripts/Keyword Search - Model Filenames.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Keyword Search - EDID 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | var 11 | slResults: TStringList; 12 | sQuery: string; 13 | 14 | function Initialize: integer; 15 | begin 16 | 17 | Result := 0; 18 | 19 | slResults := TStringList.Create; 20 | slResults.Sorted := True; 21 | slResults.Duplicates := dupIgnore; 22 | 23 | if not InputQuery('Enter', 'Search Query:', sQuery) then begin 24 | Result := 1; 25 | exit; 26 | end; // end if 27 | 28 | if sQuery = '' then begin 29 | Result := 1; 30 | exit; 31 | end; // end if 32 | 33 | AddMessage('-------------------------------------------------------------------------------'); 34 | 35 | end; // end begin 36 | 37 | function Process(e: IInterface): integer; 38 | var 39 | sFormID, sName: string; 40 | 41 | begin 42 | 43 | Result := 0; 44 | 45 | sFormID := GetEditValue(ElementByPath(e, 'Record Header\FormID')); 46 | sName := GetEditValue(ElementByPath(e, 'Male world model\MOD2 - Model Filename')); 47 | 48 | if pos(lowercase(sQuery), lowercase(sName)) > 0 then begin 49 | slResults.Add(sName); 50 | end; 51 | 52 | end; 53 | 54 | function Finalize: integer; 55 | var 56 | i: integer; 57 | begin 58 | 59 | slResults.Sort(); 60 | 61 | for i := 0 to slResults.Count - 1 do begin 62 | 63 | AddMessage(slResults[i]); 64 | 65 | end; 66 | 67 | slResults.Clear; 68 | 69 | AddMessage('-------------------------------------------------------------------------------'); 70 | Result := 1; 71 | 72 | end; 73 | 74 | end. 75 | -------------------------------------------------------------------------------- /Scripts/Keyword Search - NAME.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Keyword Search - NAME 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | var 11 | slResultsForms, slResultsModels: TStringList; 12 | sQuery: string; 13 | 14 | function Initialize: integer; 15 | begin 16 | 17 | Result := 0; 18 | 19 | slResultsForms := TStringList.Create; 20 | slResultsModels := TStringList.Create; 21 | slResultsModels.Sorted := True; 22 | slResultsModels.Duplicates := dupIgnore; 23 | 24 | if not InputQuery('Enter', 'Search Query:', sQuery) then begin 25 | Result := 1; 26 | exit; 27 | end; // end if 28 | 29 | if sQuery = '' then begin 30 | Result := 1; 31 | exit; 32 | end; // end if 33 | 34 | AddMessage('-------------------------------------------------------------------------------'); 35 | 36 | end; // end begin 37 | 38 | function Process(e: IInterface): integer; 39 | var 40 | RECORD_FORMID, MODEL_FILENAME: IInterface; 41 | sRecordFormID, sModelFilename: string; 42 | 43 | begin 44 | Result := 0; 45 | 46 | //if Signature(e) <> 'REFR' then 47 | // exit; 48 | 49 | RECORD_FORMID := ElementByPath(e, 'Record Header\FormID'); 50 | MODEL_FILENAME := ElementByPath(e, 'NAME'); 51 | 52 | sRecordFormID := GetEditValue(RECORD_FORMID); 53 | sModelFilename := GetEditValue(MODEL_FILENAME); 54 | 55 | if pos(lowercase(sQuery), lowercase(sModelFilename)) > 0 then begin 56 | //AddMessage('Match: ' + sRecordFormID); 57 | slResultsModels.Add(sRecordFormID); 58 | end; 59 | 60 | end; 61 | 62 | function Finalize: integer; 63 | var 64 | i: integer; 65 | begin 66 | 67 | slResultsModels.Sort(); 68 | 69 | AddMessage('-------------------------------------------------------------------------------'); 70 | 71 | for i := 0 to slResultsModels.Count - 1 do begin 72 | 73 | AddMessage(slResultsModels[i]); 74 | 75 | end; 76 | 77 | slResultsModels.Clear; 78 | 79 | AddMessage('-------------------------------------------------------------------------------'); 80 | Result := 1; 81 | end; 82 | 83 | end. 84 | -------------------------------------------------------------------------------- /Scripts/Keyword Search - Reference Names.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Keyword Search - Reference Names 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | var 11 | slResults: TStringList; 12 | sQuery: string; 13 | 14 | function Initialize: integer; 15 | begin 16 | 17 | Result := 0; 18 | 19 | slResults := TStringList.Create; 20 | slResults.Sorted := True; 21 | slResults.Duplicates := dupIgnore; 22 | 23 | if not InputQuery('Enter', 'Search Query:', sQuery) then begin 24 | Result := 1; 25 | exit; 26 | end; // end if 27 | 28 | if sQuery = '' then begin 29 | Result := 1; 30 | exit; 31 | end; // end if 32 | 33 | AddMessage('-------------------------------------------------------------------------------'); 34 | AddMessage('Form ID' + ' ' + 'Group Editor ID' + ' ' + 'Group Form ID' + ' ' + 'Result' + ' ' + 'Pos X' + ' ' + 'Pos Y' + ' ' + 'Pos Z' + ' ' + 'Rot X' + ' ' + 'Rot Y' + ' ' + 'Rot Z'); 35 | 36 | end; // end begin 37 | 38 | function Process(e: IInterface): integer; 39 | var 40 | FORMID, NAME, GROUP: IInterface; 41 | sFormID, sName, sGroupFormID, sGroupEditorID, sGroupName: string; 42 | sPosX, sPosY, sPosZ, sRotX, sRotY, sRotZ: string; 43 | s: string; 44 | runOnce: integer; 45 | 46 | begin 47 | Result := 0; 48 | 49 | s := Signature(e); 50 | 51 | if (s <> 'ACHR') and (s <> 'REFR') then 52 | exit; 53 | 54 | FORMID := FixedFormID(e); 55 | NAME := ElementByPath(e, 'NAME - Base'); 56 | GROUP := GetContainer(e); 57 | while Assigned(GROUP) and (ElementType(GROUP) <> etGroupRecord) do 58 | GROUP := GetContainer(GROUP); 59 | 60 | if not Assigned(GROUP) then begin 61 | AddMessage('Group not assigned'); 62 | exit; 63 | end; 64 | 65 | GROUP := ChildrenOf(GROUP); 66 | 67 | if not Assigned(GROUP) then begin 68 | AddMessage('Child group not assigned'); 69 | exit; 70 | end; 71 | 72 | sFormID := IntToHex(FORMID, 8); 73 | sName := GetEditValue(NAME); 74 | sPosX := IntToStr(GetNativeValue(ElementByPath(e, 'DATA\Position\X'))); 75 | sPosY := IntToStr(GetNativeValue(ElementByPath(e, 'DATA\Position\Y'))); 76 | sPosZ := IntToStr(GetNativeValue(ElementByPath(e, 'DATA\Position\Z'))); 77 | sRotX := IntToStr(GetNativeValue(ElementByPath(e, 'DATA\Rotation\X'))); 78 | sRotY := IntToStr(GetNativeValue(ElementByPath(e, 'DATA\Rotation\Y'))); 79 | sRotZ := IntToStr(GetNativeValue(ElementByPath(e, 'DATA\Rotation\Z'))); 80 | sGroupFormID := IntToHex(FixedFormID(GROUP), 8); 81 | sGroupEditorID := GetElementEditValues(GROUP, 'EDID'); 82 | sGroupName := GetElementEditValues(GROUP, 'FULL'); 83 | 84 | if pos(lowercase(sQuery), lowercase(sName)) > 0 then begin 85 | AddMessage('0x' + sFormID + ' ' + sGroupEditorID + ' 0x' + sGroupFormID + ' ' + sName + ' ' + sPosX + ' ' + sPosY + ' ' + sPosZ + ' ' + sRotX + ' ' + sRotY + ' ' + sRotZ); 86 | slResults.Add(sName); 87 | end; 88 | 89 | end; 90 | 91 | function Finalize: integer; 92 | var 93 | i: integer; 94 | begin 95 | 96 | slResults.Sort(); 97 | 98 | AddMessage('-------------------------------------------------------------------------------'); 99 | 100 | for i := 0 to slResults.Count - 1 do begin 101 | 102 | AddMessage(slResults[i]); 103 | 104 | end; 105 | 106 | slResults.Clear; 107 | 108 | AddMessage('-------------------------------------------------------------------------------'); 109 | Result := 1; 110 | end; 111 | 112 | end. 113 | -------------------------------------------------------------------------------- /Scripts/Keyword Search - XLRT.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Keyword Search - Map Marker 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | var 11 | sQuery: string; 12 | 13 | function Initialize: integer; 14 | begin 15 | 16 | Result := 0; 17 | 18 | if not InputQuery('Enter', 'Search Query:', sQuery) then begin 19 | Result := 1; 20 | exit; 21 | end; // end if 22 | 23 | if sQuery = '' then begin 24 | Result := 1; 25 | exit; 26 | end; // end if 27 | 28 | AddMessage('-------------------------------------------------------------------------------'); 29 | 30 | end; // end begin 31 | 32 | function Process(e: IInterface): integer; 33 | var 34 | FORM, TARGET, NAME: IInterface; 35 | sForm, sName, sTarget: string; 36 | 37 | begin 38 | Result := 0; 39 | 40 | //if Signature(e) <> 'REFR' then 41 | // exit; 42 | 43 | FORM := ElementByPath(e, 'Record Header\FormID'); 44 | NAME := ElementByPath(e, 'Map Marker\FULL'); 45 | TARGET := ElementByPath(e, 'XLRT\Ref #0'); 46 | 47 | sForm := GetEditValue(FORM); 48 | sName := GetEditValue(NAME); 49 | sTarget := GetEditValue(TARGET); 50 | 51 | if pos(lowercase(sQuery), lowercase(sTarget)) > 0 then begin 52 | AddMessage('Match: ' + sName + ' ' + sForm); 53 | end; 54 | 55 | end; 56 | 57 | function Finalize: integer; 58 | var 59 | i: integer; 60 | begin 61 | 62 | AddMessage('-------------------------------------------------------------------------------'); 63 | Result := 1; 64 | end; 65 | 66 | end. 67 | -------------------------------------------------------------------------------- /Scripts/List FormID Items.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: List LNAM subrecords 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | function Initialize: integer; 11 | begin 12 | Result := 0; 13 | ClearMessages(); 14 | end; 15 | 16 | function Process(e: IInterface): integer; 17 | var 18 | rec, list, listitem: IInterface; 19 | lnam, formid: string; 20 | i: integer; 21 | begin 22 | Result := 0; 23 | 24 | list := ElementByName(e, 'FormIDs'); 25 | 26 | for i := 0 to ElementCount(list) - 1 do begin 27 | //lnam := GetEditValue(ElementByIndex(list, i)); 28 | listitem := ElementByIndex(list, i); 29 | formid := IntToHex(FixedFormID(LinksTo(listitem)), 8); 30 | AddMessage(GetElementEditValues(LinksTo(listitem), 'Record Header\FormID')); 31 | end; 32 | 33 | end; 34 | 35 | function Finalize: integer; 36 | begin 37 | Result := 0; 38 | end; 39 | 40 | end. 41 | -------------------------------------------------------------------------------- /Scripts/List FormIDs with EDID Query.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: List FormIDs with EDID Query 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | function Initialize: integer; 11 | begin 12 | Result := 0; 13 | end; 14 | 15 | function Process(e: IInterface): integer; 16 | var 17 | rec: IInterface; 18 | formid, name, full: string; 19 | begin 20 | Result := 0; 21 | 22 | formid := IntToHex(FixedFormID(e),8); 23 | name := GetEditValue(ElementByPath(e, 'EDID')); 24 | full := GetEditValue(ElementByPath(e, 'FULL')); 25 | AddMessage(formid + ' ' + name + ' ' + full); 26 | 27 | end; 28 | 29 | function Finalize: integer; 30 | begin 31 | Result := 0; 32 | end; 33 | 34 | end. 35 | -------------------------------------------------------------------------------- /Scripts/List FormIDs.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: List forms 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | var 11 | i: integer; 12 | slResults: TStringList; 13 | 14 | function Initialize: integer; 15 | 16 | begin 17 | 18 | Result := 0; 19 | 20 | i := 0; 21 | 22 | slResults := TStringList.Create; 23 | 24 | ClearMessages(); 25 | 26 | end; 27 | 28 | function Process(e: IInterface): integer; 29 | 30 | var 31 | rec: IInterface; 32 | formid, name, full, lctn, itemid: string; 33 | 34 | begin 35 | 36 | Result := 0; 37 | 38 | //if Signature(e) <> 'NAVM' then exit; 39 | 40 | i := i + 1; 41 | 42 | formid := IntToHex(FixedFormID(e),8); 43 | //name := GetEditValue(ElementByPath(e, 'EDID')); 44 | //full := GetEditValue(ElementByPath(e, 'FULL')); 45 | //lctn := GetEditValue(ElementByPath(e, 'DATA\Location')); 46 | itemid := GetEditValue(ElementByPath(e, 'Record Header\FormID')); 47 | //AddMessage('player.additem ' + formid + ' 1'); 48 | //AddMessage(formid + ' ' + name + ' ' + full + ' ' + lctn); 49 | //AddMessage(full); 50 | //AddMessage(name); 51 | //AddMessage(itemid); 52 | slResults.Add('player.additem ' + formid + ' 10'); 53 | 54 | end; 55 | 56 | function Finalize: integer; 57 | 58 | begin 59 | 60 | for i := slResults.Count - 1 downto 0 do 61 | AddMessage(slResults[i]); 62 | 63 | Result := 1; 64 | exit; 65 | 66 | end; 67 | 68 | end. 69 | -------------------------------------------------------------------------------- /Scripts/List Items.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: List Outfit Items 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | var 11 | slResults: TStringList; 12 | i: integer; 13 | 14 | function Initialize: integer; 15 | begin 16 | 17 | Result := 0; 18 | 19 | slResults := TStringList.Create; 20 | slResults.Sorted := True; 21 | slResults.Duplicates := dupIgnore; 22 | 23 | AddMessage('-------------------------------------------------------------------------------'); 24 | 25 | end; 26 | 27 | function Process(e: IInterface): integer; 28 | var 29 | list, listitem: IInterface; 30 | begin 31 | Result := 0; 32 | 33 | if Signature(e) = 'OTFT' then 34 | list := ElementByName(e, 'INAM - Items'); 35 | 36 | if Signature(e) = 'FLST' then 37 | list := ElementByName(e, 'FormIDs'); 38 | 39 | for i := 0 to ElementCount(list) - 1 do begin 40 | listitem := GetEditValue(ElementByIndex(list, i)); 41 | slResults.Add(listitem); 42 | end; 43 | 44 | end; 45 | 46 | function Finalize: integer; 47 | begin 48 | 49 | slResults.Sort(); 50 | 51 | for i := 0 to slResults.Count - 1 do begin 52 | 53 | AddMessage(slResults[i]); 54 | 55 | end; 56 | 57 | slResults.Clear; 58 | 59 | AddMessage('-------------------------------------------------------------------------------'); 60 | Result := 1; 61 | 62 | end; 63 | 64 | end. 65 | -------------------------------------------------------------------------------- /Scripts/List Model Paths.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: List model paths 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | // Called before processing 11 | // You can remove it if script doesn't require initialization code 12 | function Initialize: integer; 13 | begin 14 | Result := 0; 15 | end; 16 | 17 | // called for every record selected in xEdit 18 | function Process(e: IInterface): integer; 19 | var 20 | rec: IInterface; 21 | query, edid, full, modl: string; 22 | begin 23 | Result := 0; 24 | 25 | query := ''; 26 | edid := GetEditValue(ElementByPath(e, 'EDID')); 27 | full := GetEditValue(ElementByPath(e, 'FULL')); 28 | modl := GetEditValue(ElementByPath(e, 'Model\MODL')); 29 | AddMessage(IntToHex(FormID(e), 8) + ' ' + edid + ' ' + full + ' ' + modl); 30 | //if (pos(lowercase(query), lowercase(full)) > 0) or (pos(lowercase(query), lowercase(modl)) > 0) then 31 | // AddMessage(IntToHex(FormID(e), 8) + ' ' + edid + ' ' + full + ' ' + modl); 32 | 33 | end; 34 | 35 | // Called after processing 36 | // You can remove it if script doesn't require finalization code 37 | function Finalize: integer; 38 | begin 39 | Result := 0; 40 | end; 41 | 42 | end. 43 | -------------------------------------------------------------------------------- /Scripts/List Outfit Items.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: List Outfit Items 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | var 11 | slResults: TStringList; 12 | i: integer; 13 | 14 | function Initialize: integer; 15 | begin 16 | 17 | Result := 0; 18 | 19 | slResults := TStringList.Create; 20 | slResults.Sorted := True; 21 | slResults.Duplicates := dupIgnore; 22 | 23 | AddMessage('-------------------------------------------------------------------------------'); 24 | 25 | end; 26 | 27 | function Process(e: IInterface): integer; 28 | var 29 | list, listitem: IInterface; 30 | begin 31 | Result := 0; 32 | 33 | if Signature(e) = 'OTFT' then 34 | list := ElementByName(e, 'INAM - Items'); 35 | 36 | if Signature(e) = 'FLST' then 37 | list := ElementByName(e, 'FormIDs'); 38 | 39 | for i := 0 to ElementCount(list) - 1 do begin 40 | listitem := GetEditValue(ElementByIndex(list, i)); 41 | slResults.Add(listitem); 42 | end; 43 | 44 | end; 45 | 46 | function Finalize: integer; 47 | begin 48 | 49 | slResults.Sort(); 50 | 51 | for i := 0 to slResults.Count - 1 do begin 52 | 53 | AddMessage(slResults[i]); 54 | 55 | end; 56 | 57 | slResults.Clear; 58 | 59 | AddMessage('-------------------------------------------------------------------------------'); 60 | Result := 1; 61 | 62 | end; 63 | 64 | end. 65 | -------------------------------------------------------------------------------- /Scripts/List Outfits.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: List value and weight 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | 11 | function Initialize: integer; 12 | begin 13 | Result := 0; 14 | 15 | AddMessage('Form ID' + ' ' + 'Name' + ' ' + 'Editor ID' + ' ' + 'Outfit'); 16 | 17 | end; 18 | 19 | function Process(e: IInterface): integer; 20 | var 21 | rec: IInterface; 22 | sFormID, sName, sEditorID, sOutfit: string; 23 | 24 | begin 25 | Result := 0; 26 | 27 | sFormID := IntToHex(FormID(e),8); 28 | sName := GetEditValue(ElementByPath(e, 'FULL')); 29 | sEditorID := GetEditValue(ElementByPath(e, 'EDID')); 30 | sOutfit := GetEditValue(ElementByPath(e, 'DOFT')); 31 | AddMessage(sFormID + ' ' + sName + ' ' + sEditorID + ' ' + sOutfit); 32 | 33 | end; 34 | 35 | function Finalize: integer; 36 | begin 37 | Result := 0; 38 | end; 39 | 40 | end. 41 | -------------------------------------------------------------------------------- /Scripts/List Package Items.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: List Package Items 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | var 11 | slResults: TStringList; 12 | i: integer; 13 | 14 | function Initialize: integer; 15 | begin 16 | 17 | Result := 0; 18 | 19 | slResults := TStringList.Create; 20 | slResults.Sorted := True; 21 | slResults.Duplicates := dupIgnore; 22 | 23 | AddMessage('-------------------------------------------------------------------------------'); 24 | 25 | end; 26 | 27 | function Process(e: IInterface): integer; 28 | var 29 | list, listitem: IInterface; 30 | begin 31 | Result := 0; 32 | 33 | if Signature(e) = 'NPC_' then 34 | list := ElementByName(e, 'Packages'); 35 | 36 | for i := 0 to ElementCount(list) - 1 do begin 37 | listitem := GetEditValue(ElementByIndex(list, i)); 38 | slResults.Add(listitem); 39 | end; 40 | 41 | end; 42 | 43 | function Finalize: integer; 44 | begin 45 | 46 | slResults.Sort(); 47 | 48 | for i := 0 to slResults.Count - 1 do begin 49 | 50 | AddMessage(slResults[i]); 51 | 52 | end; 53 | 54 | slResults.Clear; 55 | 56 | AddMessage('-------------------------------------------------------------------------------'); 57 | Result := 1; 58 | 59 | end; 60 | 61 | end. 62 | -------------------------------------------------------------------------------- /Scripts/List Races.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: List model paths 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | function Initialize: integer; 11 | begin 12 | Result := 0; 13 | end; 14 | 15 | function Process(e: IInterface): integer; 16 | var 17 | rec: IInterface; 18 | query, formid, name: string; 19 | begin 20 | Result := 0; 21 | 22 | formid := GetEditValue(ElementByPath(e, 'Record Header\FormID')); 23 | name := GetEditValue(ElementByPath(e, 'RNAM')); 24 | AddMessage(name + ' ' + formid); 25 | 26 | end; 27 | 28 | function Finalize: integer; 29 | begin 30 | Result := 0; 31 | end; 32 | 33 | end. 34 | -------------------------------------------------------------------------------- /Scripts/List Reference Names.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: List Reference Names 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | var 11 | i: integer; 12 | 13 | function Initialize: integer; 14 | begin 15 | Result := 0; 16 | end; 17 | 18 | function Process(e: IInterface): integer; 19 | var 20 | rec: IInterface; 21 | formid, name: string; 22 | begin 23 | Result := 0; 24 | 25 | formid := GetElementEditValues(e, 'Record Header\FormID'); 26 | name := GetElementEditValues(e, 'NAME'); 27 | 28 | AddMessage(name + ' ' + formid); 29 | end; 30 | 31 | function Finalize: integer; 32 | begin 33 | Result := 0; 34 | end; 35 | 36 | end. 37 | -------------------------------------------------------------------------------- /Scripts/List Reference Records.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: List model paths 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | function Initialize: integer; 11 | begin 12 | Result := 0; 13 | end; 14 | 15 | function Process(e: IInterface): integer; 16 | var 17 | rec: IInterface; 18 | query, formid, name: string; 19 | begin 20 | Result := 0; 21 | 22 | query := 'dubh'; 23 | 24 | formid := GetEditValue(ElementByPath(e, 'Record Header\FormID')); 25 | name := GetEditValue(ElementByPath(e, 'EDID')); 26 | if (pos(lowercase(query), lowercase(name)) > 0) then begin 27 | AddMessage(formid); 28 | //AddMessage('SetElementEditValues(r, ''NAME'', ''' + formid + ''');'); 29 | end; 30 | 31 | end; 32 | 33 | function Finalize: integer; 34 | begin 35 | Result := 0; 36 | end; 37 | 38 | end. 39 | -------------------------------------------------------------------------------- /Scripts/List Referenced By.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: List referenced by 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | function Initialize: integer; 11 | begin 12 | Result := 0; 13 | end; 14 | 15 | function Process(e: IInterface): integer; 16 | var 17 | ref: IInterface; 18 | formid, name: string; 19 | i, refcount: integer; 20 | begin 21 | Result := 0; 22 | 23 | refcount := ReferencedByCount(MasterOrSelf(e)); 24 | AddMessage( 'Found ' + IntToStr( refcount ) + ' references...' ); 25 | 26 | if refcount > 0 then begin 27 | 28 | for i := 0 to refcount - 1 do begin 29 | ref := ReferencedByIndex(MasterOrSelf(e), i); 30 | formid := GetEditValue(ElementByPath(ref, 'Record Header\FormID')); 31 | //if Signature(ref) = 'NPC_' then 32 | AddMessage( IntToStr(i + 1) + ' ' + formid ); 33 | end; 34 | 35 | end; 36 | 37 | end; 38 | 39 | function Finalize: integer; 40 | begin 41 | Result := 0; 42 | end; 43 | 44 | end. 45 | -------------------------------------------------------------------------------- /Scripts/List References.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: List model paths 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | var 11 | i: integer; 12 | 13 | function Initialize: integer; 14 | begin 15 | Result := 0; 16 | i := 0; 17 | end; 18 | 19 | function Process(e: IInterface): integer; 20 | var 21 | rec: IInterface; 22 | query, formid, name, posx, posy, posz, rotx, roty, rotz: string; 23 | begin 24 | Result := 0; 25 | 26 | query := 'WEAP:'; 27 | 28 | if Signature(e) <> 'REFR' then 29 | exit; 30 | 31 | formid := GetEditValue(ElementByPath(e, 'Record Header\FormID')); 32 | name := GetEditValue(ElementByPath(e, 'NAME')); 33 | posx := GetEditValue(ElementByPath(e, 'DATA\Position\X')); 34 | posy := GetEditValue(ElementByPath(e, 'DATA\Position\Y')); 35 | posz := GetEditValue(ElementByPath(e, 'DATA\Position\Z')); 36 | rotx := GetEditValue(ElementByPath(e, 'DATA\Rotation\X')); 37 | roty := GetEditValue(ElementByPath(e, 'DATA\Rotation\Y')); 38 | rotz := GetEditValue(ElementByPath(e, 'DATA\Rotation\Z')); 39 | if (pos(lowercase(query), lowercase(name)) > 0) then begin 40 | //i := i + 1; 41 | AddMessage(GetFileName(GetFile(e)) + ' ' + name + ' ' + posx + ' ' + posy + ' ' + posz + ' ' + rotx + ' ' + roty + ' ' + rotz); 42 | end; 43 | 44 | end; 45 | 46 | function Finalize: integer; 47 | begin 48 | Result := 0; 49 | end; 50 | 51 | end. 52 | -------------------------------------------------------------------------------- /Scripts/List Value and Weight.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: List value and weight 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | // Called before processing 11 | // You can remove it if script doesn't require initialization code 12 | function Initialize: integer; 13 | begin 14 | Result := 0; 15 | 16 | AddMessage('Form ID' + ' ' + 'Name' + ' ' + 'Editor ID' + ' ' + 'Model Filename' + ' ' + 'Value' + ' ' + 'Weight'); 17 | 18 | end; 19 | 20 | // called for every record selected in xEdit 21 | function Process(e: IInterface): integer; 22 | var 23 | rec: IInterface; 24 | sFormID, sName, sEditorID, sModel: string; 25 | sValue: integer; 26 | sWeight: float; 27 | begin 28 | Result := 0; 29 | 30 | // processing code goes here 31 | sFormID := IntToHex(FormID(e),8); 32 | sName := GetEditValue(ElementByPath(e, 'FULL')); 33 | sEditorID := GetEditValue(ElementByPath(e, 'EDID')); 34 | sModel := GetEditValue(ElementByPath(e, 'Model\MODL')); 35 | sValue := GetEditValue(ElementByPath(e, 'DATA\Value')); 36 | sWeight := GetEditValue(ElementByPath(e, 'DATA\Weight')); 37 | AddMessage(sFormID + ' ' + sName + ' ' + sEditorID + ' ' + sModel + ' ' + IntToStr(sValue) + ' ' + FloatToStr(sWeight)); 38 | 39 | end; 40 | 41 | // Called after processing 42 | // You can remove it if script doesn't require finalization code 43 | function Finalize: integer; 44 | begin 45 | Result := 0; 46 | end; 47 | 48 | end. 49 | -------------------------------------------------------------------------------- /Scripts/List Winning Override.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: List Winning Override 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | var 11 | slOverrides: TStringList; 12 | 13 | function Initialize: integer; 14 | 15 | begin 16 | 17 | Result := 0; 18 | 19 | slOverrides := TStringList.Create; 20 | 21 | ClearMessages(); 22 | 23 | end; 24 | 25 | function Process(e: IInterface): integer; 26 | 27 | var 28 | sRecOverride: string; 29 | 30 | begin 31 | 32 | Result := 0; 33 | 34 | sRecOverride := GetFileName(GetFile(WinningOverride(e))); 35 | 36 | slOverrides.Add(sRecOverride + ' overrides: ' + GetElementEditValues(e, 'Record Header\FormID')); 37 | 38 | end; 39 | 40 | function Finalize: integer; 41 | var 42 | i: integer; 43 | 44 | begin 45 | 46 | for i := slOverrides.Count - 1 downto 0 do 47 | AddMessage(slOverrides[i]); 48 | 49 | AddMessage(''); 50 | Result := 0; 51 | exit; 52 | 53 | end; 54 | 55 | end. 56 | -------------------------------------------------------------------------------- /Scripts/NPC Add Flag (Auto-Calc Stats).pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Add auto-calc stats flag to NPC 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | var 11 | a, b, c: integer; 12 | 13 | // Called before processing 14 | function Initialize: integer; 15 | begin 16 | 17 | end; 18 | 19 | // Processing 20 | function Process(e: IInterface): integer; 21 | var 22 | rec: IInterface; 23 | sPath, sPathFlags: string; 24 | 25 | begin 26 | 27 | Result := 0; 28 | 29 | rec := Signature(e); 30 | sPath := Name(e); 31 | 32 | if (rec = 'NPC_') then begin 33 | 34 | sPathFlags := 'ACBS\Flags'; 35 | 36 | SetElementNativeValues(e, sPathFlags, GetElementNativeValues(e, sPathFlags) or 16); 37 | AddMessage(sPath + ' now flagged Auto-Calc Stats'); 38 | 39 | end; // end condition 40 | 41 | end; // end function 42 | 43 | // Cleanup 44 | function Finalize: integer; 45 | begin 46 | 47 | Result := 1; 48 | 49 | end; // end function 50 | 51 | end. // end script -------------------------------------------------------------------------------- /Scripts/NPC Add Flag (Essential).pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Add essential flag to NPC 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | var 11 | a, b, c: integer; 12 | 13 | // Called before processing 14 | function Initialize: integer; 15 | begin 16 | 17 | end; 18 | 19 | // Processing 20 | function Process(e: IInterface): integer; 21 | var 22 | rec: IInterface; 23 | sPath, sPathFlags: string; 24 | 25 | begin 26 | 27 | Result := 0; 28 | 29 | rec := Signature(e); 30 | sPath := Name(e); 31 | 32 | if (rec = 'NPC_') then begin 33 | 34 | sPathFlags := 'ACBS\Flags'; 35 | 36 | SetElementNativeValues(e, sPathFlags, GetElementNativeValues(e, sPathFlags) or 1); 37 | AddMessage(sPath + ' now flagged Essential'); 38 | 39 | end; // end condition 40 | 41 | end; // end function 42 | 43 | // Cleanup 44 | function Finalize: integer; 45 | begin 46 | 47 | Result := 1; 48 | 49 | end; // end function 50 | 51 | end. // end script -------------------------------------------------------------------------------- /Scripts/NPC Add Flag (PC Level Mult).pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Add PC Level Mult flag to NPC 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | var 11 | a, b, c: integer; 12 | //fMult: float; 13 | 14 | // Called before processing 15 | function Initialize: integer; 16 | begin 17 | 18 | //fMult := (InputBox('Set Multiplier', 'Mult:', 1.5)); 19 | 20 | end; 21 | 22 | function Process(e: IInterface): integer; 23 | var 24 | rec: IInterface; 25 | sPath, sPathFlags: string; 26 | iLevelMult: integer; 27 | 28 | begin 29 | 30 | Result := 0; 31 | 32 | rec := Signature(e); 33 | sPath := Name(e); 34 | 35 | if (rec = 'NPC_') then begin 36 | 37 | sPathFlags := 'ACBS - Configuration\Flags'; 38 | 39 | SetElementNativeValues(e, sPathFlags, GetElementNativeValues(e, sPathFlags) or 128); 40 | AddMessage(sPath + ' now flagged PC Level Mult'); 41 | 42 | end; // end condition 43 | 44 | end; // end function 45 | 46 | // Cleanup 47 | function Finalize: integer; 48 | begin 49 | 50 | Result := 1; 51 | 52 | end; // end function 53 | 54 | end. // end script -------------------------------------------------------------------------------- /Scripts/NPC Add Flag (Protected).pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Make NPCs Protected 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | var 11 | a, b, c: integer; 12 | 13 | // Called before processing 14 | function Initialize: integer; 15 | begin 16 | 17 | end; 18 | 19 | // Processing 20 | function Process(e: IInterface): integer; 21 | var 22 | rec: IInterface; 23 | sPath, sPathFlags: string; 24 | 25 | begin 26 | 27 | Result := 0; 28 | 29 | rec := Signature(e); 30 | sPath := Name(e); 31 | 32 | if (rec = 'NPC_') then begin 33 | 34 | sPathFlags := 'ACBS\Flags'; 35 | 36 | SetElementNativeValues(e, sPathFlags, GetElementNativeValues(e, sPathFlags) or 2048); 37 | AddMessage(sPath + ' now flagged Protected'); 38 | 39 | end; // end condition 40 | 41 | end; // end function 42 | 43 | // Cleanup 44 | function Finalize: integer; 45 | begin 46 | 47 | Result := 1; 48 | 49 | end; // end function 50 | 51 | end. // end script -------------------------------------------------------------------------------- /Scripts/NPC Add Flag (Unique).pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Make NPCs Protected 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | var 11 | a, b, c: integer; 12 | 13 | // Called before processing 14 | function Initialize: integer; 15 | begin 16 | 17 | end; 18 | 19 | // Processing 20 | function Process(e: IInterface): integer; 21 | var 22 | rec: IInterface; 23 | sPath, sPathFlags: string; 24 | 25 | begin 26 | 27 | Result := 0; 28 | 29 | rec := Signature(e); 30 | sPath := Name(e); 31 | 32 | if (rec = 'NPC_') then begin 33 | 34 | sPathFlags := 'ACBS\Flags'; 35 | 36 | SetElementNativeValues(e, sPathFlags, GetElementNativeValues(e, sPathFlags) or 32); 37 | AddMessage(sPath + ' now flagged Unique'); 38 | 39 | end; // end condition 40 | 41 | end; // end function 42 | 43 | // Cleanup 44 | function Finalize: integer; 45 | begin 46 | 47 | Result := 1; 48 | 49 | end; // end function 50 | 51 | end. // end script -------------------------------------------------------------------------------- /Scripts/NPC Add Flags.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Make NPCs Protected 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | function Process(e: IInterface): integer; 11 | var 12 | rec: IInterface; 13 | sPath, sPathFlags: string; 14 | sPath0, sPath1, sPath3, sPath4, sPath5, sPath6, sPath7, sPath11, sPath14, sPath16, sPath31: string; 15 | 16 | begin 17 | 18 | Result := 0; 19 | 20 | rec := Signature(e); 21 | sPath := Name(e); 22 | 23 | if (rec = 'NPC_') then begin 24 | 25 | sPathFlags := 'ACBS\Flags'; 26 | sPath0 := 'ACBS\Flags\Female'; 27 | sPath1 := 'ACBS\Flags\Essential'; 28 | sPath3 := 'ACBS\Flags\Respawn'; 29 | sPath4 := 'ACBS\Flags\Auto-calc stats'; 30 | sPath5 := 'ACBS\Flags\Unique'; 31 | sPath7 := 'ACBS\Flags\PC Level Mult'; 32 | sPath11 := 'ACBS\Flags\Protected'; 33 | sPath14 := 'ACBS\Flags\Summonable'; 34 | sPath31 := 'ACBS\Flags\Invulnerable'; 35 | 36 | // REMOVE 'ESSENTIAL' FLAG 37 | if ElementExists(e, sPath1) then 38 | begin 39 | SetElementEditValues(e, sPath1, 0); 40 | AddMessage(sPath + ' is no longer Essential'); 41 | end; 42 | 43 | // REMOVE 'INVULNERABLE' FLAG 44 | if ElementExists(e, sPath31) then 45 | begin 46 | SetElementEditValues(e, sPath31, 0); 47 | AddMessage(sPath + ' is no longer Invulnerable'); 48 | end; 49 | 50 | // ADD 'AUTO-CALC STATS' FLAG 51 | if GetElementEditValues(e, sPath4) = 0 then 52 | begin 53 | SetElementNativeValues(e, sPathFlags, GetElementNativeValues(e, sPathFlags) or 16); 54 | AddMessage(sPath + ' is flagged Auto-Calc Stats'); 55 | end; 56 | 57 | // ADD 'UNIQUE' FLAG 58 | if GetElementEditValues(e, sPath5) = 0 then 59 | begin 60 | SetElementNativeValues(e, sPathFlags, GetElementNativeValues(e, sPathFlags) or 32); 61 | AddMessage(sPath + ' is flagged Unique'); 62 | end; 63 | 64 | // ADD 'PC LEVEL MULT' FLAG 65 | if GetElementEditValues(e, sPath7) = 0 then 66 | begin 67 | SetElementNativeValues(e, sPathFlags, GetElementNativeValues(e, sPathFlags) or 128); 68 | AddMessage(sPath + ' is flagged PC Level Mult'); 69 | end; 70 | 71 | // ADD 'PROTECTED' FLAG 72 | if GetElementEditValues(e, sPath11) = 0 then 73 | begin 74 | SetElementNativeValues(e, sPathFlags, GetElementNativeValues(e, sPathFlags) or 2048); 75 | AddMessage(sPath + ' is flagged Protected'); 76 | end; 77 | 78 | // CHANGE 'LEVEL MULT' TO 1.00 79 | if GetElementEditValues(e, 'ACBS\Level Mult') <> 1.0 then 80 | begin 81 | SetElementEditValues(e, 'ACBS\Level Mult', 1.0); 82 | AddMessage(sPath + ' now levels up with the player'); 83 | end; 84 | 85 | // CHANGE 'CALC MAX LEVEL' TO 80 86 | if GetElementEditValues(e, 'ACBS\Calc max level') <> 81 then 87 | begin 88 | SetElementEditValues(e, 'ACBS\Calc max level', 81); 89 | AddMessage(sPath + ' can now level up to 81'); 90 | end; 91 | 92 | // CHANGE 'SPEED MULTIPLIER' TO 100 93 | if GetElementEditValues(e, 'ACBS\Speed Multiplier') <> 100 then 94 | begin 95 | SetElementEditValues(e, 'ACBS\Speed Multiplier', 100); 96 | AddMessage(sPath + ' has a new speed of 100 (normal)'); 97 | end; 98 | 99 | end; // end condition 100 | 101 | end; // end function 102 | 103 | // Cleanup 104 | function Finalize: integer; 105 | begin 106 | 107 | Result := 1; 108 | 109 | end; // end function 110 | 111 | end. // end script -------------------------------------------------------------------------------- /Scripts/Quick Scripts - Convert to COBJ.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Convert STAT to MISC 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | 7 | 1. Create a new plugin 8 | 2. Copy STAT records to new plugin AS NEW RECORDS 9 | 3. Select STAT records in new plugin 10 | 4. Apply script 11 | } 12 | 13 | unit UserScript; 14 | 15 | var 16 | baserecord, formlist, items: IInterface; 17 | sPrefix, sSuffix: string; 18 | destination, fileBaseRecord, fileFormList: iwbFile; 19 | fileLoadOrder1, fileLoadOrder2: string; 20 | 21 | //============================================================================ 22 | function Initialize: integer; 23 | 24 | begin 25 | 26 | // base record is the template to copy? 27 | // BasicKnife01 [MISC:00104B40] 28 | fileLoadOrder1 := '$07'; // Hunterborn.esp 29 | fileLoadOrder2 := '$08'; // Target 30 | 31 | fileBaseRecord := FileByLoadOrder(StrToInt(fileLoadOrder1)); 32 | fileFormList := FileByLoadOrder(StrToInt(fileLoadOrder2)); 33 | 34 | baserecord := RecordByFormID(fileBaseRecord, StrToInt(fileLoadOrder1 + '015D8E'), true); 35 | formlist := RecordByFormID(fileFormList, StrToInt(fileLoadOrder2 + 'FF0800'), true); 36 | 37 | sPrefix := '_DS_Recipe_Special_'; 38 | sSuffix := ''; 39 | 40 | destination := FileByLoadOrder(StrToInt(fileLoadOrder2)); 41 | 42 | if not Assigned(baserecord) then begin 43 | AddMessage('Cannot find base record'); 44 | Result := 1; 45 | Exit; 46 | end; 47 | 48 | end; 49 | 50 | //============================================================================ 51 | function Process(e: IInterface): integer; 52 | 53 | var 54 | r, origin, conditions, condition2: IInterface; 55 | formid: cardinal; 56 | i: integer; 57 | 58 | begin 59 | 60 | AddRequiredElementMasters(GetFile(e), destination, false); 61 | 62 | // Copy base record to file 63 | r := wbCopyElementToFile(baserecord, destination, true, true); 64 | 65 | if not Assigned(r) then begin 66 | AddMessage('Cannot copy base record as new'); 67 | exit; 68 | end; 69 | 70 | SetElementEditValues(r, 'EDID', sPrefix + GetElementEditValues(e, 'EDID') + sSuffix); 71 | 72 | items := ElementByName(formlist, 'FormIDs'); 73 | 74 | for i := 0 to ElementCount(items) - 1 do begin 75 | 76 | origin := ElementByIndex(items, i); 77 | 78 | if pos( GetElementEditValues(LinksTo(origin), 'EDID'), GetElementEditValues(r, 'EDID') ) > 0 then begin 79 | 80 | SetElementEditValues(r, 'Items\Item\CNTO\Item', GetElementEditValues(LinksTo(origin), 'Record Header\FormID')); 81 | 82 | condition2 := ElementByIndex(ElementByPath(r, 'Conditions'), 1); 83 | 84 | SetElementEditValues(condition2, 'CTDA\Inventory Object', GetElementEditValues(LinksTo(origin), 'Record Header\FormID')); 85 | 86 | end; 87 | 88 | end; 89 | 90 | // todo: create new formid instead of using the current formid and removing the node 91 | // for now, manually change the formid of the new record 92 | formid := GetLoadOrderFormID(e); 93 | 94 | RemoveNode(e); 95 | 96 | SetLoadOrderFormID(r, formid); 97 | 98 | end; 99 | 100 | function Finalize: integer; 101 | 102 | begin 103 | 104 | Result := 1; 105 | exit; 106 | 107 | end; 108 | 109 | end. 110 | -------------------------------------------------------------------------------- /Scripts/Quick Scripts - Find Keyless Locked Doors.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Find Keyless Locked Doors (FLST) 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | unit UserScript; 8 | 9 | var 10 | slRefsDoors: TStringList; 11 | flstFile: iwbFile; 12 | rec, flstRefsDoors, flstRefsDoorsFormIDs: IInterface; 13 | i: integer; 14 | 15 | function Initialize: integer; 16 | 17 | begin 18 | Result := 0; 19 | 20 | ClearMessages(); 21 | 22 | slRefsDoors := TStringList.Create; 23 | 24 | flstFile := FileByLoadOrder(StrToInt('$09')); 25 | flstRefsDoors := RecordByFormID(flstFile, $09000800, false); 26 | 27 | flstRefsDoorsFormIDs := ElementByName(flstRefsDoors, 'FormIDs'); 28 | 29 | if slRefsDoors.Count = 0 then begin 30 | 31 | if Assigned(flstRefsDoorsFormIDs) then begin 32 | 33 | for i := 0 to ElementCount(flstRefsDoorsFormIDs) - 1 do begin 34 | 35 | rec := LinksTo(ElementByIndex(flstRefsDoorsFormIDs, i)); 36 | slRefsDoors.Add(GetElementEditValues(rec, 'EDID')); 37 | 38 | end; 39 | 40 | end; 41 | 42 | end; 43 | 44 | AddMessage(#13#10); 45 | 46 | end; 47 | 48 | function Process(e: IInterface): integer; 49 | 50 | var 51 | 52 | name, key: string; 53 | 54 | begin 55 | Result := 0; 56 | 57 | if Signature(e) <> 'REFR' then 58 | exit; 59 | 60 | name := GetElementEditValues(LinksTo(ElementByPath(e, 'NAME')), 'EDID'); 61 | 62 | //AddMessage(name); 63 | 64 | for i := 0 to slRefsDoors.Count - 1 do begin 65 | 66 | if pos(slRefsDoors[i], name) > 0 then begin 67 | 68 | if Assigned(ElementByPath(e, 'XLOC')) then begin 69 | 70 | key := GetElementEditValues(e, 'XLOC\Key'); 71 | 72 | if CompareStr(key, 'NULL - Null Reference [00000000]') = 0 then 73 | AddMessage('Locked/No Key: ' + GetElementEditValues(e, 'Record Header\FormID')); 74 | 75 | end; 76 | 77 | end; 78 | 79 | end; 80 | 81 | end; 82 | 83 | function Finalize: integer; 84 | 85 | begin 86 | AddMessage(#13#10); 87 | Result := 1; 88 | end; 89 | 90 | end. 91 | -------------------------------------------------------------------------------- /Scripts/Quick Scripts - Unlevel Leveled List.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Unlevel/Relevel Leveled Lists 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | var 11 | slParentElements: TStringList; 12 | sTargetLevel: string; 13 | bDebug: bool; 14 | 15 | //============================================================================ 16 | function Initialize: integer; 17 | 18 | begin 19 | 20 | bDebug := true; 21 | 22 | slParentElements := TStringList.Create; 23 | 24 | if not InputQuery('Enter', 'Target Level:', sTargetLevel) then begin 25 | Result := 1; 26 | exit; 27 | end; 28 | 29 | if bDebug then begin 30 | ClearMessages(); 31 | AddMessage('Applying script...' + #13#10); 32 | end; 33 | 34 | end; 35 | 36 | //============================================================================ 37 | function Process(e: IInterface): integer; 38 | 39 | var 40 | h, i, j, k: integer; 41 | L0, L1, L2, L3: IInterface; 42 | s: string; 43 | 44 | begin 45 | 46 | slParentElements.Clear; 47 | 48 | // signature check 49 | if (Signature(e) = 'LVLI') or (Signature(e) = 'LVLN') or (Signature(e) = 'LVSP') then 50 | slParentElements.Add('Leveled List Entries') 51 | else 52 | exit; 53 | 54 | // ------------------------------------------------------------------------------- 55 | for h := 0 to slParentElements.Count - 1 do begin 56 | 57 | // level 1 58 | L0 := ElementByPath(e, slParentElements[h]); 59 | 60 | // ------------------------------------------------------------------------------- 61 | for i := 0 to ElementCount(L0) - 1 do begin 62 | 63 | // level 2 64 | L1 := ElementByIndex(L0, i); 65 | 66 | // ------------------------------------------------------------------------------- 67 | for j := 0 to ElementCount(L1) - 1 do begin 68 | 69 | // level 3 70 | L2 := ElementByIndex(L1, j); 71 | 72 | // ------------------------------------------------------------------------------- 73 | for k := 0 to ElementCount(L2) - 1 do begin 74 | 75 | // level 4 76 | L3 := ElementByIndex(L2, k); 77 | 78 | if CompareStr(Name(L3), 'Level') = 0 then begin 79 | 80 | if GetEditValue(L3) <> sTargetLevel then begin 81 | 82 | if bDebug then 83 | s := GetEditValue(L3); 84 | 85 | SetEditValue(L3, sTargetLevel); 86 | 87 | if bDebug then 88 | AddMessage('Updated: ' + GetElementEditValues(L2, 'Reference') + #13#10 + 'New Level: ' + GetEditValue(L3) + ' (Old Level: ' + s + ')' + #13#10); 89 | 90 | end; // end if - level comparison 91 | 92 | end; // end if - path comparison 93 | 94 | end; // end for - level 4 95 | 96 | end; // end for - level 3 97 | 98 | end; // end for - level 2 99 | 100 | end; // end for - level 1 101 | 102 | slParentElements.Clear; 103 | 104 | end; 105 | 106 | //============================================================================ 107 | function Finalize: integer; 108 | 109 | begin 110 | 111 | Result := 1; 112 | exit; 113 | 114 | end; 115 | 116 | end. 117 | -------------------------------------------------------------------------------- /Scripts/Remove DNAM.pas: -------------------------------------------------------------------------------- 1 | { 2 | New script template, only shows processed records 3 | Assigning any nonzero value to Result will terminate script 4 | } 5 | unit userscript; 6 | 7 | // Called before processing 8 | // You can remove it if script doesn't require initialization code 9 | function Initialize: integer; 10 | begin 11 | Result := 0; 12 | end; 13 | 14 | // called for every record selected in xEdit 15 | function Process(e: IInterface): integer; 16 | begin 17 | Result := 0; 18 | 19 | // comment this out if you don't want those messages 20 | AddMessage('Processing: ' + FullPath(e)); 21 | 22 | // processing code goes here 23 | //RemoveElement(e, 'DNAM'); 24 | //SetElementEditValues(e, 'DNAM', '0'); 25 | //SetElementEditValues(e, 'TNAM', '2'); 26 | //SetElementEditValues(e, 'ACBS\Template Flags\Use Def Pack List', '1'); 27 | //SetElementEditValues(e, 'RNAM', 'HeadPartsAllRaces [FLST:06000D62]'); 28 | SetElementNativeValues(e, 'DATA\Flags', GetElementNativeValues(e, 'DATA\Flags') or 4); 29 | 30 | end; 31 | 32 | // Called after processing 33 | // You can remove it if script doesn't require finalization code 34 | function Finalize: integer; 35 | begin 36 | Result := 0; 37 | end; 38 | 39 | end. 40 | -------------------------------------------------------------------------------- /Scripts/Replace Substring.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Replace substring in string 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | var 11 | sQuerySearch, sQueryReplace, sQueryPrefix, sQuerySuffix: string; 12 | bCapitalized: boolean; 13 | 14 | function Initialize: integer; 15 | begin 16 | 17 | if MessageDlg('Capitalize string [YES] or modify string [NO]?', mtConfirmation, [mbYes, mbNo], 0) = mrYes then 18 | bCapitalized := false 19 | else 20 | bCapitalized := true; 21 | 22 | if (bCapitalized <> false) then begin 23 | 24 | if not InputQuery('Enter', 'Search for:', sQuerySearch) then begin 25 | Result := 1; 26 | exit; 27 | end; 28 | 29 | if not InputQuery('Enter', 'Replace with:', sQueryReplace) then begin 30 | Result := 1; 31 | exit; 32 | end; 33 | 34 | if not InputQuery('Enter', 'Add prefix:', sQueryPrefix) then begin 35 | Result := 1; 36 | exit; 37 | end; 38 | 39 | if not InputQuery('Enter', 'Add suffix:', sQuerySuffix) then begin 40 | Result := 1; 41 | exit; 42 | end; 43 | 44 | end; 45 | 46 | end; 47 | 48 | function Capitalize(const s: string): string; 49 | var 50 | flag: boolean; 51 | i: Byte; 52 | t: string; 53 | 54 | begin 55 | 56 | if s <> '' then begin 57 | 58 | flag := true; 59 | t := ''; 60 | 61 | for i := 1 to Length(s) do begin 62 | 63 | if flag then 64 | t := t+ UpperCase(s[i]) 65 | else 66 | t := t+ s[i]; 67 | flag := (s[i] = ' ') 68 | 69 | end; 70 | 71 | end 72 | else t:=''; 73 | 74 | result := t; 75 | end; 76 | 77 | function Process(e: IInterface): integer; 78 | var 79 | signature: IInterface; 80 | source, target: string; 81 | begin 82 | Result := 0; 83 | 84 | signature := 'FULL'; 85 | //signature := 'Responses\Response\NAM1'; 86 | source := GetElementEditValues(e, signature); 87 | 88 | AddMessage('Processing: ' + FullPath(e)); 89 | 90 | if (bCapitalized = false) then begin 91 | 92 | if length(source) > 0 then begin 93 | 94 | SetElementEditValues(e, signature, Capitalize(source)); 95 | exit; 96 | 97 | end; 98 | 99 | end; 100 | 101 | if (pos(sQuerySearch, source) > 0) then begin 102 | 103 | if length(sQuerySearch) > 0 then begin 104 | source := GetElementEditValues(e, signature); 105 | target := StringReplace(source, sQuerySearch, sQueryReplace, [rfReplaceAll, rfIgnoreCase]); 106 | SetElementEditValues(e, signature, target); 107 | end; 108 | 109 | end; 110 | 111 | if length(sQueryPrefix) > 0 then begin 112 | source := GetElementEditValues(e, signature); 113 | target := Insert(sQueryPrefix, source, 0); 114 | SetElementEditValues(e, signature, target); 115 | end; 116 | 117 | if length(sQuerySuffix) > 0 then begin 118 | source := GetElementEditValues(e, signature); 119 | target := Insert(sQuerySuffix, source, length(source) + 1); 120 | SetElementEditValues(e, signature, target); 121 | end; 122 | 123 | end; 124 | 125 | function Finalize: integer; 126 | begin 127 | Result := 1; 128 | exit; 129 | end; 130 | 131 | end. 132 | -------------------------------------------------------------------------------- /Scripts/Resolve Errors.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Resolve Errors 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | 8 | unit UserScript; 9 | 10 | var 11 | slParentElements: TStringList; 12 | sOldIndex, sNewIndex, sFormID: string; 13 | fileFixed: iwbFile; 14 | bDebug: bool; 15 | 16 | //============================================================================ 17 | function Initialize: integer; 18 | 19 | begin 20 | 21 | ClearMessages(); 22 | 23 | bDebug := false; 24 | 25 | slParentElements := TStringList.Create; 26 | 27 | if not InputQuery('Enter', 'Old Index:', sOldIndex) then begin 28 | Result := 1; 29 | exit; 30 | end; 31 | 32 | if not InputQuery('Enter', 'New Index:', sNewIndex) then begin 33 | Result := 1; 34 | exit; 35 | end; 36 | 37 | fileFixed := FileByLoadOrder(StrToInt('$' + sNewIndex)); 38 | 39 | AddMessage(GetFileName(fileFixed)); 40 | 41 | end; 42 | 43 | //============================================================================ 44 | function Process(e: IInterface): integer; 45 | 46 | var 47 | h, i, j, k, l: integer; 48 | baseRecord, L0, L1, L2, L3, L4: IInterface; 49 | s, sCorrection: string; 50 | 51 | begin 52 | 53 | slParentElements.Clear; 54 | 55 | if Signature(e) = 'COBJ' then begin 56 | slParentElements.Add('Items'); 57 | slParentElements.Add('Conditions'); 58 | slParentElements.Add('CNAM'); 59 | slParentElements.Add('BNAM'); 60 | end; 61 | 62 | if Signature(e) = 'FLST' then 63 | slParentElements.Add('FormIDs'); 64 | 65 | if Signature(e) = 'LVLI' then 66 | slParentElements.Add('Leveled List Entries'); 67 | 68 | if Signature(e) = 'REFR' then 69 | slParentElements.Add('NAME'); 70 | 71 | // ------------------------------------------------------------------------------- 72 | for h := 0 to slParentElements.Count - 1 do begin 73 | 74 | // Level 0 75 | L0 := ElementByPath(e, slParentElements[h]); 76 | 77 | // If there is an error to be corrected 78 | if pos('Error:', GetEditValue(L0)) > 0 then begin 79 | 80 | s := IntToHex(GetNativeValue(L0), 8); 81 | 82 | // If this error should be corrected 83 | if CompareStr(sOldIndex, Copy(s, 1, 2)) = 0 then begin 84 | 85 | sCorrection := Delete(s, 1, 2); 86 | 87 | sCorrection := Insert(sNewIndex, sCorrection, 0); 88 | 89 | AddMessage('Error (' + Name(L0) + '): ' + GetEditValue(L0)); 90 | 91 | AddMessage('Correcting to: ' + sCorrection); 92 | 93 | baseRecord := RecordByFormID(FileByLoadOrder(StrToInt('$' + sNewIndex)), StrToInt('$' + sCorrection), true); 94 | 95 | AddMessage( 'Form ID: ' + GetElementEditValues(baseRecord, 'Record Header\FormID') ); 96 | 97 | if not bDebug then 98 | SetEditValue(L0, GetElementEditValues(baseRecord, 'Record Header\FormID')); 99 | 100 | AddMessage('Resolved to: ' + GetEditValue(L0) + #13#10); 101 | 102 | end; 103 | 104 | end; // end if - error check 105 | 106 | // ------------------------------------------------------------------------------- 107 | for i := 0 to ElementCount(L0) - 1 do begin 108 | 109 | // Level 1 110 | L1 := ElementByIndex(L0, i); 111 | 112 | // If there is an error to be corrected 113 | if pos('Error:', GetEditValue(L1)) > 0 then begin 114 | 115 | s := IntToHex(GetNativeValue(L1), 8); 116 | 117 | // If this error should be corrected 118 | if CompareStr(sOldIndex, Copy(s, 1, 2)) = 0 then begin 119 | 120 | sCorrection := Delete(s, 1, 2); 121 | 122 | sCorrection := Insert(sNewIndex, sCorrection, 0); 123 | 124 | AddMessage('Error (' + Name(L1) + '): ' + GetEditValue(L1)); 125 | 126 | AddMessage('Correcting to: ' + sCorrection); 127 | 128 | baseRecord := RecordByFormID(FileByLoadOrder(StrToInt('$' + sNewIndex)), StrToInt('$' + sCorrection), true); 129 | 130 | AddMessage( 'Form ID: ' + GetElementEditValues(baseRecord, 'Record Header\FormID') ); 131 | 132 | if not bDebug then 133 | SetEditValue(L1, GetElementEditValues(baseRecord, 'Record Header\FormID')); 134 | 135 | AddMessage('Resolved to: ' + GetEditValue(L1) + #13#10); 136 | 137 | end; 138 | 139 | end; // end if - error check 140 | 141 | // ------------------------------------------------------------------------------- 142 | for j := 0 to ElementCount(L1) - 1 do begin 143 | 144 | // Level 2 145 | L2 := ElementByIndex(L1, j); 146 | 147 | // If there is an error to be corrected 148 | if pos('Error:', GetEditValue(L2)) > 0 then begin 149 | 150 | s := IntToHex(GetNativeValue(L2), 8); 151 | 152 | // If this error should be corrected 153 | if CompareStr(sOldIndex, Copy(s, 1, 2)) = 0 then begin 154 | 155 | sCorrection := Delete(s, 1, 2); 156 | 157 | sCorrection := Insert(sNewIndex, sCorrection, 0); 158 | 159 | AddMessage('Error (' + Name(L2) + '): ' + GetEditValue(L2)); 160 | 161 | AddMessage('Correcting to: ' + sCorrection); 162 | 163 | baseRecord := RecordByFormID(FileByLoadOrder(StrToInt('$' + sNewIndex)), StrToInt('$' + sCorrection), true); 164 | 165 | AddMessage( 'Form ID: ' + GetElementEditValues(baseRecord, 'Record Header\FormID') ); 166 | 167 | if not bDebug then 168 | SetEditValue(L2, GetElementEditValues(baseRecord, 'Record Header\FormID')); 169 | 170 | AddMessage('Resolved to: ' + GetEditValue(L2) + #13#10); 171 | 172 | end; 173 | 174 | end; // end if - error check 175 | 176 | // ------------------------------------------------------------------------------- 177 | for k := 0 to ElementCount(L2) - 1 do begin 178 | 179 | // Level 3 180 | L3 := ElementByIndex(L2, k); 181 | 182 | // If there is an error to be corrected 183 | if pos('Error:', GetEditValue(L3)) > 0 then begin 184 | 185 | s := IntToHex(GetNativeValue(L3), 8); 186 | 187 | // If this error should be corrected 188 | if CompareStr(sOldIndex, Copy(s, 1, 2)) = 0 then begin 189 | 190 | sCorrection := Delete(s, 1, 2); 191 | 192 | sCorrection := Insert(sNewIndex, sCorrection, 0); 193 | 194 | AddMessage('Error (' + Name(L3) + '): ' + GetEditValue(L3)); 195 | 196 | AddMessage('Correcting to: ' + sCorrection); 197 | 198 | baseRecord := RecordByFormID(FileByLoadOrder(StrToInt('$' + sNewIndex)), StrToInt('$' + sCorrection), true); 199 | 200 | AddMessage( 'Form ID: ' + GetElementEditValues(baseRecord, 'Record Header\FormID') ); 201 | 202 | if not bDebug then 203 | SetEditValue(L3, GetElementEditValues(baseRecord, 'Record Header\FormID')); 204 | 205 | AddMessage('Resolved to: ' + GetEditValue(L3) + #13#10); 206 | 207 | end; 208 | 209 | end; // end if - error check 210 | 211 | // ------------------------------------------------------------------------------- 212 | for l := 0 to ElementCount(L3) - 1 do begin 213 | 214 | // Level 3 215 | L4 := ElementByIndex(L3, l); 216 | 217 | // If there is an error to be corrected 218 | if pos('Error:', GetEditValue(L4)) > 0 then begin 219 | 220 | s := IntToHex(GetNativeValue(L4), 8); 221 | 222 | // If this error should be corrected 223 | if CompareStr(sOldIndex, Copy(s, 1, 2)) = 0 then begin 224 | 225 | sCorrection := Delete(s, 1, 2); 226 | 227 | sCorrection := Insert(sNewIndex, sCorrection, 0); 228 | 229 | AddMessage('Error (' + Name(L4) + '): ' + GetEditValue(L4)); 230 | 231 | AddMessage('Correcting to: ' + sCorrection); 232 | 233 | baseRecord := RecordByFormID(FileByLoadOrder(StrToInt('$' + sNewIndex)), StrToInt('$' + sCorrection), true); 234 | 235 | AddMessage( 'Form ID: ' + GetElementEditValues(baseRecord, 'Record Header\FormID') ); 236 | 237 | if not bDebug then 238 | SetEditValue(L4, GetElementEditValues(baseRecord, 'Record Header\FormID')); 239 | 240 | AddMessage('Resolved to: ' + GetEditValue(L4) + #13#10); 241 | 242 | end; 243 | 244 | end; // end if - error check 245 | 246 | end; // end for - level 3 247 | 248 | end; // end for - level 2 249 | 250 | end; // end for - level 1 251 | 252 | end; // end for - level 0 253 | 254 | end; // end for - list 255 | 256 | slParentElements.Clear; 257 | 258 | end; 259 | 260 | function Finalize: integer; 261 | 262 | begin 263 | 264 | Result := 1; 265 | exit; 266 | 267 | end; 268 | 269 | end. 270 | -------------------------------------------------------------------------------- /Scripts/Reweigh Items.pas: -------------------------------------------------------------------------------- 1 | { 2 | Purpose: Reweigh Items 3 | Game: The Elder Scrolls V: Skyrim 4 | Author: fireundubh 5 | Version: 0.1 6 | } 7 | unit UserScript; 8 | 9 | var 10 | fConfirmation, fWeightless, fArmor, fBooks, fConsumables, fIngredients, fKeys, fMisc, fScrolls, fSoulGems, fWeapons: boolean; 11 | fArmorWeight, fBooksWeight, fConsumablesWeight, fIngredientsWeight, fKeysWeight, fMiscWeight, fScrollsWeight, fSoulGemsWeight, fWeaponsWeight: float; 12 | 13 | function Initialize: integer; 14 | begin 15 | Result := 0; 16 | 17 | fConfirmation := (MessageDlg('Are you sure you want to apply this script?', mtConfirmation, [mbYes, mbNo], 0) = mrYes); 18 | if (fConfirmation <> TRUE) then begin 19 | Exit; 20 | end; 21 | 22 | fWeightless := (MessageDlg('Do you want to reduce all item weights to zero?', mtConfirmation, [mbYes, mbNo], 0) = mrYes); 23 | if (fWeightless <> FALSE) then begin 24 | fArmor := TRUE; 25 | fBooks := TRUE; 26 | fConsumables := TRUE; 27 | fIngredients := TRUE; 28 | fKeys := TRUE; 29 | fMisc := TRUE; 30 | fScrolls := TRUE; 31 | fSoulGems := TRUE; 32 | fWeapons := TRUE; 33 | fArmorWeight := 0.000000; 34 | fBooksWeight := 0.000000; 35 | fConsumablesWeight := 0.000000; 36 | fIngredientsWeight := 0.000000; 37 | fKeysWeight := 0.000000; 38 | fMiscWeight := 0.000000; 39 | fScrollsWeight := 0.000000; 40 | fSoulGemsWeight := 0.000000; 41 | fWeaponsWeight := 0.000000; 42 | end; 43 | 44 | if (fWeightless <> TRUE) then begin 45 | 46 | fArmor := (MessageDlg('Reweigh Armor?', mtConfirmation, [mbYes, mbNo], 0) = mrYes); 47 | if (fArmor) AND (fWeightless <> TRUE) then begin 48 | fArmorWeight := (InputBox('Set Weight:', 'Weight:', 0.000000)); 49 | end; 50 | 51 | fBooks := (MessageDlg('Reweigh Books?', mtConfirmation, [mbYes, mbNo], 0) = mrYes); 52 | if (fBooks) AND (fWeightless <> TRUE) then begin 53 | fBooksWeight := (InputBox('Set Weight:', 'Weight:', 0.000000)); 54 | end; 55 | 56 | fConsumables := (MessageDlg('Reweigh Consumables?', mtConfirmation, [mbYes, mbNo], 0) = mrYes); 57 | if (fConsumables) AND (fWeightless <> TRUE) then begin 58 | fConsumablesWeight := (InputBox('Set Weight:', 'Weight:', 0.000000)); 59 | end; 60 | 61 | fIngredients := (MessageDlg('Reweigh Ingredients?', mtConfirmation, [mbYes, mbNo], 0) = mrYes); 62 | if (fIngredients) AND (fWeightless <> TRUE) then begin 63 | fIngredientsWeight := (InputBox('Set Weight:', 'Weight:', 0.000000)); 64 | end; 65 | 66 | fKeys := (MessageDlg('Reweigh Keys?', mtConfirmation, [mbYes, mbNo], 0) = mrYes); 67 | if (fKeys) AND (fWeightless <> TRUE) then begin 68 | fKeysWeight := (InputBox('Set Weight:', 'Weight:', 0.000000)); 69 | end; 70 | 71 | fMisc := (MessageDlg('Reweigh Misc.?', mtConfirmation, [mbYes, mbNo], 0) = mrYes); 72 | if (fMisc) AND (fWeightless <> TRUE) then begin 73 | fMiscWeight := (InputBox('Set Weight:', 'Weight:', 0.000000)); 74 | end; 75 | 76 | fScrolls := (MessageDlg('Reweigh Scrolls?', mtConfirmation, [mbYes, mbNo], 0) = mrYes); 77 | if (fScrolls) AND (fWeightless <> TRUE) then begin 78 | fScrollsWeight := (InputBox('Set Weight:', 'Weight:', 0.000000)); 79 | end; 80 | 81 | fSoulGems := (MessageDlg('Reweigh Soul Gems?', mtConfirmation, [mbYes, mbNo], 0) = mrYes); 82 | if (fSoulGems) AND (fWeightless <> TRUE) then begin 83 | fSoulGemsWeight := (InputBox('Set Weight:', 'Weight:', 0.000000)); 84 | end; 85 | 86 | fWeapons := (MessageDlg('Reweigh Weapons?', mtConfirmation, [mbYes, mbNo], 0) = mrYes); 87 | if (fWeapons) AND (fWeightless <> TRUE) then begin 88 | fWeaponsWeight := (InputBox('Set Weight:', 'Weight:', 0.000000)); 89 | end; 90 | 91 | end; 92 | 93 | end; 94 | 95 | function Process(e: IInterface): integer; 96 | begin 97 | Result := 0; 98 | 99 | AddMessage('Processing: ' + Name(e)); 100 | 101 | if (fArmor) AND (Signature(e) = 'ARMO') then begin 102 | SetElementNativeValues(e, 'DATA - Data\Weight', fArmorWeight) 103 | end; 104 | 105 | if (fBooks) AND (Signature(e) = 'BOOK') then begin 106 | SetElementNativeValues(e, 'DATA - Data\Weight', fBooksWeight) 107 | end; 108 | 109 | if (fConsumables) AND (Signature(e) = 'ALCH') then begin 110 | SetElementNativeValues(e, 'DATA - Weight', fConsumablesWeight) 111 | end; 112 | 113 | if (fIngredients) AND (Signature(e) = 'INGR') then begin 114 | SetElementNativeValues(e, 'DATA - \Weight', fIngredientsWeight) 115 | end; 116 | 117 | if (fKeys) AND (Signature(e) = 'KEYM') then begin 118 | SetElementNativeValues(e, 'DATA - \Weight', fKeysWeight) 119 | end; 120 | 121 | if (fMisc) AND (Signature(e) = 'MISC') then begin 122 | SetElementNativeValues(e, 'DATA - Data\Weight', fMiscWeight) 123 | end; 124 | 125 | if (fScrolls) AND (Signature(e) = 'SCRL') then begin 126 | SetElementNativeValues(e, 'DATA - Item\Weight', fScrollsWeight) 127 | end; 128 | 129 | if (fSoulGems) AND (Signature(e) = 'SLGM') then begin 130 | SetElementNativeValues(e, 'DATA - \Weight', fSoulGemsWeight) 131 | end; 132 | 133 | if (fWeapons) AND (Signature(e) = 'WEAP') then begin 134 | SetElementNativeValues(e, 'DATA - Game Data\Weight', fWeaponsWeight) 135 | end; 136 | 137 | end; 138 | 139 | end. --------------------------------------------------------------------------------