Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- Run on armor record with non-playable flag to inject unlootable armor
- into leveled lists referencing that armor piece
- }
- unit userscript;
- uses mtefunctions;
- /////////////////////////////////////////////////////////////////////////////////////
- function Initialize: integer;
- begin
- Result := 0;
- end;
- /////////////////////////////////////////////////////////////////////////////////////
- // called for every record selected in xEdit
- function Process(e: IInterface): integer;
- var
- xstr : string;
- i, u, xint : integer;
- xMain : IInterface;
- entries : IInterface;
- xlvl, xcount, xref : string;
- begin
- Result := 0;
- AddMessage('Processing: ' + FullPath(e));
- for i := 0 to Pred(ReferencedByCount(e)) do
- Begin
- xMain := ReferencedByIndex(e, i);
- AddMessage('xmain is : ' + FullPath(xMain));
- if Signature(xMain) <> 'LVLI' then
- Begin
- AddMessage('Record Signature not LVLI');
- Exit;
- End;
- entries := ElementByName(xMain, 'Leveled List Entries');
- if not Assigned(entries) then
- begin
- AddMessage('Entries not assigned');
- Exit;
- end;
- for u := 0 to (ElementCount(entries) - 1) do
- begin
- ent := ElementByIndex(entries, u);
- xlvl := GetElementEditValues(ent,'LVLO\Level');
- xcount := GetElementEditValues(ent, 'LVLO\Count');
- xref := GetElementEditValues(ent, 'LVLO\Reference');
- AddMessage('xref is ' + xref);
- end;
- end;
- end;
- /////////////////////////////////////////////////////////////////////////////////////
- // Called after processing
- // You can remove it if script doesn't require finalization code
- function Finalize: integer;
- begin
- Result := 0;
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment