So, if you want to create a spell which will damage the targeted unit when it casts a spell, you can use, for example, "Drunken Haze" spell, but edit it to make any affects on the unit. And then use this trigger:
-
Events:
-
Unit - A unit finishes casting an ability
-
Conditions:
-
Boolean - Unit has buff Drunken Haze <!!(I recommend you to edit the Drunken Haze buff, change the icon, name and description)!!>
-
Actions:
-
Unit - Set life (of the triggering unit) to ((Life of the triggering unit)-(#))
(And create a special effect !at the position of the unit! to make it look prettier)
I recommend to use the DeathCoilTarget special effect
Or, if you want the hero casting that hyper ability have the targeted unit killed (
The hero will simply get experience from kill), you can make a unit with incorrect model path (Example - Custom model path "blablabla.mdl")
so as to make it unable to be seen in the game. +you make that unit have an attack dealing damage equal to damage which should be taken by unit casting a spell. +Make that unit a long attack cooldown so as you can have that unit attacking once with triggers (remove the unit using "Unit - is attacked" event and condition "Unit-Type of the triggering unit equal to Invisible Attacker".
MAKE THE "INVISIABLE ATTACKER"'s Combat - Animation Backswing Point to 0.000 and Combat - Animation Damage Point to 0.000
Then you need 3 triggers and 4 variables and editing units' custom values.
-
Events:
-
Unit - A unit finishes casting an ability
-
Conditions:
-
Ability Comparison - (Ability being cast) equal to Holy Prevention
-
Actions:
-
General - Set variable ((INTEGER))=((INTEGER))+1
-
Unit - Set custom value of (triggering unit) to ((INTEGER))
-
Unit - Set custom value of (target unit of ability being cast) to ((INTEGER))
-
-----this will help to find the Holy Preventer and it's victim-----
-
Events:
-
Unit - A unit begins casting an ability ((If you want the unit to die before it casts an ability)) <<OR>> finishes casting an ability ((If you want to the unit to cast the spell first and then die))
-
Conditions:
-
(Integer Comparison - (Triggering unit)'s custom value not equal to 0) and (Boolean - (Triggering unit) has buff Holy Prevention)
-
Actions:
-
Unit - Create 1 Invisible Attacker for (owner of random unit in (Playable area) matching ((matching unit)'s custom value equal to custom value of (triggering unit))) at position of (triggering unit)
-
Set variable ((REAL1)) to position X of (random unit from (Playable area) matching (matching unit)'s custom value equal to custom value of (triggering unit))
-
Set variable <(!!SAME AS PREVIOUS ACTIONS BUT WITH Y POSITION OF THE UNIT WITH CUSTOM VALUE OF THE TRIGGERING UNIT!!)> ( and use ((REAL2))
-
Set variable ((REAL3)) to (facing angle of (random unit from (Playable area)) matching (matching unit)'s custom value equal to custom value of (triggering unit)
-
If (life of (triggering unit) less than <(!!# of damage that should be taken by victim!!)>) then do (Unit - Move (random unit from (Playable area)) matching (matching unit)'s custom value equal to custom value of (triggering unit) instantly to position of (triggering unit)) else (do nothing)
-
Unit - Issue an order targeting a unit - Order (last created unit) to attack the (triggering unit)
-
Wait 0.01 seconds
-
If (life of (triggering unit) less than <(!!# of damage that should be taken by victim!!)>) then do (Unit - Move (random unit from (Playable area)) matching (matching unit)'s custom value equal to custom value of (triggering unit) instantly to (Conversion - Convert coordinates to point (REAL1,REAL2))) else (do nothing)
-
If (life of (triggering unit) less than <(!!# of damage that should be taken by victim!!)>) then do (Unit - make (random unit from (Playable area)) matching (matching unit)'s custom value equal to custom value of (triggering unit) face angle ((REAL3)) else (do nothing)
-
Events:
-
Unit - A unit is attacked
-
Conditions:
-
Unit-Type of the (triggering unit) equal to INVISIBLE ATTACKER
-
Actions:
-
Unit - Remove (triggering unit) from the game
-
If (life of (attacked unit) equal or less than 0 then) do (Unit - Set custom value of (random unit from (Playable area)) matching (matching unit)'s custom value equal to custom value of (attacked unit) to 0
-
If (life of (attacked unit) equal or less than 0 then) do (Unit - Set custom value of the (attacked unit) to 0
-
Events:
-
Time - Every 2.00 seconds
-
Conditions:
-
Actions:
-
Unit Group - Pick every unit in (Playable area) matching ((matching unit)'s custom value not equal to 0) and (Boolean - unit has buff Holy Prevention equal to false) and do (set (picked unit)'s custom value to 0)
___________
Don't give me rep if you think i helped you