Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unit UserScript;
- var
- RefCount: integer;
- function Process(e: IInterface): integer;
- var
- s: string;
- var
- edid: String;
- begin
- RefCount := 0;
- s := Signature(e);
- if (s <> 'REFR') and (s <> 'ACHR') then
- Exit;
- if GetIsDeleted(e) then
- Exit;
- edid := EditorID(LinksTo(ElementBySignature(e, 'NAME')));
- // This is the important part.
- if edid = 'A' then SetElementEditValues(e, 'NAME', 'B');
- // A -> EditorID of the base object you want to replace.
- // B -> FormID number of the base object you want to replace it with. (Make sure load order is correct!
- // e.g.: if edid = 'ArmorElvenShield' then SetElementEditValues(e, 'NAME', '000139A1');
- // This will replace all elven shield with elven swords (000139A1).
- if not ElementExists(e, 'DATA') then
- Exit;
- Inc(RefCount);
- end;
- function Finalize: integer;
- begin
- AddMessage(Format('Done, updated %d reference(s)', [RefCount]));
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment