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

qwery

Status
Not open for further replies.
Level 7
Joined
Mar 6, 2006
Messages
282
It's just another Condition. You would put it in your trigger that has the "Starts the effect of an ability" event. I'm assuming you're using GUI, so it would be:

  • (Life of (Triggering unit)) Greater than 5.00
Yo, this is actually really easy stuff, so I suggest you read some tutorials on basic triggers, it will get you started.

For this example, you didn't want a unit to cast an ability unless (condition) they were above 5% health (health is of type real), so the Condition would be a Real Comparision.
 
Never played Dota. A lot of people on here have not played it.

My guess is that that spell was made by triggering. With that you can check if something is true then continue spell if not it exits the trigger and nothing happens.

Example:

Code:
Event
    unit starts effect of ability
Conditions
Actions
    If 
        triggering unit has greater than 5% health
    then
        do actions here
    else
 
Level 37
Joined
Mar 6, 2006
Messages
9,243

  • Untitled Trigger 003
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • (Issued order) Equal to (Order(move))
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Percentage life of (Triggering unit)) Less than 5.00
        • Then - Actions
          • Unit - Pause (Triggering unit)
          • Unit - Order (Triggering unit) to Stop
          • Unit - Unpause (Triggering unit)
        • Else - Actions
 
Level 14
Joined
Nov 17, 2010
Messages
1,266
You could also make a unit called "HP greater than 5%" or something like that. Remove its model so it's a dummy unit, give it Locust, etc. Now add one to your map. Then in your abilities techtree requirements fields you can add this unit you made. So now create a trigger like they suggested above that checks for health less than 5%. If the health is less than 5% you can remove the dummy unit. Since it is no longer on the map, your ability doesn't meet the requirements and cannot be used. When the unit's health is above 5% again you can create your dummy unit again on the map somewhere so your ability can once again be used.

The best part of this is when you hover over your ability after you drop below 5% it will say "requires - HP greater than 5%"

I used this technique to make an ability called "Last Stand" that can only be used when the HP of the unit is below 25%
 
Status
Not open for further replies.
Top