• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[General] Negative hp regen when no mana.

Status
Not open for further replies.
Level 8
Joined
Feb 11, 2016
Messages
232
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 39
Joined
Feb 27, 2007
Messages
5,013
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 8
Joined
Feb 11, 2016
Messages
232
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