An Attack Driven By Wrath

A Decepticon sneak attack on Autobot headquarters is actually a diversion while Megatron and Starscream use a temporary “invisibility spray” to sneak inside. Megatron sabotages the Autobots’ recharging chamber with a personality destabilizer device. After the Autobots recharge the next day, they have a sudden change of heart and are now Decepticon slaves. Optimus Prime obeys Megatron’s first order and smashes Teletraan I. 
Jazz and Bumblebee, the only unaffected Autobots, are on their way back to Headquarters. Bumblebee makes it back first, and evil Bluestreak forces him into the recharging chamber. Jazz, Sparkplug and Spike arrive and save Bumblebee from being brainwashed. Sparkplug repairs Teletraan 1, who tells them that the rest of the Autobots are now evil! 
Meanwhile, Optimus leads the Autobots on an attack at the local Air Force base, where they begin trashing military jets. Spike and Bumblebee rush off to the base to stop them, and Sparkplug and Jazz stay behind to work on a cure. All of this mess was started just so Megatron could steal a human solar energy satellite being launched the same day. The Decepticons take over the rocket base and plan to take the rocket and satellite back to Cybertron. 
At headquarters, Sparkplug cooks up a bunch of attitude exchangers that will “First, drain evil. Second, recharge good.” He and Jazz round up Ratchet, Hound and Skyfire and change them back to good using the devices. Skyfire gives them a lift to the Air Force base, where they manage to change the rest of the Autobots, except for Optimus Prime. The devices pacify Prime’s combat deck and Roller, but Prime is still on a rampage. Bumblebee takes it upon himself to change the Autobot leader back and succeeds. Optimus gives him a nice, big hug for his trouble. Back at the rocket base, Megatron and the Decepticons have boarded the reprogrammed rocket and take off. The Autobots intercept them aboard Skyfire. Prime and Ratchet detach the satellite while Jazz uses a “musical sonic boom” to disable the rocket. The Decepticons abandon it without any further resistance and retreat. Skyfire takes everyone into space and Prime throws the solar satellite into orbit. 
Finally back at headquarters, Prime thanks everyone for helping out, especially Bumblebee. But then Ratchet gets jealous and claims credit for firing the attitude exchangers (which was actually Hound’s idea. Hmmm…). Jazz reminds everybody that they have to fix all of the jets that Optimus Prime smashed at the Air Force base. Spike breaks the tension with a lame joke that his dad finds hilarious and we fade to black. 
The film opens with a female Vulcan, Lieutenant Saavik, in command of the starship USS Enterprise. The vessel is on a rescue mission to save the crew of a damaged ship in the Neutral Zone along the border with Klingon space. The Enterprise is attacked by Klingon cruisers and critically damaged. This "attack" is revealed to be a training exercise known as the "Kobayashi Maru"; a no-win situation designed to test the character of Starfleet officers. Admiral James T. Kirk oversees the simulator session of Captain Spock's trainees. 
The USS Reliant is on a mission to search for a lifeless planet for testing of the Genesis Device, a torpedo that reorganizes molecular matter to create hospitable worlds for colonization. Reliant officers Pavel Chekov and Clark Terrell transport down to the surface of a possible candidate planet, Ceti Alpha VI, where they are captured by Khan Noonien Singh. Khan and his fellow genetically-advanced supermen were once rulers on Earth in the late 20th century, but after their defeat they were exiled to space in a sleeper ship. The Enterprise discovered Khan's ship adrift in space fifteen years previously; James Kirk exiled Khan and his followers to Ceti Alpha V after the supermen nearly captured the Enterprise. Khan reveals that after they were marooned, Ceti Alpha VI exploded, destroying Ceti Alpha V's ecosystem and shifting its orbit; Chekov and Terrell have unwittingly landed on Ceti Alpha V. Khan blames Kirk for the deaths of his wife and followers, and plans to avenge them. He implants Chekov and Terrell with indigenous, mind-controlling eels that enter the ears of their victims, and uses the officers to gain control of the Reliant. 
The Enterprise embarks on a training voyage under the command of Spock. Kirk, conducting an inspection of the Enterprise, receives a garbled message from Space Station Regula I, a remote science laboratory where Kirk's former lover, Dr. Carol Marcus, and their son, Dr. David Marcus, have been developing the Genesis Device. The Enterprise is ordered to investigate and Kirk assumes command of the vessel. Khan uses a surprise attack to cripple the Enterprise en route, killing many of the ship's trainees. A transmission between the two ships reveals Khan knows of the Genesis Device and wants all materials related to the project sent to him. Kirk stalls for time and disables the Reliant's defenses by transmitting a prefix code. With his ship badly damaged, Khan is forced to retreat and make repairs. 
The Enterprise arrives at Regula I, where they find members of the Genesis team dead. The remaining scientists, including Carol and David, have hidden deep inside the planetoid of Regula. Using Terrell and Chekov as spies, Khan steals the Genesis Device. When Terrell is ordered to kill Kirk, the eels' influence wanes; Terrell kills himself while Chekov overcomes the parasite's control. Though Khan believes he is leaving Kirk stranded on Regula I, Kirk and Spock use a coded message to arrange a rendezvous and pilot the Enterprise into the nearby Mutara nebula. Static discharges from the nebula renders ships' defensive shields useless and compromises targeting systems, making the Enterprise and Reliant evenly matched. Khan pursues his quarry against his lieutenant's advice. 
Inside the nebula, Kirk uses Khan's inexperience in three-dimensional combat to critically disable the Reliant. Mortally wounded, Khan activates the Genesis Device, which will reorganize all matter in the nebula—including the Enterprise. Though Kirk's crew detects the activation of the Genesis Device and begins to lumber away using impulse engines, with the warp drive damaged they will not be able to escape the nebula in time. Spock goes to the ship's Engineering section to restore warp drive. When McCoy tries to prevent Spock's exposing himself to high levels of radiation, he disables the doctor and tells him to "remember". Spock restores power to the ship, allowing the Enterprise to escape the explosion. Kirk arrives in Engineering just before Spock dies of radiation poisoning. 
The explosion of the Genesis Device causes a planet to coalesce out of the nebula. A space burial is held in the Enterprise's torpedo room, and Spock's coffin is shot into orbit around the newly formed planet. Kirk and David make peace, and the crew leaves the planet to pick up the Reliant's marooned crew. In the final scene Spock's coffin is seen to have soft-landed on the planet. Spock narrates Star Trek's "Where no man has gone before" monologue as the camera pans forward into a field of stars.