  In this paper, we study Lusztig's $a$-function for a Coxeter group with
unequal parameters. We determine that function explicitly in the ``asymptotic
case'' in type $B_n$, where the left cells have been determined in terms of a
generalized Robinson--Schensted correspondence by Bonnaf\'e and the second
author. As a consequence, we can also show that all of Lusztig's conjectural
properties (P1)--(P15) hold in this case, except possibly (P9), (P10) and
(P15). Our methods rely on the ``leading matrix coefficients'' introduced by
the first author. We also interprete the ideal structure defined by the
two-sided cells in the associated Iwahori--Hecke algebra $\bH_n$ in terms of
the Dipper--james--Murphy basis of $\bH_n$.
