Auto-translated
If creating a spell for exchanging troops, it would be most logical to base it on Town Portal as the closest analogue.
For example, on the base level, exchange with the nearest hero; on the advanced level, exchange with any hero; on the expert level, reduce the cost based on movement points.
Variations are possible, such as exchange with a hero/exchange with a castle/exchange with both.
In principle, limiting the range of effect (similar to Visions) wouldn't be too out of place.
The level should be set no higher than 3 (because Town Portal is much more useful) and no lower than 2 (so that players don't start using it excessively from level 111).