For this tutorial I am cheating and not explaining how to make lua ability. If you want to see full example of the code click here!
Now we focus on the lua modifier. While we can do transformation and stuff in data driven counterpart, there is lack of calculations that make these things work better.
First order of issue is attack range and type. We assume our custom ability has special value for
attack_range and is designed to be a melee creature transformation. For this example we are using roshan so for attack range to match original we set it to
Now we need to make sure when this modifier is lost, we change the attack type back to the original.
What we want the transformation to effect should go here, these are some of the commons.
Now we need to setup the functions for these wonderful functions. First one is for the model. Second is for the attack range. Last is for the scale.
Last issues are using ability while immune and correctly duplicating modifier for illusions.
Thats pretty much it. You can add particle effects and/or animations. Though as a note there are some issues with animations on some heroes. For example phantom lancer's death animation makes the player model vanish so I suggest being careful with chosen animation.
Next Topic: Enchanting Trees