He turned to real-life crime to feed his virtual addiction.

A video-game addict forced a fellow geek to fork over 4.7 billion “magic” coins by pulling a realistic-looking gun during a robbery in a Fordham University classroom, The Post has learned.

The coins, used to buy items in the swords-and-sorcery video game “RuneScape,” are so treasured by players that they are regularly swapped online for real cash.

Suspect Humza Bajwa, 19, of Massachusetts, pretended he was seeking to buy game currency and arranged a deal with fellow player Jonathan Dokler to purchase the nearly 5 billion coins for $3,300 in real money, according to a criminal complaint.

Instead of transferring the money online, Bajwa allegedly wanted a face-to-face meeting — and Dokler sent his Fordham pal David Emani to collect the cash.

Emani told The Post that he met Bajwa in the school library on July 11 — and had a feeling something was wrong.

“He was transferring money from one envelope to another envelope, and I got a glimpse of it and it looked fake,” Emani said. “I was on the phone with John, and I said, ‘Don’t do it. It looks fake.’ ”

But Dokler wanted to continue with the transaction, even after Bajwa suddenly said he had to leave and asked to meet again the next night.

Emani said he came prepared for the second meeting, in a classroom, with a real $100 bill to compare with Bajwa’s money. “I took it out and said, ‘The money you have is fake,’ ” said Emani. That’s when Bajwa went from white knight to fire-breathing dragon — pointing a realistic-looking BB gun at Emani, the complaint says.

“I whispered, ‘Take it easy, man. No need for that gun,’ ” Emani said. “I couldn’t believe I was about to get shot over RuneScape! I was so scared I was about to die.”

Bajwa allegedly ordered him to call Dokler and say the transaction was complete and get him to electronically transfer the 4.7 billion RuneScape coins.

“I was like, ‘Holy crap!’ I was so afraid,” Emani said. The student said his voice was cracking as he delivered the message.

“I kept saying, ‘Hurry up, let’s go, man,’ to John. This guy was holding a gun against my head. I wanted to be finished!”

Dokler transferred the coins, and Bajwa left. He didn’t rob Emani of any of his real-world items — including his $100 bill.

Emani, who doesn’t even play the video game, was unhurt.

After checking surveillance video and talking to the victims, cops busted Bajwa, a resident of Acton, Mass., on July 24.

He was hit with charges including second-degree robbery and grand larceny and posted $20,000 bail. If convicted, he faces 15 years in jail.

The company behind RuneScape, Jagex Games, prohibits the sale of RuneScape gold or items for real money and may ban any player that engages in “real-world” trading.

Dokler said he not longer plays the game but still tries to earn money for schoolbooks by buying RuneScape coins online and reselling them for a profit.

He said that in the rough and tumble world of RuneScape, such a brazen crime didn’t shock him.

“I’m not terribly surprised because the coins are pretty much as good as cash,” he said.