Here's how knockback works :
This is just basic, I am not sure if it will work, but it is just to give an idea.
- Knock Back
- Events
- Your event(attack, spell, ect)
- Conditions
- Your condition
- Actions
- Set Unit_KnockBack = (Attacked unit)
- For each (Integer A) from 1 to 10, do (Actions)
- Loop - Actions
- Unit - Move Unit_KnockBack instantly to ((Position of Unit_KnockBack) offset by 30.00 towards ((Facing of Unit_KnockBack) - 180.00) degrees)
- Wait 0.05 seconds
Here is a knockback spell I use :
and
- Spirit Bash
- Events
- Unit - A unit Is attacked
- Conditions
- (Level of Spirit Bash for (Attacking unit)) Greater than 0
- Actions
- Set Abt_Unit_Bash[2] = (Attacking unit)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Random integer number between 1 and 100) Less than or equal to Abt_Int_Bash
- Then - Actions
- Set Abt_Int_Bash = (5 x (Level of Spirit Bash for Abt_Unit_Bash[2]))
- Set Abt_Unit_Bash[1] = (Attacked unit)
- Special Effect - Create a special effect attached to the chest of Abt_Unit_Bash[1] using Abilities\Spells\Human\Banish\BanishTarget.mdl
- Set Abt_Special_Bash = (Last created special effect)
- Special Effect - Destroy Abt_Special_Bash
- Countdown Timer - Start Timer_Bash as a Repeating timer that will expire in 0.01 seconds
- Wait 0.50 seconds
- Countdown Timer - Pause Timer_Bash
- Else - Actions
- Do nothing
hope it helps in any way.
- Bash Timer
- Events
- Time - Timer_Bash expires
- Conditions
- Actions
- Unit - Move Abt_Unit_Bash[1] instantly to ((Position of Abt_Unit_Bash[1]) offset by 5.00 towards (Facing of Abt_Unit_Bash[2]) degrees)