Advertisement
Aogara

Untitled

Jun 10th, 2022 (edited)
1,759
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 5.12 KB | None | 0 0
  1. module ReducedLootMain
  2.  
  3. import ReducedLootUtils.RL_Converters
  4. import ReducedLootTypes.*
  5.  
  6. // -- Reduced Loot - Main config file
  7. //    Here you can edit loot removal probability for all categories
  8. //    Values defined in percents where 0 equals always remove and 100 equals always drop
  9.  
  10. //    WHILE YOU EDIT THE VALUES BELOW PLEASE PAY ATTENTION TO COMMAS, YOU SHOULD NOT DELETE IT
  11.  
  12. // -- Reduced Loot Config version 1.2
  13. // Changes were made on NPCs inventory :
  14. // * Almost completely restored NPCs weapon (inventory & held) drop to avoid situation of too few weapon dropped after battle
  15. // * +25% probability for clothes uncommon quality and above to drop
  16. // * 65% chance on junks and 50% chance on money to appear in NPCs inventory
  17.  
  18. public class Config {
  19.  
  20.   // -- Probability settings for weapons drop per quality and loot source
  21.   public static func Weapon(source: RL_LootSource, quality: RL_LootQuality) -> Int32 {
  22.     //    Quality ->  Common    Uncommon    Rare    Epic    Legendary  \  Source:
  23.     let cont =     [    0,         25,       50,     75,       100  ]; // <- Containers
  24.     let wrld =     [    0,         25,       50,     75,       100  ]; // <- World placed loot
  25.     let invt =     [   90,        100,      100,    100,       100  ]; // <- NPCs inventory
  26.     let held =     [   90,        100,      100,    100,       100  ]; // <- NPCs held weapons
  27.  
  28.     switch source {
  29.       case RL_LootSource.Container: return cont[RL_Converters.QualityToInt(quality)];
  30.       case RL_LootSource.World: return wrld[RL_Converters.QualityToInt(quality)];
  31.       case RL_LootSource.Puppet: return invt[RL_Converters.QualityToInt(quality)];
  32.       case RL_LootSource.Held: return held[RL_Converters.QualityToInt(quality)];
  33.       default: return 0;
  34.     }
  35.   }
  36.  
  37.   // -- Probability settings for clothes drop per quality and loot source
  38.   public static func Clothes(source: RL_LootSource, quality: RL_LootQuality) -> Int32 {
  39.     //    Quality ->  Common    Uncommon    Rare    Epic    Legendary  \  Source:
  40.     let cont =     [    0,         25,       50,     75,       100  ]; // <- Containers
  41.     let wrld =     [    0,         25,       50,     75,       100  ]; // <- World placed loot
  42.     let invt =     [    0,         50,       75,    100,       100  ]; // <- NPCs inventory
  43.  
  44.     if Equals(RL_LootSource.Held, source) { return 0; }
  45.     switch source {
  46.       case RL_LootSource.Container: return cont[RL_Converters.QualityToInt(quality)];
  47.       case RL_LootSource.World: return wrld[RL_Converters.QualityToInt(quality)];
  48.       case RL_LootSource.Puppet: return invt[RL_Converters.QualityToInt(quality)];
  49.       default: return 0;
  50.     }
  51.   }
  52.  
  53.   // -- Probability settings for remained loot categories based on drop source per loot category
  54.   public static func Misc(source: RL_LootSource, type: RL_LootType) -> Int32 {
  55.     //    Source ->   Containers    World placed    NPCs inventory   \  Type:
  56.     let ammo =    [       25,           25,              25       ]; // <- Ammo
  57.     let craf =    [       50,           50,              50       ]; // <- Crafting materials
  58.     let cybr =    [       50,           50,              50       ]; // <- Cyberware
  59.     let edib =    [       50,           50,              50       ]; // <- Edibles
  60.     let grnd =    [       25,           25,              25       ]; // <- Grenades
  61.     let heal =    [       25,           25,              25       ]; // <- Healings
  62.     let junk =    [       50,           50,              65       ]; // <- Junk
  63.     let mods =    [       50,           50,              50       ]; // <- Mods
  64.     let moni =    [       25,           25,              50       ]; // <- Money
  65.     let hack =    [       50,           50,              50       ]; // <- Quickhacks
  66.     let schm =    [       100,          100,             100      ]; // <- Schematics
  67.     let shrd =    [       100,          100,             100      ]; // <- Shards
  68.     let skll =    [       100,          100,             100      ]; // <- Skillbooks
  69.  
  70.     if Equals(RL_LootSource.Held, source) { return 0; }
  71.     switch type {
  72.       case RL_LootType.Ammo: return ammo[RL_Converters.SourceToInt(source)];
  73.       case RL_LootType.CraftingMaterials: return craf[RL_Converters.SourceToInt(source)];
  74.       case RL_LootType.Cyberware: return cybr[RL_Converters.SourceToInt(source)];
  75.       case RL_LootType.Edibles: return edib[RL_Converters.SourceToInt(source)];
  76.       case RL_LootType.Grenades: return grnd[RL_Converters.SourceToInt(source)];
  77.       case RL_LootType.Healings: return heal[RL_Converters.SourceToInt(source)];
  78.       case RL_LootType.Junk: return junk[RL_Converters.SourceToInt(source)];
  79.       case RL_LootType.Mods: return mods[RL_Converters.SourceToInt(source)];
  80.       case RL_LootType.Money: return moni[RL_Converters.SourceToInt(source)];
  81.       case RL_LootType.Quickhacks: return hack[RL_Converters.SourceToInt(source)];
  82.       case RL_LootType.Schematics: return schm[RL_Converters.SourceToInt(source)];
  83.       case RL_LootType.Shards: return shrd[RL_Converters.SourceToInt(source)];
  84.       case RL_LootType.SkillBooks: return skll[RL_Converters.SourceToInt(source)];
  85.       default: return 0;
  86.     };
  87.   }
  88. }
  89.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement