It would be better to use a proven method. At least because handwritten links with "many different letters and numbers" are not saved.
Everything worked out, thank you)
Added after 23 hours 25 minutes
How can you "force" an enemy hero to cast a specific spell in a combat script? Moreover, this spell affects the terrain, i.e., you need to calculate the location of the troops.