Ejemplo n.º 1
0
        private async Task <bool> BuyMount(int vendorId, WoWPoint vendorLocation, int itemId)
        {
            var item = Me.BagItems.FirstOrDefault(i => i.Entry == itemId);

            if (item == null)
            {
                return(await UtilityCoroutine.BuyItem(
                           vendorId,
                           vendorLocation,
                           itemId,
                           1,
                           noVendorFrameAction : () => QBCLog.Fatal("Npc ({0}) does not offer a vendor frame", vendorId),
                           itemNotFoundAction : () => QBCLog.Fatal("Npc ({0}) does not sell the item with ID: {1}", vendorId, itemId),
                           insufficientFundsAction : () => QBCLog.Fatal("Toon does not have enough funds to buy {0} from {1}", itemId, vendorId)));
            }
            item.Use();
            _purchasedMountTimer.Reset();
            await CommonCoroutines.SleepForRandomUiInteractionTime();

            return(true);
        }