Dusknoir is a Pokémon who came from the future. Early in the story, he is thought of as a friend and even a celebrity, but he is later revealed to have been deceiving everyone. In reality, he was an agent of Primal Dialga, sent to the past in order to capture the protagonist and Grovyle in order to stop them from altering history and preventing the planet's paralysis.
Time in the future was frozen because Temporal Tower had collapsed. In order for Grovyle to prevent the planet's paralysis, he would have to journey to the past and employ the Time Gears to preclude the tower's collapse. This, in turn, would have a cataclysmic effect on the current future. If history were changed, then the current future would be forced to disappear. This includes Grovyle, Dusknoir, Primal Dialga and the player itself.
Dusknoir is shown to be a character with a very strong sense of self-preservation. Believing Dialga to be the most powerful Pokémon, he surrenders himself to Dialga's will. Moreover, he is particularly ardent in the defense of the dark future because he will cease to exist if history is altered.
Additionally, it should be noted that a group of no less than six Sableye tends to accompany him as he carries out his master's will. Six of them fight alongside Dusknoir in the Old Ruins, and six of them are present for the player's execution, however it is implied that others were present in the future.
Plot and/or ending details may follow.
Dusknoir came from the future in order to capture Grovyle and the player. He was admired as a wise explorer and an eloquent speaker. However, during his stay in Treasure Town, his primary objective was to learn the player's location while enlisting the aid of Officer Magnezone in his effort to capture Grovyle, the criminal from the future.
Throughout the game he is informed by the player's partner about so-called dizzy spells the player has whenever they touch something. Dusknoir immediately recognizes it as the Dimensional Scream. Later on in the game while on the beach, Dusknoir asks what the player's name is. After that, he knows that he has found his quarry and begins to create a plan on how to destroy him/her along with Grovyle.
When he tells the citizens of Treasure Town that Grovyle is the thief of the Time Gears, they all set out to find and capture him.
When the team is finally informed by Officer Magnezone that Grovyle has been captured, Dusknoir gathers the guild and the citizens of Treasure town in the area next to Duskull Bank, where Dusknoir has opened up a Dimensional Hole (likely with the aid of Dialga or even Darkrai himself).
He then tells everyone that he and Grovyle are both from the future. This surprises everyone, and he then asks Mesprit, Uxie and Azelf to return the Time Gears to their rightful places.
After that, he wishes for the protagonists step forward so he can bid them goodbye. Seizing the opportunity, with a proclamation of it being too soon for goodbyes, he grabs them and drags them through the Dimensional Hole.
The team awakes to find themselves in a stockade where Dusknoir intends to have them (and Grovyle) executed. The trio escapes, yet Dusknoir and his forces pursue them relentlessly crossing the landscape, ultimately leading to the team's encounter with Primal Dialga himself.
Dusknoir returns once again when the team journeys to the Hidden Land and cuts them off at the Old Ruins. After a fierce battle, he defeatedly reveals the truth to the player: he/she will disappear if the collapse of Temporal Tower is stopped.
He lunges out once more when the player is undeterred by this fate, which prompts Grovyle to sacrifice himself in order to remove Dusknoir from this time and allow the team to continue unimpeded.
In Explorers of Time and Darkness, this is the last the team sees of either Pokémon.
When Dusknoir and Grovyle go back to the future after the battle at the Hidden Land, they are forced to work together upon seeing that the Sableye are now trying to eliminate both of them. Upon hearing that Dialga has a new henchman, they put aside their differences in an effort to learn its identity. After returning to Temporal Tower in an effort to seek Dialga and realizing that he must have gone after Celebi, they follow him to Dark Ice Mountain. where Grovyle is saved from a falling chunk of ice by Dusknoir. Dusknoir is badly injured by the impact.
Grovyle notes that Dusknoir would never risk his life just for a plan to succeed and determines that Dusknoir's saving him was genuine.
Near the end of the episode, Grovyle is caught in the electricity of the icicles in Icicle Forest. Dusknoir says that everything thus far had been a plan, and that the electricity would melt his spirit, leaving an empty shell. He says that he would go back to the present with Grovyle's persona, slowly pulling the player and partner into his grasp so that he may finally kill them.
After all this, Grovyle says that along their adventure, he sensed Dusknoir's feelings of hatred had vanished.
Dusknoir states that it is untrue, but Grovyle finally proves him wrong before Celebi, the Sableye and (unfortunately) Primal Dialga, who brutally mauls Dusknoir when he sees his hesitation.
For the last time, the duo, along with Celebi, team up and chase Dialga to the summit of Vast Ice Mountain in order to stop him from using Celebi's Passage of Time. Soon it becomes apparent that the collapse of Temporal Tower has been prevented in the past. After the future's inhabitants disappear, they reappear, and Dialga, back to his own self, says that a being on a higher tier than himself brought them back. After this, Grovyle proclaims in the hope that the team will somehow hear him that they did not vanish. After this, the credits show for the last time.