Rejuvenation That Heals % Per Second

Blood_Wraith

New Member
Reaction score
2
I need an ability to act like Rejuvenation but restore a % of the Unit's HP per second instead of a set number. Is there ability like that, or do I have to use a trigger?
 

Inflicted

Currently inactive
Reaction score
63
Counld easily be done using hastables or some locals.

---

set the value of the maximum health to a variable, and then gradually increase it my a portion of that every second etc. I'm sure you should be able to work it out, would ofcourse be easier if you knew how to do it in Jass.
 

Blood_Wraith

New Member
Reaction score
2
Well my way of doing it, is a trigger like this:

Trigger:
  • Regen
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Regen
    • Actions
      • Unit - Set life of (Target unit of ability being cast) to ((Life of (Target unit of ability being cast)) + 100.00)
      • Wait 1.00 seconds
      • Unit - Set life of (Target unit of ability being cast) to ((Life of (Target unit of ability being cast)) + 100.00)
      • Wait 1.00 seconds
      • Unit - Set life of (Target unit of ability being cast) to ((Life of (Target unit of ability being cast)) + 100.00)
      • Wait 1.00 seconds
      • Unit - Set life of (Target unit of ability being cast) to ((Life of (Target unit of ability being cast)) + 100.00)
      • Wait 1.00 seconds
      • Unit - Set life of (Target unit of ability being cast) to ((Life of (Target unit of ability being cast)) + 100.00)
      • Wait 1.00 seconds
      • Unit - Set life of (Target unit of ability being cast) to ((Life of (Target unit of ability being cast)) + 100.00)
      • Wait 1.00 seconds
      • Unit - Set life of (Target unit of ability being cast) to ((Life of (Target unit of ability being cast)) + 100.00)
      • Wait 1.00 seconds
      • Unit - Set life of (Target unit of ability being cast) to ((Life of (Target unit of ability being cast)) + 100.00)
      • Wait 1.00 seconds
      • Unit - Set life of (Target unit of ability being cast) to ((Life of (Target unit of ability being cast)) + 100.00)
      • Wait 1.00 seconds
      • Unit - Set life of (Target unit of ability being cast) to ((Life of (Target unit of ability being cast)) + 100.00)
      • Wait 1.00 seconds
      • Unit - Set life of (Target unit of ability being cast) to ((Life of (Target unit of ability being cast)) + 100.00)
      • Wait 1.00 seconds
      • Unit - Set life of (Target unit of ability being cast) to ((Life of (Target unit of ability being cast)) + 100.00)
      • Wait 1.00 seconds
      • Unit - Set life of (Target unit of ability being cast) to ((Life of (Target unit of ability being cast)) + 100.00)
      • Wait 1.00 seconds
      • Unit - Set life of (Target unit of ability being cast) to ((Life of (Target unit of ability being cast)) + 100.00)
      • Wait 1.00 seconds
      • Unit - Set life of (Target unit of ability being cast) to ((Life of (Target unit of ability being cast)) + 100.00)


My Regen spell only lasts 15 seconds, so the healing part only fires 15 times; once per second. In theory, this should work, but it does not. The healing part ONLY fires 2 times, why? Something to do with the wait function I guess.

ALSO how would I go about doing (Life of (Target unit of ability being cast) + 5%)? Can not find out the percentage part.
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
612
I'm surprised it even runs. Target unit of ability being cast shouldn't return anything after the Wait. Use a local variable to store the unit, like so:
Trigger:
  • Custom script: local unit Target = GetSpellTargetUnit()


Put that line at the top of the trigger. Then, do a For Each Integer Loop:
Trigger:
  • For each (Integer A) from 1 to 15, do (Actions)
    • Loop - Actions
      • Custom script: set udg_YourUnit = Target
      • Unit - Set life of YourUnit to ((Life of (YourUnit)) + 100.00)


As for the 5% increase, do this:
Trigger:
  • Unit - Set life of YourUnit to ((Life of (YourUnit)) x 1.05)

That should increase the life by 5%.

The final trigger should look something like this:
Trigger:
  • Regen
    • Events
      • A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Regen
    • Actions
      • Custom script: local unit Target = GetSpellTargetUnit()
      • For each (Integer A) from 1 to 15, do (Actions)
        • Loop - Actions
          • Custom script: set udg_YourUnit = Target
          • Unit - Set life of YourUnit to ((Life of (YourUnit)) x 1.05)
          • Wait 1.00 seconds
 

Blood_Wraith

New Member
Reaction score
2
Ok I'm sure I know how to do this now, but I need variables correct? Can you list the ones I need, what type they are, and the initial value, if any.
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
612
You just need one. A global unit variable, YourUnit. You can call this anything you like, such as TempUnit or DIEYOUSTUPIDCREEP, but make sure to change the name of the local variable, udg_YourUnit, to reflect this. In udg_YourUnit, the "udg_" part tells the WE that it's a global variable, and the "YourUnit" part is the name of that global variable, which you can change.
 

Blood_Wraith

New Member
Reaction score
2
Okay thanks, you should be more detailed when referencing variables like that. It seems to work, but the heal part only fires ONCE, it does not loop 15 times. Whats the problem?

Here's my trigger:

Trigger:
  • Regen
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Regen
    • Actions
      • Custom script: local unit Target = GetSpellTargetUnit()
      • For each (Integer A) from 1 to 15, do (Actions)
        • Loop - Actions
          • Custom script: set udg_YourUnit = Target
          • Unit - Set life of (Target unit of ability being cast) to ((Life of (Target unit of ability being cast)) x 1.05)
          • Wait 1.00 seconds


Also, for the set your unit thing, couldn't the same thing be accomplished with

Trigger:
  • Set YourUnit = (Target unit of ability being cast)
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
612
You're not getting it. (Target unit of ability being cast) DOES NOT work after a wait. That's why you save it to a local variable, which retains its value until the trigger finishes. Then, after every wait, you set the unit variable to the local variable and use that instead. This makes it MUI.

Here's what mine looks like, and it works great. Also, thanks for the idea :)
Trigger:
  • Regenerate
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Regenerate
    • Actions
      • Custom script: local unit Target = GetSpellTargetUnit()
      • For each (Integer A) from 1 to 15, do (Actions)
        • Loop - Actions
          • Custom script: set udg_TempUnit = Target
          • Unit - Set life of TempUnit to ((Life of TempUnit) x 1.05)
          • Wait 1.00 seconds
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
you also cant use waits in a loop, the trigger wouldnt work either way if it does have waits in a loop
redo it with them out of the loop
create a unit variable and name it whatever you want
use the custom script: set udg_VariableName = Target
then do the other actions
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
612
GFreak, did you even read what I posted? I said that it works great my way. Waits work in For Each Integer loops. They only fail in Pick Every Destructible/Item/Unit loops.
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
oh... sorry, never knew that...
just read the triggers that were up and a couple posts, not the full thread :/
 

Inflicted

Currently inactive
Reaction score
63
lol tbh i was about to say the exact same thing :/
nice i learnt something too. :p
--
note that the trigger posted abit above will continiously restore 5% of current hp. If you want it to be a set amount after cast, you'd want to set the initital health points to a local or something like that.
 

Blood_Wraith

New Member
Reaction score
2
I don't get it, I did it exactly like yours, and it only loops once, what the hell...

Trigger:
  • Regen
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Regen
    • Actions
      • Custom script: local unit Target = GetSpellTargetUnit()
      • For each (Integer A) from 1 to 15, do (Actions)
        • Loop - Actions
          • Custom script: set udg_TempUnit = Target
          • Unit - Set life of TempUnit to ((Life of TempUnit) x 1.05)
          • Wait 1.00 seconds


TempUnit is a Unit type variable, just fyi. Also could you post a sample map of it? I can't see what the hell I got wrong. Could be the type of variable, since you didn't tell me what type of variable it has to be.
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
612
Here. Mine has levels, but the general idea is the same.
 

Attachments

  • Regeneration.w3x
    21.1 KB · Views: 224

Blood_Wraith

New Member
Reaction score
2
Okay now I'm sure I got it working right, I even edited your trigger in your map first to see if it works there, and it does.

Then I import THE SAME trigger that I modified in your map, and I made sure everything matches, and it does. I even made a new ability to match yours, a cripple ability with the negative attributes put to zero.

And I test it, it works, but it only loops ONCE. Once again, the looping is my problem, what's the problem? Here's my trigger:

Trigger:
  • Regenerate
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Regen
    • Actions
      • Custom script: local unit Target = GetSpellTargetUnit()
      • For each (Integer A) from 1 to 15, do (Actions)
        • Loop - Actions
          • Custom script: set udg_TempUnit = Target
          • Unit - Set life of TempUnit to ((Life of TempUnit) + ((Max life of TempUnit) x 0.05))
          • Wait 1.00 seconds


The only way I see this not working is another trigger interfering, gonna try to see if there is a trigger that might be interfering.
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
612
Right. Integer A loops wipe each other out. I knew I was forgetting something after GFreak posted.

Maybe you should just copy those actions 15 times. The local shouldn't be leaking, so set udg_TempUnit = Target should be enough after every wait. The "Integer A" in the for loop does work after waits, but it isn't compatible with other Integer A loops at the same time, as they overwrite each other.

Curse my stupidity. Can I -rep myself?
 

Blood_Wraith

New Member
Reaction score
2
That was the problem the whole time? It figures its the SECOND most obvious thing that's the problem, and it wasn't very obvious to me, I just suspected it might of had something to do with the Integer A part as well, but I didn't bother deleting it at first. It works now, my trigger looks like this now:

Trigger:
  • Regenerate
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Regen
    • Actions
      • Custom script: local unit Target = GetSpellTargetUnit()
      • Custom script: set udg_TempUnit = Target
      • Unit - Set life of TempUnit to ((Life of TempUnit) + ((Max life of TempUnit) x 0.05))
      • Wait 1.00 seconds
      • Unit - Set life of TempUnit to ((Life of TempUnit) + ((Max life of TempUnit) x 0.05))
      • Wait 1.00 seconds
      • Unit - Set life of TempUnit to ((Life of TempUnit) + ((Max life of TempUnit) x 0.05))
      • Wait 1.00 seconds
      • Unit - Set life of TempUnit to ((Life of TempUnit) + ((Max life of TempUnit) x 0.05))
      • Wait 1.00 seconds
      • Unit - Set life of TempUnit to ((Life of TempUnit) + ((Max life of TempUnit) x 0.05))
      • Wait 1.00 seconds
      • Unit - Set life of TempUnit to ((Life of TempUnit) + ((Max life of TempUnit) x 0.05))
      • Wait 1.00 seconds
      • Unit - Set life of TempUnit to ((Life of TempUnit) + ((Max life of TempUnit) x 0.05))
      • Wait 1.00 seconds
      • Unit - Set life of TempUnit to ((Life of TempUnit) + ((Max life of TempUnit) x 0.05))
      • Wait 1.00 seconds
      • Unit - Set life of TempUnit to ((Life of TempUnit) + ((Max life of TempUnit) x 0.05))
      • Wait 1.00 seconds
      • Unit - Set life of TempUnit to ((Life of TempUnit) + ((Max life of TempUnit) x 0.05))
      • Wait 1.00 seconds
      • Unit - Set life of TempUnit to ((Life of TempUnit) + ((Max life of TempUnit) x 0.05))
      • Wait 1.00 seconds
      • Unit - Set life of TempUnit to ((Life of TempUnit) + ((Max life of TempUnit) x 0.05))
      • Wait 1.00 seconds
      • Unit - Set life of TempUnit to ((Life of TempUnit) + ((Max life of TempUnit) x 0.05))
      • Wait 1.00 seconds
      • Unit - Set life of TempUnit to ((Life of TempUnit) + ((Max life of TempUnit) x 0.05))
      • Wait 1.00 seconds
      • Unit - Set life of TempUnit to ((Life of TempUnit) + ((Max life of TempUnit) x 0.05))


Here's your rep, KaerfNomekop, you've earned it.

Edit: "You must spread some Reputation around before giving it to KaerfNomekop again." Oh well, thank you anyway.
 

XeRo13g

New Member
Reaction score
3
I need an ability to act like Rejuvenation but restore a % of the Unit's HP per second instead of a set number. Is there ability like that, or do I have to use a trigger?

1. Create a custom ability based on life regeneration aura.
a. Change the area of effect to cover the whole map or at least an area that cover your needs(eg. 25000).
b. Change the Stats - Targets Allowed to Invulnerable, Vulnerable, Player Units.
(That will heal every unit you have on the map but not your allies. You may add or remove classification to restrict or expand the targets)
c. Change the Data - Amount of Hit Point Regenerated to whatever you like.

2. Create a custom unit based on your Dummy unit(eg. Dummy Healer) and add the custom ability you just made.

3. Create a custom ability based on Item Ursa Warrior Summon
a. Change Data - Summon 1 - Unit Type to Dummy Healer
b. Change Duration Hero/Normal to whatever time you wish for the units to be healed.
c. Make it a Hero ability and add it to your hero.

Pros:
-Easy to implement
-Extremely customizable
-Smooth regeneration
-Regeneration special effect when unit is not at full health
-No trigger is required

Cons:
-An extra ability for regeneration and maybe an extra unit.
-Restricting the healing aura only to the casting unit, can be a nuisance in some cases.

Note: You can avoid using the extra dummy unit, by using a normal dummy and a trigger to catch the event "Unit - A unit Spawns a summoned unit"…Then add the ability manually.

Hope that helps.-
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
1. it was already solved
2. thats way more complex and way less efficient than the current solution
3. all this would do is an aoe version of what the current solution is that would be much less accurate
4. he requested that it work on a targeted unit
5. dont make me quote you
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    Actually I was just playing with having some kind of mention of the food forum and recipes on the main page to test and see if it would engage some of those people to post something. It is just weird to get so much traffic and no engagement
  • The Helper The Helper:
    So what it really is me trying to implement some kind of better site navigation not change the whole theme of the site
  • Varine Varine:
    How can you tell the difference between real traffic and indexing or AI generation bots?
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top