Moderator
M
Moderator
10:35, 18th Jul 2012
Magtheridon96: Approved.
4.3/5.
Have a nice day.
edit
Revised to 5/5!
Magtheridon96: Approved.
4.3/5.
Have a nice day.
edit
Revised to 5/5!
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