Here's how the story of Ernie goes in Ernie the Dragon Hunter.
[The ponies, vikings, and everyone sale was at the throne room]
["You Have No Idea" starts playing]
Brian: Long ago, before Smaug destroyed Quahog. Ernie came from an unknown land and stayed with us. But then, Ernie saw our ways. He became resentful and jealous. So we've asked him for judgement and forgiveness. When he refused to accept it, he left and returned with an army, thus he started the war in Quahog. After we defeated him and his army, Smaug came in and destroyed our city.
Yuna: I don't get it, why is he doing this now?
Brian: His whole life is filled with anger and hatred. It's only a matter of time, before he destroys other lands and takes them for his own. It's also said he killed viking chiefs claiming he can control dragons. Calling himself, “The Dragon King” or “The Dragon Hunter”. And he’s also, a Sith lord.
King Solar Flare: That doesn’t seem possible. The Sith have been extinct for a millennium.
Princess Luna: I do not believe the Sith could have returned, without us knowing.
Princess Celestia: Yes.
Yuna: Mama, what's a “Sith”?
Princess Luna: Yuna, there powerful beings. Long before you where born, they took over Equestria.
Princess Luna [narrating]: They were lead by Darth Malgus.
Darth Malgus: Burn them down!
Princess Celestia: We’re done for! It’s over.
Princess Luna: [narrating] I thought we we’re done for. Out of the sky where the legendary Jedi Knights! Thanks to them, they saved Equestria and defeated the Sith.
Pricness Luna: Yes.
Brian: Someone's calling.
[Then it shows Ernie on a hologram]
Ernie: Brian Griffin.
Ernie: It's been a while, I see you made some new friends.
Brian: Save your breath!
Ernie: What's the matter? Gonna unleash your dark side on me? I don't think so. Because I'm coming for you.
Brian: Will see.
Ernie: Try me. [evil laughs]
Brian: [cuts the hologram off] We need to defend ourselves for his arrival.
Skyla: Don’t worry, will..
Princess Celestia: No Skyla. There is one who can go up against Ernie. Master Yoda.
Stewie: You mean the "Master Yoda"?
Princess Celestia: Yes.
Twilight: That's impossible. He’s been dead since Order 66.
Princess Celestia: Not quite, Twilight. He’s been living in sanctuary on the distant planet "Dagobath".
King Solar Flare: Celly, I do not want you to get help from that being.
Princess Celestia: Father.
King Solar Flare: I mean it.
Princess Celestia: He was there for you when mom died! He has to help!
King Solar Flare: [as King Triton (in his version)] Oh, have you lost your senses completely?! He’s magic, your an ailcorn!
Princess Celestia: [as Ariel] I don’t care!
Emperor Lunarlight: [in his royal contralto voice] THAT'S ENOUGH!!! [in normal voice] Son, no matter who helps us, it has to be Master Yoda. Celly, go to Dagobath and get help from him.
Princess Celestia: Thank you, grandfather.
[The two hug]
Princess Celestia: [to her father] I'm going whenever you like it or not. [walks out]
Brian: We must prepare for war when Ernie arrives, Peter get the weapons loaded.