public bool Roll(RollOption option) { bool result; var thisLootItem = this; var findIndex = Array.FindIndex(LootManager.RawLootItems, item => item.Equals(thisLootItem)); using (Core.Memory.TemporaryCacheState(false)) { lock (Core.Memory.Executor.AssemblyLock) { result = Core.Memory.CallInjected64 <bool>(Offsets.Instance.LootFunc, new object[] { Offsets.Instance.LootsAddr, (ulong)option, findIndex }); } } if (result) { LogHelper.Instance.Log($"Rolled {option} for {Item.CurrentLocaleName}. LootState: {RollState} Remaining time: {LeftRollTime:F2}"); if (BotBase.Instance.ShowLootNotification) { OverlayHelper.Instance.AddToast($"Rolled [{option}] for {Item.CurrentLocaleName}.", Colors.Gold, Colors.Black, TimeSpan.FromSeconds(2.5)); } } else { LogHelper.Instance.Log($"Failed rolling {option} for {Item.CurrentLocaleName}. LootState: {RollState} Remaining time: {LeftRollTime:F2}"); } return(result); }
private bool isTripsRollOption(RollOption result) { return((result == RollOption.TripOnes || result == RollOption.TripTwos || result == RollOption.TripThrees || result == RollOption.TripFours || result == RollOption.TripFives || result == RollOption.TripSixes ) ? true : false); }
private static bool isPair(RollOption roll) { return(roll == RollOption.Pair); }