Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //weapon type array
  2. const WeaponDetect = [  '0001E711',
  3.                         '0001E714',
  4.                         '0001E712',
  5.                         '0001E713',
  6.                         '0006D931',
  7.                         '0006D930',
  8.                         '0006D932'];
  9.  
  10. //weapon speed array                   
  11. const WeaponSpeedSet = [1.100000,
  12.                         0.900000,
  13.                         1.000000,
  14.                         1.350000,
  15.                         0.850000,
  16.                         0.600000,
  17.                         0.666667];
  18.  
  19. //weapon reach array               
  20. const WeaponReachSet = [0.700000,
  21.                         0.600000,
  22.                         0.600000,
  23.                         0.400000,
  24.                         1.050000,
  25.                         0.950000,
  26.                         0.950000];
  27.  
  28. registerPatcher({
  29.     info: info,
  30.     gameModes: [xelib.gmTES5, xelib.gmSSE],
  31.     settings: {
  32.         label: 'Weapon Rebalancer',
  33.         hide: true, //hides the name in the menu since you don't have custom settings, just shows the "build" option
  34.         //removed the other settings option since you don't have an external settings file
  35.         defaultSettings: {
  36.             patchFileName: 'WeaponRebalancer.esp' //sets your filename
  37.         }
  38.        
  39.     },
  40.     requiredFiles: [],
  41.     getFilesToPatch: function(filenames) {
  42.         return filenames;
  43.     },
  44.     execute: {
  45.         process: [{
  46.             load: function(plugin, helpers, settings, locals) {
  47.                 return {
  48.                     signature: 'WEAP'
  49.                 }
  50.             },
  51.  
  52.             patch: function(record, helpers, settings, locals) {   
  53.                 //Melee Weapon Attributes
  54.                 for (let x = 0; x < WeaponDetect.length; x++){ //loop, raises x by one every pass, limited by the length of the array
  55.                     if (xelib.HasKeyword(record, WeaponDetect[x])) {//calls the array at x
  56.                         xelib.SetFloatValue(record, 'DNAM\\Speed', WeaponSpeedSet[x]);
  57.                         xelib.SetFloatValue(record, 'DNAM\\Reach', WeaponReachSet[x]);
  58.                     }
  59.                 }
  60.             }
  61.         }]
  62.     }
  63. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement