Better Solutions:
This is my DeathMatchKill trigger straight from my hero defence... (edited slightly so u dont copy me
)
DeathMatchKills
Events
Unit - A unit Dies
Conditions
((Owner of (Dying unit)) is an ally of (Owner of (Killing unit))) Equal to False
((Dying unit) is A Hero) Equal to True
(Arena <gen> contains (Dying unit)) Equal to True
Actions
Set DeathMatcKills[(Player number of (Owner of (Killing unit)))] = DeathMatcKills[(DeathMatcKills[(Player number of (Owner of (Killing unit)))] + 1)]
Leaderboard - Change the value for (Owner of (Killing unit)) in ArenaLeaderBoard to Kills[(Player number of (Owner of (Killing unit)))]
Leaderboard - Sort ArenaLeaderBoard by Value in Descending order
Player - Add ((Level of (Dying unit)) x 100) to (Owner of (Killing unit)) Current gold
Game - Display to (All players) for 4.00 seconds the text: ((Name of (Owner of (Killing unit))) + ( slaughtered + (Name of (Owner of (Dying unit)))))
Umm somewhere in there is a Variable
eathMatchKills(IntegerArray), a Region:Arena, a Leaderboard:ArenaLeaderBoard.. and maybe some other stuff :?
Basically when a hero dies, it checks to see if the dying unit is an ally of the killing unit (so you dont go killing your own friends for gold), if the dying unit is a hero, and if the dying unit is in the arena (bcoz i have another death trigger). Then it increases the number of kills you have by one, updates the leaderboard and sorts the leaderboard to show the appropriate values. Then it gives you gold (100x the level of the dying hero) and displays a text message to all players for 4 seconds announcing your victory.
DeathRevive
Events
Unit - A unit Dies
Conditions
((Dying unit) is A Hero) Equal to True
(Arena <gen> contains (Dying unit)) Equal to False
Actions
Countdown Timer - Start TIMER_revive as a One-shot timer that will expire in ((Real((Hero level of (Dying unit)))) + 35.00) seconds
Countdown Timer - Create a timer window for TIMER_revive with title ((Name of (Owner of (Dying unit))) + revives in
Set TIMER_revive = (Last started timer)
Wait ((Real((Hero level of (Dying unit)))) + 35.00) seconds
If (((Owner of (Dying unit)) is in Team1) Equal to True) then do (Hero - Instantly revive (Dying unit) at (Center of Herospawn 1 <gen>), Show revival graphics) else do (Hero - Instantly revive (Dying unit) at (Center of Herospawn 2 <gen>), Show revival graphics)
Countdown Timer - Hide (Last created timer window) for (Owner of (Dying unit))
Countdown Timer - Destroy (Last created timer window)
Thats a dumbed down version of my deathrevive trigger. Its for heroes who dont die in the arena (so watch out with the conditions). You need a Variable:Timer, Variable:Team1(PlayerGroup), Varible:Team2(PlayerGroup), Region:Herospawn1, Region:Herospawn2.
This trigger does so that if a hero dies, it will wait 35 seconds plus his level and then revive him at the appropriate spawn point (you need to have set the teams up as player group variables somewhere else...)
hope thats helpful
Bort