Hello, I made a MUI Spell. I need help to clear the unit group leak properly without making the spell malfunctioning.
-
Vampire Dance
-

Events
-


Unit - A unit Starts the effect of an ability
-
-

Conditions
-


(Ability being cast) Equal to Summon Water Elemental
-
-

Actions
-


Set VD_Index = (VD_Index + 1)
-


Set VD_Group[VD_Index] = (Units within 500.00 of (Position of (Triggering unit)) matching (((Matching unit) belongs to an ally of (Owner of (Triggering unit))) Equal to True))
-


Set VD_Counter[VD_Index] = 0
-


Unit Group - Pick every unit in VD_Group[VD_Index] and do (Actions)
-



Loop - Actions
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






((Picked unit) is A melee attacker) Equal to True
-
-





Then - Actions
-






Unit - Add Item Life Steal to (Picked unit)
-
-





Else - Actions
-
-
-
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




VD_Index Equal to 1
-
-



Then - Actions
-




Trigger - Turn on VD Loop <gen>
-
-



Else - Actions
-
-
-
-
VD Loop
-

Events
-


Time - Every 1.00 seconds of game time
-
-

Conditions
-

Actions
-


For each (Integer VD_LoopInteger) from 1 to VD_Index, do (Actions)
-



Loop - Actions
-




Set VD_Counter[VD_LoopInteger] = (VD_Counter[VD_LoopInteger] + 1)
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






VD_Counter[VD_LoopInteger] Greater than or equal to 5
-
-





Then - Actions
-






Game - Display to (All players) the text: REMOVE
-






Unit Group - Pick every unit in VD_Group[VD_LoopInteger] and do (Actions)
-







Loop - Actions
-








Unit - Remove Item Life Steal from (Picked unit)
-
-
-






Set VD_Group[VD_LoopInteger] = VD_Group[VD_Index]
-






Set VD_Counter[VD_LoopInteger] = VD_Counter[VD_Index]
-






Set VD_Index = (VD_Index - 1)
-






Set VD_LoopInteger = (VD_LoopInteger - 1)
-






If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-







If - Conditions
-








VD_Index Equal to 0
-
-







Then - Actions
-








Trigger - Turn off (This trigger)
-
-







Else - Actions
-
-
-





Else - Actions
-
-
-
-
-
