It's calculated using your overall HSC mark, but obviously Externals have a major impact on it, if you're ranked first and you pull off one of the highest marks in the state then yes, externals play the role because you're ranked first.
If you're ranked 2nd/3rd/etc... it'll be what you get as...