}
L2NpcInstance npc = activeChar.getLastNpc();
boolean isValidMerchant = npc instanceof L2ClanHallManagerInstance || npc instanceof L2MerchantInstance || npc instanceof L2MercManagerInstance || npc instanceof L2CastleChamberlainInstance || npc instanceof L2NpcFriendInstance;
if(!activeChar.isGM() && (npc == null || !isValidMerchant || !activeChar.isInRange(npc.getLoc(), L2Character.INTERACTION_DISTANCE)))
{
activeChar.sendActionFailed();
return;
}
GArray<L2ItemInstance> toreturn = new GArray<L2ItemInstance>(_ids.length);
long price = 0, weight = 0;
for(int itemId : _ids)