- Joined
- Feb 27, 2007
- Messages
- 2,072
This one:
Target[1] = Current target, current closest unit.
Target[2] = The closest unit the last time the trigger ran. Can be the same as 1.
Target[3] = The last target, but not the closest target of the last time the trigger ran, so it can't be the same as 1#. Its the last acuall target.
This trigger:
This one:
Thanks in advance.
The problem? If the last target is dead, it displays a blank string where the last player should be..Might be other bugs too.
-
Me Chase
-

Events
-


Time - Every 0.15 seconds of game time
-
-

Conditions
-

Actions
-


Set P1 = (Position of Oger 0009 <gen>)
-


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



If - Conditions
-




Target[2] Not equal to Target[1]
-
-



Then - Actions
-




Set Target[3] = Target[2]
-
-



Else - Actions
-
-


Set Target[2] = Target[1]
-


Set TargetRange = 1000000000.00
-


Set G = (Units within 1000000.00 of P1 matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and ((Matching unit) Not equal to Oger 0009 <gen>))))
-


Unit Group - Pick every unit in G and do (Actions)
-



Loop - Actions
-




Set P2 = (Position of (Picked unit))
-




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





If - Conditions
-






(Integer((Distance between P1 and P2))) Less than (Integer(TargetRange))
-
-





Then - Actions
-






Set TargetRange = (Distance between P1 and P2)
-






Set Target[1] = (Picked unit)
-
-





Else - Actions
-
-




Custom script: call RemoveLocation (udg_P2)
-
-
-


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



If - Conditions
-




Target[1] Not equal to Target[2]
-
-



Then - Actions
-




Unit - Order Oger 0009 <gen> to Attack Target[1]
-




Sound - Play OgreWarcry1 <gen>
-




Game - Display to (All players) the text: (The oger is chasing + ((Name of (Owner of Target[1])) + !))
-
-



Else - Actions
-
-


Custom script: call RemoveLocation (udg_P1)
-


Custom script: call DestroyGroup (udg_G)
-
-
Target[1] = Current target, current closest unit.
Target[2] = The closest unit the last time the trigger ran. Can be the same as 1.
Target[3] = The last target, but not the closest target of the last time the trigger ran, so it can't be the same as 1#. Its the last acuall target.
This trigger:
-
Me Smash
-

Events
-


Unit - A unit Is attacked
-
-

Conditions
-


(Attacking unit) Equal to Oger
-
-

Actions
-


Set PlayerScore = (Owner of Target[3])
-
-
This one:
-
Me Kill
-

Events
-


Unit - A unit Dies
-
-

Conditions
-


(Killing unit) Equal to Oger
-


(Unit-type of (Dying unit)) Equal to Paladin
-
-

Actions
-


Game - Display to (All players) the text: (The Oger has |cffff0000Pulverized|r + ((Name of (Owner of (Dying unit))) + 's paladin!))
-


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



If - Conditions
-




(Owner of (Dying unit)) Not equal to PlayerScore
-
-



Then - Actions
-




Game - Display to (All players) the text: ((Name of PlayerScore) + was the last target! He gets credit for making the oger swich to targeting him.)
-
-



Else - Actions
-
-
-
Thanks in advance.
The problem? If the last target is dead, it displays a blank string where the last player should be..Might be other bugs too.
Last edited:

