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

[General] Negative hp regen when no mana.

Status
Not open for further replies.
Level 9
Joined
Feb 11, 2016
Messages
250
Greetings! I want to make that every unit will have mana and -0,1 mana regen, when it reaches 0 unit got -0,1 hp regen, when unit got some mana hp regen goes to 0 again and so on. Any way to make it? In advice thank You.
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
Are there heroes in your map? They will gain hp/mp regen per second from STR and INT, so you will have to change the value of regeneration these grant in Advanced > Gameplay Constants > Hero Attributes... At what amount of mana should it switch back to using mana instead of health? 1? 10? 100? You just need a simple trigger:
  • Events
    • Time - Every 1.00 seconds of game-time
  • Conditions
  • Actions
    • Custom script: set bj_wantDestroyGroup = true //this cleans a leak in the next line, leave it as is
    • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
      • Loop - Actions
        • If (All conditions are true) then do (actions) else (actions)
          • If - Conditions
            • (Current mana of (Picked Unit)) greater than THRESHOLD //1? 10? 100?
            • -------- this can be found under "Unit - Property" in GUI --------
          • Then - Actions
            • Unit - Set mana of (Picked Unit) to ((Mana of (Picked Unit) - 0.10)
          • Else - Actions
            • Unit - Set life of (Picked Unit) to ((lifeof (Picked Unit) - 0.10)
Don't forget to set mana/life regeneration values for units in the OE to 0 where appropriate (only you know which units you want to regen what amount when).
 
Level 9
Joined
Feb 11, 2016
Messages
250
There aren't and will not be heroes. It's so rare to be map without heroes, but it's right here.
Thank You, I hope this will work and I have two questions. How to properly make that Custom script and will be less laggy if every 10 sec. -1?
 
Status
Not open for further replies.
Top