• 🏆 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] how to absorm incoming heal

Status
Not open for further replies.
Level 8
Joined
Jun 13, 2008
Messages
345
I was wondering if wc3 lets us to complately disable hp regeneration(no matter how many regen items the target has or skills) and also absorm heal?...I mean, when the target has a specific debuff, it cannot be healed by any means....when I holy light him, life is not gonna increase etc.

an example spell from WoW:
http://www.wowhead.com/spell=73975

I searched but couldn't find any system for this and I guess its impossible except doing this one by one for each heal spell/item like attack damage detection system does(calculates) for each one.

comments and thoughts are appreciated.
 
Level 25
Joined
Jul 10, 2006
Messages
3,315
Ezekiel12's method above is what I'd also suggest. To have it only absorb a set amount of healing:

In the loop trigger, compare the unit's current health to the saved variable, and add that difference to another variable. Which this second variable reaches X amount, you can remove the buff.

So if we have
real HealthSet (what the unit's health was at cast)
real HealAbsorbed (how much healing total has been absorbed)

Do
If (Current Health of unit greater than HealthSet)
Then (Set difference = current health of unit - HealthSet)
Unit - Set life of unit to HealthSet
Set HealAbsorbed = HealAbsorbed + difference
 
Level 14
Joined
Jun 27, 2008
Messages
1,325
Its not that simple, if the unit gets healed right after taking damage the heal will not be absorbed (at least not all of it).
Peroidic approaches to those things are always a bit exhausting to code because you have to take care of lots of things.
 
Level 8
Joined
Jun 13, 2008
Messages
345
according what you say muzzel, I guess I can say that it really should be a deep considered thing, so a system?

Its odd why this type of system was never made for wc3. If only heal would be a specific type/class in wc3, it would be much easer to accomplish. but dont know how yet, I wanna do this anyhow.
 
Level 12
Joined
Mar 13, 2012
Messages
1,121
Running a 0.00 second timer after a damage event will lead to the unit actually having suffered the damage while not even one game frame will have passed. When the timer runs out set your variable to the current life of the unit.

This is the most straightforward way, everything else requires a lot more triggers.
 
I'd suggest you another way. Save the amount that should be absorbed in avariable and chech through all healings spells that can be cast. Put unit begins castin an ability and if the amount is more than order casting unit to stop. This does nto detect accurate number of healing but at least you can calculate the heals and when the variable reaches the limit remove the buff for absorbing from that unit :thumbs_up:
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,188
absorm heal
What is to absorm something?!
Did you mean absorb?
The only solution I can think of is to periodically poll the unit health and measure any increase made to it and register that increase as a heal and possibly lower health back to a certain amount. You also need to keep track of damage received so that you cannot falsely ignore a heal due to it counter acting some damage between polls. You also need to be tolerant to damage sources that do not deal damage but drain health (negative healing well, plague from abominations, inverse heals etc) however you will unfortunately allow for some of these to be counter acted by heals as there is no way to detect them if the unit has just been healed for a large amount.
 
Level 25
Joined
May 11, 2007
Messages
4,651
Simply trigger life regeneration with triggers instead of using the object editor regen.
Then custom code your healing abilites using dummy abilites that only allow targeting the unit but doesn't heal it. Then check if the unit has the buff when a healing ability is cast on it, if he DOESN'T then apply your healing effect.
 
Status
Not open for further replies.
Top