Need help with a custom ability

Basically, when the ability is used you jump into the air, and whoever is still on the ground is damaged, so you have to jump to avoid it. If you are NOT on the ground you are NOT damaged. Also I need to know how I can make it so you have to have a certain variable or be a certain hero to be damaged, could anyone do this? Ty! :slight_smile:

Do you want to understand how to do it or do you want someone to do it for you? I can make it if you would like but I need to know.

1 Like

I got it mostly working, however the timing is not perfectly, as I calculated how long it would take for orisa to fall to the ground when she had the impulse.
variables
{
global:
26: number_players_in_orisa_boss
}

rule(“ORISA JUMP ATTACK”)
{
event
{
Ongoing - Each Player;
Team 2;
Orisa;
}

conditions
{
	Global Variable(number_players_in_orisa_boss) > 0;
}

actions
{
	Wait(Random Integer(3, 9), Ignore Condition);
	Abort If Condition Is False;
	Apply Impulse(Event Player, Up, 10, To World, Cancel Contrary Motion);
	Small Message(Players On Hero(Hero(Zarya), Team 1), Custom String("Jump!", Null, Null, Null));
	Play Effect(All Players(All Teams), Ring Explosion Sound, White, Players On Hero(Hero(Zarya), Team 1), 200);
	Wait(1.350, Ignore Condition);
	Damage(Filtered Array(Players On Hero(Hero(Zarya), Team 1), Compare(Is In Air(Players On Hero(Hero(Zarya), Team 1)), ==, False)),
		Players On Hero(Hero(Orisa), Team 2), 100);
	Wait(1.500, Ignore Condition);
	Loop If Condition Is True;
}

}
If you have time, it’d be nice if you could however it’s okay if you don’t because it’s mostly good, ty though :smiley:

What is the gravity on Orisa? Also this could be done almost precisely with two rules if you want to go down that route.

The gravity is just 100%, the time she falls down is roughly 1.35s

In that case your magic number is about 1.17s

Thanks! However I got a problem where if the player is knocked back/in the air WHILE the ability is in place (timing is pretty rare but happens) the ability is adjusted as the orisa takes longer to drop down, as she flies higher into the air, any suggestions for a fix for it?

You would need to actually check if orisa is on the ground/not in air, Hence the second rule. You can use a player variable as a state machine and use the second rule to damage players