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

[Trigger] Need help to check these spells - Storm Spirit.

Status
Not open for further replies.
Level 14
Joined
Jun 15, 2016
Messages
749
I tested and found out some of them definitely have leaks. Show me anything solutions to fix them all over.

Source: These are from Wc3c and all abbandoned. Feel free to edit it.

I. Storm Spirit - Static Remnant
1.
  • Static Remnant
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Static Remnant
    • Actions
      • Set StaticRemnant_Counts = (StaticRemnant_Counts + 1)
      • Set StaticRemnant_Caster[StaticRemnant_Counts] = (Casting unit)
      • Set StaticRemnant_CasterLoc = (Position of StaticRemnant_Caster[StaticRemnant_Counts])
      • Set StaticRemnant_LightningEffects[StaticRemnant_Counts] = 0.00
      • Animation - Play StaticRemnant_Caster[StaticRemnant_Counts]'s spell animation
      • Special Effect - Create a special effect at StaticRemnant_CasterLoc using Abilities\Spells\Orc\LightningShield\LightningShieldTarget.mdl
      • Set StaticRemnant_SE[StaticRemnant_Counts] = (Last created special effect)
      • Unit - Create 1 Dummy (Common) for (Owner of StaticRemnant_Caster[StaticRemnant_Counts]) at StaticRemnant_CasterLoc facing (Facing of StaticRemnant_Caster[StaticRemnant_Counts]) degrees
      • Animation - Change (Last created unit)'s size to (150.00%, 150.00%, 150.00%) of its original size
      • Unit - Set the custom value of (Last created unit) to StaticRemnant_Counts
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Unit Group - Add (Last created unit) to StaticRemnant_StartGroup
      • Custom script: call RemoveLocation (udg_StaticRemnant_CasterLoc)
2.
  • Static Remnant Start
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is in StaticRemnant_StartGroup) Equal to True
    • Actions
      • Unit Group - Pick every unit in StaticRemnant_StartGroup and do (Actions)
        • Loop - Actions
          • Set StaticRemnant_CustomValue = (Custom value of (Picked unit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Dying unit) Equal to (Picked unit)
            • Then - Actions
              • Special Effect - Destroy StaticRemnant_SE[StaticRemnant_CustomValue]
              • Set StaticRemnant_Point[1] = (Position of (Picked unit))
              • Unit - Create 1 Static Remnant for (Owner of StaticRemnant_Caster[StaticRemnant_CustomValue]) at StaticRemnant_Point[1] facing (Facing of (Picked unit)) degrees
              • Animation - Change (Last created unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 30.00% transparency
              • Unit - Set the custom value of (Last created unit) to StaticRemnant_CustomValue
              • Unit Group - Add (Last created unit) to StaticRemnant_DummyGroup
              • Unit - Add a 12.00 second Generic expiration timer to (Last created unit)
              • Unit Group - Remove (Picked unit) from StaticRemnant_StartGroup
              • Trigger - Turn on Static Remnant Damage <gen>
              • Custom script: call RemoveLocation (udg_StaticRemnant_Point[1])
            • Else - Actions
3.
  • Static Remnant Damage
    • Events
      • Time - Every 0.20 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in StaticRemnant_DummyGroup and do (Actions)
        • Loop - Actions
          • Set StaticRemnant_CustomValue2 = (Custom value of (Picked unit))
          • Set StaticRemnant_Point[2] = (Position of (Picked unit))
          • Set StaticRemnant_LightningEffects[StaticRemnant_CustomValue2] = (StaticRemnant_LightningEffects[StaticRemnant_CustomValue2] + 0.20)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • StaticRemnant_LightningEffects[StaticRemnant_CustomValue2] Greater than or equal to 1.00
            • Then - Actions
              • Set StaticRemnant_LightningEffects[StaticRemnant_CustomValue2] = 0.00
              • Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Spells\Human\ManaFlare\ManaFlareBoltImpact.mdl
              • Special Effect - Destroy (Last created special effect)
            • Else - Actions
          • Set StaticRemnant_UnitGroup[1] = (Units within 235.00 of StaticRemnant_Point[2] matching (((((Matching unit) is A structure) Not equal to True) and (((Matching unit) is alive) Equal to True)) and (((Matching unit) belongs to an enemy of (Owner of StaticRemnant_Caster[StaticRemnant_CustomValu
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of units in StaticRemnant_UnitGroup[1]) Greater than 0
            • Then - Actions
              • Special Effect - Create a special effect at StaticRemnant_Point[2] using Abilities\Weapons\Bolt\BoltImpact.mdl
              • Special Effect - Destroy (Last created special effect)
              • Set StaticRemnant_Unit = (Picked unit)
              • Set StaticRemnant_UnitGroup[2] = (Units within 260.00 of StaticRemnant_Point[2] matching (((((Matching unit) is A structure) Not equal to True) and (((Matching unit) is alive) Equal to True)) and (((Matching unit) belongs to an enemy of (Owner of StaticRemnant_Caster[StaticRemnant_CustomValu
              • Unit Group - Pick every unit in StaticRemnant_UnitGroup[2] and do (Actions)
                • Loop - Actions
                  • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Weapons\Bolt\BoltImpact.mdl
                  • Special Effect - Destroy (Last created special effect)
                  • Unit - Cause StaticRemnant_Unit to damage (Picked unit), dealing (100.00 + (40.00 x (Real((Level of Static Remnant for StaticRemnant_Caster[StaticRemnant_CustomValue2]))))) damage of attack type Spells and damage type Normal
              • Unit Group - Remove (Picked unit) from StaticRemnant_DummyGroup
              • Unit - Remove (Picked unit) from the game
              • Custom script: call DestroyGroup (udg_StaticRemnant_UnitGroup[2])
            • Else - Actions
          • Custom script: call RemoveLocation (udg_StaticRemnant_Point[2])
          • Custom script: call DestroyGroup (udg_StaticRemnant_UnitGroup[1])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in StaticRemnant_DummyGroup) Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
4.
  • Static Remnant End
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is in StaticRemnant_DummyGroup) Equal to True
    • Actions
      • Unit Group - Remove (Dying unit) from StaticRemnant_DummyGroup
      • Unit - Remove (Dying unit) from the game
II. Storm Spirit - Electric Vortex
1.
  • Electric Vortex
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • ((Target unit of ability being cast) is in ElectricVortex_CheckGroup) Not equal to True
      • (Ability being cast) Equal to Electric Vortex
    • Actions
      • Set ElectricVortex_Counts = (ElectricVortex_Counts + 1)
      • Set ElectricVortex_Caster[ElectricVortex_Counts] = (Casting unit)
      • Set ElectricVortex_CasterLoc = (Position of ElectricVortex_Caster[ElectricVortex_Counts])
      • Set ElectricVortex_Target[ElectricVortex_Counts] = (Target unit of ability being cast)
      • Set ElectricVortex_Distance[1] = 100.00
      • Set ElectricVortex_Distance[2] = 150.00
      • Set ElectricVortex_Distance[3] = 200.00
      • Set ElectricVortex_Distance[4] = 250.00
      • Set ElectricVortex_DistanceMoved[ElectricVortex_Counts] = 0.00
      • Unit - Create 1 Dummy (Common) for (Owner of ElectricVortex_Caster[ElectricVortex_Counts]) at ElectricVortex_CasterLoc facing Default building facing degrees
      • Unit - Add Electric Vortex Slow to (Last created unit)
      • Unit - Order (Last created unit) to Neutral Pandaren Brewmaster - Drunken Haze ElectricVortex_Caster[ElectricVortex_Counts]
      • Unit - Add a 1.50 second Generic expiration timer to (Last created unit)
      • Unit - Create 1 Electric Vortex for (Owner of ElectricVortex_Caster[ElectricVortex_Counts]) at ElectricVortex_CasterLoc facing Default building facing degrees
      • Unit - Set level of Electric Vortex Dummy for (Last created unit) to (Level of Electric Vortex for ElectricVortex_Caster[ElectricVortex_Counts])
      • Unit - Order (Last created unit) to Human Dragonhawk Rider - Aerial Shackles ElectricVortex_Target[ElectricVortex_Counts]
      • Unit - Set the custom value of (Last created unit) to ElectricVortex_Counts
      • Unit - Turn collision for ElectricVortex_Target[ElectricVortex_Counts] Off
      • Unit Group - Add (Last created unit) to ElectricVortex_DummyGroup
      • Unit Group - Add ElectricVortex_Target[ElectricVortex_Counts] to ElectricVortex_CheckGroup
      • Unit - Remove Electric Vortex Caster buff from ElectricVortex_Target[ElectricVortex_Counts]
      • Custom script: call RemoveLocation (udg_ElectricVortex_CasterLoc)
      • Trigger - Turn on Electric Vortex Effects <gen>
2.
  • Electric Vortex Effects
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in ElectricVortex_DummyGroup and do (Actions)
        • Loop - Actions
          • Set ElectricVortex_CustomValue = (Custom value of (Picked unit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (ElectricVortex_Target[ElectricVortex_CustomValue] is alive) Equal to True
            • Then - Actions
              • Set ElectricVortex_Point[1] = (Position of ElectricVortex_Target[ElectricVortex_CustomValue])
              • Set ElectricVortex_Point[2] = (Position of (Picked unit))
              • Set ElectricVortex_Angle = (Angle from ElectricVortex_Point[1] to ElectricVortex_Point[2])
              • Set ElectricVortex_Point[3] = (ElectricVortex_Point[1] offset by 2.00 towards ElectricVortex_Angle degrees)
              • Unit - Move ElectricVortex_Target[ElectricVortex_CustomValue] instantly to ElectricVortex_Point[3]
              • Set ElectricVortex_DistanceMoved[ElectricVortex_CustomValue] = (ElectricVortex_DistanceMoved[ElectricVortex_CustomValue] + 2.00)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ElectricVortex_DistanceMoved[ElectricVortex_CustomValue] Greater than or equal to ElectricVortex_Distance[(Level of Electric Vortex for ElectricVortex_Caster[ElectricVortex_CustomValue])]
                • Then - Actions
                  • Unit - Turn collision for ElectricVortex_Target[ElectricVortex_CustomValue] On
                  • Unit Group - Remove (Picked unit) from ElectricVortex_DummyGroup
                  • Unit Group - Remove ElectricVortex_Target[ElectricVortex_CustomValue] from ElectricVortex_CheckGroup
                  • Unit - Remove (Picked unit) from the game
                • Else - Actions
              • Custom script: call RemoveLocation (udg_ElectricVortex_Point[1])
              • Custom script: call RemoveLocation (udg_ElectricVortex_Point[2])
              • Custom script: call RemoveLocation (udg_ElectricVortex_Point[3])
            • Else - Actions
              • Unit - Turn collision for ElectricVortex_Target[ElectricVortex_CustomValue] On
              • Unit Group - Remove (Picked unit) from ElectricVortex_DummyGroup
              • Unit Group - Remove ElectricVortex_Target[ElectricVortex_CustomValue] from ElectricVortex_CheckGroup
              • Unit - Remove (Picked unit) from the game
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in ElectricVortex_DummyGroup) Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
III. Storm Spirit - Ball Lightning
1.
  • Ball Lightning
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Ball Lightning
    • Actions
      • Set BallLightning_Counts = (BallLightning_Counts + 1)
      • Set BallLightning_Caster[BallLightning_Counts] = (Casting unit)
      • Unit - Set mana of BallLightning_Caster[BallLightning_Counts] to ((Mana of BallLightning_Caster[BallLightning_Counts]) - (1.00 + (0.02 x (Max mana of BallLightning_Caster[BallLightning_Counts]))))
      • Set BallLightning_CasterLoc[BallLightning_Counts] = (Position of BallLightning_Caster[BallLightning_Counts])
      • Set BallLightning_TargetPoint[BallLightning_Counts] = (Target point of ability being cast)
      • Set BallLightning_Angle[BallLightning_Counts] = (Angle from BallLightning_CasterLoc[BallLightning_Counts] to BallLightning_TargetPoint[BallLightning_Counts])
      • Set BallLightning_Levels = (Level of Ball Lightning for BallLightning_Caster[BallLightning_Counts])
      • Set BallLightning_Speed[1] = 25.00
      • Set BallLightning_Speed[2] = 37.50
      • Set BallLightning_Speed[3] = 50.00
      • Set BallLightning_SpeedMove[BallLightning_Counts] = BallLightning_Speed[BallLightning_Levels]
      • Set BallLightning_Distance[BallLightning_Counts] = (Distance between BallLightning_CasterLoc[BallLightning_Counts] and BallLightning_TargetPoint[BallLightning_Counts])
      • Set BallLightning_DistanceMoved[BallLightning_Counts] = 0.00
      • Set BallLightning_Damage[1] = 8.00
      • Set BallLightning_Damage[2] = 12.00
      • Set BallLightning_Damage[3] = 16.00
      • Set BallLightning_DamageRate[BallLightning_Counts] = BallLightning_Damage[BallLightning_Levels]
      • Set BallLightning_DamageDealt[BallLightning_Counts] = 0.00
      • Set BallLightning_DamageCount[BallLightning_Counts] = 0.00
      • Set BallLightning_AoE[1] = 150.00
      • Set BallLightning_AoE[2] = 225.00
      • Set BallLightning_AoE[3] = 300.00
      • Set BallLightning_AoEHit[BallLightning_Counts] = BallLightning_AoE[BallLightning_Levels]
      • Animation - Change BallLightning_Caster[BallLightning_Counts]'s vertex coloring to (100.00%, 100.00%, 100.00%) with 100.00% transparency
      • Unit - Create 1 Ball Lightning for (Owner of BallLightning_Caster[BallLightning_Counts]) at BallLightning_CasterLoc[BallLightning_Counts] facing BallLightning_Angle[BallLightning_Counts] degrees
      • Unit - Set the custom value of (Last created unit) to BallLightning_Counts
      • Unit Group - Add (Last created unit) to BallLightning_DummyGroup
      • Special Effect - Create a special effect attached to the origin of (Last created unit) using Static_Remnant_FX.mdx
      • Set BallLightning_SE[BallLightning_Counts] = (Last created special effect)
      • Unit - Turn collision for BallLightning_Caster[BallLightning_Counts] Off
      • Unit - Make BallLightning_Caster[BallLightning_Counts] Invulnerable
      • Lightning - Create a Forked Lightning lightning effect from source BallLightning_CasterLoc[BallLightning_Counts] to target BallLightning_CasterLoc[BallLightning_Counts]
      • Set BallLightning_Lightning[BallLightning_Counts] = (Last created lightning effect)
      • Trigger - Turn on Ball Lightning Move <gen>
2.
  • Ball Lightning Move
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in BallLightning_DummyGroup and do (Actions)
        • Loop - Actions
          • Set BallLightning_CustomValue = (Custom value of (Picked unit))
          • Set BallLightning_ManaUsed = (1.00 + (0.01 x (Max mana of BallLightning_Caster[BallLightning_CustomValue])))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Mana of BallLightning_Caster[BallLightning_CustomValue]) Greater than or equal to BallLightning_ManaUsed
            • Then - Actions
              • Set BallLightning_Point[1] = (Position of (Picked unit))
              • Set BallLightning_Point[2] = (BallLightning_Point[1] offset by BallLightning_SpeedMove[BallLightning_CustomValue] towards BallLightning_Angle[BallLightning_CustomValue] degrees)
              • Destructible - Pick every destructible within 100.00 of BallLightning_Point[2] and do (Actions)
                • Loop - Actions
                  • Destructible - Kill (Picked destructible)
              • Unit - Move (Picked unit) instantly to BallLightning_Point[2]
              • Custom script: call SetUnitX( udg_BallLightning_Caster[udg_BallLightning_CustomValue], GetLocationX( udg_BallLightning_Point[2] ) )
              • Custom script: call SetUnitY( udg_BallLightning_Caster[udg_BallLightning_CustomValue], GetLocationY( udg_BallLightning_Point[2] ) )
              • Lightning - Move BallLightning_Lightning[BallLightning_CustomValue] to source BallLightning_CasterLoc[BallLightning_Counts] and target BallLightning_Point[2]
              • Set BallLightning_DistanceMoved[BallLightning_CustomValue] = (BallLightning_DistanceMoved[BallLightning_CustomValue] + BallLightning_SpeedMove[BallLightning_CustomValue])
              • Set BallLightning_DamageCount[BallLightning_CustomValue] = (BallLightning_DamageCount[BallLightning_CustomValue] + BallLightning_SpeedMove[BallLightning_CustomValue])
              • Unit - Set mana of BallLightning_Caster[BallLightning_CustomValue] to ((Mana of BallLightning_Caster[BallLightning_CustomValue]) - (1.00 + (0.01 x (Max mana of BallLightning_Caster[BallLightning_CustomValue]))))
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • BallLightning_DamageCount[BallLightning_CustomValue] Greater than or equal to 100.00
                • Then - Actions
                  • Set BallLightning_DamageCount[BallLightning_CustomValue] = 0.00
                  • Set BallLightning_DamageDealt[BallLightning_CustomValue] = (BallLightning_DamageDealt[BallLightning_CustomValue] + BallLightning_DamageRate[BallLightning_CustomValue])
                • Else - Actions
              • Set BallLightning_UnitGroup = (Units within BallLightning_AoEHit[BallLightning_CustomValue] of BallLightning_Point[2] matching ((((Matching unit) is A structure) Not equal to True) and ((((Matching unit) is in BallLightning_HitGroup[BallLightning_CustomValue]) Not equal to True) and ((((M
              • Unit Group - Pick every unit in BallLightning_UnitGroup and do (Actions)
                • Loop - Actions
                  • Unit Group - Add (Picked unit) to BallLightning_HitGroup[BallLightning_CustomValue]
                  • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Human\ManaFlare\ManaFlareBoltImpact.mdl
                  • Special Effect - Destroy (Last created special effect)
                  • Unit - Cause BallLightning_Caster[BallLightning_CustomValue] to damage (Picked unit), dealing BallLightning_DamageDealt[BallLightning_CustomValue] damage of attack type Spells and damage type Normal
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • BallLightning_DistanceMoved[BallLightning_CustomValue] Greater than or equal to BallLightning_Distance[BallLightning_CustomValue]
                • Then - Actions
                  • Unit - Make BallLightning_Caster[BallLightning_CustomValue] Vulnerable
                  • Lightning - Destroy BallLightning_Lightning[BallLightning_CustomValue]
                  • Unit - Turn collision for BallLightning_Caster[BallLightning_CustomValue] On
                  • Animation - Change BallLightning_Caster[BallLightning_CustomValue]'s vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
                  • Unit Group - Remove (Picked unit) from BallLightning_DummyGroup
                  • Unit - Remove (Picked unit) from the game
                  • Special Effect - Destroy BallLightning_SE[BallLightning_CustomValue]
                  • Custom script: call RemoveLocation (udg_BallLightning_CasterLoc[udg_BallLightning_CustomValue])
                  • Custom script: call DestroyGroup (udg_BallLightning_HitGroup[udg_BallLightning_CustomValue])
                • Else - Actions
              • Custom script: call RemoveLocation (udg_BallLightning_Point[1])
              • Custom script: call RemoveLocation (udg_BallLightning_Point[2])
              • Custom script: call DestroyGroup (udg_BallLightning_UnitGroup)
            • Else - Actions
              • Unit - Make BallLightning_Caster[BallLightning_CustomValue] Vulnerable
              • Lightning - Destroy BallLightning_Lightning[BallLightning_CustomValue]
              • Unit - Turn collision for BallLightning_Caster[BallLightning_CustomValue] On
              • Animation - Change BallLightning_Caster[BallLightning_CustomValue]'s vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
              • Unit Group - Remove (Picked unit) from BallLightning_DummyGroup
              • Unit - Remove (Picked unit) from the game
              • Special Effect - Destroy BallLightning_SE[BallLightning_CustomValue]
              • Custom script: call RemoveLocation (udg_BallLightning_CasterLoc[udg_BallLightning_CustomValue])
              • Custom script: call DestroyGroup (udg_BallLightning_HitGroup[udg_BallLightning_CustomValue])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in BallLightning_DummyGroup) Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
IV. Storm Spirit - Overload
1.
  • Overload Start
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Overload
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Learning Hero) is in Overload_StartGroup) Not equal to True
        • Then - Actions
          • Unit Group - Add (Learning Hero) to Overload_StartGroup
        • Else - Actions
2.
  • Overload
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • ((Casting unit) is in Overload_StartGroup) Equal to True
      • Or - Any (Conditions) are true
        • Conditions
          • (Ability being cast) Equal to Ball Lightning
          • (Ability being cast) Equal to Electric Vortex
          • (Ability being cast) Equal to Static Remnant
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Casting unit) is in Overload_DamageStart) Not equal to True
        • Then - Actions
          • Unit Group - Add (Casting unit) to Overload_DamageStart
          • Set Overload_Point[1] = (Position of (Casting unit))
          • Unit - Create 1 Dummy (Common) for (Owner of (Casting unit)) at Overload_Point[1] facing Default building facing degrees
          • Unit - Add Overload Dummy to (Last created unit)
          • Unit - Order (Last created unit) to Orc Shaman - Bloodlust (Casting unit)
          • Unit - Add a 1.50 second Generic expiration timer to (Last created unit)
          • Custom script: call RemoveLocation (udg_Overload_Point[1])
        • Else - Actions
3.
  • Overload Damage Start
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Attacked unit) is A structure) Not equal to True
      • ((Attacking unit) is in Overload_DamageStart) Equal to True
      • ((Attacked unit) belongs to an enemy of (Owner of (Attacking unit))) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Attacked unit) is in Overload_DamageGroup) Not equal to True
        • Then - Actions
          • Unit Group - Add (Attacked unit) to Overload_DamageGroup
          • Trigger - Add to Overload Damage <gen> the event (Unit - (Attacked unit) Takes damage)
        • Else - Actions
4.
  • Overload Damage
    • Events
    • Conditions
      • ((Attacked unit) is in Overload_DamageGroup) Equal to True
      • ((Damage source) is in Overload_DamageStart) Equal to True
      • ((Damage source) has buff Overload ) Equal to True
    • Actions
      • Set Overload_Point[2] = (Position of (Attacked unit))
      • Special Effect - Create a special effect at Overload_Point[2] using Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • Set Overload_DamageSource = (Damage source)
      • Unit Group - Remove (Damage source) from Overload_DamageStart
      • Unit - Remove Overload buff from (Damage source)
      • Set Overload_UnitGroup = (Units within 300.00 of Overload_Point[2] matching ((((Matching unit) is A structure) Not equal to True) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of (Damage source))) Equal to True))))
      • Unit Group - Pick every unit in Overload_UnitGroup and do (Actions)
        • Loop - Actions
          • Unit - Cause Overload_DamageSource to damage (Picked unit), dealing (15.00 + (15.00 x (Real((Level of Overload for Overload_DamageSource))))) damage of attack type Spells and damage type Normal
          • Unit - Create 1 Dummy (Common) for (Owner of (Damage source)) at Overload_Point[2] facing Default building facing degrees
          • Unit - Add Overload Slow to (Last created unit)
          • Unit - Order (Last created unit) to Neutral Pandaren Brewmaster - Drunken Haze (Picked unit)
          • Unit - Add a 1.50 second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation (udg_Overload_Point[2])
      • Custom script: call DestroyGroup (udg_Overload_UnitGroup)
 
Level 14
Joined
Jun 15, 2016
Messages
749
It never resets "StaticRemnant_Counts" -> more and more data-packs are used, it should fill up old finished Indexes first to prevent this continuous growing amount of data-packs.

Same for "BallLightning_Counts" & "ElectricVortex_Counts".

Sound very dangerous. If it can not reset, that means it will keep using more and more data memory. Thank you.
 
The Number of units equal 0 is okay but i prefer Group is empty :).
The to change code is always at the end of the Code.
  • Static Remnant Damage
    • Ereignisse
    • Bedingungen
    • Aktionen
      • -------- Code --------
      • -------- ---------- --------
      • -------- ---------- --------
      • -------- Turn off --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (StaticRemnant_DummyGroup is empty) Equal True
        • Then - Actions
          • -------- Just add this Line --------
          • Set StaticRemnant_Counts = 0
          • -------- --- --------
          • Trigger - Turn off (This trigger)
        • Else - Actions
  • Electric Vortex Effects
    • Ereignisse
    • Bedingungen
    • Aktionen
      • -------- Code --------
      • -------- ---------- --------
      • -------- ---------- --------
      • -------- Turn off --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (ElectricVortex_DummyGroup is empty) Equal True
        • Then - Actions
          • -------- Just add this Line --------
          • Set ElectricVortex_Counts = 0
          • -------- --- --------
          • Trigger - Turn off (This trigger)
        • Else - Actions
  • Ball Lightning Move
    • Ereignisse
    • Bedingungen
    • Aktionen
      • -------- Code --------
      • -------- ---------- --------
      • -------- ---------- --------
      • -------- Turn off --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (BallLightning_DummyGroup is empty) Equal True
          • Then - Actions
            • -------- Just add this Line --------
            • Set BallLightning_Counts = 0
            • -------- --- --------
            • Trigger - Turn off (This trigger)
          • Else - Actions
 
Level 14
Joined
Jun 15, 2016
Messages
749
Almighty! How about this one spell? It also have Counts in trigger but does not reset it. Where can i add that line?

  • Karma Strike
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Karma Strike
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in KarmaStrike_UnitGroup) Greater than 0
        • Then - Actions
          • Unit Group - Pick every unit in KarmaStrike_UnitGroup and do (Actions)
            • Loop - Actions
              • Set KarmaStrike_CustomValue = (Custom value of (Picked unit))
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Casting unit) Equal to KarmaStrike_Caster[KarmaStrike_CustomValue]
                • Then - Actions
                  • Unit - Remove Karma Strike buff from KarmaStrike_Caster[KarmaStrike_CustomValue]
                  • Unit Group - Remove KarmaStrike_Caster[KarmaStrike_CustomValue] from KarmaStrike_CheckGroup
                  • Unit - Remove (Picked unit) from the game
                  • Unit Group - Remove (Picked unit) from KarmaStrike_UnitGroup
                • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Casting unit) is in KarmaStrike_CheckGroup) Not equal to True
        • Then - Actions
          • Set KarmaStrike_Counts = (KarmaStrike_Counts + 1)
          • Set KarmaStrike_Caster[KarmaStrike_Counts] = (Casting unit)
          • Set KarmaStrike_Target[KarmaStrike_Counts] = (Target unit of ability being cast)
          • Set KarmaStrike_Level[KarmaStrike_Counts] = (Level of Karma Strike for KarmaStrike_Caster[KarmaStrike_Counts])
          • Set KarmaStrike_DamageRate[1] = 0.20
          • Set KarmaStrike_DamageRate[2] = 0.30
          • Set KarmaStrike_DamageRate[3] = 0.40
          • Set KarmaStrike_Damage[KarmaStrike_Counts] = KarmaStrike_DamageRate[KarmaStrike_Level[KarmaStrike_Counts]]
          • Set KarmaStrike_Number[1] = 3.00
          • Set KarmaStrike_Number[2] = 4.00
          • Set KarmaStrike_Number[3] = 5.00
          • Set KarmaStrike_NumberCounts[KarmaStrike_Counts] = 0.00
          • Set KarmaStrike_CasterLoc = (Position of KarmaStrike_Caster[KarmaStrike_Counts])
          • Unit - Create 1 Dummy (Common) for (Owner of KarmaStrike_Caster[KarmaStrike_Counts]) at KarmaStrike_CasterLoc facing Default building facing degrees
          • Unit - Add Karma Strike Speed to (Last created unit)
          • Unit - Order (Last created unit) to Orc Shaman - Bloodlust KarmaStrike_Caster[KarmaStrike_Counts]
          • Unit - Set the custom value of (Last created unit) to KarmaStrike_Counts
          • Unit - Order KarmaStrike_Caster[KarmaStrike_Counts] to Attack KarmaStrike_Target[KarmaStrike_Counts]
          • Unit Group - Add (Last created unit) to KarmaStrike_UnitGroup
          • Unit Group - Add KarmaStrike_Caster[KarmaStrike_Counts] to KarmaStrike_CheckGroup
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (KarmaStrike_Target[KarmaStrike_Counts] is in KarmaStrike_DamageGroup) Not equal to True
            • Then - Actions
              • Unit Group - Add KarmaStrike_Target[KarmaStrike_Counts] to KarmaStrike_DamageGroup
              • Trigger - Add to Karma Strike Extra Damage <gen> the event (Unit - KarmaStrike_Target[KarmaStrike_Counts] Takes damage)
            • Else - Actions
          • Custom script: call RemoveLocation (udg_KarmaStrike_CasterLoc)
        • Else - Actions
  • Karma Strike Effects
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Attacking unit) has buff Karma Strike ) Equal to True
    • Actions
      • Unit Group - Pick every unit in KarmaStrike_UnitGroup and do (Actions)
        • Loop - Actions
          • Set KarmaStrike_CustomValue = (Custom value of (Picked unit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Attacking unit) Equal to KarmaStrike_Caster[KarmaStrike_CustomValue]
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (KarmaStrike_Caster[KarmaStrike_CustomValue] has buff Karma Strike ) Equal to True
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Attacked unit) Not equal to KarmaStrike_Target[KarmaStrike_CustomValue]
                    • Then - Actions
                      • Unit - Remove Karma Strike buff from KarmaStrike_Caster[KarmaStrike_CustomValue]
                      • Unit Group - Remove KarmaStrike_Caster[KarmaStrike_CustomValue] from KarmaStrike_CheckGroup
                      • Unit - Remove (Picked unit) from the game
                      • Unit Group - Remove (Picked unit) from KarmaStrike_UnitGroup
                    • Else - Actions
                • Else - Actions
                  • Unit - Remove (Picked unit) from the game
                  • Unit Group - Remove (Picked unit) from KarmaStrike_UnitGroup
                  • Unit Group - Remove KarmaStrike_Caster[KarmaStrike_CustomValue] from KarmaStrike_CheckGroup
            • Else - Actions
  • Karma Strike Extra Damage
    • Events
    • Conditions
      • ((Damage source) has buff Karma Strike ) Equal to True
    • Actions
      • Unit Group - Pick every unit in KarmaStrike_UnitGroup and do (Actions)
        • Loop - Actions
          • Set KarmaStrike_CustomValue = (Custom value of (Picked unit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Damage source) Equal to KarmaStrike_Caster[KarmaStrike_CustomValue]
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Attacked unit) Equal to KarmaStrike_Target[KarmaStrike_CustomValue]
                • Then - Actions
                  • Unit - Cause (Picked unit) to damage KarmaStrike_Target[KarmaStrike_CustomValue], dealing ((Damage taken) x KarmaStrike_Damage[KarmaStrike_CustomValue]) damage of attack type Hero and damage type Normal
                  • Floating Text - Create floating text that reads (+ + (String(((Damage taken) x KarmaStrike_Damage[KarmaStrike_CustomValue])))) above KarmaStrike_Target[KarmaStrike_CustomValue] with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
                  • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
                  • Floating Text - Change (Last created floating text): Disable suspend state
                  • Floating Text - Change (Last created floating text): Disable permanence
                  • Floating Text - Change the fading age of (Last created floating text) to 2.50 seconds
                  • Floating Text - Change the lifespan of (Last created floating text) to 3.50 seconds
                  • Set KarmaStrike_Damage[KarmaStrike_CustomValue] = (KarmaStrike_Damage[KarmaStrike_CustomValue] + 0.05)
                  • Special Effect - Create a special effect attached to the weapon of KarmaStrike_Caster[KarmaStrike_CustomValue] using Abilities\Spells\Human\HolyBolt\HolyBoltSpecialArt.mdl
                  • Special Effect - Destroy (Last created special effect)
                  • Special Effect - Create a special effect attached to the chest of KarmaStrike_Target[KarmaStrike_CustomValue] using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
                  • Special Effect - Destroy (Last created special effect)
                  • Set KarmaStrike_Point = (Position of KarmaStrike_Caster[KarmaStrike_CustomValue])
                  • Unit - Create 1 Dummy (Common) for (Owner of KarmaStrike_Caster[KarmaStrike_CustomValue]) at KarmaStrike_Point facing Default building facing degrees
                  • Unit - Add Karma Strike Stun to (Last created unit)
                  • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt KarmaStrike_Target[KarmaStrike_CustomValue]
                  • Unit - Add a 1.80 second Generic expiration timer to (Last created unit)
                  • Custom script: call RemoveLocation (udg_KarmaStrike_Point)
                  • Set KarmaStrike_NumberCounts[KarmaStrike_CustomValue] = (KarmaStrike_NumberCounts[KarmaStrike_CustomValue] + 1.00)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • KarmaStrike_NumberCounts[KarmaStrike_CustomValue] Greater than or equal to KarmaStrike_Number[KarmaStrike_Level[KarmaStrike_CustomValue]]
                    • Then - Actions
                      • Unit Group - Remove KarmaStrike_Caster[KarmaStrike_CustomValue] from KarmaStrike_CheckGroup
                      • Unit - Remove Karma Strike buff from KarmaStrike_Caster[KarmaStrike_CustomValue]
                      • Unit - Remove (Picked unit) from the game
                      • Unit Group - Remove (Picked unit) from KarmaStrike_UnitGroup
                    • Else - Actions
                • Else - Actions
            • Else - Actions
  • Karma Strike Death
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Unit Group - Pick every unit in KarmaStrike_UnitGroup and do (Actions)
        • Loop - Actions
          • Set KarmaStrike_CustomValue = (Custom value of (Picked unit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Dying unit) Equal to KarmaStrike_Target[KarmaStrike_CustomValue]
            • Then - Actions
              • Unit - Remove Karma Strike buff from KarmaStrike_Caster[KarmaStrike_CustomValue]
              • Unit Group - Remove KarmaStrike_Caster[KarmaStrike_CustomValue] from KarmaStrike_CheckGroup
              • Unit - Remove (Picked unit) from the game
              • Unit Group - Remove (Picked unit) from KarmaStrike_UnitGroup
            • Else - Actions
 
Level 10
Joined
Sep 16, 2016
Messages
269
The original author didn't reduce the counter since he didn't think there would be game which a spell is cast more than 8192 times (array limit). So do I, but if you are still paranoid about it, you can reset it when it was first set.
Instead of
  • Set Spell_Count = Spell_Count + 1
You can change it into this:
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • integer Equal to 800
    • Then - Actions
      • Set integer = 0
    • Else - Actions
      • Set integer = (integer + 1)
Off-topic: these spells are old and works in a template. In a bigger project, they should be revised by using indexing system like Unit Indexer (Bribe).
 
Status
Not open for further replies.
Top