If you knew you were dreaming, you were having a lucid dream. Pain is normally not associated with it. I'm sorry, but I can't help you figuring out, what it was. Perhaps pain was not related? Good luck to you.