If it's ok, could you walk me through the triggers that you used and explain to me what each of them does so that I could use them in other spells?
1. Hashtable is a table which converts anything to number and you can store it just like variable, but in this case they are connected with the child of hashtable (unit, desructible or any other object in the game)
2. GDD system give you easy detection damage, it is needed to detect damage which dealt by dummy unit.
INIT:
3. You have two spells: empty one which doesn't deal any damage or doing anything and it is used by the caster, and the real one with visual wave, and it allow to damage.
USE ABILITY:
4. Then the hero casts the spell, the dummy unit appears to cast the real spell.
5. To store damage you must get the ID of dummy unit (get handleID). In this ID (integer, child of hashtable) i stored real (damage) and the unit-caster.
DAMAGE CALCULATION:
6. When the dummy hits enemy, then you must get its ID again, load stored damage value and the unit-caster.
7. Also I used the empty group "lock_damage_group" to avoid infinite loop (then unit deals damage, the trigger activates additional damage, which again enable the trigger again and it activates additional damage over and over so you need a blocking condition which stops the loop once).
8. First I load the unit-caster, because it must deal the stored damage, not the dummy. If the caster is alive then it will deal damage, else the dummy deals it.
CLEAR HASH:
9. Since hashtable store number you need to clean it or else the memory load is increased (leaks) with every time unit casts the spell. Then dummy dies the system cleans the stored damage and the caster unit from the memory.