The USS Enterprise encounters a shapechanger

While exploring a strange planet, Captain James T. Kirk and the USS Enterprise NCC-1701 encountered a duplicate of Captain Kirk which turned out to be a shapechanger, as well as a Klingon captain with a new secret weapon. The Klingons took over the Enterprise and the landing party was stranded. Fortunately, the shapechanger turned out to be a good guy. The shapechanger helped the Enterprise crew defeat the Klingons and retake control of the ship, the shapechanger died a heroic death, and the landing party beamed back to the Enterprise. The Enterprise destroyed the Klingon weapon. Everything turned out okay and everyone forgot that it ever happened. Finally, Spock said something human and the Enterprise left at warp factor one.