I made a custom passive ability that gives a chance of knocking a melee attacker back when the hero is attacked. I'm sure this isn't the ideal way to do such a thing, and there probably are leaks. I'm also pretty sure it's MUI the way I made it, but, in case it's not...
Can I be pointed towards a way that'd be better for doing this, or how to fix whatever's broken? (GUI only please, and nothing too complicated!)
Help will be greatly appreciated.
Ideas? It *seems* to work ingame, but i'm not sure if this'll lag along the way, or get messy somehow.
>>> And another thing - is there a way of preventing units from being knocked over terrain? Like, being moved up and over cliffs or something.
Thanks in advance.
Can I be pointed towards a way that'd be better for doing this, or how to fix whatever's broken? (GUI only please, and nothing too complicated!)
Help will be greatly appreciated.
-
Resonation Switch
-
Events
-
Unit - A unit Is attacked
-
-
Conditions
-
(Level of Resonation for (Triggering unit)) Greater than 0
-
((Attacking unit) is A melee attacker) Equal to True
-
(Random integer number between 1 and 100) Less than or equal to ((5 x (Level of Resonation for (Triggering unit))) + 5)
-
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
MUIResonate Greater than 100
-
-
Then - Actions
-
Set MUIResonate = 1
-
-
Else - Actions
-
Set MUIResonate = (MUIResonate + 1)
-
-
-
Unit Group - Add (Attacking unit) to ResonateGroup
-
Set ResonateCaster[MUIResonate] = (Attacked unit)
-
Set ResonateTarget[MUIResonate] = (Attacking unit)
-
Set ResonateCasterPos[MUIResonate] = (Position of (Triggering unit))
-
Set ResonateTargetPos[MUIResonate] = (Position of (Attacking unit))
-
Set ResonateAngle[MUIResonate] = (Angle from ResonateCasterPos[MUIResonate] to ResonateTargetPos[MUIResonate])
-
Set ResonateFinalPos[MUIResonate] = (ResonateTargetPos[MUIResonate] offset by 500.00 towards ResonateAngle[MUIResonate] degrees)
-
Unit - Create 1 DUMMYEFFECT (Resonation 01) for Player 1 (Red) at ResonateCasterPos[MUIResonate] facing Default building facing degrees
-
Animation - Change (Last created unit)'s animation speed to 300.00% of its original speed
-
Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
-
-
-
Resonation Ticker
-
Events
-
Time - Every 0.03 seconds of game time
-
-
Conditions
-
Actions
-
Custom script: set bj_wantDestroyGroup = true
-
Unit Group - Pick every unit in (Units within 100.00 of ResonateFinalPos[MUIResonate] matching (((Matching unit) is in ResonateGroup) Equal to True)) and do (Actions)
-
Loop - Actions
-
Unit Group - Remove (Picked unit) from ResonateGroup
-
Custom script: call RemoveLocation(udg_ResonateTargetPos[udg_MUIResonate])
-
Custom script: call RemoveLocation(udg_ResonateCasterPos[udg_MUIResonate])
-
Custom script: call RemoveLocation(udg_ResonateFinalPos[udg_MUIResonate])
-
-
-
Unit Group - Pick every unit in ResonateGroup and do (Actions)
-
Loop - Actions
-
Unit - Move (Picked unit) instantly to (ResonateTargetPos[MUIResonate] offset by (40.00 + (40.00 x ResonateMultiplier[MUIResonate])) towards ResonateAngle[MUIResonate] degrees)
-
Set ResonateMultiplier[MUIResonate] = (ResonateMultiplier[MUIResonate] + 1.00)
-
-
-
-
Ideas? It *seems* to work ingame, but i'm not sure if this'll lag along the way, or get messy somehow.
>>> And another thing - is there a way of preventing units from being knocked over terrain? Like, being moved up and over cliffs or something.
Thanks in advance.