(2) In no event shall the duration of the actual imprisonment under the ranges or variations from the ranges exceed the maximum term of imprisonment fixed for an offense, except in the case of a prisoner who has been sentenced under ORS 161.725 as a dangerous offender, in which case the maximum term shall not exceed 30 years. [1977 c.372 §3; 1981 c.547 §1; 1987 c.634 §3]