Sure! Here's a sample implementation of an RPG game with magic and sword fights using JavaScript, HTML, and CSS. It is designed for smartphone operation and includes interactive NPCs.
RPG Game
In this example, the game layout includes a player character (represented by an image) and three NPCs (also represented by images). The player can interact with the NPCs by clicking on them, initiating different actions depending on the target object.
Of course, this is just a basic template for a game, and you can add more features, graphics, and functionality according to your game's specifications.