- Joined
- Jun 24, 2009
- Messages
- 1,409
I decided to make a new index recycling system because everyone says that the current one I use isn't the best. So I made a new one, how about it? Is it okay? Or is it better than the previous? (You can check the old in my uploaded spells)
-
Init
-
Events
- Map initialization
- Conditions
-
Actions
- Visibility - Disable fog of war
- Visibility - Disable black mask
- Set WMax = 20
- Set WCount = 0
-
For each (Integer A) from 1 to WMax, do (Actions)
-
Loop - Actions
- Set WRecycle[(Integer A)] = True
- Custom script: set udg_WDummyGroup[GetForLoopIndexA()] = CreateGroup()
-
Loop - Actions
-
Events
-
Windcutter
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Windcutter
-
Actions
- Set WGet = False
-
For each (Integer A) from 1 to WMax, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- WGet Equal to False
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- WRecycle[(Integer A)] Equal to True
-
Then - Actions
- Set WIndex = (Integer A)
- Set WGet = True
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Integer A) Equal to WMax
-
Then - Actions
- Set WMax = (WMax + 1)
- Set WRecycle[((Integer A) + 1)] = True
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
- Set WCaster[WIndex] = (Triggering unit)
- Set WTargetPoint[WIndex] = (Target point of ability being cast)
- Set WDamage[WIndex] = (Real((Level of Windcutter for WCaster[WIndex])))
- Set WTimer[WIndex] = (2.00 + (Real((Level of Windcutter for WCaster[WIndex]))))
-
For each (Integer A) from 1 to 6, do (Actions)
-
Loop - Actions
- Set TempPoint[1] = (WTargetPoint[WIndex] offset by 150.00 towards (60.00 x (Real((Integer A)))) degrees)
- Unit - Create 1 Wind for (Owner of WCaster[WIndex]) at TempPoint[1] facing ((Angle from WTargetPoint[WIndex] to TempPoint[1]) + 90.00) degrees
- Unit Group - Add (Last created unit) to WDummyGroup[WIndex]
- Animation - Change (Last created unit)'s animation speed to (Random real number between 25.00 and 50.00)% of its original speed
- Unit - Create 1 Windcutter for (Owner of WCaster[WIndex]) at TempPoint[1] facing ((Angle from WTargetPoint[WIndex] to TempPoint[1]) + 90.00) degrees
- Unit Group - Add (Last created unit) to WDummyGroup[WIndex]
- Custom script: call RemoveLocation (udg_TempPoint[1])
-
Loop - Actions
- Set WHas[WIndex] = True
- Set WRecycle[WIndex] = False
- Set WCount = (WCount + 1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Windcutter Loop <gen> is on) Equal to False
-
Then - Actions
- Trigger - Turn on Windcutter Loop <gen>
- Trigger - Turn on Crush Effect <gen>
- Else - Actions
-
If - Conditions
-
Events
-
Windcutter Loop
-
Events
- Time - Every 0.03 seconds of game time
- Conditions
-
Actions
-
For each (Integer WInteger) from 1 to WMax, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- WHas[WInteger] Equal to True
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- WTimer[WInteger] Greater than 0.00
-
Then - Actions
- Set WTimer[WInteger] = (WTimer[WInteger] - 0.03)
- Set TempGroup = (Units within 400.00 of WTargetPoint[WInteger] matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Ow
-
Unit Group - Pick every unit in TempGroup and do (Actions)
-
Loop - Actions
- Unit - Cause WCaster[WInteger] to damage (Picked unit), dealing WDamage[WInteger] damage of attack type Spells and damage type Normal
-
Loop - Actions
-
Unit Group - Pick every unit in WDummyGroup[WInteger] and do (Actions)
-
Loop - Actions
- Set TempPoint[2] = (Position of (Picked unit))
- Set TempPoint[3] = (WTargetPoint[WInteger] offset by 150.00 towards ((Angle from WTargetPoint[WInteger] to TempPoint[2]) + 10.00) degrees)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Unit-type of (Picked unit)) Equal to Wind
-
Then - Actions
- Set TempPoint[4] = (WTargetPoint[WInteger] offset by (Random real number between 300.00 and 350.00) towards ((Angle from WTargetPoint[WInteger] to TempPoint[2]) + 10.00) degrees)
- Unit - Move (Picked unit) instantly to TempPoint[4], facing ((Angle from WTargetPoint[WInteger] to TempPoint[3]) + 90.00) degrees
- Custom script: call RemoveLocation (udg_TempPoint[4])
-
Else - Actions
- Unit - Move (Picked unit) instantly to TempPoint[3], facing ((Angle from WTargetPoint[WInteger] to TempPoint[3]) + 90.00) degrees
-
If - Conditions
- Custom script: call RemoveLocation (udg_TempPoint[2])
- Custom script: call RemoveLocation (udg_TempPoint[3])
-
Loop - Actions
- Custom script: call DestroyGroup(udg_TempGroup)
-
Else - Actions
- Unit Group - Pick every unit in WDummyGroup[WInteger] and do (Unit - Kill (Picked unit))
- Set WHas[WInteger] = False
- Set WCount = (WCount - 1)
- Custom script: call RemoveLocation (udg_WTargetPoint[udg_WInteger])
- Unit Group - Remove all units from WDummyGroup[WInteger]
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Else - Actions
- Set WRecycle[WInteger] = True
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- WCount Equal to 0
-
Then - Actions
- Trigger - Turn off (This trigger)
- Trigger - Turn off Crush Effect <gen>
- Else - Actions
-
If - Conditions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
For each (Integer WInteger) from 1 to WMax, do (Actions)
-
Events
-
Crush Effect
-
Events
- Time - Every 0.50 seconds of game time
- Conditions
-
Actions
-
For each (Integer WInteger) from 1 to WMax, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- WHas[WInteger] Equal to True
-
Then - Actions
- Set TempGroup = (Units within 400.00 of WTargetPoint[WInteger] matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Ow
-
Unit Group - Pick every unit in TempGroup and do (Actions)
-
Loop - Actions
- Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Other\CrushingWave\CrushingWaveDamage.mdl
- Special Effect - Destroy (Last created special effect)
-
Loop - Actions
- Custom script: call DestroyGroup(udg_TempGroup)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
For each (Integer WInteger) from 1 to WMax, do (Actions)
-
Events