Moderator
M
Moderator
22:11, 16th Jun 2010
Hanky:
Leakless and MUI. Good job!
Hanky:
Leakless and MUI. Good job!
Unit - Create 1 *UNIT* for (Owner of (Triggering unit)) at GT_TargetPoint[GT_CastCount] facing 0.00 degrees
(Ability being cast) Equal to Great Tornado
GT Main

Events


Unit - A unit Starts the effect of an ability

Conditions


(Ability being cast) Equal to Great Tornado

Actions


Trigger - Turn on GT Loop <gen>


-------- SETTINGS --------


-------- This is the damage per 1/20 of second. --------


Set GT_DamagePerSecond = 5.00


-------- This is the AOE of Tornado. NOTE: 400 AOE ~ 100% Tornado Size --------


Set GT_TornadoAOE = 400.00


-------- This is the flying height inc/dec per 1/20 of second --------


Set GT_FlyingRate = 30.00


-------- This is the spin speed per 1/20 of second --------


Set GT_SpinSpeed = 50.00


-------- This is the maximum height that Tornado can reach --------


Set GT_TornadoHeight = 600.00


-------- This is the unit filter --------


Set GT_AffectsFlyingUnits = False


-------- END --------


Set GT_CastCount = (GT_CastCount + 1)


Set GT_IsHeightMax[GT_CastCount] = False


Set GT_Caster[GT_CastCount] = (Triggering unit)


Set GT_TargetPoint[GT_CastCount] = (Target point of ability being cast)


Set GT_AbilityLevelDamage[GT_CastCount] = ((Real((Level of (Ability being cast) for (Triggering unit)))) x GT_DamagePerSecond)


Custom script: set udg_GT_TornadoGroup[udg_GT_CastCount] = CreateGroup()


Custom script: set udg_GT_DamageGroup[udg_GT_CastCount] = CreateGroup()


For each (Integer GT_LoopInteger) from 1 to 4, do (Actions)



Loop - Actions




Unit - Create 1 Dummy_Tornado for (Owner of (Triggering unit)) at GT_TargetPoint[GT_CastCount] facing ((Real(GT_LoopInteger)) x 90.00) degrees




Animation - Change (Last created unit)'s size to ((GT_TornadoAOE / 4.00)%, (GT_TornadoAOE / 4.00)%, (GT_TornadoAOE / 4.00)%) of its original size




Unit Group - Add (Last created unit) to GT_TornadoGroup[GT_CastCount]
GT Loop

Events


Time - Every 0.05 seconds of game time

Conditions

Actions


For each (Integer GT_LoopInteger) from 1 to GT_CastCount, do (Actions)



Loop - Actions




Unit Group - Pick every unit in GT_TornadoGroup[GT_LoopInteger] and do (Actions)





Loop - Actions






Unit - Make (Picked unit) face ((Facing of (Picked unit)) + GT_SpinSpeed) over 0.00 seconds






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







If - Conditions








GT_IsHeightMax[GT_LoopInteger] Equal to False







Then - Actions








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









If - Conditions










(Current flying height of (Picked unit)) Less than GT_TornadoHeight









Then - Actions










Animation - Change (Picked unit) flying height to ((Current flying height of (Picked unit)) + GT_FlyingRate) at 0.00









Else - Actions










Set GT_IsHeightMax[GT_LoopInteger] = True







Else - Actions








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









If - Conditions










(Current flying height of (Picked unit)) Greater than 100.00









Then - Actions










Animation - Change (Picked unit) flying height to ((Current flying height of (Picked unit)) - GT_FlyingRate) at 0.00









Else - Actions










Set GT_IsHeightMax[GT_LoopInteger] = False






Set GT_CurrentHeight = (Current flying height of (Picked unit))






Set GT_CurrentFace = (Facing of (Picked unit))




Custom script: set bj_wantDestroyGroup = true




Unit Group - Pick every unit in (Units within GT_TornadoAOE of GT_TargetPoint[GT_LoopInteger] matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of GT_Caster[GT_LoopInteger])) Equal and do (Actions)





Loop - Actions






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







If - Conditions








((Picked unit) is A flying unit) Equal to True








GT_AffectsFlyingUnits Equal to False







Then - Actions







Else - Actions








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









If - Conditions










((Picked unit) is in GT_DamageGroup[GT_LoopInteger]) Equal to False









Then - Actions










Unit Group - Add (Picked unit) to GT_DamageGroup[GT_LoopInteger]










Unit - Turn collision for (Picked unit) Off










Unit - Add Destroyer Form to (Picked unit)










Unit - Remove Destroyer Form from (Picked unit)









Else - Actions








Set GT_LeakPoint[1] = (Position of (Picked unit))








Set GT_LeakPoint[2] = (GT_LeakPoint[1] offset by ((Distance between GT_LeakPoint[1] and GT_TargetPoint[GT_LoopInteger]) / 50.00) towards (Angle from GT_LeakPoint[1] to GT_TargetPoint[GT_LoopInteger]) degrees)








Unit - Move (Picked unit) instantly to GT_LeakPoint[2]








Unit - Make (Picked unit) face GT_CurrentFace over 0.00 seconds








Animation - Change (Picked unit) flying height to GT_CurrentHeight at 0.00








Custom script: call RemoveLocation(udg_GT_LeakPoint[1])








Custom script: call RemoveLocation(udg_GT_LeakPoint[2])








Unit - Cause GT_Caster[GT_LoopInteger] to damage (Picked unit), dealing GT_AbilityLevelDamage[GT_LoopInteger] damage of attack type Spells and damage type Normal
GT End

Events


Unit - A unit Finishes casting an ability


Unit - A unit Stops casting an ability

Conditions


(Ability being cast) Equal to Great Tornado

Actions


For each (Integer GT_LoopInteger) from 1 to GT_CastCount, do (Actions)



Loop - Actions




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





If - Conditions






(Triggering unit) Equal to GT_Caster[GT_LoopInteger]





Then - Actions






Unit Group - Pick every unit in GT_TornadoGroup[GT_LoopInteger] and do (Actions)







Loop - Actions








Animation - Change (Picked unit)'s animation speed to 300.00% of its original speed








Unit - Kill (Picked unit)






Unit Group - Pick every unit in GT_DamageGroup[GT_LoopInteger] and do (Actions)







Loop - Actions








Unit - Turn collision for (Picked unit) On








Animation - Change (Picked unit) flying height to (Default flying height of (Picked unit)) at 1000.00






Custom script: call RemoveLocation(udg_GT_TargetPoint[udg_GT_LoopInteger])






Set GT_TargetPoint[GT_LoopInteger] = GT_TargetPoint[GT_CastCount]






Set GT_Caster[GT_LoopInteger] = GT_Caster[GT_CastCount]






Set GT_IsHeightMax[GT_LoopInteger] = GT_IsHeightMax[GT_CastCount]






Unit Group - Remove all units from GT_TornadoGroup[GT_LoopInteger]






Unit Group - Add all units of GT_TornadoGroup[GT_CastCount] to GT_TornadoGroup[GT_LoopInteger]






Unit Group - Remove all units from GT_DamageGroup[GT_LoopInteger]






Unit Group - Add all units of GT_DamageGroup[GT_CastCount] to GT_DamageGroup[GT_LoopInteger]






Custom script: call DestroyGroup(udg_GT_TornadoGroup[udg_GT_CastCount])






Custom script: call DestroyGroup(udg_GT_DamageGroup[udg_GT_CastCount])






Set GT_CastCount = (GT_CastCount - 1)






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







If - Conditions








GT_CastCount Equal to 0







Then - Actions








Trigger - Turn off GT Loop <gen>







Else - Actions





Else - Actions