!?!flash in topdown!?!

You know the flash in League of Legends?

I want exactly the same but only with a height difference (3D).

What I NEED:

a point that is like the cursor all times on the ground but he has a maximus range between player and cursor.

WHAT I KNOW:

I can allready flash like in LoL (with a maximus range).
[He finds his rotation to cursor and moves forward]

PROBLEM:

He flashes forward and is on the air, when the cursor is far away and it exists a height difference

a pic for example:

The 1. red point is the range of flash.
The 2. red point is the cursor

When i press flash, he flashes a bit higher than on the 1. red point.

He is on a high position in the picture
It works only perfect if the cursor is on the 1. red point because it is the range of flash.

Thank you for the attention and i would be glad for help. It is not easy

Capsule Trace downward a large distance from where he would flash to, and based on the Hit Location of the trace against World Static or World Dynamic objects (such as the floor), set his Z to that Hit Location’s Z.

Make sure the Capsule Trace is the same size as the character’s capsule.

Also make sure before doing that that he passes the test of not landing inside a wall or else this will let him cheat and teleport to the top of the wall.