For the multiplayer way, you could make copies of the above trigger, and set them to for each of the player, but I think that with some arrays you can make things shorter:
In order to make this work, you need to create the following variables:
- HERO: A Unit array, with a size equivalent to the number of players. You have to asign HERO[1] to the hero of Player 1, HERO[2] to the hero of Player 2...
- TIMER: A Timer array, with a size equivalent to the number of player.
- Timer_Window: A Timer Window array, with the same size as the other two arrays.
- Spawn: A point variable.
-
Start Timer
-
Events
-
Conditions
-
Or - Any (Conditions) are true
-
Conditions
-
(Triggering unit) Equal to HERO[1]
-
(Triggering unit) Equal to HERO[2]
-
(Triggering unit) Equal to HERO[3]
-
(Triggering unit) Equal to HERO[4]
-
(Triggering unit) Equal to HERO[5]
-
(Triggering unit) Equal to HERO[6]
-
(Triggering unit) Equal to HERO[7]
-
(Triggering unit) Equal to HERO[8]
-
Actions
-
Countdown Timer - Create a timer window for TIMER[(Player number of (Owner of (Triggering unit)))] with title (( + ((String((Player number of (Owner of (Triggering unit))))) + ) Respawn in:))
-
Set Timer_Window[(Player number of (Owner of (Triggering unit)))] = (Last created timer window)
-
Countdown Timer - Start TIMER[(Player number of (Owner of (Triggering unit)))] as a One-shot timer that will expire in [YOUR RESPAWN TIME] seconds
-
Countdown Timer - Mostrar Timer_Window[(Player number of (Owner of (Triggering unit)))]
This trigger will start whenever a unit dies, and will check if it's one of the heros. If it is, will start the respawn timer for the owner of the dying hero. The title of the window will be like "(X) Respawn in:", where X is the number of the player which hero has died.
-
End Timer X
-
Events
-
Conditions
-
Actions
-
Countdown Timer - Hide Timer_Window[X]
-
Countdown Timer - Destroy Timer_Window[X]
-
Set Spawn = [SPAWN LOCATION OF PLAYER X]
-
Hero - Instantly revive HERO[X] at Spawn, Show revival graphics
-
Custom script: call RemoveLocation(udg_Spawn)
This is almost the same thing as for single player, but this time it uses arrays. You'll have to create as many triggers like this as players you have, and change the X of each of them for the numbers of the players. Maybe all those triggers can be compressed in one single trigger, but I don't know how to do it.
I don't know of any way to make it better. I would make it like this. I didn't tested it, but it should work. Tell me if you find any problem, and I will help you find the issue.