- Joined
- Sep 3, 2006
- Messages
- 1,738
Okay, so I have a trigger to revive heroes after they die in their respective base. The only problem is that it only revives Player 1 (Red)'s hero. Also, if a hero dies while Player 1 (Red)'s hero is dead, when Player 1 (Red)'s hero revives, so will the other dead hero.
-
Revive Hero
-
Events
- Unit - A unit Dies
-
Conditions
- ((Dying unit) is A Hero) Equal to True
-
Actions
- Unit Group - Add (Triggering unit) to RevivableHeroes
- Set TempReal = (((Real((Hero level of (Triggering unit)))) x Hero_Revive_Time_Factor) + 5.00)
- Countdown Timer - Start ReviveTimers[(Player number of (Owner of (Triggering unit)))] as a One-shot timer that will expire in TempReal seconds
- Countdown Timer - Create a timer window for (Last started timer) with title (Name of (Owner of (Triggering unit)))
- Countdown Timer - Show (Last created timer window) for (Owner of (Triggering unit))
- Set RevivableTimersWindows[(Player number of (Owner of (Triggering unit)))] = (Last created timer window)
-
Events
-
Revive Hero Timer
-
Events
- Time - ReviveTimers[1] expires
- Time - ReviveTimers[2] expires
- Time - ReviveTimers[3] expires
- Time - ReviveTimers[4] expires
- Time - ReviveTimers[5] expires
- Time - ReviveTimers[6] expires
- Time - ReviveTimers[7] expires
- Time - ReviveTimers[8] expires
- Time - ReviveTimers[11] expires
- Time - ReviveTimers[12] expires
- Conditions
-
Actions
-
Unit Group - Pick every unit in RevivableHeroes and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Remaining time for ReviveTimers[(Player number of (Owner of (Picked unit)))]) Less than 1.00
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((Owner of (Picked unit)) is in PlayersHuman) Equal to True
-
Then - Actions
- Hero - Instantly revive (Picked unit) at (Center of HumanRevive <gen>), Show revival graphics
- Countdown Timer - Destroy RevivableTimersWindows[(Player number of (Owner of (Picked unit)))]
- Unit Group - Remove (Picked unit) from RevivableHeroes
-
Else - Actions
- Hero - Instantly revive (Picked unit) at (Center of OrcRevive <gen>), Show revival graphics
- Countdown Timer - Destroy RevivableTimersWindows[(Player number of (Owner of (Picked unit)))]
- Unit Group - Remove (Picked unit) from RevivableHeroes
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
Unit Group - Pick every unit in RevivableHeroes and do (Actions)
-
Events
Last edited: