public static bool WithdrawPackAndBank(Mobile from, int amount) { int totalGold = 0; List <Gold> packgold; //BankCheck[] packchecks; Gold[] bankgold; BankCheck[] bankchecks; if (from.Backpack != null) { packgold = from.Backpack.FindItemsByType <Gold>(); //packchecks = from.Backpack.FindItemsByType<BankCheck>( false ); //They are only blessed on the top layer. for (int i = 0; i < packgold.Count; i++) { totalGold += packgold[i].Amount; } //for ( int i = 0;i < packchecks.Length; i++ ) // totalGold += packchecks[i].Worth; } else { packgold = new List <Gold>(); //packchecks = new BankCheck[0]; } if (totalGold < amount) { totalGold += Banker.GetBalance(from, out bankgold, out bankchecks); } else { bankgold = new Gold[0]; bankchecks = new BankCheck[0]; } if (totalGold >= amount) { for (int i = 0; amount > 0 && i < packgold.Count; ++i) { int consume = Math.Min(packgold[i].Amount, amount); packgold[i].Consume(consume); amount -= consume; } /* * for ( int i = 0; amount > 0 && i < packchecks.Count; ++i ) * { * int consume = Math.Min( packchecks[i].Worth, amount ); * packchecks[i].ConsumeWorth( consume ); * amount -= consume; * } */ Banker.WithdrawUpTo(from, amount, bankgold, bankchecks); return(true); } return(false); }