Knockback
Events
Unit - A unit Is attacked
Conditions
Integer - (Level of Knockback for (Attacking unit)) Greater than 0
Integer - (Math - Random number between 0-100) less than (10 + (Level of Knockback for (Attacking unit)) x 10) [i]// 20/30/40% chance[/i]
Actions
Set KB_Target = (Attacked unit)
Set KB_Angle = (Angle between (Position of (Attacking unit)) and (Position of (Attacked unit))
Set KB_Distance = (64 + (Level of (Knockback) for (Attacking unit)) x 64) [i]// 128/196/256[/i]
Unit - Make (Attacking unit) damage (Attacked unit) for (10 + (Level of (Knockback) for (Attacking unit) x 15) [i]// 25/40/55 damage[/i]
Trigger - Turn on (Slide <Gen>)
Slide
Event
Time - Every .05 seconds of the game
Condition
Action
If/Then/Else
If (Integer - KB_Angle greater than 0)
Then (Do nothing)
Else
Trigger - Turn off (This trigger)
Skip remaining actions
Set Point = (Position of (KB_Target) offset by 3.2 towards (KB_Angle))
Unit - Move (KB_Target) instantly to (Point)
Set KB_Distance = (KB_Distance - 3.2)
Custom Script - call RemoveLocation(udg_Point)