Game-based learning is a popular method and has implemented on mobile platforms to make ubiquitous learning more efficiently. However, most of mobile educational game researches focus on specific topic/discipline/curriculum with small applications and few researches consider attracting users playing the educational game continuously. In this research, we design a Context-Aware Mobile Role Playing Game (CAM-RPG for short) that can generate a series of story-based quests (i.e., a quest chain) automatically for users and make the users interact with specific real (e.g., projector, rest room, pine tree, etc.) and virtual (payroll system, business policy, E-Commerce course, etc.) objects in the real world. The useful contexts are filtered out by using information theory and rough set and then are re-organized into a series of learning activities (i.e., a learning activity chain). To make the learning activities attractive to the users and make the mobile game become an immersive learning environment for the users, we analyze and apply narrative elements into the learning activity generation process and transform the learning activity chain into a quest chain in the game.