Boy is on Earth but when he sleeps he goes to a different world. Both worlds' stories carry on over the book and they connect at the end. It starts with the boy in a monastery and in a small apartment on earth but strangers arrive to get a map decoded in his sleep. He goes on a quest then with these strangers to find hidden ancient heirlooms of their ruling family. Boy is from on of the ruling elite family's able to exist in both worlds we meet a alien guide who offers to teach the boy as a teacher .
In the end of the book he brings a gun from Earth to the magic world.
He is attacked by a dragon but heals the damage, and later he makes a healing deal with the dragon to heal him in the future.
it was a book I read in the 90's but I forget its name I like to read it again