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
 
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.
 
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
 
Does your trigger even work because your nulling it but not seting the variable again
 
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
 
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.
 
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).
 
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!
 
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.
  • The Helper The Helper:
    News portal has been retired. Main page of site goes to Headline News forum now
  • The Helper The Helper:
    I am working on getting access to the old news portal under a different URL for those that would rather use that for news before we get a different news view.
  • Ghan Ghan:
    Easily done
    +1
  • The Helper The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:
  • The Helper The Helper:
    What do you think Tom?
  • tom_mai78101 tom_mai78101:
    I will have to get used to this.
  • tom_mai78101 tom_mai78101:
    The latest news feed looks good
  • The Helper The Helper:
    I would like to see it again like Ghan had it the first time with pagination though - without the pagination that view will not work but with pagination it just might...
  • The Helper The Helper:
    This drink recipe I have had more than a few times back in the day! Mind Eraser https://www.thehelper.net/threads/cocktail-mind-eraser.194720/

      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