Ejemplo n.º 1
0
        public static bool GivePlayerTokens(PlayerMobile player, int amount, bool informPlayer)
        {
#if USE_TOKENS
            int amountLeft = amount;
            if (amount < 0)
            {
                return(false);
            }
            MasterLooterBackpack backpack = GetMasterLooter(player);
            if (backpack != null)
            {
                amountLeft = (int)backpack.AddTokensAmount((ulong)amountLeft);
            }
            while (amountLeft > 0)
            {
                int pileAmount = amountLeft > 60000?60000:amountLeft;
                amountLeft -= pileAmount;
                Daat99Tokens tokens = new Daat99Tokens(pileAmount);
                if (!DropItemInBagOrFeet(player, backpack, tokens))
                {
                    return(false);
                }
            }
            if (informPlayer)
            {
                player.SendMessage(1173, "You recieved " + (amount - amountLeft) + " tokens.");
            }
            if (amountLeft == 0)
            {
                return(true);
            }
#endif
            return(false);
        }