Now I'm to repost. I hope I don't get bad rep for that. Read mine, its non-buggy except with buildings if thats what the knockback is for. If the attacker is facing north attacking a unit north of him, the attacked unit (unit north of attacker that is getting attacked) will move north. Reposting:
I have a trigger exactly like that. Let me write it down. Also, the spawn a unit when an ability is cast? Just base the spell off of Summon Misha, if you don't want a timer, and if you want a timer, base it off of Summon Water Elemental, change the description and all that, and then make it "units summoned - (number)" and make "unit type summoned - (unit you want)" and "timer - (how many seconds you want it to live)" for both.
Heres the first trigger in my tri-set
EDIT: Ok, I have 3 triggers in my map, due to something, what I have no idea, it was a long time ago. Anyways...
-
Warrior KnockbackAddUnits1
-
Events
-
Map initialization
-
Conditions
-
Actions
-
Unit Group - Pick every unit in (Units in (Playable map area)) and do (actions)
-
Loop - Actions
-
Trigger - Add to Warrior Knockback <gen> the event (Unit - (Picked Unit) Takes damage)
Heres my second in the tri-set... The condition is optional. If you want all units affected, then delete the condition. If not, edit the unit type that I put in.
-
Warrior KnockbackAddUnits2
-
Events
-
Unit - A unit enters (Playable map area)
-
Conditions
-
((Triggering unit) is A ground unit) Equal to True
-
Actions
-
Trigger - Add to Warrior Knockback <gen> the event (Unit - Entering unit) Takes damage)
Heres my third in the tri set. This is what the other two triggers were modifying. Here is when the knockback begins!
-
Warrior Knockback
-
Events
-
Conditions
-
(Unit-type of (Damage source)) Equal to (unit attacking, not unit moved, I said Warrior)
-
(Damage taken) Greater than or equal to 1.00
-
(Attacking unit) knows (Thunder Clap) Equal to True
-
Actions
-
Set tempPoint[0] = (Position of (Damage source))
-
Set tempPoint[1] = (Position of (Triggering unit))
-
Set tempPoint[2] = (tempPoint[1] offset by 32.00 towards (Angle from tempPoint[0] to tempPoint[1]) degrees)
-
Unit - Move (Triggering unit) instantly to tempPoint[2]
-
Custom script: call RemoveLocation(udg_tempPoint[0])
-
Custom script: call RemoveLocation(udg_tempPoint[1])
-
Custom script: call RemoveLocation(udg_tempPoint[2])
Now, in order to do this, you need to turn your ability, Thunder Clap (i think it is?) passive.