• 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.
  • 💡 We're thrilled to announce that our upcoming texturing contest is in the works, and we're eager to hear your suggestions! Please take this opportunity to share your ideas in this theme discussion thread for the Texturing Contest #34!
  • 🏆 Hive's 7th HD Modeling Contest: Icecrown Creature is now open! The frozen wastes of Icecrown are home to some of Azeroth’s most terrifying and resilient creatures. For this contest, your challenge is to design and model a HD 3D monster that embodies the cold, undead, and sinister essence of Icecrown! 📅 Submissions close on April 13, 2025. Don't miss this opportunity to let your creativity shine! Enter now and show us your frozen masterpiece! 🔗 Click here to enter!

[Trigger] Heal over time trigger, overwriting

Status
Not open for further replies.
Level 7
Joined
Jul 22, 2021
Messages
64
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 44
Joined
Feb 27, 2007
Messages
5,562
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