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

[General] Negate Regeneration

Status
Not open for further replies.

sentrywiz

S

sentrywiz

Is there a way to "negate" or stop the effects of item abilities that regenerate life? I'm not talking about simple if/else conditions checking for debuffs when casting healing spells, but stopping the regeneration effects from item abilities.

I'm thinking about negative regeneration, mostly from Ancient Apparition in DotA. Apparently, his ulti causes the unit to not regenerate any health if I remember correctly.

Is the above done through adding item ability that has negative regeneration?
Because if not, then the only solution I can think of is use a loop of every 1 second and heal/restore mana to units via triggers. That way I have control over how much mana/health if any are restored to the unit.

Your thoughts on this?
 

sentrywiz

S

sentrywiz

To negate dynamic regeneration, you need to trigger the regeneration.
If the regeneration is always the same, you can just make a regeneration ability with that value but then negative.

Otherwise... good luck.

That was my thought. Because I have X number of items and spells that add some sort of regeneration effect, to "prepare" the same amount in negative amount. I was just wondering if there was some other way
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
Meh

Unholy Aura:
Life Regeneration Increase: 0% (nothing happens)
Life Regeneration Increase: -100% (instantly dead)
Life Regeneration Increase: -1% (slowly drains life... not with a constant speed though)
Life Regeneration Increase: 1% (increases regeneration)

I don't know if there are other "Life Regeneration Increase %" abilities but Unholy Aura is a no-go.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
Actually... I just discovered a bug where regeneration is negated :D

I was making a spell pack for Vladimir from LoL.
His passive increases his health based on ability power. (I used INT.)
Anyway, to do that, you have to keep track of how much health is increased, remove that, calculate how much should be increased, add that.
And do that every ... seconds of gametime.

The thing is that when I used a too low interval... 0.03 for example, the regeneration is COMPLETELY REMOVED!!!
I searched the crap outta me before I finally found out why it happens.
So if you increase/decrease a pretty amount of a unit's max health every 0.03 seconds, you remove Health Regeneration.
Same counts for Mana ofc.

I uploaded the pack here.
That one has a 0.5 seconds interval and does not remove regeneration.
You can take a look if you are interested.
 
Level 3
Joined
Sep 7, 2013
Messages
47
Is there a way to "negate" or stop the effects of item abilities that regenerate life? I'm not talking about simple if/else conditions checking for debuffs when casting healing spells, but stopping the regeneration effects from item abilities.

I'm thinking about negative regeneration, mostly from Ancient Apparition in DotA. Apparently, his ulti causes the unit to not regenerate any health if I remember correctly.

Is the above done through adding item ability that has negative regeneration?
Because if not, then the only solution I can think of is use a loop of every 1 second and heal/restore mana to units via triggers. That way I have control over how much mana/health if any are restored to the unit.

Your thoughts on this?

This is just my opinion but I don't think negative regeneration that DISABLES other regeneration is done by tracking triggered regenerative spells/items and negating it. I really think that is impossible (if not impossible, must be complicated) because you have to save all data of your regenerative spells/items into triggers in order to track them. (not hard really, but requires lot of work)

Of course you would not want to do complicated things just for a single spell right? But in order to achieve this effect that nullifies (it doesn't really nullifies) regenerative spells/items, you may do this:


this is just a draft trigger,...this is not MUI and may have leaks...I advise you to not copy this, instead, just learn from the idea. (the idea is all i wanted to tell you anyway) You may have others to make this MUI and usable or you may do that yourself
  • FirstTrigger
  • Events
    • Unit - Unit starts the effect of an ability
  • Conditions
    • Ability being cast = NegativeRegen
  • Actions
    • Set NRtarget = //the unit affected by negative regen
    • Set NRperSec = //negative regeneration per second
    • Set NRperInstance = NRperSec/100 //because we will use later a loop at 0.01 interval
    • Set NRtargetlife = //the exact beginning life of the affected unit the moment you have casted the spell
    • Trigger - //start second trigger
  • SecondTrigger
  • Events
    • Time - Every 0.01 seconds of game time
  • Conditions
  • Actions
    • If - Conditions
      • Life of NRtarget is greater than NRtargetlife // checks if unit's life has regenerated from the moment you have casted the spell
    • Then - Actions
      • Set NRtargetlife = NRtargetlife - NRperInstance // lessen our artificial life variable
      • Set life of NRtarget to NRtargetlife // the life of the unit has been saved to the variable so any regeneration will do nothing because we are using that artificial life to set the life of the unit as intended
Of course that wasn't enough, was it? What if during the negative regen duration, the unit takes damage?
  • ContinuationOfSecondTrigger
    • Else - Actions
      • Set NRtargetlife = Life of NRtarget
      • Set NRtargetlife = NRtargetlife - NRperInstance
      • Set life of NRtarget to NRtargelife
Again this is just a draft trigger (i can't open WE now for some reasons) and I am still new here in hive so i can't write triggers properly but i think this is the best way to do it. Again, you can make it MUI easily by Indexing or you may have others to do it for you
 
Level 3
Joined
Sep 7, 2013
Messages
47
Wow, I didn't thought manipulating stats like that prevents regeneration. I learned quite a few things from you. Thanks :D
But what if the user also wants the unit to be also not healed (instead of just not regenerating). I think most people would prefer that the unit will also be not healed because y'know... regeneration is mostly not big factor compared to instant heal spells. (well based on some games...imagine when clashing heroes)

add: by the way, the little system is good... but don't you think there are many triggers on it? I mean the user is just making a simple spell. And it is a bit complicated... not to mention he has to add something in the header
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
You think that i use too many triggers in that system?
well if you make another spell you only have to copy the 2 lines of code in that activation trigger
if you think that i use too much code then go ahead and search for some good systems
they have 3k+ lines of code
 
Level 3
Joined
Sep 7, 2013
Messages
47
Well of course, good systems sometimes have too much code in them. But it doesn't mean that a good system must have. I mean systems must be simplified as possible. If I am the creator of that spell, I'd prefer to use something as simple as the 2 triggered technique I've shown above instead of copying 3 to 4 triggers + some lines of code in the header + an ability + adjust constants and then still create a trigger for the specific spell. I mean the trigger I have shown above can still be simplified into 1 trigger with just few codes via vjass, it is just better that way (gui). Of course that is just my opinion. Because if the user plan to make many spells that negate regeneration (even just about 3-4), yours will be better to use but I didn't think to user planned to
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
Well... if you don't want to do it on my way then idc.
It is just that I am not satisfied with less than the best.
And the solution that I showed is completely removing the regeneration effect but nothing else.

Ofcourse if you have an Alternative Damage-Engine, you don't even have to care about these weird methods.
But when you implement that system correctly... you require to have much better coding experience than most triggerers here.
 
Level 3
Joined
Sep 7, 2013
Messages
47
Well, if you think that that way is the best, then I do not have even the slightest of objection. We have our own styles and opinions that we think are the best ways and we do it that way. But still, I didn't say that your system is bad (it is good i already told ya). I just had a few questions because I believe that you have the capability to do even something more than that. But because you have said that it was the best way, then I cannot do anything. Like I've said earlier, I cannot object.
 

sentrywiz

S

sentrywiz

Well thanks for your replies. I've decided to go with my own regeneration loop + dds.

Already made spells that affect regeneration and I'm very happy with the results.
 
Status
Not open for further replies.
Top