Add 30% of max HP and then remove it

Leazy

You can change this now in User CP.
Reaction score
50
Hello!

I'm creating a spell like survival instincts. The spell is for a druid character, who can shapeshift into a bear form where he has this ability. I want it to have 30% extra hp during this spell, but afterwards all the hp should be removed. The thing is, that if you swap out of bear form you should still have 30% extra hp, but 30% extra hp of the hp you have outside bear form (which is less). After the 20 sec I want the hp to become like the old one again, bugg free. It should also be removed when ressurected if you die with the effect. I can't think of any way to do this GUI (been testing for about an hour), so I would like to request a spell like this to be done (I think JASS is the only way to do this). Thanks in advance!
 

avalya

New Member
Reaction score
37
I believe making a percentage bonus could prove more trouble than you think, but I'd give it a shot in GUI. First of all, how much health do your druid have in bear form (will his health go over 3300 at any point or even over 33000)? Depending on his health, make item health bonuses, obviously based on Item Health Bonus, so they all got 10 levels, the first one goes from +0 to +9 health, the second from +0 to +90 (note that this is 0, 10, 20, 30 and so on and not 0, 1, 2, 3), a third one from +0 to +900, and if the health would go over 3000, make another +0 to +9000, a +0 to +90000 can also be made, depending on how high his health may be. That is the abilities that add the health, unfortunately, if he gains any new health bonuses (from Strength or Health from items) he will not get the extra percentage bonus from that until he casts the spell the next time.

Trigger:
  • SI Setup
    • Events
      • Map Initialization
    • Conditions
    • Actions
      • Set SI_HealthBonus[1] = Health Bonus Level 4
      • Set SI_HealthBonus[2] = Health Bonus Level 3
      • Set SI_HealthBonus[3] = Health Bonus Level 2
      • Set SI_HealthBonus[4] = Health Bonus Level 1

Those are all the abilities that are set to make sure the correct ones are added.

Trigger:
  • SI Cast
    • Events
      • Unit - A Unit Starts the effect of an Ability
    • Conditions
      • Ability Being Cast equal to Survival Instincts
    • Actions
      • Set SIP = Player Number of (Owner of (Triggering Unit)
      • Set SI_Caster[SIP] = Triggering Unit
      • Set SI_MaxHealth = (Max Life of SI_Caster[SIP] x 0.3)
      • Set TempDivider = 1000
      • For Each (Integer A) from 1 to 4, do (Actions)
        • Loop - Actions
          • Unit - Add SI_HealthBonus[Integer A] to (SI_Caster[SIP])
      • For Each (Integer A) from 1 to 4, do (Actions)
        • Loop - Actions
          • Set TempInteger = ((Integer(SI_MaxHealth)) / TempDivider)
          • Set Level of SI_HealthBonus[Integer A] for (SI_Caster[SIP]) to (TempInteger + 1)
          • Set SI_MaxHealth = (SI_MaxHealth - (Real((TempInteger x TempDivider)))
          • Set TempDivider = (TempDivider / 10)
      • Wait 20 seconds
      • For Each (Integer A) from 1 to 4, do (Actions)
        • Loop - Actions
          • Unit - Remove SI_HealthBonus[Integer A] from (SI_Caster[SIP])
      • Set SI_Caster[SIP] = No Unit

Make sure everything is correct and if you face any problems, let me know, this was completely freehanded so tell me if anything needs clarification.
 

Ayanami

칼리
Reaction score
288
I believe making a percentage bonus could prove more trouble than you think, but I'd give it a shot in GUI. First of all, how much health do your druid have in bear form (will his health go over 3300 at any point or even over 33000)? Depending on his health, make item health bonuses, obviously based on Item Health Bonus, so they all got 10 levels, the first one goes from +0 to +9 health, the second from +0 to +90 (note that this is 0, 10, 20, 30 and so on and not 0, 1, 2, 3), a third one from +0 to +900, and if the health would go over 3000, make another +0 to +9000, a +0 to +90000 can also be made, depending on how high his health may be. That is the abilities that add the health, unfortunately, if he gains any new health bonuses (from Strength or Health from items) he will not get the extra percentage bonus from that until he casts the spell the next time.

Trigger:
  • SI Setup
    • Events
      • Map Initialization
    • Conditions
    • Actions
      • Set SI_HealthBonus[1] = Health Bonus Level 1
      • Set SI_HealthBonus[2] = Health Bonus Level 2
      • Set SI_HealthBonus[3] = Health Bonus Level 3
      • Set SI_HealthBonus[4] = Health Bonus Level 4

Those are all the abilities that are set to make sure the correct ones are added.

Trigger:
  • SI Cast
    • Events
      • Unit - A Unit Starts the effect of an Ability
    • Conditions
      • Ability Being Cast equal to Survival Instincts
    • Actions
      • Set SIP = Player Number of (Owner of (Triggering Unit)
      • Set SI_Caster[SIP] = Triggering Unit
      • Set SI_MaxHealth = (Max Life of SI_Caster[SIP] x 0.3)
      • Set TempDivider = 1000
      • For Each (Integer A) from 1 to 4, do (Actions)
        • Loop - Actions
          • Unit - Add SI_HealthBonus[Integer A] to (SI_Caster[SIP])
      • For Each (Integer A) from 2 to 5, do (Actions)
        • Loop - Actions
          • Set TempInteger = ((Integer(SI_MaxHealth)) / TempDivider)
          • Set Level of SI_HealthBonus[Integer A] for (SI_Caster[SIP]) to (TempInteger + 1)
          • Set SI_MaxHealth = (SI_MaxHealth - (Real((TempInteger x TempDivider)))
          • Set TempDivider = (TempDivider / 10)
      • Wait 20 seconds
      • For Each (Integer A) from 1 to 4, do (Actions)
        • Loop - Actions
          • Unit - Remove SI_HealthBonus[Integer A] from (SI_Caster[SIP])
      • Set SI_Caster[SIP] = No Unit

Make sure everything is correct and if you face any problems, let me know, this was completely freehanded so tell me if anything needs clarification.

You kind of got it wrong. The loop numbers are wrong. Should be 1 to 4, not 2 to 5. I suspect you copied the trigger from one of my explanations in the other trigger XD. Bear in mind that SI_HealthBonus[1] should be the highest health bonus while SI_HealthBonus[4] should be the lowest health bonus. However, this isn't MUI. It is MPI. There is a way to make this MUI, that is if you want to.
 

avalya

New Member
Reaction score
37
Oh, right, yeah, changing that. It is MPI however, unless I'm totally wrong today. And using an increasing Integer (up to 200 or so) it could be MUI, yes. I just decided not to, since I'm guessing he's making a hero, and even if every player can have the same hero, it wouldn't be any problem.
 

Leazy

You can change this now in User CP.
Reaction score
50
Good idea, however this would bugg if you die with the buff, and it won't work if you go out of form (don't want 30% of the bear form hp if you leave it, want 30% of the normal hp). The hp in bear form will not be a constant value (you can get new items etc). I prefer MUI if possible, MPI is fine though.
 

Ayanami

칼리
Reaction score
288
Good idea, however this would bugg if you die with the buff, and it won't work if you go out of form (don't want 30% of the bear form hp if you leave it, want 30% of the normal hp). The hp in bear form will not be a constant value (you can get new items etc). I prefer MUI if possible, MPI is fine though.

Can be easily fixed. Use a periodic trigger. Every 0.10 seconds or so, check if the unit is dead. If it is dead, remove the Health Bonuses. So you're saying the 30% should scale? In this case, you need to move the the whole trigger into the periodic one. Save a real variable every periodic. The saved amount should be equal to amount of health added. Then every 0.10 seconds, Set SI_MaxHealth = ((Max Life of SI_Caster - SavedReal) x 0.3). An easy way to save a real variable is by using a hashtable.
 

NoobImbaPro

You can change this now in User CP.
Reaction score
60
here somewhere is e-gui it can help you VERY MUCH (max hp/mp damage def and many others to change values)
 

Leazy

You can change this now in User CP.
Reaction score
50
Glenphir and avalya, thanks for helping me out, you got me on the right directon. I decided to use this system to modify the hp, as it looked cleaner. +rep for helping me!
 

Ayanami

칼리
Reaction score
288
Using the loop action posted on the second post is much shorter than using that system. It basically does everything in 1 loop.
 

Dirac

22710180
Reaction score
147
I think its easier to create an ability that has 100 levels with 10 hp bonus difference between each one or 5... then do (Max Hp) x 0.03 (in case of 10hp interval) and set the level of the ability to that number
 

Ayanami

칼리
Reaction score
288
I think its easier to create an ability that has 100 levels with 10 hp bonus difference between each one or 5... then do (Max Hp) x 0.03 (in case of 10hp interval) and set the level of the ability to that number

It isn't accurate. And imagine if the health bonus is needed to be 10000. Setting that huge amount of levels would be both inefficient and would cause lags.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though

      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