• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Heal over time trigger, overwriting

Status
Not open for further replies.
Level 7
Joined
Jul 22, 2021
Messages
65
Hello,

So I made these triggers which cause the triggering unit to heal +50 hp and then an additional 75 hp over time.
But there's a problem when other unit will use the spell (during HoT duration), then the trigger is kinda "overwritten" onto the latest unit which used the spell.

I was thinking maybe variable arrays will solve this problem, but I'm not really sure how to implement this. Maybe there is another workaround on this?

Below you can find the triggers I made.

  • Well Fed
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Issued order) Equal to (Order(neutralspell))
        • Then - Actions
          • Unit - Order Priest 0263 <gen> to Human Priest - Inner Fire (Triggering unit)
          • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + 50.00)
          • Set VariableSet WellFedUnit = (Triggering unit)
          • Wait 2.00 seconds
          • Trigger - Turn on Well Fed HoT <gen>
        • Else - Actions

  • Well Fed HoT
    • Events
      • Time - Every 3.00 seconds of game time
    • Conditions
    • Actions
      • Unit - Set life of WellFedUnit to ((Life of WellFedUnit) + 15.00)
      • Wait 15.00 seconds
      • Trigger - Turn off Well Fed HoT <gen>
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
Haha, we all make mistakes. The kind of problem that you ran into, for reference, is making a spell (or bit of code) Mult-Unit Instancable (MUI). Your intuition about variable arrays is correct. Here's a good tutorial that explains how to use that method:

 
Status
Not open for further replies.
Top