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

Energy Regen System

Status
Not open for further replies.
Level 8
Joined
Feb 17, 2007
Messages
368
Can anyone help me create an energy regen system where when a hero reaches a certain amount of energy, he casts his ultimate move. The energy wouild start at 0, and maybe go to around 900. It would increase at a specified rate.

I want a table that displays the energy value in the top right hand corner of my map.
 
Level 12
Joined
Apr 18, 2007
Messages
1,130
Wouldn't it just be easier to have it time-base, like, encountering the boss turns on a trigger that starts a counter in the top right that says "Time until next move" and say it's 30 seconds, then have another trigger be enabled from the encounter that begins when the timer hits 0. It sets the timer back to say, 30 seconds, and then makes the move happen. Then, when the encounter ends, at the very end of the line of actions to the end of the counter, it disables the timer, the trigger that started the timer, and the trigger that restarts the timer and does the move.
If you want the code, here:

BOSS ENCOUNTERED (enabled)
  • Events:
  • A unit comes within 900 feet of (Boss 1 [specific])
  • Conditions:
  • (Triggering unit) Is a hero equal to true
  • (Triggering unit) is owned by a player equal to true
  • Actions:
  • Run (timer start)
  • Enable (timer reset and boss move)
  • Enable (encounter 1 ends)
  • [do encounter stuffz]
TIMER START (not enabled)
  • Events:
  • Conditions:
  • Actions:
  • Enable (timer 1) with the description (Time until next move:) at 30 seconds
TIMER RESET AND BOSS MOVE (disabled until enabled by first trigger)
  • Events:
  • (timer 1) hits 0
  • Conditions:
  • Actions:
  • Set (timer 1) to 0 seconds
  • [preform move)
ENCOUNTER 1 ENDS (disabled until enabled by first trigger)
  • Events:
  • (Boss 1 [specific]) dies
  • Conditions:
  • Actions:
  • Disable (timer start)
  • Disable (this trigger)
  • [award gold and loot and whatever]
 
Level 8
Joined
Feb 17, 2007
Messages
368
Actually disregard what I said previously about it not being a mana based system, I DO want it to be based on mana. I'm going to have a boss gain mana at a specified rate, and I want the bosses current mana to be displayed in a table in the upper right hand corner of my map.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
  • Multib
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Multiboard - Create a multiboard with 1 columns and 1 rows, titled Boss Mana
      • Multiboard - Set the display style for (Last created multiboard) item in column 1, row 1 to Show text and Hide icons
      • Multiboard - Set the width for (Last created multiboard) item in column 1, row 1 to 5.00% of the total screen width
      • Multiboard - Show (Last created multiboard)
  • Update Multiboard
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set Temp_Unit_1 = Blood Mage 0087 <gen>
      • Multiboard - Set the text for (Last created multiboard) item in column 1, row 1 to ((String((Integer((Mana of Temp_Unit_1))))) + (/ + (String((Integer((Max mana of Temp_Unit_1)))))))
 
Level 8
Joined
Feb 17, 2007
Messages
368
  • Multib
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Multiboard - Create a multiboard with 1 columns and 1 rows, titled Boss Mana
      • Multiboard - Set the display style for (Last created multiboard) item in column 1, row 1 to Show text and Hide icons
      • Multiboard - Set the width for (Last created multiboard) item in column 1, row 1 to 5.00% of the total screen width
      • Multiboard - Show (Last created multiboard)
  • Update Multiboard
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set Temp_Unit_1 = Blood Mage 0087 <gen>
      • Multiboard - Set the text for (Last created multiboard) item in column 1, row 1 to ((String((Integer((Mana of Temp_Unit_1))))) + (/ + (String((Integer((Max mana of Temp_Unit_1)))))))

Hey thanks a lot dude again. :grin: Whats the exact trigger name for the integer? I've got the rest correct I think, it's just missing the Integer before the Mana of the unit.So its:
  • Multiboard - Set the text for (Last created multiboard) item in column 1, row 1 to ((String((Mana of |cff008000Cell|r 0015 <gen>))) + (/ + (String((Max mana of |cff008000Cell|r 0015 <gen>)))))
In game it shows up as 0.000/90 when it should be 0/900.
 
Status
Not open for further replies.
Top