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

Star Shower v1.06

  • Like
Reactions: Oljin and Catch_ya
Calls down shooting stars from the sky which appear at a random place and moving in a circle down to the earth. When they impact on the ground they deal damage to enemy units and set them in flames.

Triggers :

  • Star Shower Base
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Star Shower
    • Actions
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- If the number of current running inctances of this spell equal 0 then the star shower loop trigger will turned on. --------
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • StSh_IndexSize Equal to 0
        • Then - Actions
          • Trigger - Turn on Star Shower loop <gen>
        • Else - Actions
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- Increase the index size(number of current running spells). --------
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
      • Set StSh_IndexSize = (StSh_IndexSize + 1)
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- Dynamic Index --------
      • -------- Dynamic index system reduces the index size by 1 when a spell(or instance) ends to reduce lagg. --------
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • StSh_IndexSize Greater than StSh_Index_MAX
        • Then - Actions
          • Set StSh_Index[StSh_IndexSize] = StSh_IndexSize
          • Set StSh_Index_MAX = StSh_IndexSize
        • Else - Actions
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- Dynamic Index End --------
      • -------- Converting the StSh_Index to StSh_Tempint to make it easier to understand and read. --------
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
      • Set StSh_TempInt = StSh_Index[StSh_IndexSize]
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- Now we have the right index number for this instance of the spell so we can set up the variables which belong to this index number. --------
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- Well this is the target location on which the spell is cast. It is important to determine where the action takes place. --------
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
      • Set StSh_SpellTargetLoc[StSh_TempInt] = (Target point of ability being cast)
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- The caster of this spell. --------
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
      • Set StSh_caster[StSh_TempInt] = (Triggering unit)
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- Level of Star Shower for the caster. --------
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
      • Set StSh_Level[StSh_TempInt] = (Level of Star Shower for StSh_caster[StSh_TempInt])
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- Here we create a unit which can use harvest to check later if we destroy a tree or a destructable like a bridge. Because we want only trees to get destroyed we use this harvester. --------
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • StSh_Tree_checker Equal to No unit
        • Then - Actions
          • Set StSh_StarTargetTempLoc = (Point(0.00, 0.00))
          • Unit - Create 1 Arbeiter for Neutral Passive at StSh_StarTargetTempLoc facing Default building facing (270.0) degrees
          • Custom script: call RemoveLocation( udg_StSh_StarTargetTempLoc)
          • Set StSh_Tree_checker = (Last created unit)
          • Unit - Make (Last created unit) Invulnerable
          • Unit - Hide (Last created unit)
        • Else - Actions
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- -------------------------------GLOBALS// CHANGEABLE VARIABLES------------------------------- --------
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- This boolean regulates if a DoT(Damage over time) is added to the damaged units or not. --------
      • Set StSh_DoTBoolean = True
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- If the DoT option is enabled weset up the variables for the DoT. --------
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- -------------------------------DoT OPTIONS------------------------------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • StSh_DoTBoolean Equal to True
        • Then - Actions
          • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
          • -------- This is the Damage over time which suffers a unit, after been hitted by a shooting star, every 0.03 seconds. --------
          • Set StSh_DoTDamageValue[StSh_TempInt] = ((Real(StSh_Level[StSh_TempInt])) x ((Real((Intelligence of StSh_caster[StSh_TempInt] (Include bonuses)))) x 0.01))
          • -------- If the damage is too low because your hero is lvl 1 for example it will automatically be 1. --------
          • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • StSh_DoTDamageValue[StSh_TempInt] Less than or equal to 1.00
            • Then - Actions
              • Set StSh_DoTDamageValue[StSh_TempInt] = 1.00
            • Else - Actions
          • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
          • -------- The time a unit burns after hit by a shooting star. This number stacks, which means if a unit burns still 0.4 and then gets hit it will burn 0.9 usw. --------
          • Set StSh_DoT_Time = 0.50
          • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
          • -------- This effect appear on the burning units. --------
          • Set StSh_EffectVar[4] = Environment\LargeBuildingFire\LargeBuildingFire1.mdl
          • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
        • Else - Actions
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- -------------------------------GENERAL SPELL OPTIONS------------------------------- --------
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- Here we determine the damage which inflicts a star to the surrounding enemy units when he hits the ground. --------
      • Set StSh_DamageValue[StSh_TempInt] = ((Real(StSh_Level[StSh_TempInt])) x ((Real((Intelligence of StSh_caster[StSh_TempInt] (Include bonuses)))) x 0.50))
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- The area in which the units gets damaged when a star hits the ground. --------
      • Set StSh_ImpactAoE = 250.00
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- This Changes the Chance to spawn a star every 0.03 seconds in the Star Shower loop. Change the 8 to what ever you want. --------
      • Set StSh_StarChance[StSh_TempInt] = (6 x StSh_Level[StSh_TempInt])
      • -------- The number will be multiplied with the Level of the Skill so for example 8*Level 3= 24% to create a star every 0.03 seconds. --------
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- With this variable you can change in which range the falling stars will spawn. --------
      • Set StSh_Area[StSh_TempInt] = (100.00 + (100.00 x (Real(StSh_Level[StSh_TempInt]))))
      • -------- The number here is the limit where a star spawns, that means between 0 and this number away from the target spell point. --------
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- This number is for the radius of the circle in which the stars fall. --------
      • Set StSh_StarCircleRadius[1] = 100.00
      • Set StSh_StarCircleRadius[2] = 300.00
      • -------- Each star gets a random number between the minimum and the maximum. To make it for all stars the same make the two variables identical. --------
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- Here you can change how fast the falling stars rotates. --------
      • Set StSh_StarSpinRate = 6.00
      • -------- You can calculate how long a star needs to fullfil a circle if you divide 360 with the variable and multiple the result with 0.03.. --------
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- The speed with which the stars fall down increaes every 0.03 seconds for every star so to prevent them to fall in highspeed you can use this variable to limit their speed. --------
      • Set StSh_MAX_fall_speed = 12.00
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- This effect is added to the star dummy. --------
      • Set StSh_EffectVar[1] = Abilities\Weapons\WitchDoctorMissile\WitchDoctorMissile.mdl
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- This effect is added to the star dummy. --------
      • Set StSh_EffectVar[2] = Abilities\Weapons\PhoenixMissile\Phoenix_Missile_mini.mdl
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- This effect appear when a star hits the ground. --------
      • Set StSh_EffectVar[3] = Abilities\Spells\Other\Doom\DoomDeath.mdl
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
  • Star Shower loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • -------- We use a loop to check for all running instances and executing their actions. --------
      • For each (Integer StSh_loop_int) from 1 to StSh_IndexSize, do (Actions)
        • Loop - Actions
          • Set StSh_TempInt = StSh_Index[StSh_loop_int]
          • -------- If the conditions are true we continue. --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (StSh_caster[StSh_TempInt] is dead) Equal to False
              • StSh_caster[StSh_TempInt] Not equal to No unit
              • (Current order of StSh_caster[StSh_TempInt]) Equal to (Order(deathanddecay))
            • Then - Actions
              • -------- Chance to spawn a new star. --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Random integer number between 1 and 100) Less than or equal to StSh_StarChance[StSh_TempInt]
                • Then - Actions
                  • -------- Dynamic Index for the star. --------
                  • Set StSh_STARIndexSize = (StSh_STARIndexSize + 1)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • StSh_STARIndexSize Greater than StSh_STARIndex_MAX
                    • Then - Actions
                      • Set StSh_STARIndex[StSh_STARIndexSize] = StSh_STARIndexSize
                      • Set StSh_STARIndex_MAX = StSh_STARIndexSize
                    • Else - Actions
                  • Set StSh_STARIndex_temp = StSh_STARIndex[StSh_STARIndexSize]
                  • -------- End Dynamic Indexes. --------
                  • Set StSh_caster2[StSh_STARIndex_temp] = StSh_caster[StSh_TempInt]
                  • Set StSh_DAMAGE[StSh_STARIndex_temp] = StSh_DamageValue[StSh_TempInt]
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • StSh_DoTBoolean Equal to True
                    • Then - Actions
                      • Set StSh_DoTDamage_Convert[StSh_STARIndex_temp] = StSh_DoTDamageValue[StSh_TempInt]
                    • Else - Actions
                  • Set StSh_StarHeight[StSh_STARIndex_temp] = 1000.00
                  • Set StSh_HeightDecrease[StSh_STARIndex_temp] = 4.00
                  • Set StSh_StarDegrees[StSh_STARIndex_temp] = (Random angle)
                  • -------- Right or Left spin. --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Random integer number between 1 and 2) Equal to 1
                    • Then - Actions
                      • Set StSh_StarSpinDirection[StSh_STARIndex_temp] = True
                      • -------- Right spin. --------
                    • Else - Actions
                      • Set StSh_StarSpinDirection[StSh_STARIndex_temp] = False
                      • -------- Left spin. --------
                  • Set StSh_CircleRadius[StSh_STARIndex_temp] = (Random real number between StSh_StarCircleRadius[1] and StSh_StarCircleRadius[2])
                  • Set StSh_StarTargetLoc[StSh_STARIndex_temp] = (StSh_SpellTargetLoc[StSh_TempInt] offset by (Random real number between 0.00 and StSh_Area[StSh_TempInt]) towards (Random angle) degrees)
                  • Set StSh_StarTargetTempLoc = (StSh_StarTargetLoc[StSh_STARIndex_temp] offset by StSh_CircleRadius[StSh_STARIndex_temp] towards StSh_StarDegrees[StSh_STARIndex_temp] degrees)
                  • Unit - Create 1 StSh_dummy for (Owner of StSh_caster[StSh_TempInt]) at StSh_StarTargetLoc[StSh_STARIndex_temp] facing Default building facing (270.0) degrees
                  • Set StSh_Star[StSh_STARIndex_temp] = (Last created unit)
                  • Animation - Change StSh_Star[StSh_STARIndex_temp] flying height to StSh_StarHeight[StSh_STARIndex_temp] at 0.00
                  • Special Effect - Create a special effect attached to the chest of StSh_Star[StSh_STARIndex_temp] using StSh_EffectVar[1]
                  • Set StSh_StarEffect1[StSh_STARIndex_temp] = (Last created special effect)
                  • Special Effect - Create a special effect attached to the chest of StSh_Star[StSh_STARIndex_temp] using StSh_EffectVar[2]
                  • Set StSh_StarEffect2[StSh_STARIndex_temp] = (Last created special effect)
                  • -------- Clearing the leaks. --------
                  • Custom script: call RemoveLocation(udg_StSh_StarTargetTempLoc)
                • Else - Actions
            • Else - Actions
              • -------- The caster had ended the spell so the instance is over. --------
              • -------- We remove the Spell Target point to clean up the leak. --------
              • Custom script: call RemoveLocation(udg_StSh_SpellTargetLoc[udg_StSh_TempInt])
              • -------- RecycleIndex --------
              • -------- We clean up the index arrays and unlock the index for the next usage. --------
              • Set StSh_Index[StSh_loop_int] = StSh_Index[StSh_IndexSize]
              • Set StSh_Index[StSh_IndexSize] = StSh_TempInt
              • Set StSh_IndexSize = (StSh_IndexSize - 1)
              • Set StSh_loop_int = (StSh_loop_int - 1)
      • -------- ---------------------------------STAR LOOP--------------------------------- --------
      • For each (Integer StSh_loop2_int) from 1 to StSh_STARIndexSize, do (Actions)
        • Loop - Actions
          • -------- Converting the StSh_STARIndex to StSh_STARIndex_temp to make it easier to understand and read. --------
          • Set StSh_STARIndex_temp = StSh_STARIndex[StSh_loop2_int]
          • -------- We check if the star is still in the air or hits the ground. --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • StSh_StarHeight[StSh_STARIndex_temp] Greater than or equal to -5.00
            • Then - Actions
              • -------- This condition is used to increase the fall speed of the star but avoiding that it will be higher as the max Fall speed. --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • StSh_HeightDecrease[StSh_STARIndex_temp] Less than StSh_MAX_fall_speed
                • Then - Actions
                  • Set StSh_HeightDecrease[StSh_STARIndex_temp] = (StSh_HeightDecrease[StSh_STARIndex_temp] x 1.06)
                  • -------- If the evaluaded result is bigger then the max fall speed it will automatically set to the max fall speed value. --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • StSh_HeightDecrease[StSh_STARIndex_temp] Greater than StSh_MAX_fall_speed
                    • Then - Actions
                      • Set StSh_HeightDecrease[StSh_STARIndex_temp] = StSh_MAX_fall_speed
                    • Else - Actions
                • Else - Actions
              • Set StSh_StarHeight[StSh_STARIndex_temp] = (StSh_StarHeight[StSh_STARIndex_temp] - StSh_HeightDecrease[StSh_STARIndex_temp])
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • StSh_StarSpinDirection[StSh_STARIndex_temp] Equal to True
                • Then - Actions
                  • Set StSh_StarDegrees[StSh_STARIndex_temp] = (StSh_StarDegrees[StSh_STARIndex_temp] + StSh_StarSpinRate)
                • Else - Actions
                  • Set StSh_StarDegrees[StSh_STARIndex_temp] = (StSh_StarDegrees[StSh_STARIndex_temp] - StSh_StarSpinRate)
              • Set StSh_StarTargetTempLoc = (StSh_StarTargetLoc[StSh_STARIndex_temp] offset by StSh_CircleRadius[StSh_STARIndex_temp] towards StSh_StarDegrees[StSh_STARIndex_temp] degrees)
              • Animation - Change StSh_Star[StSh_STARIndex_temp] flying height to StSh_StarHeight[StSh_STARIndex_temp] at 0.00
              • Unit - Move StSh_Star[StSh_STARIndex_temp] instantly to StSh_StarTargetTempLoc
              • -------- Cleaning up the produced leak. --------
              • Custom script: call RemoveLocation(udg_StSh_StarTargetTempLoc)
            • Else - Actions
              • Set StSh_StarTargetTempLoc = (Position of StSh_Star[StSh_STARIndex_temp])
              • Special Effect - Destroy StSh_StarEffect1[StSh_STARIndex_temp]
              • Special Effect - Destroy StSh_StarEffect2[StSh_STARIndex_temp]
              • Unit - Remove StSh_Star[StSh_STARIndex_temp] from the game
              • -------- Creating a spezialeffect when the star hits the ground. --------
              • Special Effect - Create a special effect at StSh_StarTargetTempLoc using StSh_EffectVar[3]
              • Special Effect - Destroy (Last created special effect)
              • -------- Destroying trees in the area. --------
              • Destructible - Pick every destructible within 225.00 of StSh_StarTargetTempLoc and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Picked destructible) is alive) Equal to True
                    • Then - Actions
                      • -------- Moving the harvest dummy to the picked destructable. --------
                      • Custom script: call SetUnitX(udg_StSh_Tree_checker, GetWidgetX(GetEnumDestructable() ))
                      • Custom script: call SetUnitY(udg_StSh_Tree_checker, GetWidgetY(GetEnumDestructable() ))
                      • -------- Order the tree checker to use harvest. If he is able to do it we know it has to be a tree. --------
                      • Unit - Order StSh_Tree_checker to Harvest (Picked destructible)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Current order of StSh_Tree_checker) Equal to (Order(harvest))
                        • Then - Actions
                          • Destructible - Kill (Picked destructible)
                        • Else - Actions
                      • Unit - Order StSh_Tree_checker to Stop
                    • Else - Actions
              • Set StSh_TempGrp = (Units within StSh_ImpactAoE of StSh_StarTargetTempLoc matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) belongs to an ally of (Owner of StSh_caster2[StSh_STARIndex_temp])) Equa
              • Unit Group - Pick every unit in StSh_TempGrp and do (Actions)
                • Loop - Actions
                  • Unit - Cause StSh_caster2[StSh_STARIndex_temp] to damage (Picked unit), dealing StSh_DAMAGE[StSh_STARIndex_temp] damage of attack type Chaos and damage type Normal
                  • -------- ---------------------------------DoT---------------------------------If the boolean DoT_boolean is true damaged units start to burn and suffering damage over time. --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • StSh_DoTBoolean Equal to True
                    • Then - Actions
                      • -------- Cause to prevent that units get multiple arrays for example 6 we create this two variables to check if the unit is already burning. --------
                      • Set StSh_DoTCheckInt = (StSh_DoTIndexSize + 2)
                      • -------- Now we use a variable which represent the picked unit and add the integer to it. --------
                      • Set StSh_DoTUnitCheck[StSh_DoTCheckInt] = (Picked unit)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • StSh_DoTIndexSize Equal to 0
                        • Then - Actions
                          • -------- Setting up the Dynamic Index for the DoT. --------
                          • Set StSh_DoTIndexSize = (StSh_DoTIndexSize + 1)
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • StSh_DoTIndexSize Greater than StSh_DoTIndex_MAX
                            • Then - Actions
                              • Set StSh_DoTIndex[StSh_DoTIndexSize] = StSh_DoTIndexSize
                              • Set StSh_DoTIndex_MAX = StSh_DoTIndexSize
                            • Else - Actions
                          • -------- End of the Dynamic Index set up. --------
                          • Set StSh_DoTIndex_temp = StSh_DoTIndex[StSh_DoTIndexSize]
                          • Set StSh_DoTDuration[StSh_DoTIndex_temp] = StSh_DoT_Time
                          • Set StSh_DoTUnit[StSh_DoTIndex_temp] = StSh_DoTUnitCheck[StSh_DoTCheckInt]
                          • Set StSh_caster3[StSh_DoTIndex_temp] = StSh_caster2[StSh_STARIndex_temp]
                          • Special Effect - Create a special effect attached to the chest of StSh_DoTUnit[StSh_DoTIndex_temp] using StSh_EffectVar[4]
                          • Set StSh_DoTEffect[StSh_DoTIndex_temp] = (Last created special effect)
                          • Set StSh_DoTDamage[StSh_DoTIndex_temp] = StSh_DoTDamage_Convert[StSh_STARIndex_temp]
                        • Else - Actions
                          • -------- Now we check if the picked unit is already burning or not. For these reason we loop through all existing burning units and check if our new unit belonging to them. --------
                          • For each (Integer StSh_loop3_int) from 1 to StSh_DoTIndexSize, do (Actions)
                            • Loop - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • StSh_DoTUnit[StSh_loop3_int] Equal to StSh_DoTUnitCheck[StSh_DoTCheckInt]
                                  • StSh_DoTCheck_Boolean Equal to False
                                • Then - Actions
                                  • -------- We have found our unit so we set the boolean to true. --------
                                  • Set StSh_DoTCheck_Boolean = True
                                  • -------- The duration of the burn effect gets updated. --------
                                  • Set StSh_DoTDuration[StSh_loop3_int] = (StSh_DoTDuration[StSh_loop3_int] + StSh_DoT_Time)
                                  • -------- If the new damage source, caster, has a higher damage value, we replace the old with the new and make the new caster as the damage source. --------
                                  • Set StSh_DoTDamage[StSh_DoTCheckInt] = StSh_DoTDamage_Convert[StSh_STARIndex_temp]
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • StSh_DoTDamage[StSh_DoTCheckInt] Greater than StSh_DoTDamage[StSh_loop3_int]
                                    • Then - Actions
                                      • -------- The damage is higher so the old value gets replaced. --------
                                      • Set StSh_DoTDamage[StSh_loop3_int] = StSh_DoTDamage[StSh_DoTCheckInt]
                                      • -------- Same for the caster. --------
                                      • Set StSh_caster3[StSh_loop3_int] = StSh_caster2[StSh_STARIndex_temp]
                                    • Else - Actions
                                • Else - Actions
                                  • -------- If we already have found our unit this is no longer needed and will cause bugs without the condition. --------
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • StSh_DoTCheck_Boolean Equal to True
                                    • Then - Actions
                                    • Else - Actions
                                      • -------- We still haven´t found our unit in the burning ones so we leave the boolean at false to add later a new integer to it. --------
                                      • Set StSh_DoTCheck_Boolean = False
                          • -------- If our unit was below the burning ones this will take no action but if it wasn´t and the boolean says false the unit will added as a new one to the burning ones. --------
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • StSh_DoTCheck_Boolean Equal to False
                            • Then - Actions
                              • -------- Dynamic Index for the DoT. --------
                              • Set StSh_DoTIndexSize = (StSh_DoTIndexSize + 1)
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • StSh_DoTIndexSize Greater than StSh_DoTIndex_MAX
                                • Then - Actions
                                  • Set StSh_DoTIndex[StSh_DoTIndexSize] = StSh_DoTIndexSize
                                  • Set StSh_DoTIndex_MAX = StSh_DoTIndexSize
                                • Else - Actions
                              • Set StSh_DoTIndex_temp = StSh_DoTIndex[StSh_DoTIndexSize]
                              • -------- End Dynamic Index. --------
                              • Set StSh_DoTDuration[StSh_DoTIndex_temp] = StSh_DoT_Time
                              • Set StSh_DoTUnit[StSh_DoTIndex_temp] = StSh_DoTUnitCheck[StSh_DoTCheckInt]
                              • Set StSh_caster3[StSh_DoTIndex_temp] = StSh_caster2[StSh_STARIndex_temp]
                              • Special Effect - Create a special effect attached to the chest of StSh_DoTUnit[StSh_DoTIndex_temp] using StSh_EffectVar[4]
                              • Set StSh_DoTEffect[StSh_DoTIndex_temp] = (Last created special effect)
                              • Set StSh_DoTDamage[StSh_DoTIndex_temp] = StSh_DoTDamage_Convert[StSh_STARIndex_temp]
                            • Else - Actions
                          • Set StSh_DoTUnitCheck[StSh_DoTCheckInt] = No unit
                          • Set StSh_DoTCheckInt = 0
                          • -------- This is necessary because for the next unit the value has to start with false. --------
                          • Set StSh_DoTCheck_Boolean = False
                    • Else - Actions
              • Custom script: call DestroyGroup(udg_StSh_TempGrp)
              • Custom script: call RemoveLocation(udg_StSh_StarTargetTempLoc)
              • Custom script: call RemoveLocation(udg_StSh_StarTargetLoc[udg_StSh_STARIndex_temp])
              • -------- Recycle Index --------
              • Set StSh_STARIndex[StSh_loop2_int] = StSh_STARIndex[StSh_STARIndexSize]
              • Set StSh_STARIndex[StSh_STARIndexSize] = StSh_STARIndex_temp
              • Set StSh_STARIndexSize = (StSh_STARIndexSize - 1)
              • Set StSh_loop2_int = (StSh_loop2_int - 1)
      • -------- ---------------------------------DoT LOOP--------------------------------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • StSh_DoTBoolean Equal to True
        • Then - Actions
          • For each (Integer StSh_loop4_int) from 1 to StSh_DoTIndexSize, do (Actions)
            • Loop - Actions
              • Set StSh_DoTIndex_temp = StSh_DoTIndex[StSh_loop4_int]
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • StSh_DoTDuration[StSh_DoTIndex_temp] Greater than or equal to 0.00
                  • (StSh_DoTUnit[StSh_DoTIndex_temp] is alive) Equal to True
                • Then - Actions
                  • Set StSh_DoTDuration[StSh_DoTIndex_temp] = (StSh_DoTDuration[StSh_DoTIndex_temp] - 0.03)
                  • Unit - Cause StSh_caster3[StSh_DoTIndex_temp] to damage StSh_DoTUnit[StSh_DoTIndex_temp], dealing StSh_DoTDamage[StSh_DoTIndex_temp] damage of attack type Chaos and damage type Normal
                • Else - Actions
                  • Special Effect - Destroy StSh_DoTEffect[StSh_DoTIndex_temp]
                  • -------- Recycle Index. --------
                  • Set StSh_DoTIndex[StSh_loop4_int] = StSh_DoTIndex[StSh_DoTIndexSize]
                  • Set StSh_DoTIndex[StSh_DoTIndexSize] = StSh_DoTIndex_temp
                  • Set StSh_DoTIndexSize = (StSh_DoTIndexSize - 1)
                  • Set StSh_loop4_int = (StSh_loop4_int - 1)
        • Else - Actions
      • -------- Turn the trigger again off if the index_size is below 0... --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • StSh_STARIndexSize Equal to 0
          • StSh_IndexSize Equal to 0
          • StSh_DoTIndexSize Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
-- Same trigger with comments. --

  • Star Shower loop commented
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- We use a loop to check for all running instances and executing their actions. --------
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
      • For each (Integer StSh_loop_int) from 1 to StSh_IndexSize, do (Actions)
        • Loop - Actions
          • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
          • -------- Converting the StSh_Index to StSh_Tempint to make it easier to understand and read. --------
          • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
          • Set StSh_TempInt = StSh_Index[StSh_loop_int]
          • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
          • -------- With this condition we check if the caster is still channeling, in this case he has the order deathanddecay, if he had stopped or died the instance will be ended. --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (StSh_caster[StSh_TempInt] is dead) Equal to False
              • StSh_caster[StSh_TempInt] Not equal to No unit
              • (Current order of StSh_caster[StSh_TempInt]) Equal to (Order(deathanddecay))
            • Then - Actions
              • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
              • -------- To prevent that a mass of stars will fall from the sky we use a condition so that ,for example, only every fifth loop creates a star. --------
              • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Random integer number between 1 and 100) Less than or equal to StSh_StarChance[StSh_TempInt]
                • Then - Actions
                  • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                  • -------- Dynamic Index in the loop --------
                  • -------- Again we set up the dynamic indexes, this time for the stars. --------
                  • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                  • Set StSh_STARIndexSize = (StSh_STARIndexSize + 1)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • StSh_STARIndexSize Greater than StSh_STARIndex_MAX
                    • Then - Actions
                      • Set StSh_STARIndex[StSh_STARIndexSize] = StSh_STARIndexSize
                      • Set StSh_STARIndex_MAX = StSh_STARIndexSize
                    • Else - Actions
                  • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                  • -------- Converting the StSh_STARIndex to StSh_STARIndex_temp to make it easier to understand and read. --------
                  • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                  • Set StSh_STARIndex_temp = StSh_STARIndex[StSh_STARIndexSize]
                  • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                  • -------- End Dynamic Index in the loop --------
                  • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                  • -------- Here we convert the StSh_caster from the beginning of the spell to StSh_caster2 because in the Star loop we can not refer to the first set up of indexes. --------
                  • Set StSh_caster2[StSh_STARIndex_temp] = StSh_caster[StSh_TempInt]
                  • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                  • -------- Here we take the damage value from the base trigger as damage. It is necessary because it has to match with the star index. --------
                  • Set StSh_DAMAGE[StSh_STARIndex_temp] = StSh_DamageValue[StSh_TempInt]
                  • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • StSh_DoTBoolean Equal to True
                    • Then - Actions
                      • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                      • -------- The damage burning units suffers per instance. --------
                      • Set StSh_DoTDamage_Convert[StSh_STARIndex_temp] = StSh_DoTDamageValue[StSh_TempInt]
                      • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                    • Else - Actions
                  • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                  • -------- This is the height where the stars get spawned. --------
                  • Set StSh_StarHeight[StSh_STARIndex_temp] = 1000.00
                  • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                  • -------- This value is the basic speed with which the stars fall down. --------
                  • Set StSh_HeightDecrease[StSh_STARIndex_temp] = 4.00
                  • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                  • -------- Here we set the angle where the Stars will created. We set it up to random to because we want the stars spawn everywhere. --------
                  • Set StSh_StarDegrees[StSh_STARIndex_temp] = (Random angle)
                  • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                  • -------- Here we allocate the spin direction of each star, having a 50:50 chance that the star will spin left or right. --------
                  • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Random integer number between 1 and 2) Equal to 1
                    • Then - Actions
                      • Set StSh_StarSpinDirection[StSh_STARIndex_temp] = True
                      • -------- Right spin. --------
                    • Else - Actions
                      • Set StSh_StarSpinDirection[StSh_STARIndex_temp] = False
                      • -------- Left spin. --------
                  • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                  • -------- The distance from the random point where the Stars spawn. --------
                  • Set StSh_CircleRadius[StSh_STARIndex_temp] = (Random real number between StSh_StarCircleRadius[1] and StSh_StarCircleRadius[2])
                  • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                  • -------- The point where the star will spin around. --------
                  • Set StSh_StarTargetLoc[StSh_STARIndex_temp] = (StSh_SpellTargetLoc[StSh_TempInt] offset by (Random real number between 0.00 and StSh_Area[StSh_TempInt]) towards (Random angle) degrees)
                  • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                  • -------- The place where the star spawn. --------
                  • Set StSh_StarTargetTempLoc = (StSh_StarTargetLoc[StSh_STARIndex_temp] offset by StSh_CircleRadius[StSh_STARIndex_temp] towards StSh_StarDegrees[StSh_STARIndex_temp] degrees)
                  • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                  • -------- The Star dummy. --------
                  • Unit - Create 1 StSh_dummy for (Owner of StSh_caster[StSh_TempInt]) at StSh_StarTargetLoc[StSh_STARIndex_temp] facing Default building facing (270.0) degrees
                  • Set StSh_Star[StSh_STARIndex_temp] = (Last created unit)
                  • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                  • -------- Here we add the Spezialeffects to the model which had set into variables in the base trigger. --------
                  • Animation - Change StSh_Star[StSh_STARIndex_temp] flying height to StSh_StarHeight[StSh_STARIndex_temp] at 0.00
                  • Special Effect - Create a special effect attached to the chest of StSh_Star[StSh_STARIndex_temp] using StSh_EffectVar[1]
                  • Set StSh_StarEffect1[StSh_STARIndex_temp] = (Last created special effect)
                  • Special Effect - Create a special effect attached to the chest of StSh_Star[StSh_STARIndex_temp] using StSh_EffectVar[2]
                  • Set StSh_StarEffect2[StSh_STARIndex_temp] = (Last created special effect)
                  • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                  • -------- To clean up the temp location where the stars had spawned. --------
                  • Custom script: call RemoveLocation(udg_StSh_StarTargetTempLoc)
                • Else - Actions
            • Else - Actions
              • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
              • -------- The caster had ended the spell so the instance is over. --------
              • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
              • -------- We remove the Spell Target point to clean up the leak. --------
              • Custom script: call RemoveLocation(udg_StSh_SpellTargetLoc[udg_StSh_TempInt])
              • -------- RecycleIndex --------
              • -------- We clean up the index arrays and unlock the index for the next usage. --------
              • Set StSh_Index[StSh_loop_int] = StSh_Index[StSh_IndexSize]
              • Set StSh_Index[StSh_IndexSize] = StSh_TempInt
              • Set StSh_IndexSize = (StSh_IndexSize - 1)
              • Set StSh_loop_int = (StSh_loop_int - 1)
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- Star loop --------
      • -------- Here the movement of each star is described and at the end the damage is dealt when the star hits the ground. --------
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
      • For each (Integer StSh_loop2_int) from 1 to StSh_STARIndexSize, do (Actions)
        • Loop - Actions
          • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
          • -------- Converting the StSh_STARIndex to StSh_STARIndex_temp to make it easier to understand and read. --------
          • Set StSh_STARIndex_temp = StSh_STARIndex[StSh_loop2_int]
          • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
          • -------- We check if the star is still in the air or hits the ground. --------
          • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • StSh_StarHeight[StSh_STARIndex_temp] Greater than or equal to -5.00
            • Then - Actions
              • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
              • -------- The star is still in the air so we let him fall. --------
              • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
              • -------- This condition is used to increase the fall speed of the star but avoiding that it will be higher as the max Fall speed. --------
              • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • StSh_HeightDecrease[StSh_STARIndex_temp] Less than StSh_MAX_fall_speed
                • Then - Actions
                  • Set StSh_HeightDecrease[StSh_STARIndex_temp] = (StSh_HeightDecrease[StSh_STARIndex_temp] x 1.06)
                  • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                  • -------- If the evaluaded result is bigger then the max fall speed it will automatically set to the max fall speed value. --------
                  • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • StSh_HeightDecrease[StSh_STARIndex_temp] Greater than StSh_MAX_fall_speed
                    • Then - Actions
                      • Set StSh_HeightDecrease[StSh_STARIndex_temp] = StSh_MAX_fall_speed
                    • Else - Actions
                • Else - Actions
              • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
              • -------- Here the current height of the star gets reduced. --------
              • Set StSh_StarHeight[StSh_STARIndex_temp] = (StSh_StarHeight[StSh_STARIndex_temp] - StSh_HeightDecrease[StSh_STARIndex_temp])
              • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
              • -------- Checking if the star has a left spin or a right spin. --------
              • -------- And setting the new angle. --------
              • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • StSh_StarSpinDirection[StSh_STARIndex_temp] Equal to True
                • Then - Actions
                  • -------- Right spin. --------
                  • Set StSh_StarDegrees[StSh_STARIndex_temp] = (StSh_StarDegrees[StSh_STARIndex_temp] + StSh_StarSpinRate)
                • Else - Actions
                  • -------- Left spin. --------
                  • Set StSh_StarDegrees[StSh_STARIndex_temp] = (StSh_StarDegrees[StSh_STARIndex_temp] - StSh_StarSpinRate)
              • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
              • -------- Creating the new location of the falling star. --------
              • Set StSh_StarTargetTempLoc = (StSh_StarTargetLoc[StSh_STARIndex_temp] offset by StSh_CircleRadius[StSh_STARIndex_temp] towards StSh_StarDegrees[StSh_STARIndex_temp] degrees)
              • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
              • -------- Reducing the stars height. --------
              • Animation - Change StSh_Star[StSh_STARIndex_temp] flying height to StSh_StarHeight[StSh_STARIndex_temp] at 0.00
              • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
              • -------- Moving the Star to the new position. --------
              • Unit - Move StSh_Star[StSh_STARIndex_temp] instantly to StSh_StarTargetTempLoc
              • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
              • -------- Cleaning up the produced leak. --------
              • Custom script: call RemoveLocation(udg_StSh_StarTargetTempLoc)
            • Else - Actions
              • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
              • -------- Checking where the star hits the ground. --------
              • Set StSh_StarTargetTempLoc = (Position of StSh_Star[StSh_STARIndex_temp])
              • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
              • -------- Destroying the Specialeffect to destroy the leak. --------
              • Special Effect - Destroy StSh_StarEffect1[StSh_STARIndex_temp]
              • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
              • -------- Destroying the Specialeffect to destroy the leak. --------
              • Special Effect - Destroy StSh_StarEffect2[StSh_STARIndex_temp]
              • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
              • -------- Removing the star dummy to destroy the leak. --------
              • Unit - Remove StSh_Star[StSh_STARIndex_temp] from the game
              • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
              • -------- Creating a spezialeffect when the star hits the ground. --------
              • Special Effect - Create a special effect at StSh_StarTargetTempLoc using StSh_EffectVar[3]
              • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
              • -------- Destroying the specialeffect to avoid leaks. --------
              • Special Effect - Destroy (Last created special effect)
              • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
              • -------- Destroying trees in the area. --------
              • Destructible - Pick every destructible within 225.00 of StSh_StarTargetTempLoc and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Picked destructible) is alive) Equal to True
                    • Then - Actions
                      • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                      • -------- Moving the harvest dummy to the picked destructable. --------
                      • Custom script: call SetUnitX(udg_StSh_Tree_checker, GetWidgetX(GetEnumDestructable() ))
                      • Custom script: call SetUnitY(udg_StSh_Tree_checker, GetWidgetY(GetEnumDestructable() ))
                      • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                      • -------- Order the tree checker to use harvest. If he is able to do it we know it has to be a tree. --------
                      • Unit - Order StSh_Tree_checker to Harvest (Picked destructible)
                      • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Current order of StSh_Tree_checker) Equal to (Order(harvest))
                        • Then - Actions
                          • Destructible - Kill (Picked destructible)
                        • Else - Actions
                      • Unit - Order StSh_Tree_checker to Stop
                    • Else - Actions
              • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
              • -------- Checking for targets around the impact place. --------
              • Set StSh_TempGrp = (Units within StSh_ImpactAoE of StSh_StarTargetTempLoc matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) belongs to an ally of (Owner of StSh_caster2[StSh_STARIndex_temp])) Equa
              • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
              • Unit Group - Pick every unit in StSh_TempGrp and do (Actions)
                • Loop - Actions
                  • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                  • -------- Cause the caster to damage them. --------
                  • Unit - Cause StSh_caster2[StSh_STARIndex_temp] to damage (Picked unit), dealing StSh_DAMAGE[StSh_STARIndex_temp] damage of attack type Chaos and damage type Normal
                  • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                  • -------- Now the things get a little bit tricky up here. --------
                  • -------- If the boolean DoT_boolean is true damaged units start to burn and suffering damage over time. --------
                  • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • StSh_DoTBoolean Equal to True
                    • Then - Actions
                      • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                      • -------- Cause to prevent that units get only one array and not for example 6 we create this two variables to check if the unit is already burning. --------
                      • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                      • -------- We take a number 2 above the max integer size to avoid possible bugs. --------
                      • Set StSh_DoTCheckInt = (StSh_DoTIndexSize + 2)
                      • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                      • -------- Now we use a variable which represent the picked unit and add the integer to it. --------
                      • Set StSh_DoTUnitCheck[StSh_DoTCheckInt] = (Picked unit)
                      • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • StSh_DoTIndexSize Equal to 0
                        • Then - Actions
                          • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                          • -------- The DoT_IndexSize is still 0 so there is no way that a unit is already burning. We can continue like always. --------
                          • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                          • -------- Setting up the Dynamic Index for the DoT. --------
                          • Set StSh_DoTIndexSize = (StSh_DoTIndexSize + 1)
                          • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • StSh_DoTIndexSize Greater than StSh_DoTIndex_MAX
                            • Then - Actions
                              • Set StSh_DoTIndex[StSh_DoTIndexSize] = StSh_DoTIndexSize
                              • Set StSh_DoTIndex_MAX = StSh_DoTIndexSize
                            • Else - Actions
                          • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                          • -------- End of the Dynamic Index set up. --------
                          • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                          • -------- Converting the DoT_index to DoTIndex_temp to make it easier to understand and read. --------
                          • Set StSh_DoTIndex_temp = StSh_DoTIndex[StSh_DoTIndexSize]
                          • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                          • -------- This is the duration a unit burns. --------
                          • Set StSh_DoTDuration[StSh_DoTIndex_temp] = StSh_DoT_Time
                          • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                          • -------- The picked unit. We take the representable variable for it. --------
                          • Set StSh_DoTUnit[StSh_DoTIndex_temp] = StSh_DoTUnitCheck[StSh_DoTCheckInt]
                          • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                          • -------- Again the caster gets converted but it is necessary for the damage source. --------
                          • Set StSh_caster3[StSh_DoTIndex_temp] = StSh_caster2[StSh_STARIndex_temp]
                          • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                          • -------- The burning effect. --------
                          • Special Effect - Create a special effect attached to the chest of StSh_DoTUnit[StSh_DoTIndex_temp] using StSh_EffectVar[4]
                          • Set StSh_DoTEffect[StSh_DoTIndex_temp] = (Last created special effect)
                          • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                          • -------- The damage per interval, 0.03 seconds. It is converted from the convert variable. --------
                          • Set StSh_DoTDamage[StSh_DoTIndex_temp] = StSh_DoTDamage_Convert[StSh_STARIndex_temp]
                        • Else - Actions
                          • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                          • -------- Now we check if the picked unit is already burning or not. For these reason we loop through all existing burning units and check if our new unit belonging to them. --------
                          • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                          • For each (Integer StSh_loop3_int) from 1 to StSh_DoTIndexSize, do (Actions)
                            • Loop - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • StSh_DoTUnit[StSh_loop3_int] Equal to StSh_DoTUnitCheck[StSh_DoTCheckInt]
                                  • StSh_DoTCheck_Boolean Equal to False
                                • Then - Actions
                                  • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                                  • -------- We have found our unit so we set the boolean to true. --------
                                  • Set StSh_DoTCheck_Boolean = True
                                  • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                                  • -------- The duration of the burn effect gets updated. --------
                                  • Set StSh_DoTDuration[StSh_loop3_int] = (StSh_DoTDuration[StSh_loop3_int] + StSh_DoT_Time)
                                  • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                                  • -------- If the new damage source, caster, has a higher damage value, we replace the old with the new and make the new caster as the damage source. --------
                                  • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                                  • -------- To check we use our example integer for the damage variable. --------
                                  • Set StSh_DoTDamage[StSh_DoTCheckInt] = StSh_DoTDamage_Convert[StSh_STARIndex_temp]
                                  • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • StSh_DoTDamage[StSh_DoTCheckInt] Greater than StSh_DoTDamage[StSh_loop3_int]
                                    • Then - Actions
                                      • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                                      • -------- The damage is higher so the old value gets replaced. --------
                                      • Set StSh_DoTDamage[StSh_loop3_int] = StSh_DoTDamage[StSh_DoTCheckInt]
                                      • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                                      • -------- Same for the caster. --------
                                      • Set StSh_caster3[StSh_loop3_int] = StSh_caster2[StSh_STARIndex_temp]
                                    • Else - Actions
                                • Else - Actions
                                  • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                                  • -------- If we already have found our unit this is no longer needed and will cause bugs without the condition. --------
                                  • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • StSh_DoTCheck_Boolean Equal to True
                                    • Then - Actions
                                    • Else - Actions
                                      • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                                      • -------- We still haven´t found our unit in the burning ones so we leave the boolean at false to add later a new integer to it. --------
                                      • Set StSh_DoTCheck_Boolean = False
                                      • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                          • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                          • -------- If our unit was below the burning ones this will take no action but if it wasn´t and the boolean says false the unit will added as a new one to the burning ones. --------
                          • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • StSh_DoTCheck_Boolean Equal to False
                            • Then - Actions
                              • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                              • -------- Dynamic Index for the DoT. --------
                              • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                              • Set StSh_DoTIndexSize = (StSh_DoTIndexSize + 1)
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • StSh_DoTIndexSize Greater than StSh_DoTIndex_MAX
                                • Then - Actions
                                  • Set StSh_DoTIndex[StSh_DoTIndexSize] = StSh_DoTIndexSize
                                  • Set StSh_DoTIndex_MAX = StSh_DoTIndexSize
                                • Else - Actions
                              • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                              • Set StSh_DoTIndex_temp = StSh_DoTIndex[StSh_DoTIndexSize]
                              • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                              • -------- End Dynamic Index. --------
                              • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                              • -------- This is the duration a unit burns. --------
                              • Set StSh_DoTDuration[StSh_DoTIndex_temp] = StSh_DoT_Time
                              • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                              • -------- The picked unit. We take the representable variable for it. --------
                              • Set StSh_DoTUnit[StSh_DoTIndex_temp] = StSh_DoTUnitCheck[StSh_DoTCheckInt]
                              • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                              • -------- Again the caster gets converted but it is necessary for the damage source. --------
                              • Set StSh_caster3[StSh_DoTIndex_temp] = StSh_caster2[StSh_STARIndex_temp]
                              • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                              • -------- The burning effect. --------
                              • Special Effect - Create a special effect attached to the chest of StSh_DoTUnit[StSh_DoTIndex_temp] using StSh_EffectVar[4]
                              • Set StSh_DoTEffect[StSh_DoTIndex_temp] = (Last created special effect)
                              • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                              • -------- The damage per interval, 0.03 seconds. It is converted from the convert variable. --------
                              • Set StSh_DoTDamage[StSh_DoTIndex_temp] = StSh_DoTDamage_Convert[StSh_STARIndex_temp]
                              • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                            • Else - Actions
                          • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                          • -------- Well here the example variables gets resetted. It is not really necessary but i feel better with it ;) --------
                          • Set StSh_DoTUnitCheck[StSh_DoTCheckInt] = No unit
                          • Set StSh_DoTCheckInt = 0
                          • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                          • -------- This is necessary because for the next unit the value has to start with false. --------
                          • Set StSh_DoTCheck_Boolean = False
                          • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                    • Else - Actions
              • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
              • -------- The star has impacted on the ground so we can destroy the leaks. --------
              • Custom script: call DestroyGroup(udg_StSh_TempGrp)
              • Custom script: call RemoveLocation(udg_StSh_StarTargetTempLoc)
              • Custom script: call RemoveLocation(udg_StSh_StarTargetLoc[udg_StSh_STARIndex_temp])
              • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
              • -------- Recycle Index --------
              • -------- We clean up the index arrays and unlock the index for the next usage. --------
              • Set StSh_STARIndex[StSh_loop2_int] = StSh_STARIndex[StSh_STARIndexSize]
              • Set StSh_STARIndex[StSh_STARIndexSize] = StSh_STARIndex_temp
              • Set StSh_STARIndexSize = (StSh_STARIndexSize - 1)
              • Set StSh_loop2_int = (StSh_loop2_int - 1)
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- The DoT loop to damage the burning units. --------
      • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • StSh_DoTBoolean Equal to True
        • Then - Actions
          • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
          • For each (Integer StSh_loop4_int) from 1 to StSh_DoTIndexSize, do (Actions)
            • Loop - Actions
              • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
              • -------- Converting the loop to the DoT_IndexTemp to make it easier to read and understand. --------
              • Set StSh_DoTIndex_temp = StSh_DoTIndex[StSh_loop4_int]
              • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • StSh_DoTDuration[StSh_DoTIndex_temp] Greater than or equal to 0.00
                  • (StSh_DoTUnit[StSh_DoTIndex_temp] is alive) Equal to True
                • Then - Actions
                  • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                  • -------- The duration gets reduced. --------
                  • Set StSh_DoTDuration[StSh_DoTIndex_temp] = (StSh_DoTDuration[StSh_DoTIndex_temp] - 0.03)
                  • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                  • -------- The caster damages the burning ones. --------
                  • Unit - Cause StSh_caster3[StSh_DoTIndex_temp] to damage StSh_DoTUnit[StSh_DoTIndex_temp], dealing StSh_DoTDamage[StSh_DoTIndex_temp] damage of attack type Chaos and damage type Normal
                  • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                • Else - Actions
                  • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                  • -------- Destroying the burning effect. --------
                  • Special Effect - Destroy StSh_DoTEffect[StSh_DoTIndex_temp]
                  • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                  • -------- Recycle Index. --------
                  • -------- We clean up the index arrays and unlock the index for the next usage. --------
                  • -------- --------------------------------------------------------------------------------------------------------------------------------------------- --------
                  • Set StSh_DoTIndex[StSh_loop4_int] = StSh_DoTIndex[StSh_DoTIndexSize]
                  • Set StSh_DoTIndex[StSh_DoTIndexSize] = StSh_DoTIndex_temp
                  • Set StSh_DoTIndexSize = (StSh_DoTIndexSize - 1)
                  • Set StSh_loop4_int = (StSh_loop4_int - 1)
        • Else - Actions
      • -------- Turn the trigger again off if the index_size is below 0... --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • StSh_STARIndexSize Equal to 0
          • StSh_IndexSize Equal to 0
          • StSh_DoTIndexSize Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
      • -------- Spell finished :) --------

CREDITS goes to Hanky for the Dynamic Index system, D4RK_G4ND4LF for the tree destroy technique and to the creator of the DUMMY.mdx model.

Spell should be MUI and Leakless.

Update v1.01: Corrected the Preload trigger.

Update v1.05: Created the loop trigger twice, one with barely comments to spare space, the other one fully commented to make it easier to understand.

Update v1.06: Another fix at the preload trigger, removed the leak

Greetz, BlackHawk




Keywords:
Star, Shower, Sky, Channeling, Ground, Air, Impact, Explosion, DoT, Flames, MUI. Long Text
Contents

S.O.A.D_RoXXX` s Test Map (Map)

Reviews
15:22, 19th Nov 2009 The_Reborn_Devil: It looks pretty nice and there are no leaks. The triggering looks good too. Status: Approved Rating: Recommended

Moderator

M

Moderator

15:22, 19th Nov 2009
The_Reborn_Devil:
It looks pretty nice and there are no leaks.
The triggering looks good too.

Status: Approved
Rating: Recommended
 
Level 4
Joined
Nov 8, 2009
Messages
25
@kola:
Yes it is so long because i didn´t seperate the loops into different trigger but leave it at one trigger. I thought it would be easier to copy just two trigger instead of three. And yes the documentation does the rest :)

Thank you for the comments!
 
Last edited:
Level 4
Joined
Nov 8, 2009
Messages
25
Thank you vercas for pointing that out, i wasn´t 100% sure if I got all the leaks.
Should I use less comments next time? I thought they would make it easier for the reader to understand what´s going on in the spell.


Greetz, BlackHawk
 
Level 21
Joined
Dec 9, 2007
Messages
3,096
Add documentation triggers or trigger description. Stuffing your triggers with commends make them look huge.
But I am very impressed for a GUI spell. :smile:

I give you a suggestion for the documentation trigger.
Make a new trigger and convert it to custom text.
Disable it and write in it everything you need.
To "quote" GUI lines, right click them and select Copy As Text and paste them wherever you need.
(I know you know how to copy GUI lines, already, but I am pointing it out for other users to read, that if they don't know already.)
 
Level 4
Joined
Nov 8, 2009
Messages
25
Allright, thanks for your suggestion.

I decided to copy the trigger, one with documentation and the other one without, because I, for myself as a GUI user, would find it more helpful if i see the GUI trigger with comments instead of a text. So if you just want the trigger you can use the barely commented one and for learning the other one.

But your idea would be good aswell, I just did it this way, because I think it would be easier to understand every aspect of the spell because of its length.

+rep for you :)

~BlackHawk
 
Level 2
Joined
Mar 12, 2008
Messages
7
:D

Nice work...
Although I can't seem to be able to import it into my map? :S
I imported and exported the model...
I copied and pasted both the spell and the dummy...
I copied and pasted the triggers at the end...
All I got up was a spell that created special effects on the ground...
There was no falling stars... Maybe it's the model? I'm not sure... Please reply ^^
I really need this awesome spell in my map :/
and don't worry... I'll give you full credit...
 
Top