How do i make this trigger function? The damage isn't applying to the picked target.
-
Attraction Potion Work
-

Events
-


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

Conditions
-


(Ability being cast) Equal to Attraction Potion
-
-

Actions
-


Set VariableSet AttractionPotion_Caster = (Triggering unit)
-


Set VariableSet AttractionPotion_Point = (Position of AttractionPotion_Caster)
-


Unit - Create 1 Dummy Attraction Potion for (Owner of AttractionPotion_Caster) at AttractionPotion_Point facing Default building facing degrees
-


Set VariableSet AttractionPotion_Dummy = (Last created unit)
-


Unit - Add a 1.00 second Generic expiration timer to AttractionPotion_Dummy
-


-------- Damage --------
-


Set VariableSet AttractionPotion_Damage[1] = (100 + (Intelligence of AttractionPotion_Caster (Include bonuses)))
-


Set VariableSet AttractionPotion_Damage[2] = (125 + (Intelligence of AttractionPotion_Caster (Include bonuses)))
-


Set VariableSet AttractionPotion_Damage[3] = (150 + (Intelligence of AttractionPotion_Caster (Include bonuses)))
-


Set VariableSet AttractionPotion_Damage[4] = (175 + (Intelligence of AttractionPotion_Caster (Include bonuses)))
-


Set VariableSet AttractionPotion_Damage[5] = (200 + (Intelligence of AttractionPotion_Caster (Include bonuses)))
-


-------- --------
-


Set VariableSet AttractionPotion_Duration = 10
-


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



If - Conditions
-




AttractionPotion_Timer Equal to 0
-
-



Then - Actions
-




Trigger - Turn on AttractionPotion Loop <gen>
-
-



Else - Actions
-
-


Custom script: call RemoveLocation (udg_AttractionPotion_Point)
-
-
-
AttractionPotion Loop
-

Events
-


Time - Every 1.00 seconds of game time
-
-

Conditions
-

Actions
-


Set VariableSet AttractionPotion_Timer = (AttractionPotion_Timer + 1)
-


Set VariableSet AttractionPotion_Group = (Units within 5000.00 of AttractionPotion_Point.)
-


Unit Group - Pick every unit in AttractionPotion_Group and do (Actions)
-



Loop - Actions
-




Set VariableSet AttractionPotion_Target = (Picked unit)
-




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





If - Conditions
-






(AttractionPotion_Target belongs to an enemy of (Owner of AttractionPotion_Caster).) Equal to True
-






(AttractionPotion_Target is alive) Equal to True
-
-





Then - Actions
-






For each (Integer A) from 1 to AttractionPotion_Duration, do (Actions)
-







Loop - Actions
-








Unit - Cause AttractionPotion_Caster to damage AttractionPotion_Target, dealing (Real(AttractionPotion_Damage[(Level of Attraction Potion for AttractionPotion_Caster)])) damage of attack type Spells and damage type Normal
-








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









If - Conditions
-










AttractionPotion_Timer Equal to AttractionPotion_Duration
-
-









Then - Actions
-










Set VariableSet AttractionPotion_Timer = 0
-










Trigger - Turn off (This trigger)
-
-









Else - Actions
-
-
-
-
-





Else - Actions
-
-
-
-


Custom script: call DestroyGroup (udg_AttractionPotion_Group)
-
-

