/// <summary> /// Generates items in the given item collection based on loot table key. /// Any existing items will be destroyed. /// </summary> public static void GenerateEnemyItems(ItemCollection collection, int[] traits, EnemyEntity enemyEnt) { DaggerfallEntity enemy = enemyEnt as DaggerfallEntity; int[] enemyPredefLootTableProperties; int[] enemyExtraLootProperties; enemyPredefLootTableProperties = EnemyBasics.EnemyPredefLootTableCalculator(enemy, traits); enemyExtraLootProperties = EnemyBasics.EnemyExtraLootCalculator(enemy, traits, enemyPredefLootTableProperties); EnemyBasics.TraitExtraLootModCalculator(traits, enemyPredefLootTableProperties, enemyExtraLootProperties, out enemyPredefLootTableProperties, out enemyExtraLootProperties); DaggerfallUnityItem[] newitems = LootTables.GenerateEnemyLoot(enemy, traits, enemyPredefLootTableProperties, enemyExtraLootProperties); FormulaHelper.ModifyFoundLootItems(ref newitems); collection.Import(newitems); }
/// <summary> /// Generates items in the given item collection based on loot table key. /// Any existing items will be destroyed. /// </summary> public static void GenerateBuildingItems(ItemCollection collection, int[] traits, EnemyEntity enemyEnt = null) { DaggerfallEntity enemy = enemyEnt as DaggerfallEntity; // This may not work as i'm expecting, will have to see. int[] enemyPredefLootTableProperties; int[] enemyExtraLootProperties; enemyPredefLootTableProperties = EnemyBasics.EnemyPredefLootTableCalculator(enemy, traits); enemyExtraLootProperties = EnemyBasics.EnemyExtraLootCalculator(enemy, traits, enemyPredefLootTableProperties); EnemyBasics.TraitExtraLootModCalculator(traits, enemyPredefLootTableProperties, enemyExtraLootProperties, out enemyPredefLootTableProperties, out enemyExtraLootProperties); // Now will start actually creating the items based on enemyPredefLootTableProperties and enemyExtraLootProperties, after that is done, likely add the "flavor" items from the traits afterward. DaggerfallUnityItem[] newitems = LootTables.GenerateEnemyLoot(enemy, traits, enemyPredefLootTableProperties, enemyExtraLootProperties); FormulaHelper.ModifyFoundLootItems(ref newitems); collection.Import(newitems); }