W
wc3andIlikei
Guest
I would like some help with a trigger that does so when a unit come close to another unit it knocks the unit backwards(or from the direction the unit comes from). Hope you understand what I mean-> :nuts:
DragKnock
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to DragKnock
Actions
Set DragKnockCaster = (Casting unit)
Set DragKnockCasterTarget = (Target unit of ability being cast)
Set DragKnockAngle = (Angle from (Position of DragKnockCasterTarget) to (Position of DragKnockCaster))
Unit - Pause DragKnockCasterTarget
Trigger - Turn on Drag <gen>
Animation - Change DragKnockCaster's animation speed to 5.00% of its original speed
Animation - Play DragKnockCaster's attack animation
Trigger - Run Anti dragstuck <gen> (checking conditions)
Drag
Events
Time - Every 0.03 seconds of game time
Conditions
Actions
Set DragKnockPoint = ((Position of DragKnockCasterTarget) offset by 50.00 towards DragKnockAngle degrees)
Set DragKnockpoint = (Distance between (Position of DragKnockCaster) and (Position of DragKnockCasterTarget))
Unit - Move DragKnockCasterTarget instantly to DragKnockPoint
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DragKnockpoint Less than or equal to 100.00
Then - Actions
Trigger - Run Knock animation <gen> (ignoring conditions)
Trigger - Turn off (This trigger)
Else - Actions
Custom script: call RemoveLocation (udg_DragKnockPoint)
Knock animation
Events
Conditions
Actions
Unit - Make DragKnockCaster face DragKnockCasterTarget over 0.00 seconds
Unit - Pause DragKnockCaster
Sound - Play HeroBladeMasterYesAttack2 <gen> at 100.00% volume, attached to DragKnockCaster
Unit - Cause DragKnockCaster to damage DragKnockCasterTarget, dealing 250.00 damage of attack type Chaos and damage type Normal
Animation - Play DragKnockCaster's attack animation
Unit - Make DragKnockCaster face DragKnockCasterTarget over 0.00 seconds
Set DragKnockAngle = (Angle from (Position of DragKnockCaster) to (Position of DragKnockCasterTarget))
Unit - Unpause DragKnockCaster
Animation - Change DragKnockCaster's animation speed to 100.00% of its original speed
Trigger - Turn on Knock <gen>
Trigger - Run Anti knockstuck <gen> (checking conditions)
Trigger - Turn off (This trigger)
Knock
Events
Time - Every 0.03 seconds of game time
Conditions
Actions
Unit - Add Storm Crow Form to DragKnockCasterTarget
Unit - Remove Storm Crow Form from DragKnockCasterTarget
Animation - Change DragKnockCasterTarget flying height to ((Current flying height of DragKnockCasterTarget) + 300.00) at 0.00
Set DragKnockPoint = ((Position of DragKnockCasterTarget) offset by 50.00 towards DragKnockAngle degrees)
Unit - Move DragKnockCasterTarget instantly to DragKnockPoint
Animation - Change DragKnockCasterTarget flying height to 0.00 at 300.00
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Distance between (Position of DragKnockCaster) and (Position of DragKnockCasterTarget)) Greater than or equal to 600.00
Then - Actions
Unit - Unpause DragKnockCasterTarget
Trigger - Turn off (This trigger)
Else - Actions
Events
Elapsed game time is 1 second
Conditions
Actions
set bj_wantDestroyGroup = true
Pick every units in playable map area matching unit-type of (matching unit) equal to siege engine and do actions
Loop
set EngineCount = EngineCount + 1
set Engine[EngineCount] = picked unit
Add to Second Trigger <gen> the event A unit gets within X range of Engine[EngineCount]
Events
Conditions
Actions
// set all variables and then add an event for Third Trigger <gen> to activate the knockback.