- Joined
- Jun 21, 2009
- Messages
- 282
Needing help with a trigger, wanting to put it as a invisable shockwave with a dummy following it then the dummy gets removed when the shockwave ends. If you could put this on a map and link it that would be sweet!


Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.

Events

Unit - A unit Starts the effect of an ability
Conditions

(Ability being cast) Equal to Shockwave 2
Actions

Unit - Create 1 Infernal for (Owner of (Casting unit)) at ((Position of (Casting unit)) offset by 200.00 towards (Facing of (Casting unit)) degrees) facing (Facing of (Casting unit)) degrees

Set unit = (Last created unit)

Set facing = (Facing of (Casting unit))

Set caster_loc = (Position of (Casting unit))

For each (Integer A) from 1 to 6, do (Actions)


Loop - Actions



Unit - Move unit instantly to (caster_loc offset by (Real((((Integer A) x 100) + 200))) towards facing degrees)



Wait 0.01 seconds

Unit - Explode unit
there has to be a better way of doing it, but this sorta works
The exploding part was just for cinematic effect lol
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Shockwave 2
Actions
Unit - Create 1 Footman for (Owner of (Casting unit)) at (Position of (Casting unit)) facing (Facing of (Casting unit)) degrees
Set unit = (Last created unit)
For each (Integer A) from 1 to 8, do (Actions)
Loop - Actions
Unit - Move unit instantly to ((Position of (Casting unit)) offset by (Real(((Integer A) x 100))) towards (Facing of (Casting unit)) degrees)
Wait 0.01 seconds
Unit - Explode unit
This should be rather easy if I understand you correctly. You want to create a shockwave that follows your hero? OR you want an invisible unit following your current shockwave? Or am I totally mistaking?
The only way you are going to be able to do this, is through a trigger.
You have to create a dummy unit, and use the SetUnitMove command in GUI.., and periodic event - 0.03 seconds.
unit - move position to point with polar offset (facing, 10 )..
Stuff like that, look in the spells section for knockback spells.
I just want to make sure you you know that you can't do this an easy way. You have to trigger a unit to be created and moved towards the target point, and should actually just get rid of the shockwave so you don't have to optimize the movement of the unit with the WC3 projectile as that could get very difficult.
Also, shockwave should almost never be used, seeing as how Carrion Swarm is a more lag-free solution that has the same effect. (Shockwave deforms terrain, therefore lags a little)
I agree it's a simple knockback spell. I'd recommend getting a knockback spell for this, I could try make you one at some point, though it will be later this week

Shockwave

Events


Unit - A unit Starts the effect of an ability

Conditions


(Ability being cast) Equal to Shockwave (Invisible)

Actions


Set TargetedPoint = (Target point of ability being cast)


Set PositionCaster = (Position of (Casting unit))


Set Caster = (Casting unit)


Set Duration = 1.00


Set Distance = 20.00


Unit - Create 1 Shockwave Dummy (Custom Campaign) for Player 1 (Red) at PositionCaster facing (Angle from (Position of Caster) to TargetedPoint) degrees


Set DummyUnit = (Last created unit)


Trigger - Turn on Loop <gen>
Loop

Events


Time - Every 0.04 seconds of game time

Conditions

Actions


Set DummyPosition = (Position of DummyUnit)


Set Duration = (Duration - 0.04)


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




Duration Greater than 0.00



Then - Actions




For each (Integer A) from 1 to 10, do (Actions)





Loop - Actions






Unit - Move DummyUnit instantly to (DummyPosition offset by Distance towards (Angle from PositionCaster to TargetedPoint) degrees), facing TargetedPoint



Else - Actions




Unit - Remove DummyUnit from the game




Set DummyUnit = No unit




Custom script: call RemoveLocation (udg_TargetedPoint)




Custom script: call RemoveLocation (udg_DummyPosition)




Custom script: call RemoveLocation (udg_PositionCaster)




Trigger - Turn off (This trigger)
