• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Victory/Defeat {granting victory upon the death of a hero}

Status
Not open for further replies.
Level 2
Joined
Mar 1, 2009
Messages
13
HI.I have am learning about the trigers but it so hard for me.I dont understand anything.That is why i am asking if someone can help me how can i make Victory/Defeat Conditions?In my map you need to kill the enemy Hero and thats it.
 
Level 6
Joined
Apr 23, 2009
Messages
94
Do
  • Untitled Trigger 001
    • Events
      • Unit - Archmage 0000 <gen> Dies
    • Conditions
    • Actions
      • Game - Victory Player 1 (Red) (Show dialogs, Show scores)
      • Game - Defeat Player 2 (Blue) with the message: Defeat!
Or..
  • Untitled Trigger 001 Copy
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Archmage
    • Actions
      • Game - Victory Player 1 (Red) (Show dialogs, Show scores)
      • Game - Defeat Player 2 (Blue) with the message: Defeat!
 
Level 11
Joined
Feb 14, 2009
Messages
884
Nice, but what if the enemy hero is not an Archmage? I assume that you have more than one heros in your map, so here's a more efficient way to do that:

First of all, create two group variables called LosingGroup and WinningGroup

  • Victory Conditions
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Set LosingGroup = (All enemies of (Owner of (Killing unit)))
      • Set WinningGroup = (All allies of (Owner of (Killing unit)))
      • Player Group - Pick every player in LosingGroup and do (Game - Defeat (Picked player) with the message: Pwnd!)
      • Player Group - Pick every player in WinningGroup and do (Game - Victory (Picked player) (Show dialogs, Show scores))
      • Custom script: call DestroyForce(udg_LosingGroup)
      • Custom script: call DestroyForce(udg_WinningGroup)
 
Status
Not open for further replies.
Top