The Keys to The Palace of Bliss, by Todd Calfin
Pierce Brosnan said "I am hooked" after reading the first page of this fun little book.
... When the miserable Emperor is prescribed a peculiar cure for his misery - "You must find a happy person and wear their underpants!" - he discovers that the only happy person in the entire kingdom is a mysterious forest dweller who plays an enchanted flute."