It's an AC-130U Spooky II, successor to AC-130A Spectre, AC-130E Spectre, AC-130J Ghostrider, AC-130H Spectre, and predecessor of AC-130W Stinger II, if I got them in the right order. They're all retired except the AC-130J Ghostrider that's used for Special Operations. Most of the variations were called Spectre, vs. "Puff" being Spooky.
Puff, the Magic Dragon was a Douglas AC-47 Spooky and was the first in a series of fixed-wing gunships developed by the United States Air Force during the Vietnam War. The C-47 version was Project Gunship I, and the C-130 was Project Gunship II. The AC-47 was a United C-47, the military version of the DC-3, that had been modified by mounting three 7.62 mm General Electric miniguns to fire through two rear window openings and the side cargo door, all on the left side of the aircraft, to provide close air support for ground troops. The rumor I heard was that it would put a bullet every inch over an area the size of a football field. All I can say for sure is that 3 miniguns will spit out a lot of bullets in a hurry. Here's a time-lapse photo from Wikipedia, showing tracer rounds visible at night while converging on the target of an AC-47D performing a pylon turn in Saigon in 1968.
https://en.wikipedia.org/wiki/Douglas_AC-47_Spooky https://en.wikipedia.org/wiki/Lockheed_AC-130