- Joined
- Aug 23, 2008
- Messages
- 6
I have a problem. When the base dies, the units and hero do not although spawning stops (footmen map) here is what I got so far:
The alternative trigger I have is this
Neither of them work. Could someone please help or write one? I just want it to kill the current units and hero when base dies.
Code:
Building Destroyed
Events
Unit - A unit Dies
Conditions
(Dying unit) Equal to Base[(Player number of (Owner of (Dying unit)))]
Actions
Set xu = (Dying unit)
Set xpl = (Owner of xu)
Game - Display to PlayersPlaying the text: (PlayerName[(Player number of (Triggering player))] + |cffff0000 has been defeated!!|r)
Set TempGroup = (Units owned by xpl)
Unit Group - Pick every unit in TempGroup and do (Actions)
Loop - Actions
Unit - Kill (Picked unit)
Unit - Remove (Picked unit) from the game
Custom script: call DestroyGroup (udg_TempGroup)
Player Group - Remove xpl from PlayersPlaying
Player Group - Pick every player in PlayersPlaying and do (Actions)
Loop - Actions
Set TempForce = (All players matching ((((Matching player) is an enemy of (Picked player)) Equal to True) and (((Matching player) is in PlayersPlaying) Equal to True)))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of players in TempForce) Equal to 0
Then - Actions
Player Group - Pick every player in PlayersPlaying and do (Actions)
Loop - Actions
Game - Display to PlayersPlaying for 30.00 seconds the text: Game Victory in 60 ...
Wait 60.00 seconds
Game - Victory (Picked player) (Show dialogs, Show scores)
Else - Actions
Custom script: call DestroyForce (udg_TempForce)
The alternative trigger I have is this
Code:
Building Destroyed Copy
Events
Unit - A unit Dies
Conditions
(Dying unit) Equal to Base[(Player number of (Owner of (Dying unit)))]
Actions
Set TempUnit = (Dying unit)
Set TempPlayer = (Owner of TempUnit)
For each (Integer A) from 1 to 25, do (Actions)
Loop - Actions
Player Group - Remove TempPlayer from TierGroup[(Integer A)]
Game - Display to PlayersPlaying the text: (PlayerName[(Player number of (Triggering player))] + |cffff0000 has been defeated!!|r)
Set TempGroup = (Units owned by TempPlayer)
Unit Group - Pick every unit in TempGroup and do (Actions)
Loop - Actions
Unit - Kill (Picked unit)
Unit - Remove (Picked unit) from the game
Custom script: call DestroyGroup (udg_TempGroup)
Player Group - Remove TempPlayer from PlayersPlaying
Player Group - Pick every player in PlayersPlaying and do (Actions)
Loop - Actions
Set TempForce = (All players matching ((((Matching player) is an enemy of (Picked player)) Equal to True) and (((Matching player) is in PlayersPlaying) Equal to True)))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of players in TempForce) Equal to 0
Then - Actions
Player Group - Pick every player in (All allies of (Picked player)) and do (Actions)
Loop - Actions
Game - Victory (Picked player) (Show dialogs, Show scores)
Else - Actions
Custom script: call DestroyForce (udg_TempForce)
Neither of them work. Could someone please help or write one? I just want it to kill the current units and hero when base dies.