• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Spell] Reincarnation with timer

Status
Not open for further replies.
Level 9
Joined
Apr 4, 2004
Messages
519
So I've thought about adding a Second Wind kind of ability to an agility hero (Reincarnation). As she is a melee agility character facing hordes of undead, a passive ability that lets her resurrect for say 20 seconds after death would be ideal to dish out some additional damage before she's forced to wait for the respawn timer.

Problem is, I have no idea how to do this. I don't want it to be a copy of Reincarnation. Rather, when she's revived by the passive spell, she's on a 20 second timer before she dies again, regardless of her health. The duration on the Reincarnation spell doesn't seem to do anything. :/
 
Level 12
Joined
May 22, 2015
Messages
1,051
You could potentially do this by catching the event at the normal respawn timer. Check if they should die and be counted as dead (by checking for this ability and potentially others) and then do whatever you want from there. You could just revive them on the spot with no animation and make your own.

I don't know what happens if you put an expiration timer on a hero, but it's worth a test. Just create a buff called "Second Wind" or something and then add that as the expiration timer buff.

You'd need some way to make sure it doesn't happen more than once. You could set a boolean variable somewhere or even add a hidden ability that does nothing that just indicates that the ability has been activated. If you see that ability during the check for the Second Wind passive, you remove it but also let the hero die normally.

I hope this makes sense. Also I am going to give you rep because I might use this ability for my berserker class in my own map. I hope that's cool with you! (I plan to put everyone I gave rep to into the credits for my map)
 
Level 9
Joined
Apr 4, 2004
Messages
519
Thanks for the input. I'll see what I can do with it.

Feel free to use it as you wish. I doubt it's an original idea so no worries there. :)
 
The most simple way would be to do it like this:

1. Use a dumby ability with icon (we will trigger the rest).
2. On Unit Dies Event - Remove unit from the respawn trigger if unit has dummy ability and SecWind = false.
3. If SecWind = false run our respawn trigger.
4. Set a boolean for the unit - SecWind = true.
5. You may set a timer or loop with integers for the "wait" but don't use plain old gui wait. Set your 20 sec timer for the ability anyway you like. Here is a tutorial. Custom Respawn Tutorial. When timer runs out - kill unit.
6. When unit dies, this time SecWind will = true. Now he will die and we set SecWind back to = false, and your respawn trigger can run as it would for any hero.

This is the same as what SAUS said essentially, except using a buff seems a bit extra complex, though it would have some nice features like adding the buff icon, however, you can add and remove the buff with a trigger too if you want.
 
Status
Not open for further replies.
Top