Mator

[xEdit] Save Female NPCs

Feb 11th, 2016
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.83 KB | None | 0 0
  1. unit UserScript;
  2.  
  3. uses 'lib\mxpf';
  4.  
  5. function Initialize: Integer;
  6. var
  7.   i: integer;
  8.   sl, files: TStringList;
  9.   rec: IInterface;
  10.   fn: string;
  11. begin
  12.   // initialize stringlists
  13.   sl := TStringList.Create;
  14.   files := TStringList.Create;
  15.  
  16.   // get user file selection
  17.   MultiFileSelect(files, 'Select the files you want to save female NPCs from');
  18.   InitializeMXPF;
  19.   DefaultOptionsMXPF;
  20.   SetInclusions(files.CommaText);
  21.   LoadRecords('NPC_');
  22.   for i := 0 to MaxRecordIndex do begin
  23.     rec := GetRecord(i);
  24.     fn := GetFileName(GetFile(rec));
  25.     if geev(rec, 'ACBS/Flags/Female') = '1' then begin
  26.       sl.Add(Format('%s|%s', [fn, IntToHex(FormID(rec), 8)]));
  27.       sl.Add(Name(rec));
  28.     end;
  29.   end;
  30.  
  31.   // clean up
  32.   FinalizeMXPF;
  33.   sl.SaveToFile('Female NPCs.txt');
  34.   files.Free;
  35.   sl.Free;
  36. end;
  37.  
  38. end.
Advertisement
Add Comment
Please, Sign In to add comment