Mator

[xEdit] [pascal] Save Female NPCs

Sep 14th, 2015
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.79 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
  26.       sl.Add(Format('%s|%s', [fn, IntToHex(FormID(rec), 8)]));
  27.   end;
  28.  
  29.   // clean up
  30.   FinalizeMXPF;
  31.   sl.SaveToFile('Female NPCs.xml');
  32.   files.Free;
  33.   sl.Free;
  34. end;
  35.  
  36. end.
Advertisement
Add Comment
Please, Sign In to add comment