• 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] Need simple trigger for! healing units in region for team A

Status
Not open for further replies.
Level 37
Joined
Mar 6, 2006
Messages
9,243
  • Heal Area
    • Events
      • Time - Every 0.25 seconds of game time
    • Conditions
    • Actions
      • Set HealGroup = (Units in Healing Area <gen>((Owner of (Matching unit)) Equal to Player 1 (Red)))
      • Unit Group - Pick every unit in HealGroup and do (Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + 10.00))
      • Unit Group - Pick every unit in HealGroup and do (Unit - Set mana of (Picked unit) to ((Mana of (Picked unit)) + 10.00))
      • Custom script: call DestroyGroup(udg_HealGroup)
Here's a simple solution. Work from there. You can use "unit leaves rect" and "unit enters rect" triggers to turn this one on/off so it's not running all the time.

If those players 1-6 are allies, you can use booldean "unit - owner of unit is an ally of...".
 
  • TriggerHealing
  • Events
    • Time - Every 1.00 second of game-time
  • Conditions
  • Actions
    • For each (Integer A) from 1 to 6, do (Actions)
      • Loop - Actions
        • Set TempG = (Units in <Your Region <gen>> owned by Player(IntegerA))
        • Unit Group - Pick every unit in TempG and do (Actions)
          • Loop - Actions
            • Unit - Set Life of (Picked unit) to (((Life of (Picked unit)) + X)
            • Unit - Set Mana of (Picked unit) to (((Mana of (Picked unit)) + Y)
        • Custom script: call DestroyGroup (udg_TempG)
 
Level 7
Joined
May 6, 2008
Messages
284
well i just tried do you give any better solutions to this bcs i just simple did when unit enters region it will automatically haves ability life reg and when hero leaves region the ability will be gone
 
Level 7
Joined
May 6, 2008
Messages
284
ye i did i just made the AOE smaller so it heals only that unit
and when the unit leaves region it will be removed
simple eh..?
 
Level 2
Joined
Jul 13, 2009
Messages
9

  • enter
    • Events
      • Unit - A unit enters YourRegionName <gen>
    • Conditions
    • Actions
      • Unit - Add YourAbility to (Entering unit)
  • leave
    • Events
      • Unit - A unit leaves YourRegionName <gen>
    • Conditions
    • Actions
      • Unit - Remove YourAbility from (Leaving unit)
Smth like this?
First triggers add the ability which heals (when the unit enters the specified region)
, and seconds removes the ability (when the units leaves the specified region)
 
Last edited:
Status
Not open for further replies.
Top