I made a Knockback passive skill. What it does is whenever the hero that has this skill is attacked, there is certain chance to knockback the attacking enemy unit. The problem is that when my hero is attacking, this skill doesn't activate, but when i move around while getting attacked by the ememy units, it activates.. I want to make it happen ALWAYS. please check my trigger, and fix please. thanks.
EDIT: I made those interger chances really large for now, so i can see if it works or not.
Trigger:
- Stone Skin
- Events
- Unit - A unit Is attacked
- Conditions
- (Unit-type of (Attacked unit)) Equal to Stone Golem
- ((Attacking unit) belongs to an enemy of (Owner of (Attacked unit))) Equal to True
- Actions
- Set StoneSkincaster = (Attacked unit)
- Set StoneSkinPoint = (Position of (Attacked unit))
- Set StoneSkinTimer = 1.60
- Unit Group - Pick every unit in (Units within 150.00 of StoneSkinPoint matching ((((Matching unit) belongs to an enemy of (Owner of (Attacked unit))) Equal to True) and (((Matching unit) is alive) Equal to True))) and do (Actions)
- Loop - Actions
- Special Effect - Create a special effect attached to the origin of (Picked unit) using Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
- Special Effect - Destroy (Last created special effect)
- Loop - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Level of Stone Golem - Stone Skin for (Attacked unit)) Equal to 1
- Then - Actions
- 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 50
- Then - Actions
- Trigger - Turn on Stone Skin Periodic <gen>
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Level of Stone Golem - Stone Skin for (Attacked unit)) Equal to 2
- Then - Actions
- 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 100
- Then - Actions
- Trigger - Turn on Stone Skin Periodic <gen>
- 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)
- If - Conditions
- Events
Trigger:
- Stone Skin Periodic
- Events
- Time - Every 0.04 seconds of game time
- Conditions
- Actions
- Set StoneSkinTimer = (StoneSkinTimer - 0.04)
- Unit Group - Pick every unit in (Units within 150.00 of StoneSkinPoint matching ((((Matching unit) belongs to an enemy of (Owner of StoneSkincaster)) Equal to True) and (((Matching unit) is alive) Equal to True))) and do (Actions)
- Loop - Actions
- Set StoneSkinTargetPoint = (Position of (Picked unit))
- Set StoneSkinKnockbackPoint = (StoneSkinPoint offset by ((Distance between StoneSkinPoint and StoneSkinTargetPoint) + 5.00) towards (Angle from StoneSkinPoint to StoneSkinTargetPoint) degrees)
- Unit - Move (Picked unit) instantly to StoneSkinKnockbackPoint
- Custom script: call RemoveLocation(udg_StoneSkinTargetPoint)
- Loop - Actions
- Events
Trigger:
- Stone Skin Stop
- Events
- Game - StoneSkinTimer becomes Less than or equal to 0.00
- Conditions
- Actions
- Trigger - Turn off Stone Skin Periodic <gen>
- Events
EDIT: I made those interger chances really large for now, so i can see if it works or not.