• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Spell FX Not Displaying Properly on a Unit's Second Use of the Spell

Status
Not open for further replies.
Level 5
Joined
Aug 12, 2010
Messages
149
I'm trying to make my first serious GUI/MUI spell. In testing, two units can cast this spell simultaneously and everything displays/functions properly. When any unit casts this spell a subsequent time, some of the point-to-point lightning effects aren't created. All of the dummies are created, damage is dealt properly, but lightning effects are missing. For any given initial configuration of the spell, the same lightning effect are missing.

I'm thinking that the problem has something do with the way I clean up the hashtable and/or memory leaks, probably once the "loop" trigger detects that the timer expired for an individual caster. I've attached all of the triggers to the end of my post, but I use the action "Clear all child hashtables of child (Key (Picked Unit)) in Hashtable" to do it.



  • Discordance Initialize
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • -------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- ============================= ABILITY PARAMETERS ============================= --------
      • -------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- APPEARANCE --------
      • -------- 1: Number of dummies used to create the ring - for best results should go into 360 evenly and be evenly divisible by 3 --------
      • -------- 2: Radius of the outer ring --------
      • -------- 3: Dummies skipped by each link in the ring SFX - see trigger comment --------
      • -------- 4: Height above caster of lightning-emitting orb --------
      • -------- 5: Inner ring radius - should be less than Params[2 and 6] - also the inner damage radius --------
      • -------- -------------------------------------------------------- --------
      • Set K_Discordance_Params[1] = 7.00
      • Set K_Discordance_Params[2] = 500.00
      • Set K_Discordance_Params[3] = 2.00
      • Set K_Discordance_Params[4] = 400.00
      • Set K_Discordance_Params[5] = 250.00
      • -------- -------------------------------------------------------- --------
      • -------- DAMAGE --------
      • -------- 6: Outer damge radius - set equal to Params[2] --------
      • -------- 7: Base damage per AoE dmg interval for units inside inner damage radius --------
      • -------- 8: Damage per AoE dmg interval for units between inner and outer radii --------
      • -------- 9: UNUSED ---- LIGHTNING DMG IS SET BY ABILITY "DISCORDANCE LIGHTNING" --------
      • -------- 10: UNUSED ---- LIGHTNING DMG IS SET BY ABILITY "DISCORDANCE LIGHTNING" --------
      • -------- -------------------------------------------------------- --------
      • Set K_Discordance_Params[6] = K_Discordance_Params[2]
      • Set K_Discordance_Params[7] = 1.00
      • Set K_Discordance_Params[8] = 0.50
      • Set K_Discordance_Params[9] = 0.00
      • Set K_Discordance_Params[10] = 0.00
      • -------- -------------------------------------------------------- --------
      • -------- TIMING --------
      • -------- Note: Loop trigger is set to fire every 0.03 seconds by default. --------
      • -------- 11: Firings of loop trigger per lightning bolt cast from central orb (default of one lightning bolt every 3 seconds) --------
      • -------- 12: Firings of loop trigger per AoE damage interval (default dmg interval is 0.09 seconds) --------
      • -------- -------------------------------------------------------- --------
      • Set K_Discordance_Params[11] = 66.00
      • Set K_Discordance_Params[12] = 3.00
      • -------- -------------------------------------------------------- --------
      • -------- LEVEL BONUSES --------
      • -------- Note: Lightning Bolt Damage can be changed by altering the skill "Discordance Lightning" --------
      • -------- 13: Damage bonus (per AoE dmg interval) - units within inner radius --------
      • -------- 14: Damage bonus (per AoE dmg interval) - units between radii --------
      • -------- -------------------------------------------------------- --------
      • Set K_Discordance_Params[13] = 5.00
      • Set K_Discordance_Params[14] = 10.00
      • -------- -------------------------------------------------------- --------
      • -------- DURATION --------
      • -------- Note: Should be kept equal to the duration of the dummy skill used to trigger Discordance --------
      • -------- 15: Duration in seconds --------
      • -------- -------------------------------------------------------- --------
      • Set K_Discordance_Params[15] = 15.00
      • -------- -------------------------------------------------------- --------
      • -------- DO NOT CHANGE --------
      • -------- -------------------------------------------------------- --------
      • Hashtable - Create a hashtable
      • Set K_Discordance_Hash = (Last created hashtable)
      • Set K_Discordance_Theta = (360.00 / K_Discordance_Params[1])
  • Discordance
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Discordance (K)
    • Actions
      • -------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- ============================= SETUP ============================= --------
      • -------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • Set K_Discordance_Caster = (Triggering unit)
      • Set K_Discordance_Duration = K_Discordance_Params[15]
      • Set K_Discordance_Owner = (Owner of (Triggering unit))
      • Set K_Discordance_Locations[1] = (Position of K_Discordance_Caster)
      • Unit Group - Add K_Discordance_Caster to K_Discordance_CasterGroup
      • -------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- ============================= CREATE RING OF DUMMIES ============================= --------
      • -------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • For each (Integer A) from 0 to ((Integer(K_Discordance_Params[1])) - 1), do (Actions)
        • Loop - Actions
          • -------- Creating The Inner Ring --------
          • Set K_Discordance_Iteration[1] = (Integer A)
          • Set K_Discordance_Locations[2] = (K_Discordance_Locations[1] offset by K_Discordance_Params[5] towards ((Real(K_Discordance_Iteration[1])) x K_Discordance_Theta) degrees)
          • Unit - Create 1 Dummy (Discordance) for K_Discordance_Owner at K_Discordance_Locations[2] facing K_Discordance_Locations[1]
          • Unit - Add a K_Discordance_Duration second Generic expiration timer to (Last created unit)
          • Hashtable - Save Handle Of(Last created unit) as (Key (Inner Ring Dummy + (String(K_Discordance_Iteration[1])))) of (Key (Triggering unit)) in K_Discordance_Hash
          • -------- Clearing point leak --------
          • Custom script: call RemoveLocation(udg_K_Discordance_Locations[2])
      • For each (Integer A) from 0 to ((Integer(K_Discordance_Params[1])) - 1), do (Actions)
        • Loop - Actions
          • -------- Creating The Outer Ring --------
          • Set K_Discordance_Iteration[1] = (Integer A)
          • Set K_Discordance_Locations[2] = (K_Discordance_Locations[1] offset by K_Discordance_Params[2] towards ((Real(K_Discordance_Iteration[1])) x K_Discordance_Theta) degrees)
          • Unit - Create 1 Dummy (Discordance) for K_Discordance_Owner at K_Discordance_Locations[2] facing K_Discordance_Locations[1]
          • Unit - Add a K_Discordance_Duration second Generic expiration timer to (Last created unit)
          • Hashtable - Save Handle Of(Last created unit) as (Key (Outer Ring Dummy + (String(K_Discordance_Iteration[1])))) of (Key (Triggering unit)) in K_Discordance_Hash
          • -------- Clearing point leak --------
          • Custom script: call RemoveLocation(udg_K_Discordance_Locations[2])
      • -------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- ============================= CREATE LIGHTNING FX BETWEEN POSITIONS OF DUMMIES ============================= --------
      • -------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • For each (Integer A) from 0 to ((Integer(K_Discordance_Params[1])) - 1), do (Actions)
        • Loop - Actions
          • -------- Linking points on the inner ring --------
          • Set K_Discordance_Iteration[1] = (Integer A)
          • Set K_Discordance_Iteration[2] = ((K_Discordance_Iteration[1] + (Integer(K_Discordance_Params[3]))) mod (Integer(K_Discordance_Params[1])))
          • Set K_Discordance_Locations[2] = (Position of (Load (Key (Inner Ring Dummy + (String(K_Discordance_Iteration[1])))) of (Key (Triggering unit)) in K_Discordance_Hash))
          • Set K_Discordance_Locations[3] = (Position of (Load (Key (Inner Ring Dummy + (String(K_Discordance_Iteration[2])))) of (Key (Triggering unit)) in K_Discordance_Hash))
          • Lightning - Create a Drain Mana lightning effect from source K_Discordance_Locations[2] to target K_Discordance_Locations[3]
          • Hashtable - Save Handle Of(Last created lightning effect) as (Key (Inner Lightning + (String(K_Discordance_Iteration[1])))) of (Key (Triggering unit)) in K_Discordance_Hash
          • -------- Clearing point leaks --------
          • Custom script: call RemoveLocation(udg_K_Discordance_Locations[2])
          • Custom script: call RemoveLocation(udg_K_Discordance_Locations[3])
      • For each (Integer A) from 0 to ((Integer(K_Discordance_Params[1])) - 1), do (Actions)
        • Loop - Actions
          • -------- Linking the points on the outer ring --------
          • Set K_Discordance_Iteration[1] = (Integer A)
          • Set K_Discordance_Iteration[2] = ((K_Discordance_Iteration[1] + (Integer(K_Discordance_Params[3]))) mod (Integer(K_Discordance_Params[1])))
          • Set K_Discordance_Locations[2] = (Position of (Load (Key (Outer Ring Dummy + (String(K_Discordance_Iteration[1])))) of (Key (Triggering unit)) in K_Discordance_Hash))
          • Set K_Discordance_Locations[3] = (Position of (Load (Key (Outer Ring Dummy + (String(K_Discordance_Iteration[2])))) of (Key (Triggering unit)) in K_Discordance_Hash))
          • Lightning - Create a Drain Mana lightning effect from source K_Discordance_Locations[3] to target K_Discordance_Locations[2]
          • Hashtable - Save Handle Of(Last created lightning effect) as (Key (Outer Lightning + (String(K_Discordance_Iteration[1])))) of (Key (Triggering unit)) in K_Discordance_Hash
          • -------- Clearing point leaks --------
          • Custom script: call RemoveLocation(udg_K_Discordance_Locations[2])
          • Custom script: call RemoveLocation(udg_K_Discordance_Locations[3])
      • For each (Integer A) from 0 to ((Integer(K_Discordance_Params[1])) - 1), do (Actions)
        • Loop - Actions
          • -------- Creating SFX at each point on each ring --------
          • Set K_Discordance_Iteration[1] = (Integer A)
          • Set K_Discordance_Locations[2] = (Position of (Load (Key (Inner Ring Dummy + (String(K_Discordance_Iteration[1])))) of (Key (Triggering unit)) in K_Discordance_Hash))
          • Set K_Discordance_Locations[3] = (Position of (Load (Key (Outer Ring Dummy + (String(K_Discordance_Iteration[1])))) of (Key (Triggering unit)) in K_Discordance_Hash))
          • Special Effect - Create a special effect at K_Discordance_Locations[2] using Abilities\Weapons\SpiritOfVengeanceMissile\SpiritOfVengeanceMissile.mdl
          • Hashtable - Save Handle Of(Last created special effect) as (Key (Inner Dummy Effect + (String(K_Discordance_Iteration[1])))) of (Key (Triggering unit)) in K_Discordance_Hash
          • Special Effect - Create a special effect at K_Discordance_Locations[3] using Abilities\Weapons\SpiritOfVengeanceMissile\SpiritOfVengeanceMissile.mdl
          • Hashtable - Save Handle Of(Last created special effect) as (Key (Outer Dummy Effect + (String(K_Discordance_Iteration[1])))) of (Key (Triggering unit)) in K_Discordance_Hash
          • -------- Clearing point leaks --------
          • Custom script: call RemoveLocation(udg_K_Discordance_Locations[2])
          • Custom script: call RemoveLocation(udg_K_Discordance_Locations[3])
      • -------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- ============================= SET SPELL DAMAGE and HASHTABLE VALUES ============================= --------
      • -------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • Set K_Discordance_Damage[1] = (K_Discordance_Params[7] + ((Real((Level of Unknown (A664) for (Triggering unit)))) x K_Discordance_Params[13]))
      • Set K_Discordance_Damage[2] = (K_Discordance_Params[8] + ((Real((Level of Unknown (A664) for (Triggering unit)))) x K_Discordance_Params[14]))
      • Set K_Discordance_Damage[3] = (K_Discordance_Params[9] + ((Real((Level of Unknown (A664) for (Triggering unit)))) x K_Discordance_Params[15]))
      • Hashtable - Save K_Discordance_Damage[1] as (Key Inner Damage) of (Key (Triggering unit)) in K_Discordance_Hash
      • Hashtable - Save K_Discordance_Damage[2] as (Key Outer Damage) of (Key (Triggering unit)) in K_Discordance_Hash
      • Hashtable - Save K_Discordance_Damage[3] as (Key Lightning Damage) of (Key (Triggering unit)) in K_Discordance_Hash
      • Hashtable - Save K_Discordance_Params[15] as (Key Duration) of (Key (Triggering unit)) in K_Discordance_Hash
      • Hashtable - Save 0 as (Key SFX Counter) of (Key (Triggering unit)) in K_Discordance_Hash
      • Hashtable - Save 0 as (Key Loop Counter) of (Key (Triggering unit)) in K_Discordance_Hash
      • -------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- ============================= CREATE CENTRAL ORB and INITIATE LOOP ============================= --------
      • -------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • Unit - Create 1 Dummy (Discordance Orb) for K_Discordance_Owner at K_Discordance_Locations[1] facing Default building facing degrees
      • Unit - Add a K_Discordance_Duration second Generic expiration timer to (Last created unit)
      • Unit - Add Storm Crow Form to (Last created unit)
      • Unit - Remove Storm Crow Form from (Last created unit)
      • Animation - Change (Last created unit) flying height to K_Discordance_Params[4] at 0.00
      • Animation - Change (Last created unit)'s size to (200.00%, 200.00%, 200.00%) of its original size
      • Unit - Add K - Discordance Lightning to (Last created unit)
      • Unit - Set level of K - Discordance Lightning for (Last created unit) to (Level of Discordance (K) for (Triggering unit))
      • Hashtable - Save Handle Of(Last created unit) as (Key Orb) of (Key (Triggering unit)) in K_Discordance_Hash
      • -------- Clearing point leak --------
      • Custom script: call RemoveLocation(udg_K_Discordance_Locations[1])
      • Trigger - Turn on Discordance Loop <gen>
  • Discordance Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • -------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- ============================= TIMING and ENDING THE SPELL ============================= --------
      • -------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • Unit Group - Pick every unit in K_Discordance_CasterGroup and do (Actions)
        • Loop - Actions
          • -------- For each caster, decrement duration by 0.03 --------
          • Set K_Discordance_Duration = (Load (Key Duration) of (Key (Picked unit)) from K_Discordance_Hash)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • K_Discordance_Duration Less than or equal to 0.03
            • Then - Actions
              • -------- End the spell if the duration has expired --------
              • For each (Integer A) from 0 to ((Integer(K_Discordance_Params[1])) - 1), do (Actions)
                • Loop - Actions
                  • Lightning - Destroy (Load (Key (Inner Lightning + (String((Integer A))))) of (Key (Picked unit)) in K_Discordance_Hash)
                  • Lightning - Destroy (Load (Key (Outer Lightning + (String((Integer A))))) of (Key (Picked unit)) in K_Discordance_Hash)
                  • Lightning - Destroy (Load (Key (Red Lightning CCW + (String((Integer A))))) of (Key (Picked unit)) in K_Discordance_Hash)
                  • Special Effect - Destroy (Load (Key (Red Lightning Effect A + (String((Integer A))))) of (Key (Picked unit)) in K_Discordance_Hash)
                  • Special Effect - Destroy (Load (Key (Red Lightning Effect B + (String((Integer A))))) of (Key (Picked unit)) in K_Discordance_Hash)
                  • Special Effect - Destroy (Load (Key (Inner Dummy Effect + (String((Integer A))))) of (Key (Picked unit)) in K_Discordance_Hash)
                  • Special Effect - Destroy (Load (Key (Outer Dummy Effect + (String((Integer A))))) of (Key (Picked unit)) in K_Discordance_Hash)
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in K_Discordance_Hash
              • Unit Group - Remove (Picked unit) from K_Discordance_CasterGroup
            • Else - Actions
              • -------- If the duration has not expired, increment the loop counter by 1 and continue --------
              • Hashtable - Save ((Load (Key Duration) of (Key (Picked unit)) from K_Discordance_Hash) - 0.03) as (Key Duration) of (Key (Picked unit)) in K_Discordance_Hash
              • Hashtable - Save ((Load (Key Loop Counter) of (Key (Picked unit)) from K_Discordance_Hash) + 1) as (Key Loop Counter) of (Key (Picked unit)) in K_Discordance_Hash
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (K_Discordance_CasterGroup is empty) Equal to True
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
      • -------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- ============================= DEALING DAMAGE ============================= --------
      • -------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • Unit Group - Pick every unit in K_Discordance_CasterGroup and do (Actions)
        • Loop - Actions
          • Set K_Discordance_Caster = (Picked unit)
          • Set K_Discordance_Owner = (Owner of (Picked unit))
          • Set K_Discordance_Locations[1] = (Position of (Picked unit))
          • Set K_Discordance_RingUnit[1] = No unit
          • Set K_Discordance_RingUnit[2] = No unit
          • Set K_Discordance_RingUnit[3] = (Load (Key Orb) of (Key (Picked unit)) in K_Discordance_Hash)
          • Set K_Discordance_Damage[1] = (Load (Key Inner Damage) of (Key (Picked unit)) from K_Discordance_Hash)
          • Set K_Discordance_Damage[2] = (Load (Key Outer Damage) of (Key (Picked unit)) from K_Discordance_Hash)
          • Set K_Discordance_Damage[3] = (Load (Key Lightning Damage) of (Key (Picked unit)) from K_Discordance_Hash)
          • Set K_Discordance_Duration = (Load (Key Duration) of (Key (Picked unit)) from K_Discordance_Hash)
          • Set K_Discordance_Iteration[4] = (Load (Key Loop Counter) of (Key (Picked unit)) from K_Discordance_Hash)
          • -------- For each caster, check: Is caster alive,? Is spell duration expired? --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (K_Discordance_Caster is alive) Equal to True
              • K_Discordance_Duration Greater than 0.00
            • Then - Actions
              • -------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
              • -------- ============================= AoE DAMAGE ============================= --------
              • -------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (K_Discordance_Iteration[4] mod (Integer(K_Discordance_Params[12]))) Equal to 1
                • Then - Actions
                  • -------- Create unit groups for units within inner damage radius and between inner and outer damage radii --------
                  • -------- DmgGroup[1] is inner, DmgGroup[2] is outer --------
                  • Set K_Discordance_DmgGroup[1] = (Units within K_Discordance_Params[5] of K_Discordance_Locations[1] matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is A structure) Equal to False) and (((Matching unit) belongs to an enemy of K_Discordance_Owner) Equal to True))))
                  • Set K_Discordance_DmgGroup[2] = (Units within K_Discordance_Params[6] of K_Discordance_Locations[1] matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) belongs to an enemy of K_Discordance_Owner) Equal to True) a
                  • Unit Group - Pick every unit in K_Discordance_DmgGroup[1] and do (Actions)
                    • Loop - Actions
                      • Unit - Cause K_Discordance_Caster to damage (Picked unit), dealing K_Discordance_Damage[1] damage of attack type Chaos and damage type Lightning
                  • Unit Group - Pick every unit in K_Discordance_DmgGroup[2] and do (Actions)
                    • Loop - Actions
                      • Unit - Cause K_Discordance_Caster to damage (Picked unit), dealing K_Discordance_Damage[2] damage of attack type Chaos and damage type Lightning
                  • Custom script: call DestroyGroup(udg_K_Discordance_DmgGroup[1])
                  • Custom script: call DestroyGroup(udg_K_Discordance_DmgGroup[2])
                • Else - Actions
              • -------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
              • -------- ============================= LIGHTNING BOLTS ============================= --------
              • -------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (K_Discordance_Iteration[4] mod (Integer(K_Discordance_Params[11]))) Equal to 1
                • Then - Actions
                  • -------- Create unit groups for units within inner damage radius (also the radius of the lightning bolt) --------
                  • Set K_Discordance_DmgGroup[1] = (Units within K_Discordance_Params[5] of K_Discordance_Locations[1] matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is A structure) Equal to False) and (((Matching unit) belongs to an enemy of K_Discordance_Owner) Equal to True))))
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (K_Discordance_DmgGroup[1] is empty) Equal to False
                    • Then - Actions
                      • Special Effect - Create a special effect attached to the origin of (Load (Key Orb) of (Key (Picked unit)) in K_Discordance_Hash) using Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • For each (Integer A) from 1 to (Level of K - Discordance Lightning for (Last created unit)), do (Actions)
                        • Loop - Actions
                          • Unit - Create 1 Dummy (Discordance) for K_Discordance_Owner at K_Discordance_Locations[1] facing Default building facing degrees
                          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
                          • Unit - Add Storm Crow Form to (Last created unit)
                          • Unit - Remove Storm Crow Form from (Last created unit)
                          • Animation - Change (Last created unit) flying height to (K_Discordance_Params[4] - 40.00) at 0.00
                          • Unit - Add K - Discordance Lightning to (Last created unit)
                          • Unit - Set level of K - Discordance Lightning for (Last created unit) to (Level of K - Discordance Lightning for (Load (Key Orb) of (Key (Picked unit)) in K_Discordance_Hash))
                          • Unit - Order (Last created unit) to Orc Far Seer - Chain Lightning (Random unit from K_Discordance_DmgGroup[1])
                    • Else - Actions
                  • Custom script: call DestroyGroup(udg_K_Discordance_DmgGroup[1])
                • Else - Actions
              • Custom script: call RemoveLocation(udg_K_Discordance_Locations[1])
            • Else - Actions
      • -------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- ============================= SFX ACTIONS ============================= --------
      • -------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • Unit Group - Pick every unit in K_Discordance_CasterGroup and do (Actions)
        • Loop - Actions
          • Set K_Discordance_Caster = (Picked unit)
          • Set K_Discordance_Owner = (Owner of (Picked unit))
          • Set K_Discordance_Locations[1] = (Position of (Picked unit))
          • Set K_Discordance_RingUnit[1] = No unit
          • Set K_Discordance_RingUnit[2] = No unit
          • Set K_Discordance_RingUnit[3] = (Load (Key Orb) of (Key (Picked unit)) in K_Discordance_Hash)
          • -------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
          • -------- ============================= RED LIGHTNING SWEEP ============================= --------
          • -------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (K_Discordance_Iteration[4] mod 16) Equal to 1
            • Then - Actions
              • -------- --------
              • -------- (SFX Counter, unit handle) in hashtable functions as a timer --------
              • -------- Iteration[3] - holds the value of the next dummies to be connected by red lightning --------
              • -------- Iteration[4] - DO NOT CHANGE --------
              • -------- Iteration[5] - # of dummies to skip to travel 1/3 the ring distance --------
              • -------- Iteration[6] - # of dummies to skip to travel 2/3 the ring distance --------
              • -------- Iteration[7] - # of dummies to skip to travel the full ring distance --------
              • -------- --------
              • -------- Iteration[3] + Iteration[5,6, or 7] mod (ring size) gives the 3 dummy id's that will be connected by red lightning --------
              • -------- --------
              • Set K_Discordance_Iteration[5] = ((Integer(K_Discordance_Params[1])) / 3)
              • Set K_Discordance_Iteration[6] = (((Integer(K_Discordance_Params[1])) x 2) / 3)
              • Set K_Discordance_Iteration[7] = (Integer(K_Discordance_Params[1]))
              • -------- --------
              • -------- Destroy lightning from the last round --------
              • -------- --------
              • Set K_Discordance_Iteration[3] = (((Load (Key SFX Counter) of (Key (Picked unit)) from K_Discordance_Hash) + K_Discordance_Iteration[5]) mod (Integer(K_Discordance_Params[1])))
              • Lightning - Destroy (Load (Key (Red Lightning CCW + (String(K_Discordance_Iteration[3])))) of (Key (Picked unit)) in K_Discordance_Hash)
              • Special Effect - Destroy (Load (Key (Red Lightning Effect A + (String(K_Discordance_Iteration[3])))) of (Key (Picked unit)) in K_Discordance_Hash)
              • Special Effect - Destroy (Load (Key (Red Lightning Effect B + (String(K_Discordance_Iteration[3])))) of (Key (Picked unit)) in K_Discordance_Hash)
              • Set K_Discordance_Iteration[3] = (((Load (Key SFX Counter) of (Key (Picked unit)) from K_Discordance_Hash) + K_Discordance_Iteration[6]) mod (Integer(K_Discordance_Params[1])))
              • Lightning - Destroy (Load (Key (Red Lightning CCW + (String(K_Discordance_Iteration[3])))) of (Key (Picked unit)) in K_Discordance_Hash)
              • Special Effect - Destroy (Load (Key (Red Lightning Effect A + (String(K_Discordance_Iteration[3])))) of (Key (Picked unit)) in K_Discordance_Hash)
              • Special Effect - Destroy (Load (Key (Red Lightning Effect B + (String(K_Discordance_Iteration[3])))) of (Key (Picked unit)) in K_Discordance_Hash)
              • Set K_Discordance_Iteration[3] = (((Load (Key SFX Counter) of (Key (Picked unit)) from K_Discordance_Hash) + K_Discordance_Iteration[7]) mod (Integer(K_Discordance_Params[1])))
              • Lightning - Destroy (Load (Key (Red Lightning CCW + (String(K_Discordance_Iteration[3])))) of (Key (Picked unit)) in K_Discordance_Hash)
              • Special Effect - Destroy (Load (Key (Red Lightning Effect A + (String(K_Discordance_Iteration[3])))) of (Key (Picked unit)) in K_Discordance_Hash)
              • Special Effect - Destroy (Load (Key (Red Lightning Effect B + (String(K_Discordance_Iteration[3])))) of (Key (Picked unit)) in K_Discordance_Hash)
              • -------- --------
              • -------- Increment the SFX counter --------
              • -------- --------
              • Hashtable - Save ((Load (Key SFX Counter) of (Key (Picked unit)) from K_Discordance_Hash) + 1) as (Key SFX Counter) of (Key (Picked unit)) in K_Discordance_Hash
              • -------- --------
              • -------- Create new lightning --------
              • -------- --------
              • Set K_Discordance_Iteration[3] = (((Load (Key SFX Counter) of (Key (Picked unit)) from K_Discordance_Hash) + K_Discordance_Iteration[5]) mod (Integer(K_Discordance_Params[1])))
              • Set K_Discordance_Locations[2] = (Position of (Load (Key (Inner Ring Dummy + (String(K_Discordance_Iteration[3])))) of (Key (Picked unit)) in K_Discordance_Hash))
              • Set K_Discordance_Locations[3] = (Position of (Load (Key (Outer Ring Dummy + (String(K_Discordance_Iteration[3])))) of (Key (Picked unit)) in K_Discordance_Hash))
              • Lightning - Create a Finger of Death lightning effect from source K_Discordance_Locations[3] to target K_Discordance_Locations[2]
              • Hashtable - Save Handle Of(Last created lightning effect) as (Key (Red Lightning CCW + (String(K_Discordance_Iteration[3])))) of (Key (Picked unit)) in K_Discordance_Hash
              • Special Effect - Create a special effect at K_Discordance_Locations[2] using Abilities\Weapons\VengeanceMissile\VengeanceMissile.mdl
              • Hashtable - Save Handle Of(Last created special effect) as (Key (Red Lightning Effect A + (String(K_Discordance_Iteration[3])))) of (Key (Picked unit)) in K_Discordance_Hash
              • Special Effect - Create a special effect at K_Discordance_Locations[3] using Abilities\Weapons\VengeanceMissile\VengeanceMissile.mdl
              • Hashtable - Save Handle Of(Last created special effect) as (Key (Red Lightning Effect B + (String(K_Discordance_Iteration[3])))) of (Key (Picked unit)) in K_Discordance_Hash
              • -------- Clearing point leaks --------
              • Custom script: call RemoveLocation(udg_K_Discordance_Locations[2])
              • Custom script: call RemoveLocation(udg_K_Discordance_Locations[3])
              • -------- --------
              • Set K_Discordance_Iteration[3] = (((Load (Key SFX Counter) of (Key (Picked unit)) from K_Discordance_Hash) + K_Discordance_Iteration[6]) mod (Integer(K_Discordance_Params[1])))
              • Set K_Discordance_Locations[2] = (Position of (Load (Key (Inner Ring Dummy + (String(K_Discordance_Iteration[3])))) of (Key (Picked unit)) in K_Discordance_Hash))
              • Set K_Discordance_Locations[3] = (Position of (Load (Key (Outer Ring Dummy + (String(K_Discordance_Iteration[3])))) of (Key (Picked unit)) in K_Discordance_Hash))
              • Lightning - Create a Finger of Death lightning effect from source K_Discordance_Locations[3] to target K_Discordance_Locations[2]
              • Hashtable - Save Handle Of(Last created lightning effect) as (Key (Red Lightning CCW + (String(K_Discordance_Iteration[3])))) of (Key (Picked unit)) in K_Discordance_Hash
              • Special Effect - Create a special effect at K_Discordance_Locations[2] using Abilities\Weapons\VengeanceMissile\VengeanceMissile.mdl
              • Hashtable - Save Handle Of(Last created special effect) as (Key (Red Lightning Effect A + (String(K_Discordance_Iteration[3])))) of (Key (Picked unit)) in K_Discordance_Hash
              • Special Effect - Create a special effect at K_Discordance_Locations[3] using Abilities\Weapons\VengeanceMissile\VengeanceMissile.mdl
              • Hashtable - Save Handle Of(Last created special effect) as (Key (Red Lightning Effect B + (String(K_Discordance_Iteration[3])))) of (Key (Picked unit)) in K_Discordance_Hash
              • -------- Clearing point leaks --------
              • Custom script: call RemoveLocation(udg_K_Discordance_Locations[2])
              • Custom script: call RemoveLocation(udg_K_Discordance_Locations[3])
              • -------- --------
              • Set K_Discordance_Iteration[3] = (((Load (Key SFX Counter) of (Key (Picked unit)) from K_Discordance_Hash) + K_Discordance_Iteration[7]) mod (Integer(K_Discordance_Params[1])))
              • Set K_Discordance_Locations[2] = (Position of (Load (Key (Inner Ring Dummy + (String(K_Discordance_Iteration[3])))) of (Key (Picked unit)) in K_Discordance_Hash))
              • Set K_Discordance_Locations[3] = (Position of (Load (Key (Outer Ring Dummy + (String(K_Discordance_Iteration[3])))) of (Key (Picked unit)) in K_Discordance_Hash))
              • Lightning - Create a Finger of Death lightning effect from source K_Discordance_Locations[3] to target K_Discordance_Locations[2]
              • Hashtable - Save Handle Of(Last created lightning effect) as (Key (Red Lightning CCW + (String(K_Discordance_Iteration[3])))) of (Key (Picked unit)) in K_Discordance_Hash
              • Special Effect - Create a special effect at K_Discordance_Locations[2] using Abilities\Weapons\VengeanceMissile\VengeanceMissile.mdl
              • Hashtable - Save Handle Of(Last created special effect) as (Key (Red Lightning Effect A + (String(K_Discordance_Iteration[3])))) of (Key (Picked unit)) in K_Discordance_Hash
              • Special Effect - Create a special effect at K_Discordance_Locations[3] using Abilities\Weapons\VengeanceMissile\VengeanceMissile.mdl
              • Hashtable - Save Handle Of(Last created special effect) as (Key (Red Lightning Effect B + (String(K_Discordance_Iteration[3])))) of (Key (Picked unit)) in K_Discordance_Hash
              • -------- Clearing point leaks --------
              • Custom script: call RemoveLocation(udg_K_Discordance_Locations[2])
              • Custom script: call RemoveLocation(udg_K_Discordance_Locations[3])
              • -------- --------
            • Else - Actions
I've tried to use the approach that Maker did in the Lich King Spellpack with separate triggers to set parameters, detect a new instance of the spell, and create the spell effects for each caster. Some of the variable names may seem weird or be unused - sorry, I had to really overhaul the spell once already. This is my first attempt at making an MUI custom spell with any sort of effects. Here's a test map, too.
 

Attachments

  • Discordance.w3x
    37.1 KB · Views: 33
Status
Not open for further replies.
Top