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

[Trigger] Make a hero unit cast a spell on itself when it's below a certain health threshold

Status
Not open for further replies.
Level 2
Joined
Nov 21, 2015
Messages
15
I made a custom ability, based on the rejuvenation ability for my custom hero.
I tested it and it's working, now I'm trying to make AI heroes use it.
Here is the trigger I tried
332bfwj.jpg

I tried using different events, but the unit just never uses the ability.
 
Level 10
Joined
Apr 4, 2010
Messages
509
Use the event,
Generic Unit Event - Unit -A unit is attacked
The conditions
Integer Comparison - Level of Rejuvenation for (Attacked Unit) is greater than 0 [This checks if the unit being attacked has the Rejuvenation spell, since having an ability at level zero is not having the ability at all, anything higher means that they do have the ability]
Real Comparison - Life of (Attacked Unit) is Less than or equal to (YOUR VALUE)
Actions
Unit - Order (Attacked unit) to Night Elf Druid Of The Claw - Rejuvenation (Attacked Unit)

This only works when a unit is attacked though, so you would need a Damage Detection System, but don't worry about that for now. Sometimes there is a little hint on top of the Ok and Cancel box, when you are making triggers, it's good to read them when starting out. Try Googling what each Event is for and when is it appropriate to use Matching unit, Picked Unit, Attacked Unit, etc.
 
Level 23
Joined
Feb 6, 2014
Messages
2,466
Use events like:
The unit's hp becomes less than someValue or the unit is damaged. And also, you're not supposed to use Matching Unit like that, use Triggering Unit instead. Currently, what your trigger does is order an invalid unit (because you're using Matching Unit) to cast Rejuvenation on an invalid unit while the map is in the loading screen. Matching Unit refers tobthe filtering unit while Triggering Unit refers to the unit that causes the trigger to run.

EDIT: Oh, DEE-BOO was faster.
 
Level 2
Joined
Nov 21, 2015
Messages
15
Thanks a lot for the quick replies guys, now the ability is working exactly as intended :thumbs_up:
 
Status
Not open for further replies.
Top