A court heard the attacks were part of a recent phenomenon known as "county lines" dealing in which drug traffickers try to expand their markets from big cities to smaller towns.
Jurors were told how gang members are prepared to use "extreme violence" to gain a foothold in local markets and chase out established dealers.
Leeds Crown Court heard victim Barry Gourlay had a corrosive substance sprayed in his face during a street attack in Harrogate.
Later the same evening, October 20 last year, Leeds drug dealer Audley Mascoll and his driver Carl Heptonstall were stabbed repeatedly and attacked with pepper spray at a house on Skipton Road, Harrogate.
Leeds Crown Court heard Heptonstall was stabbed 12 times to the chest and back, suffering a collapsed lung.
He also suffered stab wounds and bone damage to his right leg and needed extensive surgery.
Mascoll received multiple stab wounds in the attack.
Mohammed Adbi, Abdirahman Shire and Julian Soares are on trial accused of attempted murder, wounding with intent, administering poison and conspiracy to supply cocaine.
Soares is also charged with conspiracy to supply heroin.
Jonathan Sharp, prosecuting, said the background to the attacks was a "county lines" operation targeting Harrogate.
Organisers of the operation were based in London and had a connection to Leicester.
Mr Sharp said organisers used a mobile phone as a single point of contact known as the H Line and were sending out messages to 90 customers.
By late September of last year the operation had begun to establish itself in the north Yorkshire town.
The jury heard that the operation continued to expand during October
The prosecutor said all three defendants went to the house on Skipton Road on October 20 in order to deliver drugs.
He said: "They were armed with at least one knife, which Abdi had in a sheath under his tracksuit bottoms, with a pepper spray, and with a bottle containing some sort of corrosive or irritant liquid..
"It is apparent, both from their being armed and from their actions that night, that they were intent on violence."
Jurors heard their first act of violence was against Gourlay.
Mr Sharp said: "They challenged him, saying he was a rival dealer nicknamed "Leicestershire Chris'.
"They then sprayed the liquid in his face.
"Mr Gourlay immediately called 999 and described what had happened to him."
The prosecution claims all three men then attacked Mascoll and Heptonstall back at the house on Skipton Road.
Mascoll was in possession of a wallet containing 38 wraps of heroin and 29 wraps of cocaine when he turned up at the house.
Mr Sharp said: "Heptonstall received injuries that were life-threatening and the attack on him was of such severity and intensity that the defendants' joint intention, in that moment, can only have been to kill him."
The court heard Heptonstall and Mascoll fought back during the attack.
Adbi suffered a punctured lung and an ambulance had to be called for him shortly after he left the flat.
Shire also suffered injuries.
Abdi, 25, of Tower Street, Leicester, Shire, 22, of Oak Street, Leicester, and Soares, 23, of Brixton, London, deny all charges.
The trial continues.
'PHENOMENON' OF COUNTY LINES DRUG DEALING.
Jurors heard how "county lines" drug dealing is a new phenomenon in which traffickers from big big cities target smaller towns in a bid to boost profits.
The operations will normally be run from a big city - often London - but the purpose is to sell in county towns.
Prosecutor Jonathan Sharp told the jury at Leeds Crown Court: "In north Yorkshire, that mean places like Scarborough, or York, or, as in this case, Harrogate."
He added: "The organisers of these operations will send people into smaller towns with the purpose of selling drugs.
"They will need to gain a foothold in the local market and try to chase out any dealers who are already working in the area.
"They will also need to establish a temporary base.
"You will not be surprised to hear that the way these operations work is by using intimidation and violence, often extreme violence - violence that is uncharacteristic of the towns they target, but which no doubt serves the purpose of establishing the operation and chasing off its competitors."
The operation involves someone keeping a mobile phone which regularly sends out text messages advertising that drugs are for sale.
The number of that phone becomes a single point of contact and customers call it to place orders.
When an order comes in, whoever is looking after the phone will call another person in the targeted area.
That second person will then deliver the order.
Mr Sharp said: "The organisers stay remote from the actual drugs and their supply, and so are protected from the risk of detection.
"All of that activity can leave evidence, in the form of calls, text messages and other mobile phone activity.
"In this case, the police have been able to investigate that phone activity.
"This is the picture that investigation has produced."