[trigger=Gui]Loop
Events
Time - Every 0.03 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in GroupStar and do (Actions)
Loop - Actions
Set TempUnitA = (Picked unit)
Custom script: set udg_TempIntegerA = GetHandleId( udg_TempUnitA )
Set TempUnitB = (Load 0 of TempIntegerA in HashtableStar)
Set TempPlayerA = (Owner of TempUnitB)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(3 is stored as a String of TempIntegerA in HashtableStar) Equal to True
Then - Actions
Set StarSize = (Load -1 of TempIntegerA from HashtableStar)
Set StarModel = (Load -2 of TempIntegerA from HashtableStar)
Set StarTail = (Load 3 of TempIntegerA from HashtableStar)
Set StarInterval = (Load 4 of TempIntegerA from HashtableStar)
Set StarSpeed = (Load 5 of TempIntegerA from HashtableStar)
Set StarDistance = (Load 6 of TempIntegerA from HashtableStar)
Set StarCollision = (Load 7 of TempIntegerA from HashtableStar)
Set StarEffects = (Load 8 of TempIntegerA from HashtableStar)
Set StarAttachment = (Load 9 of TempIntegerA from HashtableStar)
Set StarSplit = (Load 10 of TempIntegerA from HashtableStar)
Set StarWeaken = (Load 11 of TempIntegerA from HashtableStar)
Set StarRadius = (Load 12 of TempIntegerA from HashtableStar)
Set StarDuration = (Load 13 of TempIntegerA from HashtableStar)
-------- --------
Set TempRealA = (Load 1 of TempIntegerA from HashtableStar)
Set TempRealB = ((Load -6 of TempIntegerA from HashtableStar) + StarSpeed)
Custom script: set udg_TempRealC = ( udg_TempRealA * bj_DEGTORAD )
Custom script: call SetUnitX( udg_TempUnitA, GetUnitX( udg_TempUnitA ) + udg_StarSpeed * Cos( udg_TempRealC))
Custom script: call SetUnitY( udg_TempUnitA, GetUnitY( udg_TempUnitA ) + udg_StarSpeed * Sin( udg_TempRealC))
Set TempPointA = (Position of TempUnitA)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
TempRealB Less than StarDistance
(Terrain pathing at TempPointA of type Walkability is off) Equal to False
Then - Actions
Hashtable - Save TempRealB as -6 of TempIntegerA in HashtableStar
Set TempRealB = ((Load -4 of TempIntegerA from HashtableStar) + 0.03)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
TempRealB Greater than or equal to StarInterval
Then - Actions
Hashtable - Save 0.00 as -4 of TempIntegerA in HashtableStar
Special Effect - Create a special effect at TempPointA using StarTail
Special Effect - Destroy (Last created special effect)
Else - Actions
Hashtable - Save TempRealB as -4 of TempIntegerA in HashtableStar
Set TempGroupA = (Units within StarCollision of TempPointA matching (((((Matching unit) is alive) Equal to True) and (((Matching unit) is A ground unit) Equal to True)) and (((Matching unit) is A structure) Equal to False)))
Unit Group - Pick every unit in (Random 1 units from TempGroupA) and do (Actions)
Loop - Actions
Set TempUnitC = (Load -3 of TempIntegerA in HashtableStar)
Set TempUnitD = (Picked unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
TempUnitD Not equal to TempUnitC
(TempUnitD is an illusion) Equal to False
(TempUnitD is Magic Immune) Equal to False
(Unit-type of TempUnitD) Not equal to (Unit-type of TempUnitC)
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
TempUnitC Equal to No unit
Then - Actions
Set TempUnitC = TempUnitD
Hashtable - Save Handle OfTempUnitC as -3 of TempIntegerA in HashtableStar
Special Effect - Create a special effect attached to the StarAttachment of TempUnitC using StarEffects
Else - Actions
Set TempPlayerB = (Owner of TempUnitD)
Unit - Create 1 Dummy for TempPlayerB at TempPointA facing Default building facing degrees
Set TempUnitE = (Last created unit)
Custom script: call SetUnitX( udg_TempUnitE, GetUnitX( udg_TempUnitC ))
Custom script: call SetUnitY( udg_TempUnitE, GetUnitY( udg_TempUnitC ))
Unit - Add clonestar to TempUnitE
Custom script: call IssueTargetOrderById(udg_TempUnitE, 852274, udg_TempUnitC)
Custom script: call SetUnitX( udg_TempUnitF, GetUnitX( udg_TempUnitD ))
Custom script: call SetUnitY( udg_TempUnitF, GetUnitY( udg_TempUnitD ))
Special Effect - Create a special effect attached to the StarAttachment of TempUnitF using StarEffects
Unit - Set life of TempUnitF to (Percentage life of TempUnitD)%
Unit - Remove TempUnitE from the game
-------- --------
Unit - Hide TempUnitD
Unit - Pause TempUnitD
For each (Integer TempIntegerB) from 1 to 12, do (Actions)
Loop - Actions
Set TempPlayerB = (Player(TempIntegerB))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(TempUnitD is selected by TempPlayerB) Equal to True
Then - Actions
Selection - Add TempUnitF to selection for TempPlayerB
Else - Actions
Custom script: set udg_TempIntegerB = GetHandleId( udg_TempUnitD )
Hashtable - Save Handle OfTempUnitF as 0 of TempIntegerB in HashtableStar
Hashtable - Save StarDuration as 1 of TempIntegerB in HashtableStar
Unit Group - Add TempUnitD to GroupStar
Hashtable - Save StarDistance as -6 of TempIntegerA in HashtableStar
Special Effect - Destroy (Last created special effect)
-------- --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
StarSplit Greater than 0
Then - Actions
For each (Integer TempIntegerB) from 1 to StarSplit, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
StarSplit Greater than 1
Then - Actions
Set TempRealB = ((StarRadius / (Real(StarSplit))) x (Real(TempIntegerB)))
Set TempRealB = ((TempRealA + TempRealB) - (StarRadius / 1.66))
Else - Actions
Set TempRealB = TempRealA
Unit - Create 1 Dummy for TempPlayerA at TempPointA facing TempRealB degrees
Set TempUnitE = (Last created unit)
Unit Group - Add TempUnitE to GroupStar
Animation - Change TempUnitE flying height to 50.00 at 0.00
Animation - Change TempUnitE's size to (StarSize%, 0.00%, 0.00%) of its original size
Special Effect - Create a special effect attached to the origin of TempUnitE using StarModel
Custom script: call SetUnitX( udg_TempUnitE, GetUnitX( udg_TempUnitA ))
Custom script: call SetUnitY( udg_TempUnitE, GetUnitY( udg_TempUnitA ))
-------- --------
Custom script: set udg_TempIntegerC = GetHandleId( udg_TempUnitE )
Hashtable - Save Handle OfTempUnitB as 0 of TempIntegerC in HashtableStar
Hashtable - Save TempRealB as 1 of TempIntegerC in HashtableStar
Hashtable - Save Handle Of(Last created special effect) as 2 of TempIntegerC in HashtableStar
Hashtable - Save StarTail as 3 of TempIntegerC in HashtableStar
Hashtable - Save StarInterval as 4 of TempIntegerC in HashtableStar
Hashtable - Save StarSpeed as 5 of TempIntegerC in HashtableStar
Hashtable - Save StarDistance as 6 of TempIntegerC in HashtableStar
Hashtable - Save StarCollision as 7 of TempIntegerC in HashtableStar
Hashtable - Save StarEffects as 8 of TempIntegerC in HashtableStar
Hashtable - Save StarAttachment as 9 of TempIntegerC in HashtableStar
Hashtable - Save (StarSplit - StarWeaken) as 10 of TempIntegerC in HashtableStar
Hashtable - Save StarWeaken as 11 of TempIntegerC in HashtableStar
Hashtable - Save StarRadius as 12 of TempIntegerC in HashtableStar
Hashtable - Save StarDuration as 13 of TempIntegerC in HashtableStar
-------- --------
Hashtable - Save StarSize as -1 of TempIntegerC in HashtableStar
Hashtable - Save StarModel as -2 of TempIntegerC in HashtableStar
Hashtable - Save Handle OfTempUnitC as -3 of TempIntegerC in HashtableStar
Else - Actions
Else - Actions
Custom script: call DestroyGroup ( udg_TempGroupA )
Else - Actions
Special Effect - Destroy (Load 2 of TempIntegerA in HashtableStar)
Unit - Remove TempUnitA from the game
Unit Group - Remove TempUnitA from GroupStar
Hashtable - Clear all child hashtables of child TempIntegerA in HashtableStar
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in GroupStar) Equal to 0
Then - Actions
Trigger - Turn off (This trigger)
Else - Actions
Custom script: call RemoveLocation ( udg_TempPointA )
Else - Actions
Set TempRealA = ((Load 1 of TempIntegerA from HashtableStar) - 0.03)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
TempRealA Greater than 0.00
(TempUnitB is alive) Equal to True
Then - Actions
Unit - Make TempUnitA face (Facing of TempUnitB) over 0.00 seconds
Custom script: call SetUnitX( udg_TempUnitA, GetUnitX( udg_TempUnitB ))
Custom script: call SetUnitY( udg_TempUnitA, GetUnitY( udg_TempUnitB ))
Hashtable - Save TempRealA as 1 of TempIntegerA in HashtableStar
Else - Actions
Unit - Unhide TempUnitA
Unit - Unpause TempUnitA
Unit - Set life of TempUnitA to (Percentage life of TempUnitB)%
Unit - Kill TempUnitB
Custom script: call SetUnitX( udg_TempUnitA, GetUnitX( udg_TempUnitB ))
Custom script: call SetUnitY( udg_TempUnitA, GetUnitY( udg_TempUnitB ))
For each (Integer TempIntegerB) from 1 to 12, do (Actions)
Loop - Actions
Set TempPlayerB = (Player(TempIntegerB))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(TempUnitB is selected by TempPlayerB) Equal to True
Then - Actions
Selection - Add TempUnitA to selection for TempPlayerB
Else - Actions
-------- --------
Unit Group - Remove TempUnitA from GroupStar
Hashtable - Clear all child hashtables of child TempIntegerA in HashtableStar
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in GroupStar) Equal to 0
Then - Actions
Trigger - Turn off (This trigger)
Else - Actions
[/trigger]