Beispiel #1
0
        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);
        }
Beispiel #2
0
 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);
 }
Beispiel #3
0
 private static bool isPair(RollOption roll)
 {
     return(roll == RollOption.Pair);
 }