When a player's vHP unit is destroyed, it deals 10 damage to one RANDOM building in his base.
I see 2wo options for doing this:
1. There is a trigger that is like this:
[*]All Players
[*]Current Player has at most 20 deaths of Randomization
[*]Add one death of Randomization for current player
[*]Preserve Trigger
And a trigger like this:
[*]All Players
[*]Current Player has exactly 20 deaths of Randomization
[*]Set to 1 death of Randomization for current player
[*]Preserve Trigger
Then when the vHP unit is killed, all buildings inside your base are given to Player 8 (who is allied with the player who is about to get hurt). Then if the player has at least one death count, a death count is subtracted from that player and the building farthest to the left is given BACK to the player who is about to get hurt. If at any time during this player 8 has no buildings left but there are still death counts unaccounted for, all buildings are given to player 8 again. Once the player runs out of death counts, a location is moved to the building farthest left in his base, all building in his base are given to back to the player, and an enemy zergling is spawned next to the building to deal 10 damage to it.
That is the 1irst option.
The 2econd option I see is this:
Again the 2 triggers that I showed above for the 1irst option are used to randomize a death count. This time, there is an observer owned by Player 8 that is created over every building that is built in the player's base. If he is hit, it makes all the observers become owned by the player that is getting hurt, then it cycles through them much like in the 1irst option I gave, and when all the death counts are used up, it creates a zergling at the left-most observer.
The problem with the first option is that when you get hit, all of your buildings are de-selected. When under constant fire, sometimes you will get hit (at most) every 1/3 of a second, which means that selecting things and creating units from them (which makes explosions and stuff sometimes) is just about impossible. Also it will be really frustrating to be about to click something and then it gets de-selected for apparently no reason.
The problems with the second problem is that having observers over all your buildings is pretty ugly and that if your building is in the air, moving, there is a huge possibility that your observer will move over to a different building on accident.
If I had no other options, I would use the second option I gave and just take out the ability to lift (Kill them when they lift off).
Can anybody think of a better way to deal 10 damage to a random building?
None.