using System.Collections.Generic; using ACE.Server.Factories.Entity; using ACE.Database.Models.World; namespace ACE.Server.Factories.Tables { public static class ScrollLevelChance { private static ChanceTable T1_ScrollLevelChances = new ChanceTable() { ( 1, 0.25f ), ( 2, 0.50f ), ( 3, 0.25f ) }; private static ChanceTable T2_ScrollLevelChances = new ChanceTable() { ( 3, 0.25f ), ( 4, 0.50f ), ( 5, 0.25f ) }; private static ChanceTable T3_ScrollLevelChances = new ChanceTable() { ( 5, 0.25f ), ( 6, 0.50f ), ( 7, 0.25f ) }; private static ChanceTable T4_ScrollLevelChances = new ChanceTable() { ( 6, 0.50f ), ( 7, 0.50f ) }; private static ChanceTable T5_T8_ScrollLevelChances = new ChanceTable() { ( 7, 1.00f ) }; private static readonly List> scrollLevelChances = new List>() { T1_ScrollLevelChances, T2_ScrollLevelChances, T3_ScrollLevelChances, T4_ScrollLevelChances, T5_T8_ScrollLevelChances, T5_T8_ScrollLevelChances, T5_T8_ScrollLevelChances, T5_T8_ScrollLevelChances, }; public static int Roll(TreasureDeath profile) { // shortcut if (profile.Tier >= 5) return 7; var table = scrollLevelChances[profile.Tier - 1]; return table.Roll(profile.LootQualityMod); } } }