• 🏆 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!

Spark of Lightning v1.1

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
Spell Description: Hero creating a ball of lightning. The ball increase size, if the ball get enough energy it explode and deals damage. While the is charging energy all nearby enemy MAX of 600 AoE will get slowed by 99%.

  • Spark of Lightning Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- ----------- --------
      • -------- Configuration --------
      • -------- ----------- --------
      • -------- Setting up the Main Ability --------
      • -------- ----------- --------
      • Set SL_ABILITY = Sparks of Lightning
      • -------- ----------- --------
      • -------- Setting up the Dummy Ability --------
      • -------- ----------- --------
      • Set SL_DUMMYABLITY = SoL Slow
      • -------- ----------- --------
      • -------- Setting up the Buffs --------
      • -------- ----------- --------
      • Set SL_BUFFS = Spark of Light
      • Set SL_DUMMYABLITY = SoL Slow
      • -------- ----------- --------
      • -------- Setting up the Damage Level 1 - 50 damage Level 2 - 100 damage Level 3 - 150 damage --------
      • -------- ----------- --------
      • Set SL_DAMAGE[1] = 50.00
      • Set SL_DAMAGE[2] = 100.00
      • Set SL_DAMAGE[3] = 150.00
      • -------- ----------- --------
      • -------- Setting up the Sparks ball --------
      • -------- ----------- --------
      • Set SL_DUMMY = Dummy
      • -------- ----------- --------
      • -------- Limit of the ball size when explode --------
      • -------- ----------- --------
      • Set SL_MAXSIZE = 600.00
      • -------- ----------- --------
      • -------- Setting up the Ball Explosion Effect --------
      • -------- ----------- --------
      • Set SL_SFX = Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
      • -------- ----------- --------
      • -------- Setting up the Exploded units effect --------
      • -------- ----------- --------
      • Set SL_SFX2 = Abilities\Spells\Human\DispelMagic\DispelMagicTarget.mdl
      • -------- ----------- --------
      • -------- Increase size of the ball per 0.03 seconds --------
      • -------- NOTE: the higher the number the faster of explosion --------
      • -------- ----------- --------
      • Set SL_SIZEUP = 6.00
      • -------- ----------- --------
      • -------- Increase AoE of the spelll per 0.03 seconds --------
      • -------- ----------- --------
      • Set SL_AOE = 6.00
      • -------- ----------- --------
      • -------- END of Configuration --------
      • -------- ----------- --------
      • -------- ----------- --------
      • -------- DONT TOUCH THIS LINE --------
      • -------- ----------- --------
      • Trigger - Add to Spark of Lightning Loop <gen> the event (Time - Every 0.03 seconds of game time)
      • -------- ----------- --------
      • -------- DONT TOUCH THIS LINE --------
      • -------- ----------- --------
  • Spark of Lightning
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to SL_ABILITY
    • Actions
      • Set SLIndexA = (SLIndexA + 1)
      • Set SLCaster[SLIndexA] = (Triggering unit)
      • Set SLCasterPoint[SLIndexA] = (Position of SLCaster[SLIndexA])
      • Set SLTempPoint[SLIndexA] = (Target point of ability being cast)
      • Unit - Create 1 SL_DUMMY for (Owner of SLCaster[SLIndexA]) at SLTempPoint[SLIndexA] facing Default building facing degrees
      • Set SLDummy[SLIndexA] = (Last created unit)
      • Set SLDummySize[SLIndexA] = 0.00
      • Set SLSpellAoE[SLIndexA] = 0.00
      • Set SLDummyMaxSize[SLIndexA] = SL_MAXSIZE
      • Set SLDummyPoint[SLIndexA] = (Position of SLDummy[SLIndexA])
      • Set SL_Multiplier = (Level of SL_ABILITY for SLCaster[SLIndexA])
      • Custom script: call RemoveLocation (udg_SLCasterPoint[udg_SLIndexA])
      • Custom script: call RemoveLocation (udg_SLDummyPoint[udg_SLIndexA])
      • Custom script: call RemoveLocation (udg_SLTempPoint[udg_SLIndexA])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SLIndexA Equal to 1
        • Then - Actions
          • Trigger - Turn on Spark of Lightning Loop <gen>
        • Else - Actions
  • Spark of Lightning Loop
    • Events
    • Conditions
    • Actions
      • For each (Integer SLIndexB) from 1 to SLIndexA, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • SLDummySize[SLIndexB] Not equal to SLDummyMaxSize[SLIndexB]
            • Then - Actions
              • Set SLDummyPoint[SLIndexB] = (Position of SLDummy[SLIndexB])
              • Set SLDummySize[SLIndexB] = (SLDummySize[SLIndexB] + SL_SIZEUP)
              • Set SLSpellAoE[SLIndexB] = (SLSpellAoE[SLIndexB] + SL_AOE)
              • Animation - Change SLDummy[SLIndexB]'s size to (SLDummySize[SLIndexB]%, SLDummySize[SLIndexB]%, SLDummySize[SLIndexB]%) of its original size
              • Set SLTargetGroup[SLIndexB] = (Units within SLSpellAoE[SLIndexB] of SLDummyPoint[SLIndexB])
              • Unit Group - Pick every unit in SLTargetGroup[SLIndexB] and do (Actions)
                • Loop - Actions
                  • Set SLTarget[SLIndexB] = (Picked unit)
                  • Set SLTargetPoint[SLIndexB] = (Position of SLTarget[SLIndexB])
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (SLTarget[SLIndexB] is A structure) Equal to False
                      • (SLTarget[SLIndexB] has buff SL_BUFFS) Equal to False
                      • (SLTarget[SLIndexB] belongs to an enemy of (Owner of SLCaster[SLIndexB])) Equal to True
                      • (Distance between SLDummyPoint[SLIndexB] and SLTargetPoint[SLIndexB]) Less than or equal to SLSpellAoE[SLIndexB]
                    • Then - Actions
                      • Unit - Add SL_DUMMYABLITY to SLDummy[SLIndexB]
                      • Unit - Order SLDummy[SLIndexB] to Neutral Pandaren Brewmaster - Drunken Haze SLTarget[SLIndexB]
                    • Else - Actions
                      • Unit Group - Add SLTarget[SLIndexB] to SLDamageGroup[SLIndexB]
                  • Custom script: call RemoveLocation (udg_SLTargetPoint[udg_SLIndexB])
              • Custom script: call DestroyGroup (udg_SLTargetGroup[udg_SLIndexB])
            • Else - Actions
              • Special Effect - Create a special effect at SLDummyPoint[SLIndexB] using SL_SFX
              • Special Effect - Destroy (Last created special effect)
              • Unit - Remove SLDummy[SLIndexB] from the game
              • Unit Group - Pick every unit in SLDamageGroup[SLIndexB] and do (Actions)
                • Loop - Actions
                  • Set SLDamageUnits[SLIndexB] = (Picked unit)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (SLDamageUnits[SLIndexB] belongs to an enemy of (Owner of SLCaster[SLIndexB])) Equal to True
                      • (SLDamageUnits[SLIndexB] is A structure) Equal to False
                    • Then - Actions
                      • Unit - Cause SLCaster[SLIndexB] to damage SLDamageUnits[SLIndexB], dealing SL_DAMAGE[SL_Multiplier] damage of attack type Spells and damage type Normal
                      • Unit - Remove SL_BUFFS buff from SLDamageUnits[SLIndexB]
                      • Special Effect - Create a special effect attached to the overhead of SLDamageUnits[SLIndexB] using SL_SFX2
                      • Special Effect - Destroy (Last created special effect)
                    • Else - Actions
              • Unit Group - Remove all units from SLDamageGroup[SLIndexB]
              • Cinematic - Fade in over 2.00 seconds using texture White Mask and color (100.00%, 100.00%, 100.00%) with 50.00% transparency
              • Custom script: call RemoveLocation (udg_SLDummyPoint[udg_SLIndexB])
              • Set SLCaster[SLIndexB] = SLCaster[SLIndexA]
              • Set SLCasterPoint[SLIndexB] = SLCasterPoint[SLIndexA]
              • Set SLDummy[SLIndexB] = SLDummy[SLIndexA]
              • Set SLDummyMaxSize[SLIndexB] = SLDummyMaxSize[SLIndexA]
              • Set SLDummyPoint[SLIndexB] = SLDummyPoint[SLIndexA]
              • Set SLDummySize[SLIndexB] = SLDummySize[SLIndexA]
              • Set SLDamageUnits[SLIndexB] = SLDamageUnits[SLIndexA]
              • Set SLDamageGroup[SLIndexB] = SLDamageGroup[SLIndexA]
              • Set SLSpellAoE[SLIndexB] = SLSpellAoE[SLIndexA]
              • Set SLTarget[SLIndexB] = SLTarget[SLIndexA]
              • Set SLTargetGroup[SLIndexB] = SLTargetGroup[SLIndexA]
              • Set SLTargetPoint[SLIndexB] = SLTargetPoint[SLIndexA]
              • Set SLTempPoint[SLIndexB] = SLTempPoint[SLIndexA]
              • Set SLIndexA = (SLIndexA - 1)
              • Set SLIndexB = (SLIndexB - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • SLIndexA Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
ChangeLog said:
V1.0 - Initial Release
V1.1 - Remove Leaks
Contents

Just another Warcraft III map (Map)

Reviews
12th Dec 2015 IcemanBo: For long time as NeedsFix. Rejected. 16:51, 2nd Feb 2015 IcemanBo: http://www.hiveworkshop.com/forums/spells-569/spark-lightning-v1-1-a-261164/#post2648137
Level 14
Joined
Oct 19, 2014
Messages
187
Ammh maybe you should not array index the Point variable
  • Set SLCasterPoint[SLIndexA] = (Position of SLCaster[SLIndexA])
  • Set SLTempPoint[SLIndexA] = (Target point of ability being cast)
=>
  • Set SLTempLoc1 = (Position of SLCaster[SLIndexA])
  • Set SLTempLoc2 = (Target point of ability being cast)
And alos this one
  • Unit Group - Pick every unit in SLTargetGroup[SLIndexB] and do (Actions)
    • Loop - Actions
      • Set SLTarget[SLIndexB] = (Picked unit)
      • Set SLTargetPoint[SLIndexB] = (Position of SLTarget[SLIndexB])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (SLTarget[SLIndexB] is A structure) Equal to False
          • (SLTarget[SLIndexB] is alive) Equal to True
          • (SLTarget[SLIndexB] belongs to an enemy of (Owner of SLCaster[SLIndexB])) Equal to True
          • (SLTarget[SLIndexB] has buff SL_BUFFS) Equal to False
          • (Distance between SLDummyPoint[SLIndexB] and SLTargetPoint[SLIndexB]) Less than or equal to SLSpellAoE[SLIndexB]
        • Then - Actions
          • Unit Group - Add SLTarget[SLIndexB] to SLDamageGroup[SLIndexB]
          • Unit - Add SL_DUMMYABLITY to SLDummy[SLIndexB]
          • Unit - Order SLDummy[SLIndexB] to Neutral Pandaren Brewmaster - Drunken Haze SLTarget[SLIndexB]
        • Else - Actions
  • Custom script: call RemoveLocation (udg_SLTargetPoint[udg_SLIndexB])
=> base in my theory the group is looping too and I thing if Custom script: call RemoveLocation (udg_SLTargetPoint[udg_SLIndexB]) is outside of group then you got lot of leak, this just my opinion
  • Unit Group - Pick every unit in SLTargetGroup[SLIndexB] and do (Actions)
    • Loop - Actions
      • Set SLTarget[SLIndexB] = (Picked unit)
      • Set SLTargetPoint[SLIndexB] = (Position of SLTarget[SLIndexB])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (SLTarget[SLIndexB] is A structure) Equal to False
          • (SLTarget[SLIndexB] is alive) Equal to True
          • (SLTarget[SLIndexB] belongs to an enemy of (Owner of SLCaster[SLIndexB])) Equal to True
          • (SLTarget[SLIndexB] has buff SL_BUFFS) Equal to False
          • (Distance between SLDummyPoint[SLIndexB] and SLTargetPoint[SLIndexB]) Less than or equal to SLSpellAoE[SLIndexB]
        • Then - Actions
          • Unit Group - Add SLTarget[SLIndexB] to SLDamageGroup[SLIndexB]
          • Unit - Add SL_DUMMYABLITY to SLDummy[SLIndexB]
          • Unit - Order SLDummy[SLIndexB] to Neutral Pandaren Brewmaster - Drunken Haze SLTarget[SLIndexB]
        • Else - Actions
      • Custom script: call RemoveLocation (udg_SLTargetPoint[udg_SLIndexB])
 
Read posts in thread. There are some good points mentioned.

Additional:

    • Set SLDummyMaxSize[SLIndexA] = 600.00
    Why is this needed if user sets a (constant) variable for it in config part?
  • Make attack- and damage type configurable.
  • onDeindex you make a unit group enumeration with a not created group.
  • onDeindex you have to null group-, units-, points [maxIndex]

Awaiting update.
 
Top