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

Chaos Singularity V1.025

Haven't done anything for quite a while, and felt I might as well do something.

Also note that I'm a bit rusty so expect some really stupid mistakes like a point or group leak.

A lot of people (so I've heard) hold the belief that I don't know how to dynamically index things, hence why I use hashtables most of the time. This is specifically a counter to that, since I didn't use hashtables, however also made making sure the WC3 enginge didn't bust it up made some parts of dynamically indexing it much more tediuous and boring.

Eitherway enjoy the spell, (yes it uses one extra imported model other than the dummy to make it look more extra-special or whatever)


Chaos Singularity:

Creates an obelisk which calls upon the voice to summon a singularity which unleashed chaos pulses into the nearby are. The obelisk paralyses and freezes enemies in place, damaging them while the singularity unleashes chaos into the surrounding area. |n|n|cffffcc00Level 1|r - 300 Paralyse AoE, 220 damage per pulse |n|cffffcc00Level 2|r - 375 Paralyse AoE, 240 damage per pulse |n|cffffcc00Level 3|r - 450 Paralyse AoE, 260 damage per pulse



- Heavily configurable
- Very flashy sfx
- Functions rather uniquely
- Dynamically indexed
- Had importing instructions/configuring instructions



  • Chaos Singularity Configuration
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- -------- --------
      • -------- Determines the area that will be caught --------
      • Set CS_AoeBase = 225.00
      • Set CS_AoePerLevel = 75.00
      • -------- Determines the starting delay --------
      • Set CS_StartDelay = 50
      • -------- Paralyse-related Configurables --------
      • Set CS_ParalyseDamageBase = 0.20
      • Set CS_ParalyseDamagePerLevel = 0.20
      • -------- Determines how fast a unit becomes paralysed --------
      • Set CS_ParalyseCounterSpeedBase = 1
      • Set CS_ParalyseCounterSpeedPerLvl = 1
      • Set CS_ParalyseCounterMax = 250
      • -------- Determines the amount of Segments creating the lightning --------
      • Set CS_RotatingOrbCount = 5
      • Set CS_ParalysingOrbCountBase = 6
      • Set CS_ParalysingOrbCountPerLevel = 2
      • -------- Determines how fast the segments spread out --------
      • Set CS_SegmentSpreadOutSpeed = 3.00
      • -------- Determines the size of the segments --------
      • Set CS_SegmentScaling = 100.00
      • -------- Determines Lightning Colouration --------
      • Set CS_LightningRed = 0.80
      • Set CS_LightningGreen = 0.00
      • Set CS_LightningBlue = 1.00
      • -------- Determines the settings of the Singularity visually --------
      • Set CS_SingularitySpawnSize = 2.00
      • Set CS_SingularityGrowthSpeed = 1.00
      • Set CS_SingularityFinalSize = 100.00
      • Set CS_SingularitySrinkSpeed = 10.00
      • -------- Determines the damage done by the singularity --------
      • Set CS_SingularityDamageBase = 200.00
      • Set CS_SingularityDamagePerLevel = 20.00
      • -------- Determines the amount of strikes given off by the singularity before it fades --------
      • Set CS_StrikeTotal = 20
      • -------- Determines the speed of the revolving orbs --------
      • Set CS_RevolvingSpeed = 2.00
      • -------- Determines the minimum delay between chaos pulses --------
      • Set CS_ChaosGenerationRateMin = 10
      • -------- Determines the maximum delay between chaos pulses --------
      • Set CS_ChaosGenerationRateMax = 50
      • -------- Determines the height given to the rotating orbs and the singularity --------
      • Set CS_HeightIncrement = 225.00
      • -------- Determines the scaling of the spawn sfx --------
      • Set CS_EffectScalingSpawn = 200.00
      • -------- Determines the Height given to the lightning effects --------
      • Set CS_LightningZ = 100.00
      • -------- Determines the unit model used as the Singularity --------
      • Set CS_SingularityModel = war3mapImported\BlackHoleSpell.mdl
      • -------- Determines the unit model used as the Main Section --------
      • Set CS_ObelixModel = Doodads\Underground\Props\UndergroundObilisk\UndergroundObilisk.mdl
      • -------- Determines the unit model used as the Segments --------
      • Set CS_SegmentsModel = Abilities\Spells\Undead\Possession\PossessionTarget.mdl
      • -------- Determines the unit model used as the rotating orbs --------
      • Set CS_RotatingOrbsModel = Abilities\Spells\Undead\Possession\PossessionTarget.mdl
      • -------- Determines the SFX used to create create the spell --------
      • Set CS_SpawnSFX = Abilities\Spells\Undead\DarkRitual\DarkRitualTarget.mdl
      • -------- Determines the SFX used to End the spell --------
      • Set CS_DissappearenceSFX = Abilities\Spells\Undead\DarkRitual\DarkRitualTarget.mdl
      • -------- Determines the Lightning Effect used --------
      • Set CS_LightningEffect = CLPB
      • -------- Determines the spell used to act as the activation spell --------
      • Set CS_Spell = Chaos Singularity
      • -------- Determines the Dummy used to attach all the effects to --------
      • Set CS_DummyType = Chaos Singularity
  • Chaos Singularity Activation
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to CS_Spell
    • Actions
      • Set CS_TempPoint = (Target point of ability being cast)
      • Unit - Create 1 CS_DummyType for Neutral Passive at CS_TempPoint facing Default building facing degrees
      • Set CS_TempUnit = (Last created unit)
      • Special Effect - Create a special effect attached to the origin of CS_TempUnit using CS_SpawnSFX
      • Animation - Change CS_TempUnit's size to (CS_EffectScalingSpawn%, 0.00%, 0.00%) of its original size
      • Special Effect - Destroy (Last created special effect)
      • Unit - Add a 1.00 second Generic expiration timer to CS_TempUnit
      • Unit - Create 1 CS_DummyType for Neutral Passive at CS_TempPoint facing Default building facing degrees
      • Set CS_TempUnit = (Last created unit)
      • Special Effect - Create a special effect attached to the origin of CS_TempUnit using CS_ObelixModel
      • Set CS_MaxIndex = (CS_MaxIndex + 1)
      • Set CS_OriginalCaster[CS_MaxIndex] = (Triggering unit)
      • Set CS_TempInteger = (Level of CS_Spell for CS_OriginalCaster[CS_MaxIndex])
      • Set CS_TempReal = (Real(CS_TempInteger))
      • Set CS_ActiveLightning[CS_MaxIndex] = False
      • Set CS_SpecialEffect[CS_MaxIndex] = (Last created special effect)
      • Set CS_Core[CS_MaxIndex] = CS_TempUnit
      • Set CS_Aoe[CS_MaxIndex] = (CS_AoeBase + (CS_AoePerLevel x CS_TempReal))
      • Set CS_ParalyseDamage[CS_MaxIndex] = (CS_ParalyseDamageBase + (CS_ParalyseDamagePerLevel x CS_TempReal))
      • Set CS_SingularityDamage[CS_MaxIndex] = (CS_SingularityDamageBase + (CS_SingularityDamagePerLevel x CS_TempReal))
      • Set CS_SingularityLimiter[CS_MaxIndex] = False
      • Set CS_SingularityCurrentSize[CS_MaxIndex] = 0.00
      • Set CS_ParalyseCounterSpeed[CS_MaxIndex] = (CS_ParalyseCounterSpeedBase + (CS_ParalyseCounterSpeedPerLvl x CS_TempInteger))
      • Set CS_ParalyseCounterCurrent[CS_MaxIndex] = 0
      • Set CS_ChaosGenerationRateCurrent[CS_MaxIndex] = 0
      • Set CS_ChaosGenerationRateSetting[CS_MaxIndex] = 0
      • Set CS_ParalysingOrbCount[CS_MaxIndex] = (CS_ParalysingOrbCountBase + (CS_ParalysingOrbCountPerLevel x CS_TempInteger))
      • Set CS_StrikeTotalCurrent[CS_MaxIndex] = 0
      • Set CS_StasisFieldActive[CS_MaxIndex] = False
      • Set CS_CurrentDistance[CS_MaxIndex] = 0.00
      • Set CS_UnitIndex[CS_MaxIndex] = CS_TempUnit
      • Set CS_CurrentDelay[CS_MaxIndex] = 0
      • Set CS_StageID[CS_MaxIndex] = 1
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • CS_MaxIndex Equal to 1
        • Then - Actions
          • Trigger - Turn on Chaos Singularity Loop <gen>
        • Else - Actions
      • Custom script: call RemoveLocation (udg_CS_TempPoint)
  • Chaos Singularity Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer CS_Index) from 1 to CS_MaxIndex, do (Actions)
        • Loop - Actions
          • Set CS_Angle = 0.00
          • -------- Main Controls --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • CS_StageID[CS_Index] Equal to 1
            • Then - Actions
              • Set CS_CurrentDelay[CS_Index] = (CS_CurrentDelay[CS_Index] + 1)
              • -------- Stasis Field Generation --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • CS_CurrentDelay[CS_Index] Greater than or equal to CS_StartDelay
                • Then - Actions
                  • For each (Integer CS_SecondaryIndex) from 1 to CS_ParalysingOrbCount[CS_Index], do (Actions)
                    • Loop - Actions
                      • Set CS_Angle = (CS_Angle + (360.00 / (Real(CS_ParalysingOrbCount[CS_Index]))))
                      • Set CS_TempPoint = (Position of CS_UnitIndex[CS_Index])
                      • Unit - Create 1 CS_DummyType for Neutral Passive at CS_TempPoint facing CS_Angle degrees
                      • Set CS_TempUnit = (Last created unit)
                      • Animation - Change CS_TempUnit's size to (CS_SegmentScaling%, 0.00%, 0.00%) of its original size
                      • Special Effect - Create a special effect attached to the chest of CS_TempUnit using CS_SegmentsModel
                      • Set CS_MaxIndex = (CS_MaxIndex + 1)
                      • Set CS_UnitIndex[CS_MaxIndex] = CS_TempUnit
                      • Set CS_OriginalCaster[CS_MaxIndex] = CS_OriginalCaster[CS_Index]
                      • Set CS_Aoe[CS_MaxIndex] = CS_Aoe[CS_Index]
                      • Set CS_SpecialEffect[CS_MaxIndex] = (Last created special effect)
                      • Set CS_SingularityDamage[CS_MaxIndex] = CS_SingularityDamage[CS_Index]
                      • Set CS_Core[CS_MaxIndex] = CS_UnitIndex[CS_Index]
                      • Set CS_ActiveLightning[CS_MaxIndex] = False
                      • Set CS_StageID[CS_MaxIndex] = 3
                      • Set CS_CurrentDistance[CS_MaxIndex] = 0.00
                      • Set CS_ParalyseDamage[CS_MaxIndex] = 0.00
                      • Set CS_SingularityCurrentSize[CS_MaxIndex] = 0.00
                      • Set CS_ParalyseCounterSpeed[CS_MaxIndex] = 0
                      • Set CS_ParalyseCounterCurrent[CS_MaxIndex] = 0
                      • Set CS_ChaosGenerationRateCurrent[CS_MaxIndex] = 0
                      • Set CS_ChaosGenerationRateSetting[CS_MaxIndex] = 0
                      • Set CS_ParalysingOrbCount[CS_MaxIndex] = 0
                      • Set CS_StrikeTotalCurrent[CS_MaxIndex] = 0
                      • Set CS_StasisFieldActive[CS_MaxIndex] = False
                      • Set CS_SingularityLimiter[CS_MaxIndex] = False
                      • Set CS_CurrentDelay[CS_MaxIndex] = 0
                      • Custom script: call RemoveLocation (udg_CS_TempPoint)
                  • Set CS_StageID[CS_Index] = 2
                  • Set CS_StasisFieldActive[CS_Index] = True
                • Else - Actions
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • CS_StageID[CS_Index] Equal to 2
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • CS_CurrentDistance[CS_Index] Less than CS_Aoe[CS_Index]
                    • Then - Actions
                      • Set CS_CurrentDistance[CS_Index] = (CS_CurrentDistance[CS_Index] + CS_SegmentSpreadOutSpeed)
                    • Else - Actions
                      • -------- Rotating Orb Generation --------
                      • Set CS_StageID[CS_Index] = 0
                      • For each (Integer CS_SecondaryIndex) from 1 to CS_RotatingOrbCount, do (Actions)
                        • Loop - Actions
                          • Set CS_Angle = (CS_Angle + (360.00 / (Real(CS_RotatingOrbCount))))
                          • Set CS_TempPoint = (Position of CS_UnitIndex[CS_Index])
                          • Unit - Create 1 CS_DummyType for Neutral Passive at CS_TempPoint facing CS_Angle degrees
                          • Set CS_TempUnit = (Last created unit)
                          • Special Effect - Create a special effect attached to the chest of CS_TempUnit using CS_RotatingOrbsModel
                          • Unit - Add Storm Crow Form to CS_TempUnit
                          • Unit - Remove Storm Crow Form from CS_TempUnit
                          • Set CS_MaxIndex = (CS_MaxIndex + 1)
                          • Set CS_UnitIndex[CS_MaxIndex] = CS_TempUnit
                          • Set CS_Aoe[CS_MaxIndex] = CS_Aoe[CS_Index]
                          • Set CS_SpecialEffect[CS_MaxIndex] = (Last created special effect)
                          • Set CS_OriginalCaster[CS_MaxIndex] = CS_OriginalCaster[CS_Index]
                          • Set CS_ActiveLightning[CS_MaxIndex] = False
                          • Set CS_SingularityDamage[CS_MaxIndex] = CS_SingularityDamage[CS_Index]
                          • Set CS_Core[CS_MaxIndex] = CS_UnitIndex[CS_Index]
                          • Set CS_StageID[CS_MaxIndex] = 4
                          • Set CS_CurrentDistance[CS_MaxIndex] = 0.00
                          • Set CS_ParalyseDamage[CS_MaxIndex] = 0.00
                          • Set CS_SingularityCurrentSize[CS_MaxIndex] = 0.00
                          • Set CS_ParalyseCounterSpeed[CS_MaxIndex] = 0
                          • Set CS_ParalyseCounterCurrent[CS_MaxIndex] = 0
                          • Set CS_ChaosGenerationRateCurrent[CS_MaxIndex] = 0
                          • Set CS_ChaosGenerationRateSetting[CS_MaxIndex] = 0
                          • Set CS_ParalysingOrbCount[CS_MaxIndex] = 0
                          • Set CS_StrikeTotalCurrent[CS_MaxIndex] = 0
                          • Set CS_StasisFieldActive[CS_MaxIndex] = False
                          • Set CS_SingularityLimiter[CS_MaxIndex] = False
                          • Set CS_CurrentDelay[CS_MaxIndex] = 0
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • CS_SecondaryIndex Equal to CS_RotatingOrbCount
                            • Then - Actions
                              • Set CS_SingularityLimiter[CS_MaxIndex] = True
                            • Else - Actions
                          • Custom script: call RemoveLocation (udg_CS_TempPoint)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • CS_StageID[CS_Index] Equal to 3
                    • Then - Actions
                      • -------- Stasis Field Spread control --------
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • CS_CurrentDistance[CS_Index] Less than CS_Aoe[CS_Index]
                        • Then - Actions
                          • Set CS_TempUnit = CS_UnitIndex[CS_Index]
                          • Set CS_TempPoint = (Position of CS_TempUnit)
                          • Set CS_TempPoint2 = (Position of CS_Core[CS_Index])
                          • Custom script: set udg_CS_Angle = (GetUnitFacing(udg_CS_TempUnit) * bj_DEGTORAD)
                          • Custom script: set udg_CS_TempX = (GetUnitX(udg_CS_TempUnit))
                          • Custom script: set udg_CS_TempY = (GetUnitY(udg_CS_TempUnit))
                          • Custom script: set udg_CS_TempX2 = (GetUnitX(udg_CS_Core[udg_CS_Index]))
                          • Custom script: set udg_CS_TempY2 = (GetUnitY(udg_CS_Core[udg_CS_Index]))
                          • Custom script: set udg_CS_TempZ = (GetLocationZ(udg_CS_TempPoint) + udg_CS_LightningZ)
                          • Custom script: set udg_CS_TempZ2 = (GetLocationZ(udg_CS_TempPoint2) + udg_CS_LightningZ)
                          • Custom script: call SetUnitX(udg_CS_TempUnit, udg_CS_TempX + udg_CS_SegmentSpreadOutSpeed * Cos(udg_CS_Angle))
                          • Custom script: call SetUnitY(udg_CS_TempUnit, udg_CS_TempY + udg_CS_SegmentSpreadOutSpeed * Sin(udg_CS_Angle))
                          • Set CS_CurrentDistance[CS_Index] = (CS_CurrentDistance[CS_Index] + CS_SegmentSpreadOutSpeed)
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • CS_ActiveLightning[CS_Index] Equal to True
                            • Then - Actions
                              • Lightning - Destroy CS_CurrentLightningEffect[CS_Index]
                              • Set CS_ActiveLightning[CS_Index] = False
                            • Else - Actions
                          • Custom script: set udg_CS_CurrentLightningEffect[udg_CS_Index] = AddLightningEx(udg_CS_LightningEffect, true, udg_CS_TempX, udg_CS_TempY, udg_CS_TempZ, udg_CS_TempX2, udg_CS_TempY2, udg_CS_TempZ2)
                          • Lightning - Change color of CS_CurrentLightningEffect[CS_Index] to (CS_LightningRed CS_LightningGreen CS_LightningBlue) with 1.00 alpha
                          • Set CS_ActiveLightning[CS_Index] = True
                          • Custom script: call RemoveLocation(udg_CS_TempPoint2)
                          • Custom script: call RemoveLocation(udg_CS_TempPoint)
                        • Else - Actions
                    • Else - Actions
                      • -------- Rotating Orb Spread Control --------
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • CS_StageID[CS_Index] Equal to 4
                        • Then - Actions
                          • Set CS_TempUnit = CS_UnitIndex[CS_Index]
                          • Custom script: set udg_CS_Angle = (GetUnitFacing(udg_CS_TempUnit) * bj_DEGTORAD)
                          • Custom script: set udg_CS_TempX = (GetUnitX(udg_CS_TempUnit))
                          • Custom script: set udg_CS_TempY = (GetUnitY(udg_CS_TempUnit))
                          • Custom script: call SetUnitX(udg_CS_TempUnit, udg_CS_TempX + udg_CS_SegmentSpreadOutSpeed * Cos(udg_CS_Angle))
                          • Custom script: call SetUnitY(udg_CS_TempUnit, udg_CS_TempY + udg_CS_SegmentSpreadOutSpeed * Sin(udg_CS_Angle))
                          • Set CS_CurrentDistance[CS_Index] = (CS_CurrentDistance[CS_Index] + CS_SegmentSpreadOutSpeed)
                          • Animation - Change CS_UnitIndex[CS_Index] flying height to ((Current flying height of CS_UnitIndex[CS_Index]) + ((CS_CurrentDistance[CS_Index] / CS_SegmentSpreadOutSpeed) / 7.50)) at 0.00
                          • -------- Singularity Generation --------
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Current flying height of CS_UnitIndex[CS_Index]) Greater than or equal to CS_HeightIncrement
                            • Then - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • CS_SingularityLimiter[CS_Index] Equal to True
                                • Then - Actions
                                  • Set CS_TempPoint = (Position of CS_Core[CS_Index])
                                  • Unit - Create 1 CS_DummyType for Neutral Passive at CS_TempPoint facing CS_Angle degrees
                                  • Set CS_TempUnit = (Last created unit)
                                  • Special Effect - Create a special effect attached to the chest of CS_TempUnit using CS_SingularityModel
                                  • Animation - Change CS_TempUnit's size to (CS_SingularitySpawnSize%, 0.00%, 0.00%) of its original size
                                  • Set CS_MaxIndex = (CS_MaxIndex + 1)
                                  • Set CS_UnitIndex[CS_MaxIndex] = CS_TempUnit
                                  • Set CS_Aoe[CS_MaxIndex] = CS_Aoe[CS_Index]
                                  • Set CS_ActiveLightning[CS_MaxIndex] = False
                                  • Set CS_SpecialEffect[CS_MaxIndex] = (Last created special effect)
                                  • Set CS_SingularityDamage[CS_MaxIndex] = CS_SingularityDamage[CS_Index]
                                  • Set CS_OriginalCaster[CS_MaxIndex] = CS_OriginalCaster[CS_Index]
                                  • Set CS_Core[CS_MaxIndex] = CS_Core[CS_Index]
                                  • Set CS_SingularityCurrentSize[CS_MaxIndex] = CS_SingularitySpawnSize
                                  • Set CS_StrikeTotalCurrent[CS_MaxIndex] = 0
                                  • Set CS_StageID[CS_MaxIndex] = 6
                                  • Set CS_ChaosGenerationRateCurrent[CS_MaxIndex] = 0
                                  • Set CS_ChaosGenerationRateSetting[CS_MaxIndex] = (Random integer number between CS_ChaosGenerationRateMin and CS_ChaosGenerationRateMax)
                                  • Set CS_ParalyseDamage[CS_MaxIndex] = 0.00
                                  • Set CS_ParalyseCounterSpeed[CS_MaxIndex] = 0
                                  • Set CS_ParalyseCounterCurrent[CS_MaxIndex] = 0
                                  • Set CS_ParalysingOrbCount[CS_MaxIndex] = 0
                                  • Set CS_StasisFieldActive[CS_MaxIndex] = False
                                  • Set CS_SingularityLimiter[CS_MaxIndex] = False
                                  • Set CS_CurrentDistance[CS_MaxIndex] = 0.00
                                  • Set CS_CurrentDelay[CS_MaxIndex] = 0
                                  • Custom script: call RemoveLocation (udg_CS_TempPoint)
                                  • Set CS_SingularityLimiter[CS_Index] = False
                                • Else - Actions
                              • Set CS_StageID[CS_Index] = 5
                            • Else - Actions
                        • Else - Actions
                          • -------- Rotating Orb Spin Control --------
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • CS_StageID[CS_Index] Equal to 5
                            • Then - Actions
                              • Set CS_TempUnit = CS_UnitIndex[CS_Index]
                              • Set CS_TempPoint = (Position of CS_Core[CS_Index])
                              • Set CS_TempPoint2 = (Position of CS_TempUnit)
                              • Custom script: set udg_CS_TempX = (GetUnitX(udg_CS_Core[udg_CS_Index]))
                              • Custom script: set udg_CS_TempY = (GetUnitY(udg_CS_Core[udg_CS_Index]))
                              • Custom script: set udg_CS_TempX2 = (GetUnitX(udg_CS_TempUnit))
                              • Custom script: set udg_CS_TempY2 = (GetUnitY(udg_CS_TempUnit))
                              • Custom script: set udg_CS_TempZ = (GetLocationZ(udg_CS_TempPoint) + udg_CS_HeightIncrement * 2)
                              • Custom script: set udg_CS_TempZ2 = (GetLocationZ(udg_CS_TempPoint2) + GetUnitFlyHeight(udg_CS_TempUnit) + udg_CS_LightningZ)
                              • Custom script: set udg_CS_Angle = (GetUnitFacing(udg_CS_TempUnit)* bj_DEGTORAD)
                              • Custom script: call SetUnitFacing(udg_CS_TempUnit, GetUnitFacing(udg_CS_TempUnit) + udg_CS_RevolvingSpeed)
                              • Custom script: call SetUnitX(udg_CS_TempUnit, udg_CS_TempX + udg_CS_CurrentDistance[udg_CS_Index] * Cos(udg_CS_Angle))
                              • Custom script: call SetUnitY(udg_CS_TempUnit, udg_CS_TempY + udg_CS_CurrentDistance[udg_CS_Index] * Sin(udg_CS_Angle))
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • CS_ActiveLightning[CS_Index] Equal to True
                                • Then - Actions
                                  • Lightning - Destroy CS_CurrentLightningEffect[CS_Index]
                                  • Set CS_ActiveLightning[CS_Index] = False
                                • Else - Actions
                              • Custom script: set udg_CS_CurrentLightningEffect[udg_CS_Index] = AddLightningEx(udg_CS_LightningEffect, true, udg_CS_TempX, udg_CS_TempY, udg_CS_TempZ, udg_CS_TempX2, udg_CS_TempY2, udg_CS_TempZ2)
                              • Lightning - Change color of CS_CurrentLightningEffect[CS_Index] to (CS_LightningRed CS_LightningGreen CS_LightningBlue) with 1.00 alpha
                              • Set CS_ActiveLightning[CS_Index] = True
                              • Custom script: call RemoveLocation(udg_CS_TempPoint2)
                              • Custom script: call RemoveLocation(udg_CS_TempPoint)
                            • Else - Actions
                              • -------- Singularity Control --------
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • CS_StageID[CS_Index] Equal to 6
                                • Then - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • CS_StrikeTotalCurrent[CS_Index] Less than CS_StrikeTotal
                                    • Then - Actions
                                      • -------- Singularity Growth/Attack --------
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • CS_SingularityCurrentSize[CS_Index] Less than CS_SingularityFinalSize
                                        • Then - Actions
                                          • Set CS_SingularityCurrentSize[CS_Index] = (CS_SingularityCurrentSize[CS_Index] + CS_SingularityGrowthSpeed)
                                          • Animation - Change CS_UnitIndex[CS_Index]'s size to (CS_SingularityCurrentSize[CS_Index]%, 0.00%, 0.00%) of its original size
                                        • Else - Actions
                                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            • If - Conditions
                                              • CS_ChaosGenerationRateCurrent[CS_Index] Greater than or equal to CS_ChaosGenerationRateSetting[CS_Index]
                                            • Then - Actions
                                              • Set CS_StrikeTotalCurrent[CS_Index] = (CS_StrikeTotalCurrent[CS_Index] + 1)
                                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                • If - Conditions
                                                  • CS_ActiveLightning[CS_Index] Equal to True
                                                • Then - Actions
                                                  • Lightning - Destroy CS_CurrentLightningEffect[CS_Index]
                                                  • Set CS_ActiveLightning[CS_Index] = False
                                                • Else - Actions
                                              • Set CS_ChaosGenerationRateCurrent[CS_Index] = 0
                                              • Set CS_ChaosGenerationRateSetting[CS_Index] = (Random integer number between CS_ChaosGenerationRateMin and CS_ChaosGenerationRateMax)
                                              • Set CS_TempPoint = (Position of CS_Core[CS_Index])
                                              • Set CS_TempGroup = (Units within CS_Aoe[CS_Index] of CS_TempPoint)
                                              • Unit Group - Pick every unit in CS_TempGroup and do (Actions)
                                                • Loop - Actions
                                                  • Set CS_TempUnit = (Picked unit)
                                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                    • If - Conditions
                                                      • (CS_TempUnit is A structure) Equal to False
                                                      • (CS_TempUnit is alive) Equal to True
                                                      • (CS_TempUnit is A ground unit) Equal to True
                                                      • (CS_TempUnit is Magic Immune) Equal to False
                                                      • (CS_TempUnit belongs to an enemy of (Owner of CS_OriginalCaster[CS_Index])) Equal to True
                                                    • Then - Actions
                                                      • Unit Group - Add CS_TempUnit to CS_Targets
                                                    • Else - Actions
                                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                • If - Conditions
                                                  • (Number of units in CS_Targets) Greater than 0
                                                • Then - Actions
                                                  • Set CS_TempUnit = (Random unit from CS_Targets)
                                                  • Set CS_TempPoint = (Position of CS_Core[CS_Index])
                                                  • Set CS_TempPoint2 = (Position of CS_TempUnit)
                                                  • Unit - Cause CS_OriginalCaster[CS_Index] to damage CS_TempUnit, dealing CS_SingularityDamage[CS_Index] damage of attack type Spells and damage type Normal
                                                  • Custom script: set udg_CS_TempX = (GetUnitX(udg_CS_Core[udg_CS_Index]))
                                                  • Custom script: set udg_CS_TempY = (GetUnitY(udg_CS_Core[udg_CS_Index]))
                                                  • Custom script: set udg_CS_TempX2 = (GetUnitX(udg_CS_TempUnit))
                                                  • Custom script: set udg_CS_TempY2 = (GetUnitY(udg_CS_TempUnit))
                                                  • Custom script: set udg_CS_TempZ = (GetLocationZ(udg_CS_TempPoint) + udg_CS_HeightIncrement * 2)
                                                  • Custom script: set udg_CS_TempZ2 = (GetLocationZ(udg_CS_TempPoint2) + udg_CS_LightningZ)
                                                  • Custom script: set udg_CS_CurrentLightningEffect[udg_CS_Index] = AddLightningEx(udg_CS_LightningEffect, true, udg_CS_TempX2, udg_CS_TempY2, udg_CS_TempZ2, udg_CS_TempX, udg_CS_TempY, udg_CS_TempZ)
                                                  • Lightning - Change color of CS_CurrentLightningEffect[CS_Index] to (CS_LightningRed CS_LightningGreen CS_LightningBlue) with 1.00 alpha
                                                  • Set CS_ActiveLightning[CS_Index] = True
                                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                    • If - Conditions
                                                      • (CS_TempUnit is dead) Equal to True
                                                    • Then - Actions
                                                      • Animation - Change CS_TempUnit's animation speed to 100.00% of its original speed
                                                      • Unit - Unpause CS_TempUnit
                                                    • Else - Actions
                                                  • Custom script: call RemoveLocation(udg_CS_TempPoint2)
                                                  • Custom script: call RemoveLocation(udg_CS_TempPoint)
                                                • Else - Actions
                                              • Unit Group - Remove all units from CS_Targets
                                              • Custom script: call DestroyGroup (udg_CS_TempGroup)
                                              • Custom script: call RemoveLocation (udg_CS_TempPoint)
                                            • Else - Actions
                                              • Set CS_ChaosGenerationRateCurrent[CS_Index] = (CS_ChaosGenerationRateCurrent[CS_Index] + 1)
                                    • Else - Actions
                                      • -------- Singularity Shrink --------
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • CS_SingularityCurrentSize[CS_Index] Greater than CS_SingularitySpawnSize
                                        • Then - Actions
                                          • Set CS_SingularityCurrentSize[CS_Index] = (CS_SingularityCurrentSize[CS_Index] - CS_SingularitySrinkSpeed)
                                          • Animation - Change CS_UnitIndex[CS_Index]'s size to (CS_SingularityCurrentSize[CS_Index]%, 0.00%, 0.00%) of its original size
                                        • Else - Actions
                                          • -------- Spell Cleanup --------
                                          • Set CS_TempPoint = (Position of CS_Core[CS_Index])
                                          • Set CS_TempGroup = (Units within (CS_Aoe[CS_Index] + 100.00) of CS_TempPoint)
                                          • Unit Group - Pick every unit in CS_TempGroup and do (Actions)
                                            • Loop - Actions
                                              • Set CS_TempUnit = (Picked unit)
                                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                • If - Conditions
                                                  • (CS_TempUnit is A structure) Equal to False
                                                  • (CS_TempUnit is alive) Equal to True
                                                  • (CS_TempUnit is A ground unit) Equal to True
                                                  • (CS_TempUnit is Magic Immune) Equal to False
                                                  • (CS_TempUnit belongs to an enemy of (Owner of CS_OriginalCaster[CS_Index])) Equal to True
                                                • Then - Actions
                                                  • Unit - Unpause CS_TempUnit
                                                  • Animation - Change CS_TempUnit's animation speed to 100.00% of its original speed
                                                • Else - Actions
                                          • Custom script: call DestroyGroup (udg_CS_TempGroup)
                                          • Custom script: call RemoveLocation (udg_CS_TempPoint)
                                          • Set CS_UnitIDStorage = CS_Core[CS_Index]
                                          • For each (Integer CS_SecondaryIndex) from 1 to CS_MaxIndex, do (Actions)
                                            • Loop - Actions
                                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                • If - Conditions
                                                  • CS_Core[CS_SecondaryIndex] Equal to CS_UnitIDStorage
                                                • Then - Actions
                                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                    • If - Conditions
                                                      • CS_ActiveLightning[CS_SecondaryIndex] Equal to True
                                                    • Then - Actions
                                                      • Lightning - Destroy CS_CurrentLightningEffect[CS_SecondaryIndex]
                                                      • Set CS_ActiveLightning[CS_SecondaryIndex] = False
                                                    • Else - Actions
                                                  • Special Effect - Destroy CS_SpecialEffect[CS_SecondaryIndex]
                                                  • Special Effect - Create a special effect attached to the chest of CS_UnitIndex[CS_SecondaryIndex] using CS_DissappearenceSFX
                                                  • Special Effect - Destroy (Last created special effect)
                                                  • Unit - Add a 0.80 second Generic expiration timer to CS_UnitIndex[CS_SecondaryIndex]
                                                  • Set CS_Aoe[CS_SecondaryIndex] = CS_Aoe[CS_MaxIndex]
                                                  • Set CS_ActiveLightning[CS_SecondaryIndex] = CS_ActiveLightning[CS_MaxIndex]
                                                  • Set CS_OriginalCaster[CS_SecondaryIndex] = CS_OriginalCaster[CS_MaxIndex]
                                                  • Set CS_StageID[CS_SecondaryIndex] = CS_StageID[CS_MaxIndex]
                                                  • Set CS_SingularityCurrentSize[CS_SecondaryIndex] = CS_SingularityCurrentSize[CS_MaxIndex]
                                                  • Set CS_SingularityDamage[CS_SecondaryIndex] = CS_SingularityDamage[CS_MaxIndex]
                                                  • Set CS_SpecialEffect[CS_SecondaryIndex] = CS_SpecialEffect[CS_MaxIndex]
                                                  • Set CS_SingularityLimiter[CS_SecondaryIndex] = CS_SingularityLimiter[CS_MaxIndex]
                                                  • Set CS_StrikeTotalCurrent[CS_SecondaryIndex] = CS_StrikeTotalCurrent[CS_MaxIndex]
                                                  • Set CS_StasisFieldActive[CS_SecondaryIndex] = CS_StasisFieldActive[CS_MaxIndex]
                                                  • Set CS_ParalyseCounterCurrent[CS_SecondaryIndex] = CS_ParalyseCounterCurrent[CS_MaxIndex]
                                                  • Set CS_ParalyseDamage[CS_SecondaryIndex] = CS_ParalyseDamage[CS_MaxIndex]
                                                  • Set CS_ParalyseCounterSpeed[CS_SecondaryIndex] = CS_ParalyseCounterSpeed[CS_MaxIndex]
                                                  • Set CS_ParalysingOrbCount[CS_SecondaryIndex] = CS_ParalysingOrbCount[CS_MaxIndex]
                                                  • Set CS_ChaosGenerationRateCurrent[CS_SecondaryIndex] = CS_ChaosGenerationRateCurrent[CS_MaxIndex]
                                                  • Set CS_ChaosGenerationRateSetting[CS_SecondaryIndex] = CS_ChaosGenerationRateSetting[CS_MaxIndex]
                                                  • Set CS_CurrentDistance[CS_SecondaryIndex] = CS_CurrentDistance[CS_MaxIndex]
                                                  • Set CS_CurrentLightningEffect[CS_SecondaryIndex] = CS_CurrentLightningEffect[CS_MaxIndex]
                                                  • Set CS_CurrentDelay[CS_SecondaryIndex] = CS_CurrentDelay[CS_MaxIndex]
                                                  • Set CS_Core[CS_SecondaryIndex] = CS_Core[CS_MaxIndex]
                                                  • Set CS_UnitIndex[CS_SecondaryIndex] = CS_UnitIndex[CS_MaxIndex]
                                                  • Set CS_MaxIndex = (CS_MaxIndex - 1)
                                                  • Set CS_SecondaryIndex = (CS_SecondaryIndex - 1)
                                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                    • If - Conditions
                                                      • CS_MaxIndex Equal to 0
                                                    • Then - Actions
                                                      • Trigger - Turn off (This trigger)
                                                    • Else - Actions
                                                • Else - Actions
                                • Else - Actions
          • -------- Stasis Field Control --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • CS_StasisFieldActive[CS_Index] Equal to True
            • Then - Actions
              • Set CS_TempPoint = (Position of CS_UnitIndex[CS_Index])
              • Set CS_TempGroup = (Units within CS_CurrentDistance[CS_Index] of CS_TempPoint)
              • Unit Group - Pick every unit in CS_TempGroup and do (Actions)
                • Loop - Actions
                  • Set CS_TempUnit = (Picked unit)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (CS_TempUnit is A structure) Equal to False
                      • (CS_TempUnit is Magic Immune) Equal to False
                      • (CS_TempUnit is alive) Equal to True
                      • (CS_TempUnit is A ground unit) Equal to True
                      • (CS_TempUnit belongs to an enemy of (Owner of CS_OriginalCaster[CS_Index])) Equal to True
                    • Then - Actions
                      • Unit - Cause CS_OriginalCaster[CS_Index] to damage CS_TempUnit, dealing CS_ParalyseDamage[CS_Index] damage of attack type Spells and damage type Normal
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • CS_ParalyseCounterCurrent[CS_Index] Greater than or equal to CS_ParalyseCounterMax
                        • Then - Actions
                          • Animation - Change CS_TempUnit's animation speed to 0.00% of its original speed
                          • Unit - Pause CS_TempUnit
                          • Set CS_ParalyseCounterCurrent[CS_Index] = 0
                        • Else - Actions
                          • Set CS_ParalyseCounterCurrent[CS_Index] = (CS_ParalyseCounterCurrent[CS_Index] + CS_ParalyseCounterSpeed[CS_Index])
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (CS_TempUnit is dead) Equal to True
                        • Then - Actions
                          • Animation - Change CS_TempUnit's animation speed to 100.00% of its original speed
                          • Unit - Unpause CS_TempUnit
                        • Else - Actions
                    • Else - Actions
              • Custom script: call DestroyGroup (udg_CS_TempGroup)
              • Custom script: call RemoveLocation (udg_CS_TempPoint)
            • Else - Actions
  • Chaos Singularity Cleanup
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set CS_TempUnit = (Triggering unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of CS_TempUnit) Equal to CS_DummyType
        • Then - Actions
          • Unit - Remove CS_TempUnit from the game
        • Else - Actions



-=V1.00=-
- Initial upload
- Expect errors
-=V1.01=-
- Modified Lightning Z calculations
- Modified Dummy slightly
- Removed any graphical errors occuring when near trees or on increased terrain height
-=V1.02=-
- Modified scaling of SFX
- Moved the variable setting in the Init of the spell to avoid second calling of Triggering unit
- Corrected a Z Calculation causing lightning to not appear part of the spell (attacking lightning)
-=V1.025=-
- Special effect leaks removed
- Slightly changed Activation to remove double reference to "level of (ability) for (unit)"
-=NullUpdate=-
- Added More Comments to the script (no other changes)

The spell is recommended for use as an ultimate (just so you know)
Enjoy the spell, And remember to give credits to me if you use this spell

Additional credits to Mc ! for the Black Hole model used in this spell (yes it's necessary)

Keywords:
Chaos, Oblivion, Singularity, Portal, Electric, Paralyse, Paralyze, Paralitical, Pulse, Shock, Summon, Obelisk, Ultimate.
Contents

Chaos Singularity (Map)

Reviews
10:35, 18th Jul 2012 Magtheridon96: Approved. 4.3/5. Have a nice day. edit Revised to 5/5!

Moderator

M

Moderator

10:35, 18th Jul 2012
Magtheridon96: Approved.
4.3/5.

Have a nice day.

edit
Revised to 5/5!
 
Well, I could move onto Jass, could've done ages ago, But I like to stick with the vanilla world editor - hence GUI since it doesn't have proper coding support for JASS. Also that I like the UI it gives and more people understand Gui than Jass.

Oh, and I make these as intellectual challenges as opposed to other things, hence why everything I make is in GUI :3
 
ann yeah, i'ver mark "automatically create unknown variables while..." and copy the trigger folder D:!

It also says though (in the order of import section) to import the models, then the object data, then to create 2 TempX, 2 TempY and 2 TempZ variables with the suffix "CS_" e.g. CS_TempX, CS_TempX2, CS_TempY, etc.

Kam said:
Really great spell. I would give the obelisk doodad a fancy death effect though, right now it outlasts the spell and then just disappears.

Yeah, I wanted to, but I didn't know the effect length (in seconds) of the ending sfx, if I did then yeah I could make it work.
 
wouldn't really work - I use the obelisk as a "core" to the spell, and use it to find every associated "part" to a single spell, removing it early in the spell could be very problematic to then sort out a new indentifyer which all parts link to, or atleast rather aggrovating, Although changing the "disappear sfx" to something longer would also work to hide it. I suppose I could team colour the obelisk, but I don't know what difference it'd really make.
 
Level 4
Joined
Jun 3, 2012
Messages
92
It also says though (in the order of import section) to import the models, then the object data, then to create 2 TempX, 2 TempY and 2 TempZ variables with the suffix "CS_" e.g. CS_TempX, CS_TempX2, CS_TempY, etc.


oh yap, i do this, and don't receive more error message, but when the spell are activate, just dont' show the "spell", the icon of the spell stay in cooldown, but the spell don't has effect D:! In spells jass we must change the Raw code, in spells in GUI too? D:! it's the second spell with this problem when i try import a spell to my map T.T

Sorry my bad english! >.<
 
oh yap, i do this, and don't receive more error message, but when the spell are activate, just dont' show the "spell", the icon of the spell stay in cooldown, but the spell don't has effect D:! In spells jass we must change the Raw code, in spells in GUI too? D:! it's the second spell with this problem when i try import a spell to my map T.T

Sorry my bad english! >.<

Have you checked the configuration trigger for the activation spell? (CS_Spell = Spell Name) It's possible and even likely that it wouldn't work if you imported the triggers before importing the object data (like dummies, the actual spell) if this is the case, then I'd also try checking out CS_DummyType, either or both of those might be blank (hence the spell not activating) other than that, I couldn't help with your importing problems.
 
Level 4
Joined
Jun 3, 2012
Messages
92
hmm, i checked some things, now the effect appears, but don't cause damage and don't show the lightning effects and the black hole, just the obelisc. :\

*edit* Ahhh the spell is amazing! Perfect to my hero!
 
You have triggering unit in a variable and yet:

  • Set CS_ParalyseCounterSpeed[CS_MaxIndex] = (CS_ParalyseCounterSpeedBase + (CS_ParalyseCounterSpeedPerLvl x (Level of CS_Spell for (Triggering unit))))
  • Set CS_ParalysingOrbCount[CS_MaxIndex] = (CS_ParalysingOrbCountBase + (CS_ParalysingOrbCountPerLevel x (Level of CS_Spell for (Triggering unit))))
D:<

edit
Oh wait, I can't believe I missed all those special effect leaks o.o
Damn, I should really start taking my time when I'm doing this.

Yeah, those effects leak. Store them into variables and destroy them when you want to end the spell.
 
Okay, I wrote down the Leak test code:

JASS:
library test initializer init
    
    
    globals
        private hashtable ht = InitHashtable()
        private integer effectCount = 0
    endglobals
    
    function ASE_h takes string n, real x, real y returns effect
        set effectCount = effectCount + 1
        return null
    endfunction
    
    function ASEL_h takes string n, location loc returns effect
        set effectCount = effectCount + 1
        return null
    endfunction
    
    function ASELBJ_h takes location loc, string n returns effect
        set effectCount = effectCount + 1
        return null
    endfunction
    
    function ASET_h takes string n, widget w, string a returns effect
        set effectCount = effectCount + 1
        return null
    endfunction
    
    function ASETUBJ_h takes string n, widget w, string a returns effect
        set effectCount = effectCount + 1
        return null
    endfunction
    
    function de takes effect e returns nothing
        if LoadInteger(ht, GetHandleId(e), 0) != 1 then
            set effectCount = effectCount - 1
            call SaveInteger(ht, GetHandleId(e), 0, 1)
        endif
    endfunction
    
    hook AddSpecialEffect ASE_h
    hook AddSpecialEffectLoc ASEL_h
    hook AddSpecialEffectLocBJ ASELBJ_h
    hook AddSpecialEffectTarget ASET_h
    hook AddSpecialEffectTargetUnitBJ ASETUBJ_h
    
    hook DestroyEffect de
    hook DestroyEffectBJ de
    
    function display takes nothing returns boolean
        call BJDebugMsg(I2S(effectCount))
        return false
    endfunction
    
    function init takes nothing returns nothing
        local trigger t = CreateTrigger()
        call TriggerRegisterPlayerChatEvent(t, Player(0), "-", true)
        call TriggerAddCondition(t, Condition(function display))
        set t = null
    endfunction
endlibrary

Now to test this sucker ;D

edit
According to this test, you're leaking 1 special effect.
Just one.

edit
I may be wrong though, the handle id might've been recycled or something.
 
Level 2
Joined
Jan 26, 2012
Messages
26
umm i followed your instructions but when i use the spell only the purple lightning appears, no black hole or the obelisk, can you help me please?
 
Level 3
Joined
May 2, 2020
Messages
14
This looks absolutely beautiful. I love how the Parasite sound is produced by models instead of being played explicitly, and how both models and sounds fit together. Also, I like that units are attempting to flee when the singularity expands (it's a shame they return fearlessly though).

There's a small issue with your hotkey, "H" is already used by "Hold Position", so it is impossible to cast this spell using a keyboard.
 
Top