I suggest (with the eye on lag) to use the trigger
-
Events
-
Unit - A unit dies
-
Conditions
-
Triggering unit is equal to Elemental Spirit
-
Actions
-
If (all conditions are true) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Count number of Elemental Spirits less than 4
-
Then - Actions
-
Else - Actions
'Pause unit' will cause the unit to stay on the map, targetable, but will not perform any actions. If you want it not to be targetable either, you need to add 'Unit - Add Locust ability' to this trigger. If you want it to be completely off the map, use 'Unit - Remove Elemental God'. On top of this last option, you can choose to let the Elemental God appear again on the location it was removed by setting the postition he was removed in a variable like: 'Set GodDeathPoint = Position of Elemental God', and place it before the Remove unit command in the trigger.
Do remember that with losing and reconnecting links, the previous posted trigger will (if you're going to use the Pause unit function) change a bit to:
-
Events
-
Unit - A unit enters Playable map area
-
Conditions
-
Triggering unit is equal to Elemental Spirit
-
Actions
-
If (All conditions are true), then do (Then Actions), else do (Else Actions)
-
If - Conditions
-
Count number of Elemental Spirits equal to 4
-
Then - Actions
-
If (All conditions are true) then do (Then Actions), else do (Else Actions)
-
If - Conditions
-
Playable map area contains position of Elemental God is not equal to True
-
Then - Actions
-
Unit - Create Elemental Lord at center of Playable map area
-
Else - Actions
-
Unit - Unpause Elemental God
-
Else - Actions
This will cause the Elemental God to appear when it's not there yet, and will unpause the Elemental God when it already exists.
If you added the Locust ability (so it can't be targeted), you add the command 'Unit - Remove Locust ability' to this trigger.
If you chose to remove the Elemental God and saved the last position it was on, you just remove the 'Unpause unit' command, and change 'Unit - Create Elemental Lord at center of Playable map area' to 'Unit - Create Elemental Lord at center of GodDeathPoint'.