• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

[Solved] Get a life regen bonus when acquiring an item

Status
Not open for further replies.
Level 3
Joined
Jan 29, 2017
Messages
29
Hello, straight to the point, i have an idea of creating an item which has an ability to grants bonus life regen once we own it (having it in our inventory), but that life regen bonus are disabled temporarily if we taking damage (direct attack or spell damage) from any enemy heroes, and after few seconds if we no longer taking damage from enemy heroes, we have that life regen bonus again.

The question is, how to do that? any suggest?
 
You will probably need to use a DDS (Damage Detection System), to detect when damage is dealt. You can either add/remove a regen ability accordingly or trigger the regeneration.
You need to store a real variable for each unit, to know how long it has not been damaged.
 
Hello, straight to the point, i have an idea of creating an item which has an ability to grants bonus life regen once we own it (having it in our inventory), but that life regen bonus are disabled temporarily if we taking damage (direct attack or spell damage) from any enemy heroes, and after few seconds if we no longer taking damage from enemy heroes, we have that life regen bonus again.

The question is, how to do that? any suggest?
 

Attachments

Solved! found it my self, i used a unit is attacked event, then check if the attacked unit has that specific item, then i add negated regeneration to the attacked unit. Thanks for the replies though :D
 
At first, i use the fountain regeneration aura which regenerate health by percentage, but since it was an aura, it has delayed timing when added and removed from the attacked unit, so i think it was unreliable. so then i use normal life regen which regenerate by fixed number (i.e. ring of health)
 
Solved! found it my self, i used a unit is attacked event, then check if the attacked unit has that specific item, then i add negated regeneration to the attacked unit. Thanks for the replies though :D
Attack event doesn't mean hit event. Also attack unit doesn't react on damage caused by spells.
Also Also adding/removing negative regeneration is kinda complicated.
 
Can I also submit my solution at the problem? It's quite similar to Fruit Forest's and most likely Dota's Heart of Tarrasque.

- Wolverine dies in Logan
- Just kidding about the spoiler, though it's true. The script is written in vJass and you'll need either JNGP or WEX to make it work correctly.
 

Attachments

Status
Not open for further replies.
Back
Top