Guest User

Untitled

a guest
May 24th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. /* global ngapp, xelib */
  2. registerPatcher({
  3. info: info,
  4. gameModes: [xelib.gmTES5, xelib.gmSSE],
  5. settings: {
  6. label: 'Ench Restrict Remover',
  7. hide: true
  8. },
  9. execute: {
  10. initialize: function(patch, helpers, settigns, locals) {
  11. let flst = xelib.AddElement(patch, 'FLST\\FLST');
  12. helpers.cacheRecord(flst, "NER");
  13. locals.flst = xelib.LongName(flst);
  14. helpers.loadRecords('KYWD').forEach(kywd => {
  15. let name = xelib.LongName(kywd);
  16. if (!name.match(/^(Clothing|Armor(?!Material)|WeapType)/)) return;
  17. helpers.logMessage("Allowing " + name);
  18. xelib.AddFormID(flst, name);
  19. });
  20. },
  21. process: [{
  22. load: {
  23. signature: 'ENCH',
  24. filter: function(record) {
  25. return xelib.HasElement(record, 'ENIT\\Worn Restrictions');
  26. }
  27. },
  28. patch: function(record, helpers, settings, locals) {
  29. helpers.logMessage('Patching ' + xelib.LongName(record));
  30. xelib.SetValue(record, 'ENIT\\Worn Restrictions', locals.flst);
  31. }
  32. }]
  33. }
  34. });
Add Comment
Please, Sign In to add comment