public static void Initialize(LootConfig lootConfig) { Config = lootConfig; var random = new System.Random(); _weightedDropCountTable = new WeightedRandomCollection <int[]>(random); _weightedLootTable = new WeightedRandomCollection <LootDrop>(random); _weightedEffectTable = new WeightedRandomCollection <MagicItemEffectDefinition>(random); _weightedEffectCountTable = new WeightedRandomCollection <KeyValuePair <int, int> >(random); _weightedRarityTable = new WeightedRandomCollection <KeyValuePair <ItemRarity, int> >(random); LootTables.Clear(); AddItemSets(lootConfig.ItemSets); AddLootTables(lootConfig.LootTables); }
public static void Initialize(LootConfig lootConfig) { Config = lootConfig; var random = new System.Random(); _weightedDropCountTable = new WeightedRandomCollection <int[]>(random); _weightedLootTable = new WeightedRandomCollection <LootDrop>(random); _weightedEffectTable = new WeightedRandomCollection <MagicItemEffectDefinition>(random); _weightedEffectCountTable = new WeightedRandomCollection <KeyValuePair <int, int> >(random); _weightedRarityTable = new WeightedRandomCollection <KeyValuePair <ItemRarity, int> >(random); ItemSets.Clear(); LootTables.Clear(); if (Config == null) { EpicLoot.LogWarning("Initialized LootRoller with null"); return; } AddItemSets(lootConfig.ItemSets); AddLootTables(lootConfig.LootTables); }