private static int RollNumEnchantments_Clothing_Jewelry_Dinnerware(WorldObject wo, TreasureDeath profile, TreasureRoll roll) { var chance = 0.1f; var rng = ThreadSafeRandom.NextInterval(profile.LootQualityMod); if (rng >= chance) { return(1); } else if (profile.Tier < 6) { return(2); } // tier 6+ has a chance for 3 enchantments rng = ThreadSafeRandom.NextInterval(profile.LootQualityMod * 0.1f); if (rng >= chance * 0.5f) { return(2); } else { return(3); } }
/// <summary> /// Rolls for the initial chance of getting a quality bonus for an item /// </summary> /// <param name="treasureDeath">The chances are based on treasureDeath.Tier, and can be increased with treasureDeath.LootQualityMod</param> private static bool RollTierChance(TreasureDeath treasureDeath) { var tierChance = QualityChancePerTier[treasureDeath.Tier - 1]; // use for initial roll? logic seems backwards here... var rng = ThreadSafeRandom.NextInterval(treasureDeath.LootQualityMod); return(rng < tierChance); }
private static int RollNumEnchantments_Armor_Weapon(WorldObject wo, TreasureDeath profile, TreasureRoll roll) { var tierChances = roll.IsCaster ? EnchantmentChances_Caster : EnchantmentChances_Armor_MeleeMissileWeapon; var chance = tierChances[profile.Tier - 1]; var rng = ThreadSafeRandom.NextInterval(profile.LootQualityMod); if (rng < chance) { return(1); } else { return(0); } }