Added after 22 hours 48 minutes
I captured three cities and gained the ability to curse cities. I decided to deal with the elf. As soon as I defeated him, a mage with 18 Titans emerged from the portal and captured the second Castle. Is this a coincidence, or a reaction to the elf's death?
In any case, I will replay from the moment I captured the 3rd Castle. You can't build high-level mage guilds in the Castles. Therefore, I will curse them immediately. If the appearance of the undead is a reaction to the elf's death, then it makes sense to gather all the undead and visit all the upgrade locations first, avoiding meeting the elf. If the mage appears independently of the elf, it makes sense to immediately run to curse the cities so that he doesn't get them.