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

Mana on attack?

Status
Not open for further replies.
Level 1
Joined
Aug 25, 2013
Messages
1
I'm trying to create a hero that only gains mana once they have attacked a target, i know it can be done in triggers however it can be abused as you can just press attack without attacking to gain mana. I've tried changing the stats of a mana cost for a passive ability to -1 (meaning to gain 1 mana) but it won't let me even when i set custom values to enabled. Any ideas? This would really help.
 
Level 6
Joined
May 20, 2014
Messages
228
> however it can be abused as you can just press attack without attacking to gain mana

Use a damage detection system to detect if an unit is actually hit, then apply mana restoration. There are a lot of good ones out there, like here or here (both being GUI, if you want JASS you would have to look a bit more, looking_for_help has a version of it in JASS iirc). Then trigger it by detecting whenever an unit deals damage, checking if the hero is the attacker as well as the ability being at least at a level. It's not too difficult to trigger.

What passive ability are you talking about/using? IIRC passives can't really cost mana or even give, though I may be wrong since I've never tried this at all.
 
Status
Not open for further replies.
Top