this is my trigger:
What is the problem with this trigger? Is there an easier way to make the Crypt Fiend auto burrow/unburrow?
-
Events
-

Time - Every 1.00 seconds of game time
-
-
Conditions
-
Actions
-

Set NerubianTempUnitGroup = (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Nerubian Lurker))
-

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


Loop - Actions
-



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



Set NerubianEnemyTempUnitGroup = (Units within 512.00 of NerubianTempPoint matching ((Owner of (Matching unit)) Not equal to Player 12 (Brown)))
-



If (((Current order of (Picked unit)) Not equal to (Order(attack))) and ((Current order of (Picked unit)) Not equal to (Order(stop)))) then do (Unit - Order (Picked unit) to Undead Crypt Fiend - Burrow) else do (Do nothing)
-



If ((Number of units in NerubianEnemyTempUnitGroup) Greater than 0) then do (Unit - Order (Picked unit) to Undead Crypt Fiend - Unburrow) else do (Do nothing)
-



Custom script: call RemoveLocation(udg_NerubianTempPoint)
-



Custom script: call DestroyGroup (udg_NerubianEnemyTempUnitGroup)
-
-
-

Custom script: call DestroyGroup (udg_NerubianTempUnitGroup)
-
What is the problem with this trigger? Is there an easier way to make the Crypt Fiend auto burrow/unburrow?
