Here I'll explain a method to do this type of abilities effectively, based on this Earthquake Example:
We will review each important section of the code with comments on it, including how to get the particles to show.
Target Team/Type and DamageType are just there to show the tooltips.
"AbilityChannelTime" is a must have that will determine how much time the spell can be maintained.
"AOERadius" which accepts a
"%radius" from AbilitySpecial in its value. "AOERadius" needs
"DOTA_ABILITY_BEHAVIOR_AOE" to display the AoE Circle.
Nothing interesting except remarking that
"%duration" cannot be used as a value for
"AbilityChannelTime" (doing so makes it loop forever), so the ability will just refer to the duration and when changing the value, also change the channel time.
Has all the particles used and leshrac soundfile loaded.
Paths were copied directly from the asset browser, unmodified particles. I'll explain each of its attachments when we get to them.
When the cast point is complete, perform the following actions:
This calls a very simple Lua script which creates a dummy unit to apply a thinker modifier which does the "waves".
When using an
"AbilityBehavior" "DOTA_ABILITY_BEHAVIOR_POINT", you can pass the POINT targeted as an extra parameter to the function (it won't be passed automatically, like CASTER or TARGET). This can be accessed as the target_points
on the event.
There is a Datadriven function to do something similar, "CreateThinker", but because we need to stop the ability from casting the waves if the hero stops channeling the ability, its better to have the dummy "indexed" on the caster handle so that we can run another script to remove it without the need to do a search for it.
Back to the dummy unit, this is its definition:
And the passive ability:
IMPORTANT: The dummy doesn't have
MODIFIER_STATE_INVULNERABLE enabled, because that state is a bitch, usually preventing from applying modifiers even if they have
MODIFIER_ATTRIBUTE_IGNORE_INVULNERABLE. That's why I called it _vulnerable even tho it can't take damage.
Back to the OnSpellStart, 2 more actions:
First action will destroy the trees around the POINT targeted and the second action applies a modifier that takes care of the channeling animation, using the same method explained in the Channeling Animations Tutorial
Animation needs to start half a second later to sync with the damage, this is a matter of experimenting with the time frames.
When the ability finishes channeling either because the channel time has finished or it was cancelled, we need to stop the animation and the dummy thinker:
The 2nd lua function is even shorter, only has 1 API call to instantly remove the dummy:
Now lets move to the the Modifiers block, the first couple handles the animation:
"modifier_earthquake_thinker" is the modifier applied in Lua to the dummy, and has the main logic for all the damage, particles, sounds and other effects needed. It has a lot bunch of actions, so I'll break it up
This constantly applies another modifier effect to all units around a radius of the targeted point, in this ability its a simple slow effect:
Back to the "modifier_earthquake_thinker", we have to have actions on 2 instances: When the modifier is created, and then on each wave interval.
"TARGET" in all this scope will refer to the unit that has the modifier, i.e. the dummy.
I used one extra particle that needs to have the Control Point 1 attached to the target, else it will show on the middle of the map.
"ControlPointEntities" will set the CP0 to the origin of the dummy, and do the same for CP1.
To realize that the CP1 needs to be set else the particle will fail to display properly, this is the procedure:
Open the particle system on the Particle Editor, double clicking on it (needs decompiled particles!)
Select Control Point #1 on the Control Points List:
Hold and drag the control point to somewhere else by clicking on the blue rectangle:
Notice that there's some dust that moved with the Control Point.
This means you need to set it! Else it will stay unattached and originate on the (0,0,0) position at the map.
Still following this? Great, it's almost finished, only missing the
"OnIntervalThink" actions which do the damage +effects every
There's a couple of specific particle firing that need a separate explanation:
To find what each control point does, follow the same method as with the espirit_spawn.vpcf, but knowing this particles were designed for AoE effects, you should instead write radius-range numbers on the control points and see the effect on the particle editor.
Not gonna lie, it's mostly trial and error and just a bit of reading whatever the PET info has to enlighten you:
If you find a way to improve this method or have any questions, leave them here.