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

[Spell] Enable passive after leaving combat

Status
Not open for further replies.
Level 2
Joined
Jun 2, 2013
Messages
12
Hello guys Hive;), I'm having trouble creating a spell, when my hero learn the spell 'Out of Combat', if he does not attack or be attacked within 5 seconds, your regeneration of mana/life will increase, and if was attacked regeneration back to normal, and so on.
thank you!
 
Make periodic trigger which regens life/mana and which also increases by each period.

If your hero gets attacked turn off this trigger and incease an attack_counter, and set the attack counter to a local integer. Then wait 5 seconds and check with if your local integer is still same as your attack counter, if yes turn on your healing trigger again.

Edit:
After attack set your regen/mana increase to 0 again, or next time it will start with last used values.
 
Last edited:
Status
Not open for further replies.
Top