im making trigger when the unit is attcked it will spin and damage enemy units my problem is when my unit spins just once and damages the enemy units he suddenly dies
here is my trigger Events Unit - A unit Is attacked
Conditions (Level of Deadly Spin for (Triggering unit)) Greater than 0 If (All Conditions are True) then do (Then Actions) else do (Else Actions) If - Conditions (Random integer number between 1 and 100) Less than or equal to 25 Then - Actions Unit Group - Pick every unit in (Units within 500.00 of (Position of (Attacking unit))) and do (Actions) Loop - Actions Animation - Play (Attacked unit)'s attack walk stand spin animation Unit - Cause (Attacked unit) to damage circular area after 0.00 seconds of radius 500.00 at (Position of (Attacked unit)), dealing 260.00 damage of attack type Chaos and damage type Normal Else - Actions Do nothing
Thats a total waste of procesing power. It does nothing next to help add to background lag. Even in GUI there is no need to call it next to make your spells more understandable.
I am not an expert and never tried to do such thing, but maybe this will solve your problem...
Unit - A unit Is attacked
Conditions (Level of Deadly Spin for (Triggering unit)) Greater than 0 If (All Conditions are True) then do (Then Actions) else do (Else Actions) If - Conditions (Random integer number between 1 and 100) Less than or equal to 25 Then - Actions
"""Unit Group - Pick every unit within 500 of position (of attacked unit) matching condition - boolean - unit belongs to (enemy of owner of attacked unit) and now do (Actions)"""
Loop - Actions Animation - Play (Attacked unit)'s attack walk stand spin animation Unit - Cause (Attacked unit) to damage circular area after 0.00 seconds of radius 500.00 at (Position of (Attacked unit)), dealing 260.00 damage of attack type Chaos and damage type Normal Else - Actions Do nothing
Area damage deals damage to all units in the area, not only enemies. In order to prevent it, pick up every enemy unit, and damage it (and no other unit). In that way, it will damage only them, and allies (along with hero) will be left undamaged.