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

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