[Spell] Aoe Heal Spell bug

Level 6
Joined
May 13, 2023
Messages
72
Hello again Hive, i have this spell which heals the target and all other units nearby it, how it works is that when the spell fires the target is healed instantly and nearby units are healed overtime for the same amount. The only problem in this is that no matter how i try the heal overtime keeps going on for the target.
  • Sacred Nova
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Sacred Nova
    • Actions
      • Unit Group - Pick every unit in (Units within 300.00 of (Position of (Target unit of ability being cast)).) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Picked unit) Not equal to (Target unit of ability being cast)
              • ((Picked unit) belongs to an ally of (Owner of (Triggering unit)).) Equal to True
              • ((Picked unit) is alive) Equal to True
              • ((Picked unit) is a Structure) Equal to False
            • Then - Actions
              • Unit - Create 1 Dummy (Nothing) for (Owner of (Triggering unit)) at (Position of (Picked unit)) facing Default building facing degrees
              • Unit - Add Sacred Nova (Dummy) to (Last created unit)
              • Unit - Set level of Sacred Nova (Dummy) for (Last created unit) to (Level of Sacred Nova for (Triggering unit))
              • Unit - Order (Last created unit) to Night Elf Druid Of The Claw - Rejuvenation (Picked unit)
              • Unit - Add a 0.20 second Generic expiration timer to (Last created unit)
            • Else - Actions
 
Level 13
Joined
Feb 5, 2018
Messages
567
On a side not this trigger is leaking a unit group and several locations. Also the "Last created unit" can be lost since there are zero variables used at the moment. If the object editor data is correct and the "Allied" is checked for the spell, could be an issue where something else is created and the reference to "Last created unit" is now another unit.

EDIT: Added a quick example trigger, this works :)

  • Sacred Nova
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Sacred Nova
    • Actions
      • -------- CASTER --------
      • Set VariableSet SacredNovaCaster = (Triggering unit)
      • -------- LEVEL --------
      • Set VariableSet SacredNovaLevel = (Level of Sacred Nova for SacredNovaCaster)
      • -------- POINT --------
      • Set VariableSet SacredNovaPoint = (Position of SacredNovaCaster)
      • -------- CREATE DUMMY --------
      • -------- IF THE DUMMY UNIT IS SET UP CORRECT YOU ONLY NEED ONE --------
      • Unit - Create 1 Dummy for (Owner of SacredNovaCaster) at SacredNovaPoint facing Default building facing degrees
      • Set VariableSet SacredNovaDummy = (Last created unit)
      • Unit - Add a 0.50 second Generic expiration timer to SacredNovaDummy
      • Unit - Add Rejuvenation to SacredNovaDummy
      • Unit - Set level of Rejuvenation for SacredNovaDummy to SacredNovaLevel
      • -------- GET TARGETS --------
      • Set VariableSet SacredNovaGroup = (Units within 300.00 of SacredNovaPoint matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an ally of (Owner of SacredNovaCaster).) Equal to True)).)
      • Unit Group - Pick every unit in SacredNovaGroup and do (Actions)
        • Loop - Actions
          • Set VariableSet SacredNovaTarget = (Picked unit)
          • Unit - Order SacredNovaDummy to Night Elf Druid Of The Claw - Rejuvenation SacredNovaTarget
      • -------- CLEAN UP --------
      • Custom script: call RemoveLocation (udg_SacredNovaPoint)
      • Custom script: call DestroyGroup (udg_SacredNovaGroup)
 
Last edited:
Level 6
Joined
May 13, 2023
Messages
72
The leaks and other stuff i can fix easily, its just that the ability works for all units caught in the area including the Target Unit of Ability Being cast which i don't want. Otherwise i dont remember mentioning anything about the spell not working at all
 
Level 13
Joined
Feb 5, 2018
Messages
567
Well I did say that the reference could be lost. Just ADD to My trigger "Target unit not equal to Nova caster"

EDIT: Did you get it to work? Also my bad I was scrolling trough this site very tired and missread your thread a bit. Anyways I made a simplified trigger and tested it in game. It is hard to evaluate how skilled the person asking for help is, if you just skip all the variables and leak clean ups and don't mention that you just left them out, because it's just a test trigger.

  • Unit Group - Pick every unit in SacredNovaGroup and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Picked unit) is A structure) Equal to False
          • ((Picked unit) is Mechanical) Equal to False
          • ((Picked unit) belongs to an ally of (Owner of SacredNova_Caster).) Equal to True
          • (Picked unit) Not equal to SacredNova_Caster
        • Then - Actions
          • Set VariableSet SacredNovaTarget = (Picked unit)
          • Unit - Order SacredNovaDummy to Night Elf Druid Of The Claw - Rejuvenation SacredNovaTarget
        • Else - Actions
 
Last edited:

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
Well I did say that the reference could be lost. Just ADD to My trigger "Target unit not equal to Nova caster"
Just a quick optimization:
  • Unit Group - Pick every unit in SacredNovaGroup and do (Actions)
    • Loop - Actions
      • Set VariableSet SacredNovaTarget = (Picked unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (SacredNovaTarget is A structure) Equal to False
          • (SacredNovaTarget is Mechanical) Equal to False
          • (SacredNovaTarget belongs to an ally of (Owner of SacredNova_Caster).) Equal to True
          • SacredNovaTarget Not equal to SacredNova_Caster
        • Then - Actions
          • Unit - Order SacredNovaDummy to Night Elf Druid Of The Claw - Rejuvenation SacredNovaTarget
        • Else - Actions
Remember, if you have a variable set to an Event Response then you should be referencing that variable instead. Also, you generally only need to set a variable if you're going to reference it more than once. So your original use of SacredNovaTarget wasn't accomplishing anything besides making the trigger longer.

This is assuming that you aren't using a Wait action since that complicates things (you may not want to use global variables at all then).
 
Last edited:
Level 3
Joined
May 24, 2017
Messages
12
If you're using the Rejuvenation spell as a base for the healing part, can't you just use the Roar spell instead? You can change it to heal over time instead of increasing damage on the object editor.

You'd only neeed 1 dummy unit casting it at the position of the original caster.
 
Level 3
Joined
May 24, 2017
Messages
12
Please read the thread again
Oh... I understood your spell wrong. Sorry.

Can you just remove the rejuvenation buff from the target if you can't avoid a dummy unit casting on it?

Or you can also try changing the unit group to Units in Range Maching Condintion and put all your conditions there instead of an "if, then, else" statement.
 
Top