[Trigger=Drag Loop] Drag Loop
Events
Time - Every 0.03 seconds of game time
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in DragGroup) Less than or equal to 0
Then - Actions
Trigger - Turn off (This trigger)
Skip remaining actions
Else - Actions
Unit Group - Pick every unit in DragGroup and do (Actions)
Loop - Actions
-------- Loads needed values from the unit --------
Set DragCaster = (Load 0 of (Key (Picked unit)) in DragHastable)
Set DragPoints[0] = (Position of DragCaster)
Set DragPoints[1] = (Position of (Picked unit))
Set DragPoints[2] = (DragPoints[1] offset by 18.00 towards (Angle from DragPoints[1] to DragPoints[0]) degrees)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Distance between DragPoints[0] and DragPoints[1]) Greater than 55.00
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Terrain pathing at DragPoints[2] of type Walkability is off) Equal to True
Then - Actions
Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Weapons\AvengerMissile\AvengerMissile.mdl
Special Effect - Destroy (Last created special effect)
Special Effect - Create a special effect at DragPoints[1] using Objects\Spawnmodels\Undead\UCancelDeath\UCancelDeath.mdl
Special Effect - Destroy (Last created special effect)
Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Spells\Other\AcidBomb\BottleMissile.mdl
Special Effect - Destroy (Last created special effect)
Unit - Turn collision for (Picked unit) On
For each (Integer D) from 1 to 6, do (Actions)
Loop - Actions
Special Effect - Destroy (Load D of (Key (Picked unit)) in DragHastable)
Unit Group - Pick every unit in (Units within DragAoe[(Level of Drag for DragCaster)] of DragPoints[1] matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Magic Immune) Equal to False) and (((Matching unit) belongs to an enemy of (Owner of DragCaster)) Equ and do (Actions)
Loop - Actions
Unit - Cause DragCaster to damage (Picked unit), dealing DragDamage[(Level of Drag for DragCaster)] damage of attack type Spells and damage type Force
Set Dragged = False
Hashtable - Save Dragged as (Key Casted) of (Key (Target unit of ability being cast)) in DragHastable
Hashtable - Clear all child hashtables of child (Key (Picked unit)) in DragHastable
Unit Group - Remove (Picked unit) from DragGroup
Else - Actions
Custom script: call SetUnitX(GetEnumUnit(), GetLocationX(udg_DragPoints[2]))
Custom script: call SetUnitY(GetEnumUnit(), GetLocationY(udg_DragPoints[2]))
Else - Actions
Unit Group - Pick every unit in (Units within DragAoe[(Level of Drag for DragCaster)] of DragPoints[1] matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Magic Immune) Equal to False) and (((Matching unit) belongs to an enemy of (Owner of DragCaster)) Equ and do (Actions)
Loop - Actions
Unit - Cause DragCaster to damage (Picked unit), dealing DragDamage[(Level of Drag for DragCaster)] damage of attack type Spells and damage type Force
Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Weapons\AvengerMissile\AvengerMissile.mdl
Special Effect - Destroy (Last created special effect)
Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Spells\Other\AcidBomb\BottleMissile.mdl
Special Effect - Destroy (Last created special effect)
Special Effect - Create a special effect at DragPoints[1] using Objects\Spawnmodels\Undead\UCancelDeath\UCancelDeath.mdl
Special Effect - Destroy (Last created special effect)
-------- The Aoe --------
Unit - Turn collision for (Picked unit) On
-------- Here wuz the problem --------
-------- Instead of picked unit i inputted it in DragTarget --------
Unit - Unpause (Picked unit)
-------- Load the SFx then destroy it --------
Unit - Create 1 Dummy for (Owner of DragCaster) at DragPoints[0] facing Default building facing degrees
Unit - Add Drag(prey(dummy)) to (Last created unit)
Unit - Set level of Drag(prey(dummy)) for (Last created unit) to (Level of Drag for DragCaster)
Unit - Order (Last created unit) to Human Sorceress - Invisibility DragCaster
Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
For each (Integer D) from 1 to 6, do (Actions)
Loop - Actions
Special Effect - Destroy (Load D of (Key (Picked unit)) in DragHastable)
Set Dragged = False
Hashtable - Save Dragged as (Key Casted) of (Key (Target unit of ability being cast)) in DragHastable
Hashtable - Clear all child hashtables of child (Key (Picked unit)) in DragHastable
Unit Group - Remove (Picked unit) from DragGroup
Custom script: call RemoveLocation(udg_DragPoints[0])
Custom script: call RemoveLocation(udg_DragPoints[1])
Custom script: call RemoveLocation(udg_DragPoints[2]) [/trigger]