• 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.

Creep Hostile to only Players ?

Status
Not open for further replies.
Level 2
Joined
Jun 3, 2013
Messages
19
How do you set up a group of creeps hostile to all the player's hero only until all of them are dead and then to a specific buildings? Just like Hero siege?
Thanks :grin:
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
1- Add the Heroes to a Unit group

2- Trigger:
A Unit Acquires a Target
Target is a Building = true and Number of units in HeroGroup > 0
Order Triggering Unit to attack Random Unit from HeroGroup.
 
In GUI

  • AttackHeroesFirst
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Attacked unit) is A structure) Equal to True
      • (Number of units in Heroes) Greater than 0
    • Actions
      • Unit - Order (Attacking unit) to Attack (Random unit from Heroes)
You don't need to disable the trigger to order the attack, unless your hero could be a building too, in which case use this trigger:

  • AttackGroupFirst
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Attacked unit) is in FirstToGetAttacked) Equal to False
      • (Number of units in FirstToGetAttacked) Greater than 0
    • Actions
      • Unit - Order (Attacking unit) to Attack (Random unit from FirstToGetAttacked)
 
Status
Not open for further replies.
Top