In the fanfiction, it could be that the trident is a reward for Harry after he accomplishes a great and difficult task. For example, he might save a magical creature that is associated with the trident, and as a thank - you, he is given the trident. This would also show Harry's kindness and heroism in the story.
Perhaps it is given to him by a mysterious figure. This figure could recognize Harry's potential and believe that he is the right person to wield the trident. The figure might be from a different magical culture that has a connection to the trident and sees Harry as a key to some greater purpose.
In some fanfictions, Percy might obtain the trident through a special quest. Maybe he has to prove himself worthy to an ancient sea deity who then bestows the trident upon him as a symbol of power and trust.
He might find it during an underwater adventure. Maybe he stumbles upon an ancient temple dedicated to Poseidon and there, in the center, lies the trident. It could be a test set by Poseidon himself for Percy to prove his worthiness to wield such a powerful weapon.
He could get them from his Muggle relatives. Since he spends time with the Dursleys, there might be a situation where he stumbles upon some of their tools or weapons, like a gardening hoe that he could potentially use as a weapon in a fight. Another way is through his Muggle - born friends at Hogwarts. They might bring in some items from the Muggle world that Harry then takes an interest in and decides to use.
He might inherit some of the cars. For example, he could inherit a classic wizarding car from his parents' old friends. Another way could be that he wins them in magical contests. There could be a Triwizard Tournament - like event where the prize is a unique and powerful car.
He might find it in a hidden chamber in Hogwarts. There could be a series of magical puzzles and traps that he has to overcome to get to it.
In this fanfiction, Harry Potter could obtain Gungnir in a rather unexpected way. For example, due to a time - traveling incident. He might accidentally travel to a different time and place where Gungnir exists. There, he could be in a situation where he has to help the local magical community. As a result of his heroic deeds, the keepers of Gungnir decide to entrust him with it. And when he returns to his own time, he brings Gungnir with him, ready to use it in his fight against the dark forces.
He might find it in a hidden chamber in Hogwarts. Maybe it was left there by a powerful wizard from long ago who had some connection to other universes.
Maybe it was given to him by a mysterious stranger. This stranger could be someone who has been observing Harry from afar and believes that he is the only one who can handle the power of the hand cannon. The stranger appears out of nowhere, hands it to Harry, and then disappears again without a trace.
In some fanfictions, he might find it in the Forbidden Forest during one of his adventures. Maybe while exploring the deeper parts of the forest that are off - limits to most students, he stumbles upon a young pegasus in need of help. Harry, being the kind - hearted person he is, bonds with the pegasus and it becomes his familiar.
The origin of the trident is also a unique element. Fanfictions may explore that it came from a long - lost magical civilization or was created by a powerful entity that predates Hogwarts. This gives a sense of mystery and expands the lore of the Harry Potter universe. Writers might describe the trident as having ancient runes or markings that hold the secrets of its power and origin.