- Joined
- Mar 24, 2013
- Messages
- 1,105
So I'm trying to make a spell that upon being cast will push everyone around them back for 2 seconds, It works for 1 person...but it didn't work with multiple people and some people's got stuck permanently on, so any help would be awesome!
-
Knockback
-

Events
-


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

Conditions
-


(Ability being cast) Equal to Make Way
-
-

Actions
-


Set Knockback_MaxIndex = (Knockback_MaxIndex + 1)
-


Set Knockback_Caster[Knockback_MaxIndex] = (Triggering unit)
-


Special Effect - Create a special effect attached to the origin of Knockback_Caster[Knockback_MaxIndex] using Abilities\Spells\Undead\Unsummon\UnsummonTarget.mdl
-


Set Knockback_SpcEffec[(Player number of (Triggering player))] = (Last created special effect)
-


Set Knockback_Counter[Knockback_MaxIndex] = 66
-


Trigger - Turn on Knockback Push <gen>
-
-
-
Knockback Push
-

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
-




Knockback_MaxIndex Equal to 0
-
-



Then - Actions
-




Trigger - Turn off (This trigger)
-
-



Else - Actions
-




For each (Integer Knockback_CurrentIndex) from 1 to Knockback_MaxIndex, do (Actions)
-





Loop - Actions
-






Set Knockback_Counter[Knockback_CurrentIndex] = (Knockback_Counter[Knockback_CurrentIndex] - 1)
-






Set TempLoc = (Position of Knockback_Caster[Knockback_CurrentIndex])
-






Set Knockback_Group[Knockback_CurrentIndex] = (Units within 225.00 of TempLoc matching (((Matching unit) belongs to an enemy of (Owner of Knockback_Caster[Knockback_CurrentIndex])) Equal to True))
-






Unit Group - Pick every unit in Knockback_Group[Knockback_CurrentIndex] and do (Actions)
-







Loop - Actions
-








Set Knockback_EnemyLoc[1] = (Position of (Picked unit))
-








Set Knockback_Angle = (Angle from TempLoc to Knockback_EnemyLoc[1])
-








Set Knockback_EnemyLoc[2] = (Knockback_EnemyLoc[1] offset by 5.00 towards Knockback_Angle degrees)
-








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








Custom script: call RemoveLocation(udg_Knockback_EnemyLoc[1])
-








Custom script: call RemoveLocation(udg_Knockback_EnemyLoc[2])
-
-
-






Custom script: call DestroyGroup(udg_Knockback_Group[udg_Knockback_CurrentIndex])
-






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







If - Conditions
-








Or - Any (Conditions) are true
-









Conditions
-










(Knockback_Caster[Knockback_CurrentIndex] is alive) Not equal to True
-










Knockback_Counter[Knockback_CurrentIndex] Equal to 0
-
-
-
-







Then - Actions
-








Special Effect - Destroy Knockback_SpcEffec[Knockback_CurrentIndex]
-








Set Knockback_Caster[Knockback_CurrentIndex] = Knockback_Caster[Knockback_MaxIndex]
-








Set Knockback_CurrentIndex = (Knockback_CurrentIndex - 1)
-








Set Knockback_MaxIndex = (Knockback_MaxIndex - 1)
-
-







Else - Actions
-
-






Custom script: call RemoveLocation(udg_TempLoc)
-
-
-
-
-
-


















