If another player becomes the monarch after Emberwilde Captain's last ability triggers but before it resolves, the ability will resolve as normal. The player who attacked you will be dealt damage, even if that player was the one who became the monarch.