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

Healing Nap

Status
Not open for further replies.
Level 4
Joined
Apr 23, 2011
Messages
88
I'm trying to make a hero's sleep animation play when he uses this Nap spell (3 level ability) and get healed (faster each time). And I want him to wake up and stop healing whenever the player tries to do something with the hero, or when the hero gets attacked.

I was trying to have dummy unit cast heal on him every second and that was working EXCEPT I can only get the healing to stop when hero has reached full health, not before (not if he moves, attacks, is attacked, etc.). ALSO, he always gets up after siting down to do his sleep animation; I want him to stay down.

Anyone know how to do this? Thanks much :)
 
Level 5
Joined
Sep 1, 2010
Messages
168
Make the heal via a unit group (call it e.g. HealNap).
Then use a periodic event - every 1 seconds of the game
condition -
actions
pick every unit in HealNap
set picked unit's life to "picked unit's life + xyz *level of HEALNAP_ABILITY hp"
you can variously modify the formular (using arithmetics) or simply use 3 if/else case (if level of ability for unit equal ...then...).

And a seconds trigger
event - a unit becomes attacked
event - a unit receives an order (think you need to list all variants here... with no target, targeting a point, targeting a unit)
conditions - unit is in HealNap unit group = true
actions - wake up triggering unit.

This should pretty much do it.
If you need something more specific, I could do a testmap tomorrow or so.
For the animation part: I got no clue, sorry ^^;
 
Level 10
Joined
Apr 22, 2010
Messages
422
Weird, i made this EXACT spell..........
What i did was instead of a dummy unit, i use multiple triggers. This makes it easyer to use for begginners.

Basicly, you a trigger that add this hero to a unit variable, named sleep_caster
Then, use multiple triggers that clears the "sleep_caster" variable whenever this unit is attacked, or interrupted. My idea is for you to base this spell on channel...

Next, have a periodic trigger that fires every second and increases the health of the unit. The health increases only applies to units in the "sleep_caster" variable.
You can easily set the heal amount through a variable.

If you have additional questions, or would like a test map, just pm me, or post it here.
 
Status
Not open for further replies.
Top