His blood alcohol level was 132 milligrams of alcohol to 100 millilitres of blood.
He also had an illegal synthetic drug known as "4-MEC", which has a close chemical association with Methcathinone, in his system.
The effects of the Class C drug are likened to amphetamine drugs that provide an elevated mood or euphoria for a few hours, and can have adverse effects when mixed with alcohol.
Two blue pills found on David's body were later established to be 4-MEC.
Tests also indicated the possible use of cannabis.
Judge MacLean noted in the report that it was difficult to assess what effect the drugs had on David without information on the timing and dose that he took.
"However ... the combined effects ofthe drugs and alcohol would have adversely affected him that evening and impaired his judgment."
After consuming alcohol at two pre-ball events, both of which had parents present, David attended the ball at Eden Park.
He was put in a "time out" area after a security guard found him in the female toilets at about 8.45pm and teachers suspected the influence of drugs or alcohol.
Mr Gaynor arrived a short time later to collect him, and David was told by the deputy headmaster that there would be disciplinary action as a result.
On the ride home David was told by his father that the situation was a disappointment and that he risked being expelled.
He went quietly to bed when they arrived home.
From about 9.30pm onwards David texted friends saying he had been caught with pills, and expressed thoughts about death and getting expelled and saying he was going to jump off a bridge.
The friends responded with texts and calls, and discovered that David was no longer at home.
Three of the friends were given permission to leave the ball and look for him.
After being unable to find him, they went to his home and spoke to Mr Gaynor, who joined the search.
He sent texts and calls to his son's cellphone, which were later answered by police.
Mr Gaynor later questioned why someone with medical qualifications was not present in the "time out" room at the ball, and why the school did not call him when David's friends asked to leave the ball.
But Judge MacLean said that without the benefit of hindsight King's College had acted appropriately in the course of rapidly unfolding events.
Mr MacLean noted that there was little to warn David's friends or family of the tragedy.
"David was fit and healthy and there is no known medical or mental health history relevant to the circumstances of his death.
"The available evidence shows that David's father and friends had not ever known David to have been depressed, down, or unhappy, or troubled by any events or incidents."
He concluded that despite the clear influence of drugs and alcohol, David was aware of his actions and their likely consequences.
"I am satisfied to the point of being sure that he intended to take his own life and that the cause of his death was suicide."
WHERE TO GET HELP
If it's an emergency and you feel like you or someone else is at risk, call 111. Or call Youthline 0800 376 633, Lifeline 0800 543 354, Depression Helpline 0800 111 757, What's Up 0800 942 8787 (noon-midnight).