• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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
421
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