The man Ben Hoffmann was searching for when he allegedly gunned down four people in Darwin says he had been in a sexual relationship with the accused murderer's ex-girlfriend.
The 47-year-old has pleaded not guilty to four counts of murder in less than an hour at four locations in the afternoon of June 4, 2019.
The Crown says Hoffmann was searching for his ex-girlfriend, Kelly Collins, and Alex Deligiannis when the killings happened.
Mr Deligiannis told Hoffmann's trial he had been in a relationship with Ms Collins.
"I had like an open (sexual) relationship with her," he told the Northern Territory Supreme Court on Thursday.
"We stopped doing anything sex before she went to rehab and that was the end of it.
"We were just friends."
The court has repeatedly heard Mr Deligiannis was Ms Collins' pimp and drug supplier but he denied this.
Mr Deligiannis also knew Hoffmann and was aware he was looking for him on June 4.
He confirmed he was in a car with a woman when she received a call from Hoffmann about 10am.
"I heard the full conversation," he said.
After news of the shootings broke, Mr Deligiannis went to the Palms Motel, where the first victim, Hassan Baydoun, 33, was shot about 5.38pm.
There, he met a woman he was in a sexual relationship with who lived at the motel.
Mr Deligiannis said he had been visiting her "every day" before the shootings.
Hoffmann and Ms Collins met at drug rehab, where they formed a relationship.
After they left the program, the pair made plans to move in together and Ms Collins selected furniture.
But two weeks before the shootings, she sent Hoffmann a text message saying she was in love with another man.
"Hoffy, I love Alex," she wrote on May 20.
Hoffmann initially responded with a series of humorous texts but in the days after, his demeanour changed and he repeatedly told workmates he was going to "blow (Alex's) head off".
The Crown says after Hoffmann shot Mr Baydoun he drove to an apartment block on Garden Hills Crescent where he gunned down Nigel Hellings, 75.
Michael Sisois, 57, was shot in a car park at The Buff Club bar and restaurant and Rob Courtney, 52, was stabbed more than 30 times and shot dead at an industrial yard at Darwin Recycling.
Mr Deligiannis agreed with prosecutor Lloyd Babb SC that he had previously also lived at the Palms Motel, where he was the caretaker until the owners asked him to leave.
He also confirmed he had lived at the apartment block on Garden Hills Crescent with his girlfriend and two other women, and that his girlfriend worked as a prostitute from the premises.
Mr Deligiannis denied he was her pimp.
The court also heard Mr Deligiannis frequented Darwin Recycling in 2018.
He said the last time he'd seen Hoffmann was in a jail when he was serving a sentence for crystal methamphetamine possession.
Ms Collins has previously told the court that she and Hoffmann smoked ice at her home the night before the killings.
The court has heard Hoffmann smoked "quite a bit, as in three pipes" in about an hour then left before returning with a hammer later in the evening.
"He tried to coerce me to go with him," Ms Collins said of Hoffmann's late-night visit.
"I ran to (my neighbour). I said 'We have to ring the police'."
The third man to die, Mr Sisois, was also at Ms Collins' home on June 3.
Before he was shot in the head, Hoffmann allegedly sent Mr Sisois a text demanding that he bring a woman to him.
"I will f***ing wreck you, Sisois. Bring her to me. I'll f*** you up," the message read.
In the hours before the shooting, Hoffmann repeatedly alleged that Mr Sisois had spiked his drink or poisoned him.
The trial continues.