• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

[Trigger] Trigger for killing last mob

Status
Not open for further replies.
Level 3
Joined
Jun 1, 2005
Messages
42
01Red Has Mobs spawn in his area(AreaRed). 02Blue has gained a unit in which it needs to kill the LAST Mobs in AreaRed.

Note:
01Red has a hero in AreaRed

Trigger Needed : If 02Blue Suceeds in Killing final unit of monster in AreaRed, 02Blue Hero is Revived in AreaBlue.
 
  • Trigger
  • Events
    • Unit - A unit dies
  • Conditions
    • (Owner of (Killing unit)) Equal to Player 2 (Blue)
  • Actions
    • Set TempGroup = (Units in AreaRed <gen> matching ((Owner of (Matching unit)) Equal to Player 1 (Red)) and ((Life of (Matching unit) Greater than (0.41 - 0.05))
    • If (All conditions are true) then do (Actions) else do (Actions)
      • If - Conditions
        • (Number of units in TempGroup) Equal to 0
      • Then - Actions
        • Set Point1 = (Center of AreaBlue <gen>)
        • Hero - Revive (Hero) at Point1
        • Custom script: call RemoveLocation (udg_Point1)
      • Else - Actions
    • Custom script: call DestroyGroup (udg_TempGroup)
 
  • Trigger
  • Actions
    • Set TempGroup = (Units in AreaRed <gen> matching ((Owner of (Matching unit)) Equal to Player 1 (Red)) and ((Life of (Matching unit) Greater than (0.41 - 0.05))

Not sure how u make this part. could u give it to me in more detail please?
 
It's a Unit Group variable. When you are going to define the Unit Group, scroll to Units in Region matching condition. Select your region and in the condition part, go to "And (Conditions)". The first condition part is the Player comparison and the second condition part is Real comparison (Unit - Unit property). To get 0.41 - 0.05, when it requires a value for input, scroll to Arithmetic and manually type those numbers.

If you don't know how to set a variable, here:
https://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/variables-5896/
Other:
https://www.hiveworkshop.com/forums/triggers-scripts-269/things-leak-35124/
 
Status
Not open for further replies.
Back
Top