Ejemplo n.º 1
0
        public static bool GivePlayerGold(PlayerMobile player, int amount, bool informPlayer)
        {
            int amountLeft = amount;

            if (amount < 0)
            {
                return(false);
            }
            MasterLooterBackpack backpack = GetMasterLooter(player);

            if (backpack != null)
            {
                amountLeft = (int)backpack.AddGoldAmount((ulong)amountLeft);
            }
            while (amountLeft > 0)
            {
                int pileAmount = amountLeft > 60000?60000:amountLeft;
                amountLeft -= pileAmount;
                Gold gold = new Gold(pileAmount);
                if (!DropItemInBagOrFeet(player, backpack, gold))
                {
                    return(false);
                }
            }
            if (informPlayer)
            {
                player.SendMessage(1173, "You recieved " + (amount - amountLeft) + " gold.");
            }
            if (amountLeft == 0)
            {
                return(true);
            }
            return(false);
        }