The 27-year-old all-rounder is accused of punching Ryan Hale, 27, to the ground and then allegedly knocking out Ryan Ali, 28, a short time later during a fracas in the early hours of September 25 last year.
Bristol Crown Court heard Stokes insulted doorman Andrew Cunningham after he refused to allow the cricketer and England teammate Alex Hales into the Mbargo nightclub because it was after 2am.
Stokes, who had been drinking, became abusive after Mr Cunningham maintained his position, despite the cricketer offering him £300 for entry, the jury heard.
Nicholas Corsellis, prosecuting, described Stokes as being "provocative and offensive" towards Mr Cunningham telling him his gold front teeth made him look like a "c***" and that his tattoos were "shit".
Stokes then starting speaking with two gay men, Kai Barry and William O'Connor, who were "flamboyant, extroverted and openly gay" and acting in a "camp and effeminate" manner.
He then allegedly began "mimicking their voices and mannerisms" in a derogatory way seen by Mr Cunningham.
"Mr Cunningham had cause to be concerned when he saw Mr Stokes take either the unlit butt or the butt of his cigarette and flick it onto Mr O'Connor's head," Mr Corsellis said.
"Mr Cunningham said to Mr Stokes, 'If you want to start on anyone, start on me'."
The doorman told Mr Hales that he had seen Stokes flick the cigarette, with the cricketer telling his teammate "Stokesy - don't do that", the jury of six men and six women was told.
CCTV footage shows Ali and Hale leaving the nightclub at 2.23am and walking off with Mr Barry and Mr O'Connor.
Stokes headed off from Mbargo with Mr Hales about a minute later, after becoming "enraged" when Mr Cunningham refused to shake his hand.
"Mr Stokes's behaviour outside the nightclub sets an important tone for what happened that night," Mr Corsellis said.
"He was clearly frustrated and annoyed."
CCTV footage shows Stokes and Mr Hales catch up with Ali, Hale, Mr Barry and Mr O'Connor as they stood on Queens Road.
Mr Barry appeared to touch Ali inappropriately to his groin area, before returning and trying to take his arm.
Ali pushed Mr Barry away "with no significant force" but Stokes "charged" over to the group, Mr Corsellis said.
The jury heard only the defendants know how the alleged fight started but Ali raised a bottle as if to hit Mr Hales, instead making "glancing contact" with Mr Barry's shoulder.
Stokes then threw a punch at Ali, with both men falling to the ground. Mr Hales is seen using his foot on Ali's back, the court heard.
Mr Corsellis said all of those present, except for Stokes, then wanted the situation to stop - with Mr Hales telling him "Stokes, Stokes, that's enough".
"Alex Hales tries to get hold of Mr Stokes on two occasions to try to prevent his escalation into the violence that we see," he said.
Residents were woken up by noises from outside, including student Max Wilson who began filming with his mobile phone.
Laura Sweeney dialled 999 after waking to a person shouting "Stop, please stop, I've had enough now".
She saw Hale pulling a metal pole from a street sign before running back to the group.
Jess Thomas later described retreating back to her bed after seeing five or six men rolling around in the street.
The alleged incident was also witnessed by off-duty special constable Mark Spure.
Doctors diagnosed Ali with a fracture to the left of his face, a swollen left eye and a laceration above his eyebrow. He also had a cracked lower left molar.
Hale sustained a 1.5 inch superficial laceration and bruising to his forehead, consistent with blunt force trauma.
"Mr Stokes had no obvious injuries save for an area of swelling over the metacarpals on his right hand," Mr Corsellis added.
The Durham county cricketer was arrested at the scene and the officers' bodycam footage captures Hale saying that he did not wish to press charges as Stokes "ain't done anything to me".
"The footage also captures Mr Hales stating that he was not present during the incident, contrary to the CCTV footage," Mr Corsellis said.
"When being told by the officers the reason for his arrest, Stokes said that he had acted in the way that he did: 'Because he was abusing my two friends for being gay'."
Mr Corsellis said Stokes mouthed something to Mr Hales and appeared to wink at him from the police car.
Stokes was interviewed on two occasions and made "no comment" answers to all questions but gave three prepared statements.
He claimed he saw Ali and Hale speaking to the two gay men in a "harsh and abusive" way that was homophobic in nature.
"He denied mimicking or behaving in a derogatory manner towards Mr Barry and Mr O'Connor, saying that they had engaged in joking with each other and denied flicking a cigarette butt at anyone," Mr Corsellis said.
"He gave an account of what he said could be seen on the footage, maintaining that he acted because he was in fear for himself and others.
"He maintained that at all times he acted in self-defence of himself or others.
Prosecutors allege that Stokes was not acting in self-defence, but with "revenge, retaliation or punishment in mind".
Stokes, of Stockton Road, Castle Eden, County Durham; Ali, of Forest Road, Bristol; and Hale, of Burghill Road, Westbury-on-Trym, Bristol, each deny a joint charge of affray.
The trial continues.