• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] How do I create a non-stackable but MUI and refreshable healing over time spell?

Status
Not open for further replies.
Level 5
Joined
May 20, 2008
Messages
138
Hello!
I want to trigger a spell that acts in a way identical to rejuvination.
It would be something like this:

[wc3]
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
[/wc3]

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. However, if rejuvination is cast on a unit that already has rejuvination on it, the duration of the spell still needs to be refreshed.

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)

The reason I want to do this is that my map will contain several different healing over time spells that work just like rejuvination, and I can't base them all on the Night Elf Rejuvination, its pretty easy to see that that wont work properly.
 
Level 5
Joined
May 20, 2008
Messages
138
Well, check if the unit already has a buff of rejuvenation. If False, do your actions, else, do nothing.

Thanks for your reply, but there are some issues that prevent me from doing this:

I wont be able to check for a buff, since there aren't enough single target buff spells in the game for all my heaing over time/damage over time spells. I could use boolean variables to check, but...

Doing nothing if the unit already has rejuvination on it won't work, because then rejuvination wont be refreshed. It is pretty stupid, a unit desperately needs more heals and rejuvination is about to expire on it, you cast a new rejuvination and nothing happens because its got one tick of rejuvination left on it. No, rejuvinations duration needs to be refreshed when the spell is recast on the target.

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
 
Last edited:
Status
Not open for further replies.
Top