* @param client
	 */
	private void cmd_buy(final String arg, final Client client) {
		final Player player = getPlayer(client);

		if ( player.getStatus().equals(Constants.ST_INTERACT) ) { // interact mode
			NPC npc = (NPC) player.getTarget();
			
			// TODO null check?
			
			send(npc.getName(), client); // tell us his/her name

			debug("Target is NPC.");

			if ( npc.hasFlag(ObjectFlag.VENDOR) ) { // if the npc is a vendor
				debug("Target is Vendor");
				
				Vendor v = null;
				
				v = (Vendor) npc; // Cast npc as a vendor into a vendor reference	
				
				/*try {
					v = (Vendor) npc; // Cast npc as a vendor into a vendor reference	
				}
				catch(final Exception e) {
					System.out.println("--- Stack Trace ---");
					e.printStackTrace();
				}*/
				
				if ( v == null ) return;

				if (v.hasItem(arg)) // if the vendor had that item
				{
					final Coins value = v.getItem(arg).getValue();
					
					if( player.getMoney().isMoreOrEqual(value) ) {
						//final Coins payment = player.getMoney().subtract(value);
						final Item item1 = v.buy(arg, value);
						
						// TODO clean this up somehow
						debug("Player Funds (cp): " + player.getMoney().numOfCopper());
						debug("  Item Value (cp): " + value.numOfCopper());
						//debug("        Cost (cp): " + temp.numOfCopper());
						
						player.setMoney( player.getMoney().subtract(value) );
						
						debug("");
						debug("Player Funds (cp): " + player.getMoney().numOfCopper());

						send("Item Bought!", client); // tell us that we bought the item

						send(colors(npc.getName(), getDisplayColor("npc")) + " takes your money and gives you a " + item1.getName(), client); // response

						item1.setLocation(player.getDBRef()); // change item's location

						player.getInventory().add(item1); // add the item to the player's inventory
						
						addMessage( npc.say("There you go.") ); // npc response 
					}
					else send("I'm sorry, you can't afford that.", client);
				}
				else send("I'm sorry, we don't sell that.", client);
			}
		}
		else debug("Target is not npc.");
	}