Let me toss out a trigger for you:
-
Revive HERO
-
Events
-
Conditions
-
(Dying unit) Equal to HERO
-
Actions
-
Game - Display to (Owner of (Dying unit)), at offset (0.00, 0.00) the text: You have died and w...
-
Wait 9.00 seconds
-
Hero - Instantly revive (Dying unit) at (Position of Revive), Show revival graphics
-
Selection - Select (Reviving Hero) for (Owner of (Reviving Hero))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Hero level of (Triggering unit)) Greater than or equal to 7
-
Then - Actions
-
Item - Remove (Item carried by HERO in slot (Random integer number between 1 and 6))
-
Player - Add ((Hero level of HERO) x -10) to (Owner of (Dying unit)) Current gold
-
Game - Display to (Owner of (Dying unit)), at offset (0.00, 0.00) the text: A death Tax has bee...
-
Else - Actions
I copied it right out of my map.
HERO in this case is a unit Variable. I have two heroes in my map, the other is a side kick and one doesn't get penalized when he dies.
If you are not working with Hero then you would use the condition:
((Dying unit) is A Hero) Equal to True
A modified boolean statement.
I am using math to set a rate of gold loss. Hero level is set specifically to HERO you can set it to player's gold, owner of dying unit, etc. X - 10 meaning for each level the dying unit is it loses 10 gold - level 5 = 50 gold level 7 = 70 gold, etc.
If they have less gold than their level then the gold is set to zero.
Mind I have mine set up to where at level 7 the hero starts being "taxed" a death tax upon death.
Another way to do that is set it at a percent or a "tax"
Player - Divert 5% of the Gold income of (Owner of (Dying unit)) to Player 7 (Green) of course if you are using all player slots and dumping funding from all of the hero deaths into one then somebody is going to get very, very rich LOL.
I also have the loss of an item in this one.