• 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.
  • It's time for the first HD Modeling Contest of 2025. Join the theme discussion for Hive's HD Modeling Contest #7! Click here to post your idea!

[Trigger] how to give all heros an item ?

Status
Not open for further replies.
Level 2
Joined
Aug 6, 2009
Messages
15
is there a way to give every hero an item ?


also how do i make a trigger so that whenever a unit dies in region A a unit will spawn in region B?
 
Level 9
Joined
Aug 2, 2008
Messages
219
Pretty easy
  • Give Heros Items
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Hero - Create {YOUR ITEM} and give it to (Triggering unit)
  • Spawn In Region
    • Events
      • Unit - A unit Dies
    • Conditions
      • ({REGION A} contains (Triggering unit)) Equal to True
    • Actions
      • Set Anti_Location_Leak = (Center of {REGION B})
      • Unit - Create 1 {YOUR UNIT TYPE} for Player {YOUR PLAYER} at Anti_Location_Leak facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_Anti_Location_Leak)
 
Level 7
Joined
Oct 13, 2008
Messages
301
  • Item
    • Events
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) is A Hero) Equal to True)) and do (Hero - Create Tome of Experience and give it to (Picked unit))
 
Level 4
Joined
Jan 29, 2007
Messages
98
Don't use the above one (No offence, Duhcake) as it leaks... Use this:
  • Give Items
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set TempGroup = (Units in (Playable map area) matching (((Matching unit) is A Hero) Equal to True))
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Hero - Create Tome of Experience and give it to (Picked unit)
      • Custom script: call DestroyGroup(udg_TempGroup)
 
Status
Not open for further replies.
Top