- Joined
- Jun 28, 2008
- Messages
- 688
I have set up a hero revival system that will revive a dying hero (their level) seconds later. The variable "Hunter" (unit variable) has an array of 5 (as there is only 5 heros on the map) and is set accordingly at map initialization.
I have 15 regions on the map that act as respawn points, and are set to the region variable with an array of 15 "RezLoc" at map initialization.
This is the activating trigger:
I have 15 regions on the map that act as respawn points, and are set to the region variable with an array of 15 "RezLoc" at map initialization.
This is the activating trigger:
-
HeroRez
-
Events
- Unit - A unit Dies
-
Conditions
- ((Triggering unit) is A Hero) Equal to True
-
Actions
- Set DeadHero = (Triggering unit)
-
For each (Integer A) from 1 to 5, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Owner of DeadHero) Equal to (Player((Integer A)))
-
Then - Actions
- Set RezPoint = (Center of RezLoc[(Random integer number between 1 and 15)])
- Wait (Real((Hero level of DeadHero))) seconds
- Hero - Instantly revive Hunter[(Integer A)] at RezPoint, Hide revival graphics
- Custom script: call RemoveLocation(udg_RezPoint)
-
Else - Actions
- Do nothing
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
Events