An artist's depiction of an Extended Unit Death
Well, if it works, it works. But I do have a few notes:
General - While (Conditions) are true, do (Actions)
Conditions
((Triggering unit) Life (Current)) > 0.0
((Acquired Target) Life (Current)) > 0.0
Actions
General - Wait for (Conditions), checking every 0.1 Game Time seconds
Conditions
(Distance between (Position of (Triggering unit)) and (Position of (Acquired Target))) <= 2.0
This has a possibility of entering an infinite loop. It basically says, "If both units are alive, wait until they come close enough to each other." This means it will first check if both units are alive (which will probably be true 100% of the time), and then it will enter a loop waiting for them to come in range of each other, regardless if one or both units die while in this loop. Here's a remedy for that:
General - While (Conditions) are true, do (Actions)
Conditions
((Triggering unit) Life (Current)) > 0.0
((Acquired Target) Life (Current)) > 0.0
Actions
General - Wait for (Conditions), checking every 0.1 Game Time seconds
Conditions
Or
Conditions
((Triggering unit) Life (Current)) <= 0.0
((Acquired Target) Life (Current)) <= 0.0
(Distance between (Position of (Triggering unit)) and (Position of (Acquired Target))) <= 2.0
General - If (Conditions) then do (Actions) else do (Actions)
If
((Triggering unit) Life (Current)) > 0.0
((Acquired Target) Life (Current)) > 0.0
Then
ACTIONS
Else
Do Nothing
Also, your ResultPoint seems a bit arbitrary; I'm not sure why you have the (0.5, 0.0) offset there, and you're measuring starting from the Zealot rather than from the Marauder. I'd do something like:
Variable - Set AwayAngle = (Angle from (Position of (Triggering Unit)) to (Position of (Acquired Target)))
Variable - Set AwayDistance = 2.0
Variable - Set ResultPoint = ((Position of (Acquired Target)) offset by AwayDistance towards AwayAngle degrees)
Unit - Order (Acquired Target) to ( Move targeting ResultPoint) (Replace Existing Orders)
Unit - Order (Acquired Target) to ( Attack targeting (Triggering unit)) (After Existing Orders)
Finally, I'm not sure why you're using a timer to wait for 1.4 seconds; why aren't you using your idea of ordering the Marauder to attack after he is done moving (like I implemented above)? It should work fine. Also, you can feel free to use the Wait action in SC2 (there aren't wait block issues like there were in SC1).
So the final trigger would be:
Mrd. Move and Shoot
Events
Unit - Any Unit acquires a target
Local Variables
ResultPoint = No Point <Point>
AwayAngle = No Angle <Angle>
AwayDistance = 0.0 <Real>
Conditions
(Unit type of (Acquired Target)) == Marauder
Mrd. Script Active == 1
Actions
General - While (Conditions) are true, do (Actions)
Conditions
((Triggering unit) Life (Current)) > 0.0
((Acquired Target) Life (Current)) > 0.0
Actions
General - Wait for (Conditions), checking every 0.1 Game Time seconds
Conditions
Or
Conditions
((Triggering unit) Life (Current)) <= 0.0
((Acquired Target) Life (Current)) <= 0.0
(Distance between (Position of (Triggering unit)) and (Position of (Acquired Target))) <= 2.0
General - If (Conditions) then do (Actions) else do (Actions)
If
(Distance between (Position of (Triggering unit)) and (Position of (Acquired Target))) <= 2.0
Then
Variable - Set AwayAngle = (Angle from (Position of (Triggering Unit)) to (Position of (Acquired Target)))
Variable - Set AwayDistance = 2.0
Variable - Set ResultPoint = ((Position of (Acquired Target)) offset by AwayDistance towards AwayAngle degrees)
Unit - Order (Acquired Target) to ( Move targeting ResultPoint) (Replace Existing Orders)
Unit - Order (Acquired Target) to ( Attack targeting (Triggering unit)) (After Existing Orders)
Else
Do Nothing
Again, if your trigger works perfectly for your system, there's no need to change it.
(On a side note, if you're having problems formatting your trigger code, try putting it inside [
code][
/code] tags.)
Edit: And you should change your "Mrd. Script Active" to type Boolean (true/false). Not really important, but as a programmer, it irks me a little.