• 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 spell available if unit has less than 10% hp

Status
Not open for further replies.
Level 9
Joined
Jan 23, 2008
Messages
384
Hi !
How do i make Available a skill if my hero has less then 10% hp.
To be more specific i want my hero to learn the skill but the skill should be unavailable if the hero has more then 10% of his hp ... :confused:
Hopefully i was clear ... if not you are free to ask me ...
Pls help ! :cute:
Ty for your time !
 
Level 18
Joined
Oct 18, 2007
Messages
930
Here ya go
  • BJWOLNEFGLKW
    • Events
      • Unit - Your Unit's life becomes Less than ((Max life of (Your Unit)) / 10.00))
    • Conditions
    • Actions
      • Player - Enable Your Ability for (Owner of (Your Unit))
and for turning off

  • ASFKHNEFB
    • Events
      • Unit - Your Unit's life becomes Greater than ((Max life of (Your Unit)) / 10.00))
    • Conditions
    • Actions
      • Player - Disable Your Ability for (Owner of (Your Unit))
Dont think that you can detect precentages in that trigger but il go for less that 50 hp :p


Hope this Helped xD
 
Last edited:
Level 12
Joined
Apr 27, 2008
Messages
1,228
You can. Do the same, but instead of 50 use Maximum life of the unit divided by what you want(i.e. 10).
Example
  • Unit - Some_Unit's life becomes Less than ((Max life of Some_Unit) / 10.00)
 
Level 9
Joined
Jan 23, 2008
Messages
384
Wat kind of variable must be my unit to meet this condition ... because variable of type Unit dose not work ...
And i tried this method but it wasn't what i wanted ... this stops the effect of my skill but it stills takes mana and does nothing ...
I wanted to take no mana and can't be active ... like a icon in DISBTN form ... do you know what i'm talking about ?
 
Level 9
Joined
May 27, 2006
Messages
498
Do just as people above said. Create a trigger like spiwn's and the disable/enable ability system a bit like shown by Dynasti.
You would have to have 2 abilities, one the actual ability which can be cast and a second one, which would require some upgrade in order to be castable.
If the unit has more than 10%, then remove the actual ability, and add the dummy one.
If the life comes below 10%, enable the actual ability, disable the dummy one.
Name required upgrade like "Below 10% health" to give it a good look in the tooltip.

@Up
This event can register only SPECIFIC units, not generic ones. Meaning your unit has to be already placed at the map in the World Editor.
 
Level 18
Joined
Oct 18, 2007
Messages
930
Do just as people above said. Create a trigger like
This event can register only SPECIFIC units, not generic ones. Meaning your unit has to be already placed at the map in the World Editor.

You can solve that by doing this

  • Trigger - Add to (BJWOLNEFGLKW) the event (Unit - (Triggering unit)'s life becomes Less than ((Max life of (Triggering unit)) / 10.00))
  • Trigger - Add to (ASFKHNEFB) the event (Unit - (Triggering unit)'s life becomes Greater than ((Max life of (Triggering unit)) / 10.00))
~Solved
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
Yes it leaks, if you never remove the events.
But if this spell is a hero spell, then you will leak 1(or maybe 10) events - so nothing to worry about.
If it is a unit spell then that would be a problem, but I kind of doubt it.
Just use the unit learns an ability event.
Check if the ability is this one, check if level of ability is 1! (in the conditions).
And then use the suggested action by Dynasti.
 
Level 18
Joined
Oct 18, 2007
Messages
930
Ok ...
All of those might work cause i'm not verry new but raft_pl's way is the best but ... i ask the second time this question ...


Unit - Your Unit's life becomes Greater than ((Max life of (Your Unit)) / 10.00))


What kind of variable is that ?

I just placed that random variable there... that one have to be YOUR UNIT!! the unit you want to get affected by the trigger :p
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
Since no one wanted to repeat what has been said before, all the info has been given in little pieces. You only had to connect them.
This demo map is for a hero ability that is learned the normal way.
 

Attachments

  • 10%.w3x
    13.2 KB · Views: 53
Level 9
Joined
May 27, 2006
Messages
498
Ehh... Just make your triggers like the following:
  • Hero choose
    • Events:
      • Unit - A unit sells a unit
    • Conditions:
      • (Unit-type of (Selling unit)) Equal to YourHeroTavern
    • Actions:
      • Trigger - Add to Hero10%LifeAbilityAdd <gen> the event (Unit - (Sold unit)'s life becomes Less than ((Max life of (Sold unit)) / 10.00))
      • Trigger - Add to Hero10%LifeAbilityRemove <gen> the event (Unit - (Sold unit)'s life becomes Greater than ((Max life of (Sold unit)) / 10.00))
  • Hero10%LifeAbilityAdd
    • Events:
    • Conditions:
    • Actions:
      • Unit - Add YourHeroActualAbility to (Triggering unit)
      • Unit - Remove YourHeroDummyAbility from (Triggering unit)
  • Hero10%LifeAbilityRemove
    • Events:
    • Conditions:
    • Actions:
      • Unit - Remove YourHeroActualAbility from (Triggering unit)
      • Unit - Add YourHeroDummyAbility to (Triggering unit)
I hope its all clear now?

@Up
Damn... 1-hour-of-non-refreshing-thread pwned :p
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
Lol...
Where is this going.
Lets not talk about drifting away from the subject but about this being done already about 3.5 times...
 
Status
Not open for further replies.
Top