Special effect on the unit receiving the effect

Level 5
Joined
Jan 23, 2025
Messages
40
Hi! I'd like to explain myself clearly so you understand what I want.

For example, the King of the Mountain's Thunderbolt ability.

What I want is for the special effect to be visible when the hammer HITS the unit, and not before.


Untitled Trigger 001
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Thunderbolt
Actions
Special Effect - Create a special effect attached to the chest of (Target unit of ability being cast) using Abilities\Spells\Undead\DeathCoil\DeathCoilSpecialArt.mdl
Special Effect - Destroy (Last created special effect)

The effect happens immediately, and I want it to happen when the hammer hits the unit. Thk guys.
 
You need to use a bit of - I'm going to use a swear word - MATH!

  • Actions
    • Set VariableSet Target = (Target unit of ability being cast)
    • Set VariableSet CasterPoint = (Position of (Triggering unit))
    • Set VariableSet TargetPoint = (Position of Target)
    • Wait ((Distance between CasterPoint and TargetPoint) / 1000.00) seconds
    • Special Effect - Create a special effect attached to the chest of Target using Abilities\Spells\Undead\DeathCoil\DeathCoilSpecialArt.mdl
    • Special Effect - Destroy (Last created special effect)
So it creates the effect after an amount of time equal to the distance between the mountain king and the target divided by the speed of the projectile (1000 by default, change that to whatever value you use), and you need to store the target in a variable because of the Wait, but that's about it

It may have a very slight delay but that's the easiest as it gets without using an entire damage system

Edit: that also works for only 1 mountain king, you'd need to use arrays if multiple heroes can do it at a time in your map
 
Back
Top