• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

[Spell] Death Curse

Level 27
Joined
Sep 7, 2018
Messages
595
Hi my friends, it's mui?
  • Death Curse Config
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Death Curse
    • Actions
      • -------- Create Spell Instance --------
      • Set DeathCurse_Max = (DeathCurse_Max + 1)
      • Set DeathCurse_Target[DeathCurse_Max] = (Target unit of ability being cast)
      • Set DeathCurse_Caster[DeathCurse_Max] = (Triggering unit)
      • -------- Delay --------
      • Set DeathCurse_Tick[DeathCurse_Max] = 0.00
      • -------- Start Loop --------
      • If (DeathCurse_Max Equal to 1) then do (Trigger - Turn on Death Curse Loop <gen>) else do (Do nothing)
  • Death Curse Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Set TempInteger = 0
      • For each (Integer DeathCurse_Loop) from 1 to DeathCurse_Max, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • DeathCurse_Target[DeathCurse_Loop] Not equal to No unit
            • Then - Actions
              • -------- Count Active Spells --------
              • Set TempInteger = (TempInteger + 1)
              • -------- Target Alive --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (DeathCurse_Target[DeathCurse_Loop] is alive) Equal to True
                • Then - Actions
                  • -------- Update Timer --------
                  • Set DeathCurse_Tick[DeathCurse_Loop] = (DeathCurse_Tick[DeathCurse_Loop] + 0.03)
                  • -------- Delay Finished --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • DeathCurse_Tick[DeathCurse_Loop] Greater than or equal to 2.50
                    • Then - Actions
                      • -------- Execute --------
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Life of DeathCurse_Target[DeathCurse_Loop]) Less than 300.00
                        • Then - Actions
                          • Special Effect - Create a special effect attached to the origin of DeathCurse_Target[DeathCurse_Loop] using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
                          • Set DeathCurse_Effect[DeathCurse_Loop] = (Last created special effect)
                          • Special Effect - Destroy DeathCurse_Effect[DeathCurse_Loop]
                          • Unit - Cause DeathCurse_Caster[DeathCurse_Loop] to damage DeathCurse_Target[DeathCurse_Loop], dealing 1000000000.00 damage of attack type Spells and damage type Magic
                          • If ((DeathCurse_Target[DeathCurse_Loop] is A Hero) Equal to True) then do (Unit - For Unit DeathCurse_Caster[DeathCurse_Loop], end cooldown of ability Death Curse ) else do (Do nothing)
                          • -------- Clean Arrays --------
                          • Set DeathCurse_Target[DeathCurse_Loop] = No unit
                          • Set DeathCurse_Caster[DeathCurse_Loop] = No unit
                          • Set DeathCurse_Tick[DeathCurse_Loop] = 0.00
                          • Set TempInteger = (TempInteger - 1)
                        • Else - Actions
                          • Unit - Cause DeathCurse_Caster[DeathCurse_Loop] to damage DeathCurse_Target[DeathCurse_Loop], dealing 150.00 damage of attack type Spells and damage type Magic
                          • -------- Clean Arrays --------
                          • Set DeathCurse_Target[DeathCurse_Loop] = No unit
                          • Set DeathCurse_Caster[DeathCurse_Loop] = No unit
                          • Set DeathCurse_Tick[DeathCurse_Loop] = 0.00
                          • Set TempInteger = (TempInteger - 1)
                    • Else - Actions
                      • Do nothing
                • Else - Actions
                  • -------- Target Died --------
                  • Set DeathCurse_Target[DeathCurse_Loop] = No unit
                  • Set DeathCurse_Caster[DeathCurse_Loop] = No unit
                  • Set DeathCurse_Tick[DeathCurse_Loop] = 0.00
                  • Set TempInteger = (TempInteger - 1)
            • Else - Actions
              • Do nothing
      • -------- Stop Loop --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TempInteger Equal to 0
        • Then - Actions
          • Set DeathCurse_Max = 0
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Do nothing
 
Not sure of the MUIness, but there's a significant issue with deindexing after the damage is dealt. You need to set the current index to the max index, set the max index to no unit/0/null, then reduce both current and max index instance by 1. I'd recommend GUI Spell System v1.8.0.0 instead for GUI user to avoid the whole indexing hassle
 
Not sure of the MUIness, but there's a significant issue with deindexing after the damage is dealt. You need to set the current index to the max index, set the max index to no unit/0/null, then reduce both current and max index instance by 1. I'd recommend GUI Spell System v1.8.0.0 instead for GUI user to avoid the whole indexing hassle
Thanks, I tested it in my map, there was no problem. Is there a way to clear arrays for once in this trigger?
 
Visualize: Dynamic Indexing might have what you need. It is very similar to your triggers, but slightly different. Max Index set to no unit/0/null might not be necessary. You need the ones I didn't put in gray to properly discard the index though
You need to set the current index to the max index, set the max index to no unit/0/null, then reduce both current and max index instance by 1.
This structure also removes the need of TempInteger and the no unit check, making it cleaner and easier to keep track of.
 
Back
Top