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

[Trigger] another hand if possible.

Status
Not open for further replies.
Level 9
Joined
Jun 7, 2008
Messages
440
I didnt know if i could ask for two different things ina single post. Sorry for the double post.
I have a few triggers where if the win a duel, the game proceeds. What i need is winning the duel with a certain amount of hitpoints, a certain sound is played depending on the amount of hitpoints remaining. 15% life left one sound is played... or 99% health left another sound is played... Any Help???
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
Use multiple selection in conditional structures. Like the if then structure. You chack if their HP are less than a certain ammount and if so you play your sound, else you check if their HP are less than a bigger amount and if so play another sound. etc.
 
Level 9
Joined
Jun 7, 2008
Messages
440
Okay thats all fine and all with the lower amount, being so close to zero. But with the higher amount, heros have levels and tomes for stat upgrades. Their strengths will be greater over time. Is there any way to check (upon death of the duelers) if the percentage is over say 99%?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
Yes??? I mean why you are asking makes no sense as you have both natives capable of returning a unit / heroes current and max HP (mana as well but you do not need that).

Simply divide the current HP by the max HP and you get the HP percentage in multiplyer form. (less than or equal to 1.0 but greater than or equal to 0)

You then run your conditional stetements on the percentage you calculated.
 
Status
Not open for further replies.
Top