An artist's depiction of an Extended Unit Death
I typed up a very similar way to do this.
DefeatTrigger
Events
Unit - Any Unit dies
Local Variables
Team1 = (Players on team 1) <Player Group>
Team2 = (Players on team 2) <Player Group>
Team1Group = (Empty unit group) <Unit Group>
Team2Group = (Empty unit group) <Unit Group>
Conditions
((Unit type of (Triggering unit)) has Structure attribute) == true
Actions
Player Group - Pick each player in Team1 and do (Actions)
Actions
Unit Group - Add all units in (Any units in (Entire map) owned by player (Picked player) matching Required: Structure; Excluded: Missile, Dead, Hidden, with at most Any Amount) to Team1Group
Player Group - Pick each player in Team2 and do (Actions)
Actions
Unit Group - Add all units in (Any units in (Entire map) owned by player (Picked player) matching Required: Structure; Excluded: Missile, Dead, Hidden, with at most Any Amount) to Team2Group
General - If (Conditions) then do multiple (Actions)
If Then Else
General - Else if (Conditions) then do (Actions)
Else If
(Number of Living units in Team1Group) <= 0
Then
Player Group - Pick each player in Team1 and do (Actions)
Actions
Game - End game in Defeat for player (Picked player) (Show dialogs, Show score screen)
Player Group - Pick each player in Team2 and do (Actions)
Actions
Game - End game in Victory for player (Picked player) (Show dialogs, Show score screen)
General - Else if (Conditions) then do (Actions)
Else If
(Number of Living units in Team2Group) <= 0
Then
Player Group - Pick each player in Team1 and do (Actions)
Actions
Game - End game in Victory for player (Picked player) (Show dialogs, Show score screen)
Player Group - Pick each player in Team2 and do (Actions)
Actions
Game - End game in Defeat for player (Picked player) (Show dialogs, Show score screen)