How do I create a non-stackable but MUI healing over time spell?

Marsmallos

Member
Reaction score
17
Hello!
I want to trigger a spell that acts in a way identical to rejuvination.
It would be something like this:

Trigger:
  • Events
    • A unit starts the effect of an bility
    • Conditions
      • (Ability being cast) equal to RejuvinationTargettingSpell
    • Actions
      • custom script: local unit udg_RejuvinationTarget
      • set RejuvinationTarget = Target unit of ability being cast
      • For each integer A from 1 to 7, do actions
        • loop - actions
          • Unit - set life of RejuvinationTarget to (Life of RejuvinationTarget + 20)
          • wait 1,00 seconds
      • custom script: set udg_RejuvinationTarget = null


This makes my spell MUI, but, unfortunately it is stackable this way (as far as I can see) and I dont want that. If I cast rejuvination on the same target again before an earlier rejuvination has expired, I want the new rejuvination to overwrite the old rejuvination.
However, as far as I can see like the trigger is now, the two rejuvinations will simply stack on top of each other, thus naturally healing a double amount of what a single rejuvination would do, and I absolutely do not want that.

In short, this is how the spell should work:

It is a healing over time effect, meaning that it will heal a certain amount every x seconds for z seconds
It must be MUI
It must not be possible to stack on the same target but
Recasting it on the same target must refresh the duration of the healing over time effect
It must be triggered, using existing spells is not an option

What do I need to add/change in my trigger to make my rejuvination MUI but non-stackable on the same unit? (Keep in mind that several units might be on the battlefield casting rejuvination at the same time on the same/different targets)

Rep will of course be rewarded
 

Accname

2D-Graphics enthusiast
Reaction score
1,463
i dont get why you just dont use an ability to heal the targeted unit...

copy the ability of regeneration fountain and change its data to heal 20 hitpoints per second (be sure to uncheck "Data - Percentage") and give it 7 levels all with same data.
now create those 2 triggers:
Code:
AddAbility
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to HealOverTime
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Level of CustomRegenerationAuraSpell for (Target unit of ability being cast)) Equal to 0
            Then - Actions
                Unit - Add CustomRegenerationAuraSpell  to (Target unit of ability being cast)
            Else - Actions
                Unit - Set level of CustomRegenerationAuraSpell  for (Target unit of ability being cast) to 1
and
Code:
RemoveAbility
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        Set TempGroup = (Units in (Playable map area)((Level of CustomRegenerationAuraSpell   for (Matching unit)) Not equal to 0))
        Unit Group - Pick every unit in TempGroup and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Level of CustomRegenerationAuraSpell   for (Picked unit)) Equal to 7
                    Then - Actions
                        Unit - Remove CustomRegenerationAuraSpell   from (Picked unit)
                    Else - Actions
                        Unit - Increase level of CustomRegenerationAuraSpell   for (Picked unit)
        Custom script: call DestroyGroup (udg_TempGroup)
the 7 levels of the CustomRegenerationAuraSpell are the timer. each second the level of the spell gets increased, if it reaches level 7 it will vanish and stop healing your unit.
 

Marsmallos

Member
Reaction score
17
i dont get why you just dont use an ability to heal the targeted unit...

because I am going to trigger this action

Trigger:
  • Unit - set life of RejuvinationTarget to (Life of RejuvinationTarget + 20)


in a more advanced way in the finished version, the amount healed is going to be dependant on a number of variables (spellpower items equipped, number of players in the map, difficulty selected, etc) that can vary the amount healed between many different numbers.

EDIT: saw your updated post, and that was a pretty cool solution ;) however, see above
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
Does your trigger even work because your nulling it but not seting the variable again
 

Marsmallos

Member
Reaction score
17
Does your trigger even work because your nulling it but not seting the variable again

This is a copy of a trigger I was given on these very forums a couple of months ago (but with other variables, of course), and yes it works
 

DiFm

New Member
Reaction score
35
well you could still make it with an ability. MAke 200 levels and increase healed value every level and then just set the level of the amount it should heal. then you made the spell MUI.
 

vypur85

Hibernate
Reaction score
803
Code:
Rejuvenate
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Rejuvenate
    Actions
        Custom script:  local unit udg_Unit 
        Custom script:  local integer i = 0
        Set Unit = (Target unit of ability being cast)
        Custom script:  loop
        Custom script:  exitwhen i == 10 <-- [I]Adjust this to change how many times it loops[/I]
        Custom script:  set i = i + 1
        Set Unit = Unit2 <-- [I]Just set the local unit to another global unit[/I]
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
             [B]Unit2[/B] is in SomeUnitGroup Equal to False
          Then - Actions
             Unit - Set life of [B]Unit2[/B] to (Life of [B]Unit2[/B] + 20)
             Unit group - Add [B]Unit2[/B] to SomeUnitGroup
          Else - Actions
        Wait 1.00 seconds
        Unit group - Remove [B]Unit[/B] from SomeUnitGroup
        Custom script:  endloop
        Custom script:  set udg_Unit = null

You can try the above. Not sure if it may work. May bug. Not tested. The bolded stuffs are important. Make sure you globalise the local variable (because locals don't work in GUI condition function).
 

Marsmallos

Member
Reaction score
17
well you could still make it with an ability. MAke 200 levels and increase healed value every level and then just set the level of the amount it should heal. then you made the spell MUI.

However, then I only got one healing over time spell, and I need like 7 different ones castable on the same target (meaning that the same spell must NOT be stackable, but different spells that just happen to work in the same way must BE stackable)


Code:
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
             Unit2 is in SomeUnitGroup Equal to False
          Then - Actions
             Unit - Set life of Unit2 to (Life of Unit2 + 20)
             Unit group - Add Unit2 to SomeUnitGroup
          Else - Actions
        Wait 1.00 seconds
        Unit group - Remove Unit from SomeUnitGroup
not sure what the if/then/else and adding/removing the unit to a unit group is supposed to do

However I'll try your trigger as soon as I come home, I'll probably make five different accounts and +rep you if this works!
 

Marsmallos

Member
Reaction score
17
Hello again! I invented my own solution, and it seems to be working, but I am not sure if it was the ideal solution. Do you think there isa better way of doing this?
Trigger:
  • Hero Druid Regrowth Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to (Druid) Regrowth
    • Actions
      • Set HDRUID_RegrowthTarget[(((Player number of (Owner of (Casting unit))) x 10) + (Player number of (Owner of (Target unit of ability being cast))))] = (Target unit of ability being cast)
      • Set HDRUID_RegrowthTicks[(((Player number of (Owner of (Casting unit))) x 10) + (Player number of (Owner of (Target unit of ability being cast))))] = 0


Trigger:
  • Hero Druid Reqrowth Heal
    • Events
      • Time - Every 3.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 11 to 101, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • HDRUID_RegrowthTicks[(Integer A)] Less than 7
            • Then - Actions
              • Set HDRUID_RegrowthTicks[(Integer A)] = (HDRUID_RegrowthTicks[(Integer A)] + 1)
              • Unit - Set life of HDRUID_RegrowthTarget[(Integer A)] to ((Life of HDRUID_RegrowthTarget[(Integer A)]) + 35)
            • Else - Actions


Especially setting each of the
Trigger:
  • Set HDRUID_RegrowthTarget[(((Player number of (Owner of (Casting unit))) x 10) + (Player number of (Owner of (Target unit of ability being cast))))] = (Target unit of ability being cast)

variables will be a daunting task since I will have several healing over time spells. Does anyone know a way to speed up this task by the way?
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • 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!
    +1
  • 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
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top