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

How to regenerate life and mana on a region

Status
Not open for further replies.
Level 6
Joined
Nov 14, 2007
Messages
155
how can i create a trigger that would let specific units recover health and mana at a certain region??

for example:

Region A only regenerates Allies of Player 1 (Red)..
I tried these triggers

  • Regenerate
    • Events
      • Unit - A unit enters Region A<gen>
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • ((Entering unit) belongs to an ally of Player 1 (Red)) Equal to True
          • Or - Any (Conditions) are true
            • Conditions
              • (Owner of (Entering unit)) Equal to Player 2 (Blue)
              • (Owner of (Entering unit)) Equal to Player 3 (Teal)
              • (Owner of (Entering unit)) Equal to Player 4 (Purple)
              • (Owner of (Entering unit)) Equal to Player 5 (Yellow)
              • (Owner of (Entering unit)) Equal to Player 6 (Orange)
    • Actions
      • Unit Group - Pick every unit in (Units in Hero Spawn Point West <gen>) and do (Actions)
        • Loop - Actions
          • Unit - Add Life Regeneration Aura (Neutral) to (Entering unit)
          • Unit - Add Mana Regeneration (Neutral) to (Entering unit)
And
  • DeRegenerate
    • Events
      • Unit - A unit leaves Region A <gen>
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • ((Leaving unit) belongs to an ally of Player 1 (Red)) Equal to True
          • Or - Any (Conditions) are true
            • Conditions
              • (Owner of (Leaving unit)) Equal to Player 2 (Blue)
              • (Owner of (Leaving unit)) Equal to Player 3 (Teal)
              • (Owner of (Leaving unit)) Equal to Player 4 (Purple)
              • (Owner of (Leaving unit)) Equal to Player 5 (Yellow)
              • (Owner of (Leaving unit)) Equal to Player 6 (Orange)
    • Actions
      • Unit Group - Pick every unit in (Units in Hero Spawn Point West <gen>) and do (Actions)
        • Loop - Actions
          • Unit - Remove Life Regeneration Aura (Neutral) from (Leaving unit)
          • Unit - Remove Mana Regeneration (Neutral) from (Leaving unit)
The first trigger works but when the unit leaves; the abilities are still there..

Life and Mana Regeneration:
target units are self

and i tried summoning a unit like the feral spirit; it can't gain the ability; and i tried replacing inside the region, the unit replaced;

and after the unit re-enters the ability can't be gained

+Rep to those who can help!
 
Last edited:
Seas =)

Look at this trigger I created. It isn't an answer to your question but this one makes things easier ;)

  • Restore Mana and Health
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in Created TestRegion <gen>) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) belongs to an ally of Player 1 (Red)) Equal to True
            • Then - Actions
              • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + (((Life of (Picked unit)) / 100.00) x 1.00))
              • Unit - Set mana of (Picked unit) to ((Mana of (Picked unit)) + (((Mana of (Picked unit)) / 100.00) x 1.00))
            • Else - Actions
Event: Ofc you can use other time as 0.01 seconds.
Action: This trigger belongs now to 1% (x 1.00) you can add something other if you want.
 
Thanks but I changed something:

Unit - Set life of (Picked unit) to (((Life of (Picked unit)) x 1.00) x 1.50)
instead of (((Life of (Picked unit)) / 100.00) x 1.00)

because if i set it to (((Life of (Picked unit)) / 100.00) x 1.00) - the unit dies instantly so i changed it or is the 100 just merely 1.00?
 
Did you miss the "Life of Picked Unit +" part? Because without it you're just dividing the unit's HP by 100 every .01 seconds. Also, the "x 1.00" at the end is completely unnecessary.
 
Seas =)

@ Ham Ham: No this to uncool :P triggering = best :)

@ Loyal2NES: No I put in this x1.00 - because this 1% if he want 2% he need to change the x1.00. So he can change it directly.

@ Maker: Ok, we need to know what maptype it is. If this "regenpoint" is in a base, where directly no fight is possible you can take maxlife. But if you still can fight in this area, maxlife is to high I think.
 
Maybe use fountain of health and mana, add it to a dummy unit, and place it on a region.
Then you just have to limit who's healed with triggers.

I didn't read all posts, so sorry if someone already said this. Idk if it will work.
 
If the problem isn't solved yet:
Create two triggers.

Trigger 1: Events: When a unit enters...etc
Conditions: ...whatever
Actions: Triggger Add Event to trigger (<Trigger 2 gen>) Every x seconds of the game.
Trigger 2: Events: NONE
Conditions: your conditions here
Actions: the hp regen stuff for units.
 
Status
Not open for further replies.
Back
Top