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

Unreasonable Chaos Spellpack

This is a pack containing my favourite works I have completed over my time being here on the hive, these were either fun to create for me, or ones I really loved the effect of, and I hope you will enjoy them as much as I have.
I have decided to include quite a few details on these spells, including the full trigger list, and tooltips for each of them.
FULL SPELL LIST
- Arcane Drain
- Beserk Plant
- Chaos Portal
- Energy Glyph
- Energy Matrix
- Explosive Toxic Gas
- Helios Collision
- Magnetised Energy Bombs
- Sentry Rocks
- Soul Tether
- Spirit Scorpions
- Volcanic Crush
- Weeds
- Wild Energy




TOOLTIPS

spells_4913_screenshot_tnb.jpg
[c]Arcane Drain[c]Disperses draining fields randomly in the general direction of the target area, draining fields will absorb life and mana from the target and return the health and mana to the caster. The form the spell takes depends on its level.

Level 1 - Drains 25 health and 12 mana per second.
Level 2 - Drains 30 health and 15 mana per second.
Level 3 - Drains 35 health and 17 mana per second.
[r]
spells_4283_screenshot_tnb.jpg
[c]Beserk Plant[c]Learn: Throws a small plant at the target point. Being thrown causes the plant to be unfathomably enraged and it takes it anger out by attacking nearby enemies dealing damage every hit and knocking them back away from the plant.

Level 1: Throws a small plant at the target point. Being thrown causes the plant to be unfathomably enraged and it takes it anger out by attacking enemies within a 400 range dealing 45 damage every hit and knocking them back away from the plant.

Level 2: Throws a small plant at the target point. Being thrown causes the plant to be unfathomably enraged and it takes it anger out by attacking enemies within a 500 range dealing 70 damage every hit and knocking them back away from the plant.

Level 3: Throws a small plant at the target point. Being thrown causes the plant to be unfathomably enraged and it takes it anger out by attacking enemies within a 600 range dealing 85 damage every hit and knocking them back away from the plant.
[r]
spells_4377_screenshot_tnb.jpg
[c]Chaos Portal[c]Creates a portal at the target point which will trap nearby units within it's effect radius and push and pull them around the cage tearing them apart dealing damage and repelling units trying to enter the cage away from it.

Level 1 - 325 AOE, 15 Damage per hit 5 Pulses, Weak knockback
Level 2 - 425 AOE, 20 Damage per hit, 7 Pulses, Medium knockback
Level 3 - 525 AOE, 25 Damage per hit, 9 Pulses, Strong knockback
[r]
spells_4272_screenshot_tnb.jpg
[c]Energy Glyph[c]
Creates a Glyph on the floor which will drain the mana from all units (including allies) and then will release orbs of pure energy onto the surrounding area dealing damage (amount of orbs is based on how much mana was drained/level of ability. It can also drain the remaining energy found within dead corpses of units. All units in the area due to the draining effect have their speed reduced by 50%

Spell drains up to 400 mana (drain is spread evenly on all effected units)
[r]
spells_4276_screenshot_tnb.jpg
[c]Energy Matrix[c]Generates (2 + (1 * level of ability)) Energy Cores which spin around the caster absorbing (9 x level of ability) health per second from nearby units and converting the health into (1.35 x level of ability) mana per second, has up to (10 + (5 * level of ability)) targets. Lasts (3 + (2 * level of ability)) seconds and has a cooldown of 12 seconds.[r]
spells_4385_screenshot_tnb.jpg
[c]Explosive Toxic Gas[c]Toxic Gas:
Spews Gas onto the target area and spreads out randomly from the target point which poisons Organic units and rusts Mechanicals, dealing damage every second, if the gas is ignited it will explode dealing extra damage and setting nearby units on fire.

Level 1 - 4 Directions, Short expansion, weak poison, weak explosion
Level 2 - 6 Directions, Medium expansion, medium poison, medium explosion
Level 3 - 8 Directions, Long expansion, Strong poison, Fatal explosion

Volanic Rock:
Throws a volcanic rock at the target area dealing damage and setting nearby units on fire dealing damage over a short time also ignites toxic gas

Level 1 - Weak damage, Small explosion, 1st degree burn
Level 2 - Medium damage, Medium explosion, 2nd Degree Burn
Level 3 - Heavy Damage, Large explosion, 3rd Degree Burn
[r]
spells_4741_screenshot_tnb.jpg
[c]Helios Collision[c]The power of Helios forms infront of the caster generating a micro-sun which will travel slowly toward the target point, The sun drags enemies into it, upon reaching its destination the sun explodes dealing damage and throwing the enemy units back

Level 1 - Weak Drag, 225 Damage
Level 2 - Medium Drag, 250 Damage
Level 3 - Strong Drag, 275 Damage
[r]
spells_4277_screenshot_tnb.jpg
[c]Magnetised Energy Bombs[c]Learn: Creates Magnetised Energy Bombs which orbit the caster, which leave a trail of fire and pull nearby units into them damaging them until they explode, knocking back all enemies caught within them. Dealing an additional 75 damage if the units collide into a rock. Also deals further mana damage with a feedback effect.

Level 1: Creates 2 Magnetised Energy Bombs which orbit the caster, which leave a trail of fire and pull nearby units into them damaging them dealing 12 damage per second until they explode dealing 150 damage and knocking back all enemies caught within them. Dealing an additional 75 damage if the units collide into a rock. Also deals a further 75 mana damage, which has a feedback effect dealing an additional 75 damage.

Level 2: Creates 3 Magnetised Energy Bombs which orbit the caster, which leave a trail of fire and pull nearby units into them damaging them dealing 24 damage per second until they explode dealing 200 damage and knocking back all enemies caught within them. Dealing an additional 75 damage if the units collide into a rock. Also deals a further 100 mana damage, which has a feedback effect dealing an additional 125 damage.

Level 3: Creates 4 Magnetised Energy Bombs which orbit the caster, which leave a trail of fire and pull nearby units into them damaging them dealing 36 damage per second until they explode dealing 250 damage and knocking back all enemies caught within them. Dealing an additional 75 damage if the units collide into a rock. Also deals a further 150 mana damage, which has a feedback effect dealing an additional 225 damage.
[r]
spells_4280_screenshot_tnb.jpg
[c]Sentry Rocks[c]Learn:Creates pairs of rocks which orbit eachother and the caster, they will seek out enemies which come within a given radius of the rocks and fall on them dealing damage. Rocks last a few seconds

Level 1: Creates 4 pairs of rocks which orbit eachother and the caster, they will seek out enemies which come within a 300 radius of the rocks and fall on them dealing 200 damage each. Rocks last 7 seconds

Level 2: Creates 5 pairs of rocks which orbit eachother and the caster, they will seek out enemies which come within a 400 radius of the rocks and fall on them dealing 250 damage each. Rocks last 9 seconds

Level 3: Creates 6 pairs of rocks which orbit eachother and the caster, they will seek out enemies which come within a 400 radius of the rocks and fall on them dealing 300 damage each. Rocks last 11 seconds
[r]
spells_4559_screenshot_tnb.jpg
[c]Soul Tether[c]Summons a Soul Tether at the target point. The Soul Tether will take hold of enemy units' souls when they become weak, restoring their power and giving control to the caster, however as a penalty they must remain close to the Tether to sustain themselves, and will die without it. The Tether can sustain their lives for a short time.

Level 1 - 250 AOE, 15 second duration, sustains for 7.5 seconds
Level 2 - 300 AOE, 20 second duration, sustains for 10 seconds
Level 3 - 350 AOE, 25 second duration, sustains for 12.5 seconds
[r]
spells_4369_screenshot_tnb.jpg
[c]Spirit Scorpions[c]Throws a volley of spiritual Scorpion eggs randomly onto the target area, the scorpions then hatch and chase down nearby enemies and lay a curse upon them which will deal damage as well as freeze them temporarily.

Level 1 - 8 Eggs, 75 damage, 6 second stun, 1 hit, 250 search range
Level 2 - 10 Eggs, 100 damage, 8 second stun, 2 hits, 300 search range
Level 3 - 12 Eggs, 125 damage, 10 second stun, 3 hits, 350 search range
[r]
spells_4914_screenshot_tnb.jpg
[c]Volcanic Crush[c]Summons 5 Flaming rocks which mark a target for a volcanic energy bomb. The bomb will grow to a critical mass, and then fall onto the location of the target. Can target both enemy and friendly targets, though only damages enemies.

Level 1 - Deals 340 damage at full size.
Level 2 - Deals 380 damage at full size.
Level 3 - Deals 420 damage at full size.
[r]
spells_4289_screenshot_tnb.jpg
[c]Weeds[c]Learn: Creates seeds which will absorb enemy's hitpoints to grow bigger, upon reaching full size the plant will start attacking a specfic enemy dealing heavy damage to that particular targets.
Level 1: 4 Seeds, 7 Seconds duration, 120 drain damage per second, 300 AOE.
Level 2: 5 Seeds, 9 Seconds duration, 150 drain damage per second, 400 AOE.
Level 3: 6 Seeds, 11 Seconds duration, 180 drain damage per second, 500 AOE.

Level 1: Creates seeds which will absorb enemy's hitpoints to grow bigger, upon reaching full size the plant will start attacking a specfic enemy dealing heavy damage to that particular targets.
Level 1: 4 Seeds, 7 Seconds duration, 120 drain damage per second, 300 AOE.

Level 2: Creates seeds which will absorb enemy's hitpoints to grow bigger, upon reaching full size the plant will start attacking a specfic enemy dealing heavy damage to that particular targets.
Level 2: 5 Seeds, 9 Seconds duration, 150 drain damage per second, 400 AOE.

Level 3: Creates seeds which will absorb enemy's hitpoints to grow bigger, upon reaching full size the plant will start attacking a specfic enemy dealing heavy damage to that particular targets.
Level 3: 6 Seeds, 11 Seconds duration, 180 drain damage per second, 500 AOE.
[r]
spells_4275_screenshot_tnb.jpg
[c]Wild Energy[c]Passive spell, Gives a chance of 20 + (20 x level of ability)% to create an orb of energy which will home in on the nearest enemy dealing (0.5 x level of ability) x (max mana - current mana) in an area of 100 + (50 x level of ability) When a spell is casted. Mana cost of spell being casted when this spell is activated is not included.





TRIGGER LISTINGS
- Arcane Drain
  • Arcane Drain Configuration
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- -------- --------
      • -------- Determines the Parts of the spell used --------
      • -------- Launch Projectile --------
      • Set AD_Conditions[0] = True
      • -------- Drain Health --------
      • Set AD_Conditions[1] = True
      • -------- Drain Health Projectile --------
      • Set AD_Conditions[2] = True
      • -------- Drain Mana --------
      • Set AD_Conditions[3] = True
      • -------- Drain Mana Projectile --------
      • Set AD_Conditions[4] = True
      • -------- ProjectileSpeed/Incoming Time --------
      • Set AD_Conditions[5] = False
      • -------- Cycle Themes --------
      • Set AD_Conditions[6] = False
      • -------- If cycle themes is set to False, this determines which Theme will be used --------
      • Set AD_DefaultTheme = 1
      • Set AD_SpellsThemeCount = 3
      • -------- Determines the targets available for the spell --------
      • -------- Target is alive --------
      • Set AD_Conditions[7] = True
      • -------- Target is Magic Immune --------
      • Set AD_Conditions[8] = False
      • -------- Target is Structure --------
      • Set AD_Conditions[9] = False
      • -------- Target is Ground unit --------
      • Set AD_Conditions[10] = True
      • -------- Target is Belongs to an enemy --------
      • Set AD_Conditions[11] = True
      • -------- Full Mana Drain --------
      • Set AD_Conditions[12] = True
      • -------- Other conditions --------
      • -------- Healing SFX --------
      • Set AD_Conditions[13] = True
      • -------- Mana SFX --------
      • Set AD_Conditions[14] = True
      • -------- Drain Mana SFX --------
      • Set AD_Conditions[15] = True
      • -------- Drain Health SFX --------
      • Set AD_Conditions[16] = True
      • -------- Randomise Theme --------
      • Set AD_Conditions[17] = True
      • -------- Controls amount of SFX --------
      • Set AD_SFXWaitTime = 15.00
      • -------- Controls the minimum spread out distance of the drain areas --------
      • Set AD_MinDistanceSpread = 90.00
      • Set AD_RecieveSFXLimiter = 3
      • -------- Determines the Projectile Movement --------
      • -------- Launch Projectile --------
      • Set AD_LaunchArcMultiplyerBase = 0.30
      • Set AD_LaunchArcMultiplyerPL = 0.00
      • Set AD_LaunchSpeedBase = 4.00
      • Set AD_LaunchSpeedPerLevel = 1.00
      • Set AD_LaunchIncomingTimeBase = 2.50
      • Set AD_LaunchIncomingTimePerLevel = -0.50
      • -------- Heal Projectile --------
      • Set AD_HealthArcMultiplyerBase = 0.45
      • Set AD_HealthArcMultiplyerPL = 0.00
      • Set AD_HealSpeedBase = 5.00
      • Set AD_HealSpeedPerLevel = 0.00
      • Set AD_HealthIncomingTimeBase = 2.00
      • Set AD_HealthIncomingTimePerLevel = -0.25
      • -------- Mana Projectile --------
      • Set AD_ManaArcMultiplyerBase = 0.50
      • Set AD_ManaArcMultiplyerPL = 0.00
      • Set AD_ManaSpeedBase = 5.00
      • Set AD_ManaSpeedPerLevel = 0.00
      • Set AD_ManaIncomingTimeBase = 2.00
      • Set AD_ManaIncomingTimePerLevel = -0.25
      • -------- Determines the area that the Drain Areas will scatter across --------
      • Set AD_AoeBase = 200.00
      • Set AD_AoePerLevel = 50.00
      • -------- Determines how much space each Drain Area covers --------
      • Set AD_DrainAreaAOEBase = 120.00
      • Set AD_DrainAreaAOEPerLevel = 0.00
      • -------- Determines the amount of Drain areas created --------
      • Set AD_DrainAreaCountBase = 4
      • Set AD_DrainAreaCountPerLevel = 2
      • -------- Determines how much Health damage a unit takes per second --------
      • Set AD_HealthDamagePerSecBase = 20.00
      • Set AD_HealthDamagePerSecPerLevel = 5.00
      • -------- Determines how much Mana damage a unit takes per second --------
      • Set AD_ManaDamagePerSecBase = 10.00
      • Set AD_ManaDamagePerSecPerLevel = 2.50
      • -------- Determines how long the drain area will last (seconds) --------
      • -------- When changing this, remember to modify the object data spell and increase the "follow through time" to these values +2 or 3 seconds (depending on method of movement) --------
      • -------- Otherwise the spell will end early --------
      • Set AD_DrainAreaDurationBase = 2.00
      • Set AD_DrainAreaDurationPerLevel = 3.00
      • -------- Determines the scaling of the SFX --------
      • -------- Determines the scaling of the Launch Projectiles --------
      • Set AD_EffectScalingLaunchBase = 100.00
      • Set AD_EffectScalingLaunchPL = 0.00
      • -------- Determines the scaling of the Drain Areas --------
      • Set AD_EffectScalingDrainAreaBase = 80.00
      • Set AD_EffectScalingDrainAreaPL = 0.00
      • -------- Determines the scaling of the Drained Health Projectiles --------
      • Set AD_EffectScalingHealthBase = 50.00
      • Set AD_EffectScalingHealthPL = 0.00
      • -------- Determines the scaling of the Drained Mana Projectiles --------
      • Set AD_EffectScalingManaBase = 50.00
      • Set AD_EffectScalingManaPL = 0.00
      • -------- Determines the unit model used as the Drain Area --------
      • Set AD_DrainAreaSFX[1] = Abilities\Spells\Other\Drain\ManaDrainTarget.mdl
      • Set AD_DrainAreaSFX[2] = Abilities\Spells\Orc\LiquidFire\Liquidfire.mdl
      • Set AD_DrainAreaSFX[3] = Abilities\Spells\NightElf\EntanglingRoots\EntanglingRootsTarget.mdl
      • -------- Determines the SFX used as the Launch Projectile --------
      • Set AD_LaunchSFX[1] = Abilities\Weapons\FrostWyrmMissile\FrostWyrmMissile.mdl
      • Set AD_LaunchSFX[2] = Abilities\Weapons\RedDragonBreath\RedDragonMissile.mdl
      • Set AD_LaunchSFX[3] = Abilities\Weapons\GreenDragonMissile\GreenDragonMissile.mdl
      • -------- Determines the SFX used as the Drained Health Projectile --------
      • Set AD_HealthDrainSFX[1] = Abilities\Weapons\ZigguratMissile\ZigguratMissile.mdl
      • Set AD_HealthDrainSFX[2] = Abilities\Weapons\PhoenixMissile\Phoenix_Missile.mdl
      • Set AD_HealthDrainSFX[3] = Abilities\Weapons\IllidanMissile\IllidanMissile.mdl
      • -------- Determines the unit model used as the Drained Mana Projectile --------
      • Set AD_ManaDrainSFX[1] = Abilities\Weapons\FarseerMissile\FarseerMissile.mdl
      • Set AD_ManaDrainSFX[2] = Abilities\Weapons\LavaSpawnMissile\LavaSpawnMissile.mdl
      • Set AD_ManaDrainSFX[3] = Units\Human\HeroBloodElf\BloodElfBall.mdl
      • -------- Determines the unit model used as the Healing effect --------
      • Set AD_HealedLifeSFX[1] = Abilities\Spells\Items\ResourceItems\ResourceEffectTarget.mdl
      • Set AD_HealedLifeSFX[2] = Abilities\Spells\Orc\FeralSpirit\feralspirittarget.mdl
      • Set AD_HealedLifeSFX[3] = Abilities\Spells\Undead\DeathCoil\DeathCoilSpecialArt.mdl
      • -------- Determines the unit model used as the Healing effect for mana --------
      • Set AD_HealedManaSFX[1] = Abilities\Spells\Undead\FrostArmor\FrostArmorDamage.mdl
      • Set AD_HealedManaSFX[2] = Abilities\Spells\Other\Incinerate\FireLordDeathExplode.mdl
      • Set AD_HealedManaSFX[3] = Abilities\Spells\Undead\Sleep\SleepSpecialArt.mdl
      • -------- Determines the unit model used as the Drained effect --------
      • Set AD_DrainedHealthSFX[1] = Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
      • Set AD_DrainedHealthSFX[2] = Abilities\Spells\Other\Incinerate\IncinerateBuff.mdl
      • Set AD_DrainedHealthSFX[3] = Abilities\Spells\NightElf\Immolation\ImmolationDamage.mdl
      • -------- Determines the unit model used as the Drained effect for mana --------
      • Set AD_DrainedManaSFX[1] = Abilities\Spells\Items\SpellShieldAmulet\SpellShieldCaster.mdl
      • Set AD_DrainedManaSFX[2] = Abilities\Spells\Other\Incinerate\FireLordDeathExplode.mdl
      • Set AD_DrainedManaSFX[3] = Abilities\Spells\Undead\CarrionSwarm\CarrionSwarmDamage.mdl
      • -------- Determines the unit model used as the effect for ending the spell --------
      • Set AD_EndSFX[1] = Abilities\Spells\Human\DispelMagic\DispelMagicTarget.mdl
      • Set AD_EndSFX[2] = Abilities\Spells\Other\Incinerate\FireLordDeathExplode.mdl
      • Set AD_EndSFX[3] = Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • -------- Determines the unit model use when the effect is cancelled early --------
      • Set AD_CancelledSFX[1] = Abilities\Spells\Human\DispelMagic\DispelMagicTarget.mdl
      • Set AD_CancelledSFX[2] = Abilities\Spells\Other\Incinerate\FireLordDeathExplode.mdl
      • Set AD_CancelledSFX[3] = Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • -------- Determines the ability used as a dummy --------
      • Set AD_Spell = Arcane Drain
      • -------- Determines the order used to check that the spell is being cast (should match ability used) --------
      • Set AD_Order = channel
      • -------- Determines the Dummy used to attach all the effects to --------
      • Set AD_DummyType = Arcane Drain
      • -------- -------- --------
      • -------- Determines the Speed of the loop trigger --------
      • Set AD_TimerSpeed = 0.03
      • Trigger - Add to Arcane Drain Loop <gen> the event (Time - Every AD_TimerSpeed seconds of game time)
      • -------- -------- --------
  • Arcane Drain Activation
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to AD_Spell
    • Actions
      • Set AD_TempUnit2 = (Triggering unit)
      • Set AD_TempPlayer = (Owner of AD_TempUnit2)
      • Set AD_TempInteger2 = (Level of AD_Spell for AD_TempUnit2)
      • Set AD_TempReal = (Real(AD_TempInteger2))
      • Set AD_TempInteger = (AD_DrainAreaCountBase + (AD_DrainAreaCountPerLevel x (Integer(AD_TempReal))))
      • Set AD_TempPoint2 = (Target point of ability being cast)
      • -------- Identifies if you want the theme to change upon level up, randomly, or not at all --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • AD_Conditions[17] Equal to True
        • Then - Actions
          • Set AD_TempInteger2 = (Random integer number between 1 and AD_SpellsThemeCount)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • AD_Conditions[6] Equal to False
            • Then - Actions
              • Set AD_TempInteger2 = AD_DefaultTheme
            • Else - Actions
      • -------- Runs depending on if you want starting projectiles --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • AD_Conditions[0] Equal to True
        • Then - Actions
          • -------- Projectile Launch --------
          • Set AD_TempPoint = (Position of AD_TempUnit2)
          • For each (Integer AD_Index) from 1 to AD_TempInteger, do (Actions)
            • Loop - Actions
              • Set AD_MaxIndex = (AD_MaxIndex + 1)
              • Set AD_TempPoint3 = (AD_TempPoint2 offset by (Random real number between AD_MinDistanceSpread and (AD_AoeBase + (AD_AoePerLevel x AD_TempReal))) towards (Random angle) degrees)
              • Unit - Create 1 AD_DummyType for AD_TempPlayer at AD_TempPoint facing (Angle from AD_TempPoint to AD_TempPoint3) degrees
              • Set AD_TempUnit = (Last created unit)
              • Special Effect - Create a special effect attached to the origin of AD_TempUnit using AD_LaunchSFX[AD_TempInteger2]
              • Animation - Change AD_TempUnit's size to ((AD_EffectScalingLaunchBase + (AD_EffectScalingLaunchPL x AD_TempReal))%, 0.00%, 0.00%) of its original size
              • Set AD_OriginalCaster[AD_MaxIndex] = AD_TempUnit2
              • Set AD_SpecialEffect[AD_MaxIndex] = (Last created special effect)
              • Set AD_DrainAOE[AD_MaxIndex] = (AD_DrainAreaAOEBase + (AD_DrainAreaAOEPerLevel x AD_TempReal))
              • Set AD_HealthDrain[AD_MaxIndex] = (((AD_HealthDamagePerSecBase + (AD_HealthDamagePerSecPerLevel x AD_TempReal)) x AD_TimerSpeed) x AD_SFXWaitTime)
              • Set AD_ManaDrain[AD_MaxIndex] = (((AD_ManaDamagePerSecBase + (AD_ManaDamagePerSecPerLevel x AD_TempReal)) x AD_TimerSpeed) x AD_SFXWaitTime)
              • Set AD_Duration[AD_MaxIndex] = (AD_DrainAreaDurationBase + (AD_DrainAreaDurationPerLevel x AD_TempReal))
              • Set AD_AbilityLevel[AD_MaxIndex] = AD_TempReal
              • Set AD_CurrentDistance[AD_MaxIndex] = 0.00
              • Set AD_Theme[AD_MaxIndex] = AD_TempInteger2
              • Custom script: set udg_AD_CasterX[udg_AD_MaxIndex] = GetUnitX(udg_AD_TempUnit2)
              • Custom script: set udg_AD_CasterY[udg_AD_MaxIndex] = GetUnitY(udg_AD_TempUnit2)
              • Set AD_MaxDistance[AD_MaxIndex] = (Distance between AD_TempPoint and AD_TempPoint3)
              • Set AD_MaxHeight[AD_MaxIndex] = (AD_MaxDistance[AD_MaxIndex] x (AD_LaunchArcMultiplyerBase + (AD_LaunchArcMultiplyerPL x AD_TempReal)))
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • AD_Conditions[5] Equal to True
                • Then - Actions
                  • Set AD_LaunchSpeed[AD_MaxIndex] = (AD_LaunchSpeedBase + (AD_LaunchSpeedPerLevel x AD_TempReal))
                • Else - Actions
                  • Set AD_LaunchSpeed[AD_MaxIndex] = ((AD_MaxDistance[AD_MaxIndex] x 0.03) / (AD_LaunchIncomingTimeBase + (AD_LaunchIncomingTimePerLevel x AD_TempReal)))
              • Set AD_UnitIndex[AD_MaxIndex] = AD_TempUnit
              • Set AD_StageID[AD_MaxIndex] = 1
              • Custom script: call RemoveLocation (udg_AD_TempPoint3)
              • Custom script: set udg_AD_TempPoint3 = null
          • Custom script: call RemoveLocation (udg_AD_TempPoint)
          • Custom script: set udg_AD_TempPoint = null
        • Else - Actions
          • -------- Instant Draining area creation --------
          • For each (Integer AD_Index) from 1 to AD_TempInteger, do (Actions)
            • Loop - Actions
              • Set AD_MaxIndex = (AD_MaxIndex + 1)
              • Set AD_TempPoint3 = (AD_TempPoint2 offset by (AD_AoeBase + (AD_AoePerLevel x AD_TempReal)) towards (Random angle) degrees)
              • Unit - Create 1 AD_DummyType for AD_TempPlayer at AD_TempPoint3 facing (Angle from AD_TempPoint2 to AD_TempPoint3) degrees
              • Set AD_TempUnit = (Last created unit)
              • Unit - Add a (AD_DrainAreaDurationBase + (AD_DrainAreaDurationPerLevel x AD_TempReal)) second Generic expiration timer to AD_TempUnit
              • Unit - Pause AD_TempUnit
              • Special Effect - Create a special effect attached to the origin of AD_TempUnit using AD_DrainAreaSFX[AD_TempInteger2]
              • Animation - Change AD_TempUnit's size to ((AD_EffectScalingDrainAreaBase + (AD_EffectScalingDrainAreaPL x AD_TempReal))%, 0.00%, 0.00%) of its original size
              • Set AD_OriginalCaster[AD_MaxIndex] = AD_TempUnit2
              • Set AD_SpecialEffect[AD_MaxIndex] = (Last created special effect)
              • Set AD_DrainAOE[AD_MaxIndex] = (AD_DrainAreaAOEBase + (AD_DrainAreaAOEPerLevel x AD_TempReal))
              • Set AD_AbilityLevel[AD_MaxIndex] = AD_TempReal
              • Set AD_HealthDrain[AD_MaxIndex] = (((AD_HealthDamagePerSecBase + (AD_HealthDamagePerSecPerLevel x AD_TempReal)) x AD_TimerSpeed) x AD_SFXWaitTime)
              • Set AD_ManaDrain[AD_MaxIndex] = (((AD_ManaDamagePerSecBase + (AD_ManaDamagePerSecPerLevel x AD_TempReal)) x AD_TimerSpeed) x AD_SFXWaitTime)
              • Set AD_UnitIndex[AD_MaxIndex] = AD_TempUnit
              • Set AD_Theme[AD_MaxIndex] = AD_TempInteger2
              • Set AD_StageID[AD_MaxIndex] = 2
              • Custom script: call RemoveLocation (udg_AD_TempPoint3)
              • Custom script: set udg_AD_TempPoint3 = null
      • Custom script: call RemoveLocation (udg_AD_TempPoint2)
      • Custom script: set udg_AD_TempPoint2 = null
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Arcane Drain Loop <gen> is on) Equal to False
          • AD_MaxIndex Greater than or equal to 1
        • Then - Actions
          • Trigger - Turn on Arcane Drain Loop <gen>
          • Trigger - Turn on Arcane Drain Dummy Removal <gen>
        • Else - Actions
  • Arcane Drain Loop
    • Events
    • Conditions
    • Actions
      • For each (Integer AD_Index) from 1 to AD_MaxIndex, do (Actions)
        • Loop - Actions
          • -------- Initial projectile control --------
          • Set AD_TempUnit = AD_UnitIndex[AD_Index]
          • Custom script: set udg_AD_TempX = GetUnitX(udg_AD_OriginalCaster[udg_AD_Index])
          • Custom script: set udg_AD_TempY = GetUnitY(udg_AD_OriginalCaster[udg_AD_Index])
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Current order of AD_OriginalCaster[AD_Index]) Not equal to (Order(AD_Order))
                  • AD_CasterX[AD_Index] Not equal to AD_TempX
                  • AD_CasterY[AD_Index] Not equal to AD_TempY
            • Then - Actions
              • Special Effect - Destroy AD_SpecialEffect[AD_Index]
              • Special Effect - Create a special effect attached to the origin of AD_TempUnit using AD_CancelledSFX[AD_Theme[AD_Index]]
              • Special Effect - Destroy (Last created special effect)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • AD_StageID[AD_Index] Equal to 2
                • Then - Actions
                  • Unit - Kill AD_TempUnit
                • Else - Actions
                  • Set AD_StageID[AD_Index] = 5
            • Else - Actions
          • Custom script: set udg_AD_CasterX[udg_AD_Index] = udg_AD_TempX
          • Custom script: set udg_AD_CasterY[udg_AD_Index] = udg_AD_TempY
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • AD_StageID[AD_Index] Equal to 1
            • Then - Actions
              • Custom script: set udg_AD_TempX = GetUnitX(udg_AD_TempUnit)
              • Custom script: set udg_AD_TempY = GetUnitY(udg_AD_TempUnit)
              • Custom script: set udg_AD_Angle = GetUnitFacing(udg_AD_TempUnit) * bj_DEGTORAD
              • Custom script: call SetUnitX(udg_AD_TempUnit, udg_AD_TempX + udg_AD_LaunchSpeed[udg_AD_Index] * Cos(udg_AD_Angle))
              • Custom script: call SetUnitY(udg_AD_TempUnit, udg_AD_TempY + udg_AD_LaunchSpeed[udg_AD_Index] * Sin(udg_AD_Angle))
              • Set AD_CurrentDistance[AD_Index] = (AD_CurrentDistance[AD_Index] + AD_LaunchSpeed[AD_Index])
              • Animation - Change AD_TempUnit flying height to ((((4.00 x AD_MaxHeight[AD_Index]) / AD_MaxDistance[AD_Index]) x (AD_CurrentDistance[AD_Index] / AD_MaxDistance[AD_Index])) x (AD_MaxDistance[AD_Index] - AD_CurrentDistance[AD_Index])) at 0.00
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • AD_CurrentDistance[AD_Index] Greater than or equal to AD_MaxDistance[AD_Index]
                • Then - Actions
                  • Special Effect - Destroy AD_SpecialEffect[AD_Index]
                  • Special Effect - Create a special effect attached to the origin of AD_TempUnit using AD_DrainAreaSFX[AD_Theme[AD_Index]]
                  • Set AD_SpecialEffect[AD_Index] = (Last created special effect)
                  • Animation - Change AD_TempUnit's size to ((AD_EffectScalingDrainAreaBase + (AD_EffectScalingDrainAreaPL x AD_TempReal))%, 0.00%, 0.00%) of its original size
                  • Unit - Add a AD_Duration[AD_Index] second Generic expiration timer to AD_TempUnit
                  • Set AD_StageID[AD_Index] = 2
                • Else - Actions
            • Else - Actions
              • -------- Draining control --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • AD_StageID[AD_Index] Equal to 2
                • Then - Actions
                  • Set AD_TempPoint = (Position of AD_TempUnit)
                  • Set AD_TempGroup = (Units within AD_DrainAOE[AD_Index] of AD_TempPoint)
                  • Unit Group - Pick every unit in AD_TempGroup and do (Actions)
                    • Loop - Actions
                      • Set AD_TempUnit2 = (Picked unit)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (AD_TempUnit2 is alive) Equal to AD_Conditions[7]
                          • (AD_TempUnit2 is Magic Immune) Equal to AD_Conditions[8]
                          • (AD_TempUnit2 is A structure) Equal to AD_Conditions[9]
                          • (AD_TempUnit2 is A ground unit) Equal to AD_Conditions[10]
                          • (AD_TempUnit2 belongs to an enemy of (Owner of AD_OriginalCaster[AD_Index])) Equal to AD_Conditions[11]
                        • Then - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • AD_Conditions[1] Equal to True
                            • Then - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • AD_SFXCurrentWaitTimeHpHeal[AD_Index] Greater than or equal to AD_SFXWaitTime
                                • Then - Actions
                                  • Set AD_TempReal = (Life of AD_TempUnit2)
                                  • Unit - Cause AD_OriginalCaster[AD_Index] to damage AD_TempUnit2, dealing AD_HealthDrain[AD_Index] damage of attack type Spells and damage type Normal
                                  • Set AD_TempReal2 = (Life of AD_TempUnit2)
                                  • Set AD_CarriedHealth[AD_Index] = (AD_TempReal - AD_TempReal2)
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • AD_Conditions[16] Equal to True
                                    • Then - Actions
                                      • Special Effect - Create a special effect attached to the chest of AD_TempUnit2 using AD_DrainedHealthSFX[AD_Theme[AD_Index]]
                                      • Special Effect - Destroy (Last created special effect)
                                    • Else - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • AD_Conditions[2] Equal to True
                                    • Then - Actions
                                      • -------- Health Segment creation --------
                                      • Set AD_MaxIndex = (AD_MaxIndex + 1)
                                      • Set AD_TempPoint2 = (Position of AD_OriginalCaster[AD_Index])
                                      • Unit - Create 1 AD_DummyType for AD_TempPlayer at AD_TempPoint facing (Angle from AD_TempPoint to AD_TempPoint2) degrees
                                      • Set AD_TempUnit = (Last created unit)
                                      • Set AD_TempReal = AD_AbilityLevel[AD_Index]
                                      • Special Effect - Create a special effect attached to the origin of AD_TempUnit using AD_HealthDrainSFX[AD_Theme[AD_Index]]
                                      • Animation - Change AD_TempUnit's size to ((AD_EffectScalingHealthBase + (AD_EffectScalingHealthPL x AD_TempReal))%, 0.00%, 0.00%) of its original size
                                      • Set AD_OriginalCaster[AD_MaxIndex] = AD_OriginalCaster[AD_Index]
                                      • Set AD_SpecialEffect[AD_MaxIndex] = (Last created special effect)
                                      • Set AD_CarriedHealth[AD_MaxIndex] = AD_CarriedHealth[AD_Index]
                                      • Set AD_CarriedMana[AD_MaxIndex] = 0.00
                                      • Set AD_CurrentDistance[AD_MaxIndex] = 0.00
                                      • Set AD_Theme[AD_MaxIndex] = AD_TempInteger2
                                      • Set AD_MaxDistance[AD_MaxIndex] = (Distance between AD_TempPoint and AD_TempPoint2)
                                      • Set AD_MaxHeight[AD_MaxIndex] = (AD_MaxDistance[AD_MaxIndex] x (AD_HealthArcMultiplyerBase + (AD_HealthArcMultiplyerPL x AD_TempReal)))
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • AD_Conditions[5] Equal to True
                                        • Then - Actions
                                          • Set AD_HealthSpeed[AD_MaxIndex] = (AD_HealSpeedBase + (AD_HealSpeedPerLevel x AD_TempReal))
                                        • Else - Actions
                                          • Set AD_HealthSpeed[AD_MaxIndex] = ((AD_MaxDistance[AD_MaxIndex] x AD_TimerSpeed) / (AD_HealthIncomingTimeBase + (AD_HealthIncomingTimePerLevel x AD_TempReal)))
                                      • Set AD_UnitIndex[AD_MaxIndex] = AD_TempUnit
                                      • Set AD_StageID[AD_MaxIndex] = 3
                                      • Custom script: call RemoveLocation (udg_AD_TempPoint2)
                                    • Else - Actions
                                      • Set AD_SFXLimiter = (Random integer number between 1 and AD_RecieveSFXLimiter)
                                      • Unit - Set life of AD_OriginalCaster[AD_Index] to ((Life of AD_OriginalCaster[AD_Index]) + AD_CarriedHealth[AD_Index])
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • AD_Conditions[13] Equal to True
                                          • AD_SFXLimiter Equal to 1
                                        • Then - Actions
                                          • Special Effect - Create a special effect attached to the origin of AD_OriginalCaster[AD_Index] using AD_HealedLifeSFX[AD_Theme[AD_Index]]
                                          • Special Effect - Destroy (Last created special effect)
                                        • Else - Actions
                                  • Set AD_SFXCurrentWaitTimeHpHeal[AD_Index] = 0.00
                                • Else - Actions
                                  • Set AD_SFXCurrentWaitTimeHpHeal[AD_Index] = (AD_SFXCurrentWaitTimeHpHeal[AD_Index] + 1.00)
                            • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • AD_Conditions[3] Equal to True
                              • (Mana of AD_TempUnit2) Greater than 0.00
                            • Then - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • AD_SFXCurrentWaitTimeManaHeal[AD_Index] Greater than or equal to AD_SFXWaitTime
                                • Then - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • AD_Conditions[12] Equal to False
                                    • Then - Actions
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • (Mana of AD_TempUnit2) Greater than or equal to AD_ManaDrain[AD_Index]
                                        • Then - Actions
                                          • Unit - Set mana of AD_TempUnit2 to ((Mana of AD_TempUnit2) - AD_ManaDrain[AD_Index])
                                          • Set AD_CarriedMana[AD_Index] = AD_ManaDrain[AD_Index]
                                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            • If - Conditions
                                              • AD_Conditions[15] Equal to True
                                            • Then - Actions
                                              • Special Effect - Create a special effect attached to the chest of AD_TempUnit2 using AD_DrainedManaSFX[AD_Theme[AD_Index]]
                                              • Special Effect - Destroy (Last created special effect)
                                            • Else - Actions
                                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            • If - Conditions
                                              • AD_Conditions[4] Equal to True
                                            • Then - Actions
                                              • -------- Mana segment creation --------
                                              • Set AD_MaxIndex = (AD_MaxIndex + 1)
                                              • Set AD_TempPoint2 = (Position of AD_OriginalCaster[AD_Index])
                                              • Unit - Create 1 AD_DummyType for AD_TempPlayer at AD_TempPoint facing (Angle from AD_TempPoint to AD_TempPoint2) degrees
                                              • Set AD_TempUnit = (Last created unit)
                                              • Set AD_TempReal = AD_AbilityLevel[AD_Index]
                                              • Special Effect - Create a special effect attached to the origin of AD_TempUnit using AD_ManaDrainSFX[AD_Theme[AD_Index]]
                                              • Animation - Change AD_TempUnit's size to ((AD_EffectScalingManaBase + (AD_EffectScalingManaPL x AD_TempReal))%, 0.00%, 0.00%) of its original size
                                              • Set AD_OriginalCaster[AD_MaxIndex] = AD_OriginalCaster[AD_Index]
                                              • Set AD_SpecialEffect[AD_MaxIndex] = (Last created special effect)
                                              • Set AD_CarriedHealth[AD_MaxIndex] = 0.00
                                              • Set AD_CarriedMana[AD_MaxIndex] = AD_CarriedMana[AD_Index]
                                              • Set AD_CurrentDistance[AD_MaxIndex] = 0.00
                                              • Set AD_Theme[AD_MaxIndex] = AD_TempInteger2
                                              • Set AD_MaxDistance[AD_MaxIndex] = (Distance between AD_TempPoint and AD_TempPoint2)
                                              • Set AD_MaxHeight[AD_MaxIndex] = (AD_MaxDistance[AD_MaxIndex] x (AD_ManaArcMultiplyerBase + (AD_ManaArcMultiplyerPL x AD_TempReal)))
                                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                • If - Conditions
                                                  • AD_Conditions[5] Equal to True
                                                • Then - Actions
                                                  • Set AD_ManaSpeed[AD_MaxIndex] = (AD_ManaSpeedBase + (AD_ManaSpeedPerLevel x AD_TempReal))
                                                • Else - Actions
                                                  • Set AD_ManaSpeed[AD_MaxIndex] = ((AD_MaxDistance[AD_MaxIndex] x AD_TimerSpeed) / (AD_ManaIncomingTimeBase + (AD_ManaIncomingTimePerLevel x AD_TempReal)))
                                              • Set AD_UnitIndex[AD_MaxIndex] = AD_TempUnit
                                              • Set AD_StageID[AD_MaxIndex] = 4
                                              • Custom script: call RemoveLocation (udg_AD_TempPoint2)
                                            • Else - Actions
                                              • Set AD_SFXLimiter = (Random integer number between 1 and AD_RecieveSFXLimiter)
                                              • Unit - Set mana of AD_OriginalCaster[AD_Index] to ((Mana of AD_OriginalCaster[AD_Index]) + AD_CarriedMana[AD_Index])
                                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                • If - Conditions
                                                  • AD_Conditions[14] Equal to True
                                                  • AD_SFXLimiter Equal to 1
                                                • Then - Actions
                                                  • Special Effect - Create a special effect attached to the chest of AD_OriginalCaster[AD_Index] using AD_HealedManaSFX[AD_Theme[AD_Index]]
                                                  • Special Effect - Destroy (Last created special effect)
                                                • Else - Actions
                                        • Else - Actions
                                          • Set AD_CarriedMana[AD_Index] = 0.00
                                    • Else - Actions
                                      • Set AD_TempReal = (Mana of AD_TempUnit2)
                                      • Unit - Set mana of AD_TempUnit2 to ((Mana of AD_TempUnit2) - AD_ManaDrain[AD_Index])
                                      • Set AD_TempReal2 = (Mana of AD_TempUnit2)
                                      • Set AD_CarriedMana[AD_Index] = (AD_TempReal - AD_TempReal2)
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • AD_Conditions[15] Equal to True
                                        • Then - Actions
                                          • Special Effect - Create a special effect attached to the chest of AD_TempUnit2 using AD_DrainedManaSFX[AD_Theme[AD_Index]]
                                          • Special Effect - Destroy (Last created special effect)
                                        • Else - Actions
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • AD_Conditions[4] Equal to True
                                        • Then - Actions
                                          • -------- Mana segment creation --------
                                          • Set AD_MaxIndex = (AD_MaxIndex + 1)
                                          • Set AD_TempPoint2 = (Position of AD_OriginalCaster[AD_Index])
                                          • Unit - Create 1 AD_DummyType for AD_TempPlayer at AD_TempPoint facing (Angle from AD_TempPoint to AD_TempPoint2) degrees
                                          • Set AD_TempUnit = (Last created unit)
                                          • Set AD_TempReal = AD_AbilityLevel[AD_Index]
                                          • Special Effect - Create a special effect attached to the origin of AD_TempUnit using AD_ManaDrainSFX[AD_Theme[AD_Index]]
                                          • Animation - Change AD_TempUnit's size to ((AD_EffectScalingManaBase + (AD_EffectScalingManaPL x AD_TempReal))%, 0.00%, 0.00%) of its original size
                                          • Set AD_OriginalCaster[AD_MaxIndex] = AD_OriginalCaster[AD_Index]
                                          • Set AD_SpecialEffect[AD_MaxIndex] = (Last created special effect)
                                          • Set AD_CarriedHealth[AD_MaxIndex] = 0.00
                                          • Set AD_CarriedMana[AD_MaxIndex] = AD_CarriedMana[AD_Index]
                                          • Set AD_CurrentDistance[AD_MaxIndex] = 0.00
                                          • Set AD_Theme[AD_MaxIndex] = AD_TempInteger2
                                          • Set AD_MaxDistance[AD_MaxIndex] = (Distance between AD_TempPoint and AD_TempPoint2)
                                          • Set AD_MaxHeight[AD_MaxIndex] = (AD_MaxDistance[AD_MaxIndex] x (AD_ManaArcMultiplyerBase + (AD_ManaArcMultiplyerPL x AD_TempReal)))
                                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            • If - Conditions
                                              • AD_Conditions[5] Equal to True
                                            • Then - Actions
                                              • Set AD_ManaSpeed[AD_MaxIndex] = (AD_ManaSpeedBase + (AD_ManaSpeedPerLevel x AD_TempReal))
                                            • Else - Actions
                                              • Set AD_ManaSpeed[AD_MaxIndex] = ((AD_MaxDistance[AD_MaxIndex] x AD_TimerSpeed) / (AD_ManaIncomingTimeBase + (AD_ManaIncomingTimePerLevel x AD_TempReal)))
                                          • Set AD_UnitIndex[AD_MaxIndex] = AD_TempUnit
                                          • Set AD_StageID[AD_MaxIndex] = 4
                                          • Custom script: call RemoveLocation (udg_AD_TempPoint2)
                                        • Else - Actions
                                          • Set AD_SFXLimiter = (Random integer number between 1 and AD_RecieveSFXLimiter)
                                          • Unit - Set mana of AD_OriginalCaster[AD_Index] to ((Mana of AD_OriginalCaster[AD_Index]) + AD_CarriedMana[AD_Index])
                                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            • If - Conditions
                                              • AD_Conditions[14] Equal to True
                                              • AD_SFXLimiter Equal to 1
                                            • Then - Actions
                                              • Special Effect - Create a special effect attached to the chest of AD_OriginalCaster[AD_Index] using AD_HealedManaSFX[AD_Theme[AD_Index]]
                                              • Special Effect - Destroy (Last created special effect)
                                            • Else - Actions
                                  • Set AD_SFXCurrentWaitTimeManaHeal[AD_Index] = 0.00
                                • Else - Actions
                                  • Set AD_SFXCurrentWaitTimeManaHeal[AD_Index] = (AD_SFXCurrentWaitTimeManaHeal[AD_Index] + 1.00)
                            • Else - Actions
                        • Else - Actions
                  • Custom script: call DestroyGroup (udg_AD_TempGroup)
                  • Custom script: call RemoveLocation (udg_AD_TempPoint)
                  • Custom script: set udg_AD_TempPoint = null
                  • Custom script: set udg_AD_TempGroup = null
                • Else - Actions
                  • -------- Health Segments control --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • AD_StageID[AD_Index] Equal to 3
                    • Then - Actions
                      • Set AD_TempPoint3 = (Position of AD_OriginalCaster[AD_Index])
                      • Set AD_TempPoint2 = (Position of AD_TempUnit)
                      • Unit - Make AD_TempUnit face AD_OriginalCaster[AD_Index] over 0.00 seconds
                      • Custom script: set udg_AD_TempX = GetUnitX(udg_AD_TempUnit)
                      • Custom script: set udg_AD_TempY = GetUnitY(udg_AD_TempUnit)
                      • Custom script: set udg_AD_Angle = GetUnitFacing(udg_AD_TempUnit) * bj_DEGTORAD
                      • Custom script: call SetUnitX(udg_AD_TempUnit, udg_AD_TempX + udg_AD_HealthSpeed[udg_AD_Index] * Cos(udg_AD_Angle))
                      • Custom script: call SetUnitY(udg_AD_TempUnit, udg_AD_TempY + udg_AD_HealthSpeed[udg_AD_Index] * Sin(udg_AD_Angle))
                      • Set AD_CurrentDistance[AD_Index] = (AD_CurrentDistance[AD_Index] + AD_HealthSpeed[AD_Index])
                      • Animation - Change AD_TempUnit flying height to ((((4.00 x AD_MaxHeight[AD_Index]) / AD_MaxDistance[AD_Index]) x (AD_CurrentDistance[AD_Index] / AD_MaxDistance[AD_Index])) x (AD_MaxDistance[AD_Index] - AD_CurrentDistance[AD_Index])) at 0.00
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Distance between AD_TempPoint2 and AD_TempPoint3) Less than or equal to 50.00
                        • Then - Actions
                          • Special Effect - Destroy AD_SpecialEffect[AD_Index]
                          • Set AD_SFXLimiter = (Random integer number between 1 and AD_RecieveSFXLimiter)
                          • Unit - Set life of AD_OriginalCaster[AD_Index] to ((Life of AD_OriginalCaster[AD_Index]) + AD_CarriedHealth[AD_Index])
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • AD_Conditions[13] Equal to True
                              • AD_SFXLimiter Equal to 1
                            • Then - Actions
                              • Special Effect - Create a special effect attached to the origin of AD_OriginalCaster[AD_Index] using AD_HealedLifeSFX[AD_Theme[AD_Index]]
                              • Special Effect - Destroy (Last created special effect)
                            • Else - Actions
                          • Set AD_StageID[AD_Index] = 5
                        • Else - Actions
                      • Custom script: call RemoveLocation (udg_AD_TempPoint3)
                      • Custom script: call RemoveLocation (udg_AD_TempPoint2)
                      • Custom script: set udg_AD_TempPoint3 = null
                      • Custom script: set udg_AD_TempPoint2 = null
                    • Else - Actions
                      • -------- Mana Segments control --------
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • AD_StageID[AD_Index] Equal to 4
                        • Then - Actions
                          • Set AD_TempPoint3 = (Position of AD_OriginalCaster[AD_Index])
                          • Set AD_TempPoint2 = (Position of AD_TempUnit)
                          • Unit - Make AD_TempUnit face AD_OriginalCaster[AD_Index] over 0.00 seconds
                          • Custom script: set udg_AD_TempX = GetUnitX(udg_AD_TempUnit)
                          • Custom script: set udg_AD_TempY = GetUnitY(udg_AD_TempUnit)
                          • Custom script: set udg_AD_Angle = GetUnitFacing(udg_AD_TempUnit) * bj_DEGTORAD
                          • Custom script: call SetUnitX(udg_AD_TempUnit, udg_AD_TempX + udg_AD_ManaSpeed[udg_AD_Index] * Cos(udg_AD_Angle))
                          • Custom script: call SetUnitY(udg_AD_TempUnit, udg_AD_TempY + udg_AD_ManaSpeed[udg_AD_Index] * Sin(udg_AD_Angle))
                          • Set AD_CurrentDistance[AD_Index] = (AD_CurrentDistance[AD_Index] + AD_ManaSpeed[AD_Index])
                          • Animation - Change AD_TempUnit flying height to ((((4.00 x AD_MaxHeight[AD_Index]) / AD_MaxDistance[AD_Index]) x (AD_CurrentDistance[AD_Index] / AD_MaxDistance[AD_Index])) x (AD_MaxDistance[AD_Index] - AD_CurrentDistance[AD_Index])) at 0.00
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Distance between AD_TempPoint2 and AD_TempPoint3) Less than or equal to 50.00
                            • Then - Actions
                              • Special Effect - Destroy AD_SpecialEffect[AD_Index]
                              • Unit - Set mana of AD_OriginalCaster[AD_Index] to ((Mana of AD_OriginalCaster[AD_Index]) + AD_CarriedMana[AD_Index])
                              • Set AD_SFXLimiter = (Random integer number between 1 and AD_RecieveSFXLimiter)
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • AD_Conditions[14] Equal to True
                                  • AD_SFXLimiter Equal to 1
                                • Then - Actions
                                  • Special Effect - Create a special effect attached to the chest of AD_OriginalCaster[AD_Index] using AD_HealedManaSFX[AD_Theme[AD_Index]]
                                  • Special Effect - Destroy (Last created special effect)
                                • Else - Actions
                              • Set AD_StageID[AD_Index] = 5
                            • Else - Actions
                          • Custom script: call RemoveLocation (udg_AD_TempPoint3)
                          • Custom script: call RemoveLocation (udg_AD_TempPoint2)
                          • Custom script: set udg_AD_TempPoint3 = null
                          • Custom script: set udg_AD_TempPoint2 = null
                        • Else - Actions
                          • -------- Index recycling --------
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • AD_StageID[AD_Index] Equal to 5
                            • Then - Actions
                              • Set AD_OriginalCaster[AD_Index] = AD_OriginalCaster[AD_MaxIndex]
                              • Set AD_SpecialEffect[AD_Index] = AD_SpecialEffect[AD_MaxIndex]
                              • Set AD_DrainAOE[AD_MaxIndex] = (AD_DrainAreaAOEBase + (AD_DrainAreaAOEPerLevel x AD_TempReal))
                              • Set AD_Duration[AD_Index] = AD_Duration[AD_MaxIndex]
                              • Set AD_AbilityLevel[AD_Index] = AD_AbilityLevel[AD_MaxIndex]
                              • Set AD_HealthDrain[AD_Index] = AD_HealthDrain[AD_MaxIndex]
                              • Set AD_ManaDrain[AD_Index] = AD_ManaDrain[AD_MaxIndex]
                              • Set AD_CarriedHealth[AD_Index] = AD_CarriedHealth[AD_MaxIndex]
                              • Set AD_CarriedMana[AD_Index] = AD_CarriedMana[AD_MaxIndex]
                              • Set AD_CurrentDistance[AD_Index] = AD_CurrentDistance[AD_MaxIndex]
                              • Set AD_SFXCurrentWaitTimeHpHeal[AD_Index] = AD_SFXCurrentWaitTimeHpHeal[AD_MaxIndex]
                              • Set AD_SFXCurrentWaitTimeManaHeal[AD_Index] = AD_SFXCurrentWaitTimeManaHeal[AD_MaxIndex]
                              • Set AD_HealthSpeed[AD_Index] = AD_HealthSpeed[AD_MaxIndex]
                              • Set AD_ManaSpeed[AD_Index] = AD_ManaSpeed[AD_MaxIndex]
                              • Set AD_LaunchSpeed[AD_Index] = AD_LaunchSpeed[AD_MaxIndex]
                              • Set AD_Theme[AD_Index] = AD_Theme[AD_MaxIndex]
                              • Set AD_MaxDistance[AD_Index] = AD_MaxDistance[AD_MaxIndex]
                              • Set AD_MaxHeight[AD_Index] = AD_MaxHeight[AD_MaxIndex]
                              • Set AD_UnitIndex[AD_Index] = AD_UnitIndex[AD_MaxIndex]
                              • Set AD_StageID[AD_Index] = AD_StageID[AD_MaxIndex]
                              • Custom script: set udg_AD_CasterX[udg_AD_Index] = udg_AD_CasterX[udg_AD_MaxIndex]
                              • Custom script: set udg_AD_CasterY[udg_AD_Index] = udg_AD_CasterY[udg_AD_MaxIndex]
                              • Set AD_MaxIndex = (AD_MaxIndex - 1)
                              • Set AD_Index = (AD_Index - 1)
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • AD_MaxIndex Equal to 0
                                • Then - Actions
                                  • Trigger - Turn off Arcane Drain Loop <gen>
                                  • Trigger - Turn off Arcane Drain Dummy Removal <gen>
                                • Else - Actions
                              • Unit - Remove AD_TempUnit from the game
                            • Else - Actions
  • Arcane Drain Dummy Removal
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • -------- Clears up draining areas after they expire --------
      • Set AD_TempUnit = (Triggering unit)
      • For each (Integer AD_Index) from 1 to AD_MaxIndex, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of AD_TempUnit) Equal to AD_DummyType
              • AD_TempUnit Equal to AD_UnitIndex[AD_Index]
            • Then - Actions
              • Set AD_TempPoint = (Position of AD_TempUnit)
              • Special Effect - Destroy AD_SpecialEffect[AD_Index]
              • Special Effect - Create a special effect at AD_TempPoint using AD_EndSFX[AD_Theme[AD_Index]]
              • Special Effect - Destroy (Last created special effect)
              • Set AD_StageID[AD_Index] = 5
              • Custom script: call RemoveLocation (udg_AD_TempPoint)
              • Custom script: set udg_AD_TempPoint = null
            • Else - Actions
- Beserk Plant
  • Beserk Plant Configuration
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Do not touch --------
      • Hashtable - Create a hashtable
      • Set BP_Hash = (Last created hashtable)
      • -------- ------ --------
      • -------- Determines the Minimum casting range of the spell --------
      • Set BP_MinRange = 200.00
      • -------- Determines the strength of the knockback --------
      • Set BP_KnockbackStrengthBase = 20.00
      • Set BP_KnockbackStrengthPerLevel = 5.00
      • -------- Determines how fast the knockback will deteriorate --------
      • Set BP_KnockbackDetriment = 1.00
      • -------- Determines the AOE of the Plant --------
      • Set BP_AoeBase = 300.00
      • Set BP_AoePerLevel = 100.00
      • -------- Determines the Damage of the branches --------
      • Set BP_DamageBase = 30.00
      • Set BP_DamagePerLevel = 15.00
      • -------- Determines the duration of the plant --------
      • Set BP_DurationBase = 3.00
      • Set BP_DurationPerLevel = 2.00
      • -------- Determines the Arc shape of the plant and its branches --------
      • Set BP_HeightMultiplyer = 1.00
      • -------- Determines the Speed of the branches --------
      • Set BP_BranchSpeed = 15.00
      • -------- Determines the Speed of the Plants moving through the air --------
      • Set BP_PlantSpeed = 7.50
      • -------- Determines the Damage AOE of the branches --------
      • Set BP_BranchAoe = 90.00
      • -------- Determines the unit used as the plant --------
      • Set BP_Plant = Plant
      • -------- Determines the unit used as the branch --------
      • Set BP_BranchCore = BranchCore
      • -------- Determines the spell used by the triggers --------
      • Set BP_Spell = Beserk Plant
      • -------- Determines the SFX created on knockback --------
      • Set BP_KnockbackSFX = Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
      • -------- Determines the impact SFX of the branches hitting a target --------
      • Set BP_BranchHitSFX = Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
      • -------- Determines whether or not the spell will destroy trees --------
      • Set BP_TreeKill = True
      • -------- Determines the area of trees that will be destroyed when a unit comes within range of it during knockback --------
      • Set BP_TreeDestroyArea = 100.00
      • -------- ------- --------
      • -------- Do not touch --------
      • -------- Tree Checking Set up --------
      • Set BP_TempPoint = (Center of (Playable map area))
      • Unit - Create 1 Peasant for Neutral Passive at BP_TempPoint facing Default building facing degrees
      • Set BP_TreeChecker = (Last created unit)
      • Unit - Hide BP_TreeChecker
      • Unit - Make BP_TreeChecker Invulnerable
      • Custom script: call RemoveLocation (udg_BP_TempPoint)
      • -------- ------ --------
  • Beserk Plant Activation
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to BP_Spell
    • Actions
      • -------- Creating Plant --------
      • Set BP_U = (Triggering unit)
      • Set BP_TempPoint = (Position of BP_U)
      • Set BP_TempPoint2 = (Target point of ability being cast)
      • Set BP_TempReal = (Real((Level of BP_Spell for BP_U)))
      • Set BP_Angle = (Angle from BP_TempPoint to BP_TempPoint2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Distance between BP_TempPoint and BP_TempPoint2) Less than BP_MinRange
        • Then - Actions
          • Custom script: call RemoveLocation (udg_BP_TempPoint2)
          • Set BP_TempPoint2 = (BP_TempPoint offset by BP_MinRange towards BP_Angle degrees)
        • Else - Actions
      • Unit - Create 1 BP_Plant for (Owner of BP_U) at BP_TempPoint facing BP_Angle degrees
      • -------- ------ --------
      • -------- Passing Parameters --------
      • Set BP_TempU = (Last created unit)
      • Custom script: set udg_BP_UHandle = GetHandleId(udg_BP_TempU)
      • -------- Casting Unit ID --------
      • Hashtable - Save Handle OfBP_U as 1 of BP_UHandle in BP_Hash
      • -------- Searching AOE for the plant --------
      • Hashtable - Save (BP_AoeBase + (BP_AoePerLevel x BP_TempReal)) as 2 of BP_UHandle in BP_Hash
      • -------- Branch Damage --------
      • Hashtable - Save (BP_DamageBase + (BP_DamagePerLevel x BP_TempReal)) as 3 of BP_UHandle in BP_Hash
      • -------- Plant Duration --------
      • Hashtable - Save (BP_DurationBase + (BP_DurationPerLevel x BP_TempReal)) as 4 of BP_UHandle in BP_Hash
      • -------- Branch Knockback power --------
      • Hashtable - Save (BP_KnockbackStrengthBase + (BP_KnockbackStrengthPerLevel x BP_TempReal)) as 5 of BP_UHandle in BP_Hash
      • -------- ID in unit group --------
      • Hashtable - Save 1 as 6 of BP_UHandle in BP_Hash
      • -------- Max distance (parabola) --------
      • Hashtable - Save (Distance between BP_TempPoint and BP_TempPoint2) as 7 of BP_UHandle in BP_Hash
      • -------- Max height (parabola) --------
      • Hashtable - Save ((Distance between BP_TempPoint and BP_TempPoint2) x BP_HeightMultiplyer) as 8 of BP_UHandle in BP_Hash
      • -------- ------ --------
      • Unit Group - Add BP_TempU to BP_Plants
      • Custom script: call RemoveLocation (udg_BP_TempPoint2)
      • Custom script: call RemoveLocation (udg_BP_TempPoint)
      • Trigger - Turn on Beserk Plant Loop <gen>
  • Beserk Plant Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in BP_Plants and do (Actions)
        • Loop - Actions
          • Set BP_U = (Picked unit)
          • Custom script: set udg_BP_UHandle = GetHandleId(udg_BP_U)
          • -------- Stage 1 --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Load 6 of BP_UHandle from BP_Hash) Equal to 1
            • Then - Actions
              • -------- Movement --------
              • Custom script: set udg_BP_TempX = GetUnitX(udg_BP_U)
              • Custom script: set udg_BP_TempY = GetUnitY(udg_BP_U)
              • Set BP_Angle = (Facing of BP_U)
              • Custom script: call SetUnitX(udg_BP_U, udg_BP_TempX + udg_BP_PlantSpeed * Cos(udg_BP_Angle * bj_DEGTORAD))
              • Custom script: call SetUnitY(udg_BP_U, udg_BP_TempY + udg_BP_PlantSpeed * Sin(udg_BP_Angle * bj_DEGTORAD))
              • -------- ------ --------
              • -------- Fly Height --------
              • Set BP_RealCache[1] = (Load 7 of BP_UHandle from BP_Hash)
              • Set BP_RealCache[2] = (Load 8 of BP_UHandle from BP_Hash)
              • Set BP_RealCache[3] = ((Load 9 of BP_UHandle from BP_Hash) + BP_PlantSpeed)
              • Hashtable - Save BP_RealCache[3] as 9 of BP_UHandle in BP_Hash
              • Set BP_RealCache[4] = (((4.00 x BP_RealCache[2]) / BP_RealCache[1]) x ((BP_RealCache[3] / BP_RealCache[1]) x (BP_RealCache[1] - BP_RealCache[3])))
              • Animation - Change BP_U flying height to BP_RealCache[4] at 0.00
              • -------- ------ --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • BP_RealCache[4] Less than 0.00
                • Then - Actions
                  • -------- Stage 2 Setup --------
                  • Hashtable - Save 2 as 6 of BP_UHandle in BP_Hash
                  • Unit - Add a (Load 4 of BP_UHandle from BP_Hash) second Generic expiration timer to BP_U
                  • -------- ------ --------
                • Else - Actions
            • Else - Actions
          • -------- Stage 2 --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Load 6 of BP_UHandle from BP_Hash) Equal to 2
            • Then - Actions
              • Set BP_TempPoint = (Position of BP_U)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Load 20 of BP_UHandle from BP_Hash) Equal to 3
                • Then - Actions
                  • -------- Plant creation timer reset --------
                  • Hashtable - Save 0 as 20 of BP_UHandle in BP_Hash
                  • -------- ------ --------
                  • -------- Finding Targets --------
                  • Set BP_TempGroup = (Units within (Load 2 of BP_UHandle from BP_Hash) of BP_TempPoint)
                  • Unit Group - Pick every unit in BP_TempGroup and do (Actions)
                    • Loop - Actions
                      • Set BP_TempU = (Picked unit)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (BP_TempU is Magic Immune) Equal to False
                          • (BP_TempU is A structure) Equal to False
                          • (BP_TempU is alive) Equal to True
                          • (BP_TempU belongs to an enemy of (Owner of BP_U)) Equal to True
                          • (BP_TempU is A ground unit) Equal to True
                          • (BP_TempU is in BP_Plants) Equal to False
                        • Then - Actions
                          • -------- Creating Branch --------
                          • Set BP_TempPoint2 = (Position of BP_TempU)
                          • Set BP_Angle = (Angle from BP_TempPoint to BP_TempPoint2)
                          • Unit - Create 1 BP_BranchCore for (Owner of BP_U) at BP_TempPoint facing BP_Angle degrees
                          • -------- ------ --------
                          • -------- Passing Parameters --------
                          • Set BP_TempU = (Last created unit)
                          • Custom script: set udg_BP_UHandleC = GetHandleId(udg_BP_TempU)
                          • Unit Group - Add BP_TempU to BP_Plants
                          • -------- Casting Unit ID --------
                          • Hashtable - Save Handle Of(Load 1 of BP_UHandle in BP_Hash) as 1 of BP_UHandleC in BP_Hash
                          • -------- ID in unit group --------
                          • Hashtable - Save 3 as 6 of BP_UHandleC in BP_Hash
                          • -------- Relevent Plant ID --------
                          • Hashtable - Save Handle OfBP_U as 2 of BP_UHandleC in BP_Hash
                          • -------- Branch Damage --------
                          • Hashtable - Save (Load 3 of BP_UHandle from BP_Hash) as 3 of BP_UHandleC in BP_Hash
                          • -------- Branch Knockback power --------
                          • Hashtable - Save (Load 5 of BP_UHandle from BP_Hash) as 5 of BP_UHandleC in BP_Hash
                          • -------- Max distance (parabola) --------
                          • Hashtable - Save (Distance between BP_TempPoint and BP_TempPoint2) as 7 of BP_UHandleC in BP_Hash
                          • -------- Max height (parabola) --------
                          • Hashtable - Save ((Distance between BP_TempPoint and BP_TempPoint2) x BP_HeightMultiplyer) as 8 of BP_UHandleC in BP_Hash
                          • -------- ------ --------
                          • Custom script: call RemoveLocation (udg_BP_TempPoint2)
                        • Else - Actions
                  • -------- ------ --------
                  • Custom script: call DestroyGroup (udg_BP_TempGroup)
                • Else - Actions
                  • -------- Plant creation timer increase --------
                  • Hashtable - Save ((Load 20 of BP_UHandle from BP_Hash) + 1) as 20 of BP_UHandle in BP_Hash
                  • -------- ------ --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (BP_U is dead) Equal to True
                • Then - Actions
                  • Unit Group - Remove BP_U from BP_Plants
                  • Hashtable - Clear all child hashtables of child BP_UHandle in BP_Hash
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (BP_Plants is empty) Equal to True
                    • Then - Actions
                      • Trigger - Turn off (This trigger)
                    • Else - Actions
                • Else - Actions
              • Custom script: call RemoveLocation (udg_BP_TempPoint)
            • Else - Actions
          • -------- Branches --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Load 6 of BP_UHandle from BP_Hash) Equal to 3
            • Then - Actions
              • Custom script: set udg_BP_TempX = GetUnitX(udg_BP_U)
              • Custom script: set udg_BP_TempY = GetUnitY(udg_BP_U)
              • Set BP_Angle = (Facing of BP_U)
              • Custom script: call SetUnitX(udg_BP_U, udg_BP_TempX + udg_BP_BranchSpeed * Cos(udg_BP_Angle * bj_DEGTORAD))
              • Custom script: call SetUnitY(udg_BP_U, udg_BP_TempY + udg_BP_BranchSpeed * Sin(udg_BP_Angle * bj_DEGTORAD))
              • Set BP_RealCache[1] = (Load 7 of BP_UHandle from BP_Hash)
              • Set BP_RealCache[2] = (Load 8 of BP_UHandle from BP_Hash)
              • Set BP_RealCache[3] = ((Load 9 of BP_UHandle from BP_Hash) + BP_BranchSpeed)
              • Hashtable - Save BP_RealCache[3] as 9 of BP_UHandle in BP_Hash
              • Set BP_RealCache[4] = (((4.00 x BP_RealCache[2]) / BP_RealCache[1]) x ((BP_RealCache[3] / BP_RealCache[1]) x (BP_RealCache[1] - BP_RealCache[3])))
              • Animation - Change BP_U flying height to BP_RealCache[4] at 0.00
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • BP_RealCache[4] Less than 0.00
                • Then - Actions
                  • Set BP_TempPoint = (Position of BP_U)
                  • Set BP_TempGroup = (Units within BP_BranchAoe of BP_TempPoint)
                  • Unit Group - Pick every unit in BP_TempGroup and do (Actions)
                    • Loop - Actions
                      • Set BP_TempU = (Picked unit)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (BP_TempU is Magic Immune) Equal to False
                          • (BP_TempU is A structure) Equal to False
                          • (BP_TempU is alive) Equal to True
                          • (BP_TempU belongs to an enemy of (Owner of BP_U)) Equal to True
                          • (BP_TempU is A ground unit) Equal to True
                          • (BP_TempU is in BP_Plants) Equal to False
                        • Then - Actions
                          • Custom script: set udg_BP_UHandleC = GetHandleId(udg_BP_TempU)
                          • Unit - Cause (Load 1 of BP_UHandle in BP_Hash) to damage BP_TempU, dealing (Load 3 of BP_UHandle from BP_Hash) damage of attack type Spells and damage type Normal
                          • Special Effect - Create a special effect at BP_TempPoint using BP_BranchHitSFX
                          • Special Effect - Destroy (Last created special effect)
                          • Set BP_TempU2 = (Load 2 of BP_UHandle in BP_Hash)
                          • Custom script: set udg_BP_TempX = GetUnitX(udg_BP_TempU2)
                          • Custom script: set udg_BP_TempY = GetUnitY(udg_BP_TempU2)
                          • Hashtable - Save BP_TempX as 17 of BP_UHandleC in BP_Hash
                          • Hashtable - Save BP_TempY as 18 of BP_UHandleC in BP_Hash
                          • Hashtable - Save (Load 5 of BP_UHandle from BP_Hash) as 16 of BP_UHandleC in BP_Hash
                          • Unit Group - Add BP_TempU to BP_Plants
                          • Hashtable - Save 4 as 6 of BP_UHandleC in BP_Hash
                        • Else - Actions
                  • Custom script: call DestroyGroup (udg_BP_TempGroup)
                  • Custom script: call RemoveLocation (udg_BP_TempPoint)
                  • Custom script: set udg_BP_UHandleC = GetHandleId(udg_BP_TempU)
                  • Unit Group - Remove BP_U from BP_Plants
                  • Hashtable - Clear all child hashtables of child BP_UHandle in BP_Hash
                  • Unit - Kill BP_U
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (BP_Plants is empty) Equal to True
                    • Then - Actions
                      • Trigger - Turn off (This trigger)
                    • Else - Actions
                • Else - Actions
            • Else - Actions
          • -------- Knockback --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Load 6 of BP_UHandle from BP_Hash) Equal to 4
            • Then - Actions
              • -------- Movement --------
              • Set BP_TempPoint = (Point((Load 17 of BP_UHandle from BP_Hash), (Load 18 of BP_UHandle from BP_Hash)))
              • Set BP_TempPoint2 = (Position of BP_U)
              • -------- ------ --------
              • -------- Knockback effects --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Load 20 of BP_UHandle from BP_Hash) Equal to 3
                • Then - Actions
                  • Special Effect - Create a special effect at BP_TempPoint2 using BP_KnockbackSFX
                  • Special Effect - Destroy (Last created special effect)
                  • Hashtable - Save 0 as 20 of BP_UHandle in BP_Hash
                • Else - Actions
                  • Hashtable - Save ((Load 20 of BP_UHandle from BP_Hash) + 1) as 20 of BP_UHandle in BP_Hash
              • -------- ------ --------
              • -------- Movement --------
              • Set BP_TempReal = ((Load 16 of BP_UHandle from BP_Hash) - BP_KnockbackDetriment)
              • Hashtable - Save BP_TempReal as 16 of BP_UHandle in BP_Hash
              • Set BP_Angle = (Angle from BP_TempPoint to BP_TempPoint2)
              • Custom script: call RemoveLocation(udg_BP_TempPoint)
              • Set BP_TempPoint = (BP_TempPoint2 offset by BP_TempReal towards BP_Angle degrees)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Playable map area) contains BP_TempPoint) Equal to True
                  • (Terrain pathing at BP_TempPoint of type Walkability is off) Equal to False
                • Then - Actions
                  • Custom script: set udg_BP_TempX = GetUnitX(udg_BP_U)
                  • Custom script: set udg_BP_TempY = GetUnitY(udg_BP_U)
                  • Custom script: call SetUnitX(udg_BP_U, udg_BP_TempX + udg_BP_TempReal * Cos(udg_BP_Angle * bj_DEGTORAD))
                  • Custom script: call SetUnitY(udg_BP_U, udg_BP_TempY + udg_BP_TempReal * Sin(udg_BP_Angle * bj_DEGTORAD))
                  • -------- Tree Destruction --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • BP_TreeKill Equal to True
                    • Then - Actions
                      • Destructible - Pick every destructible within BP_TreeDestroyArea of BP_TempPoint and do (Actions)
                        • Loop - Actions
                          • Unit - Order BP_TreeChecker to Harvest (Picked destructible)
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Current order of BP_TreeChecker) Equal to (Order(harvest))
                            • Then - Actions
                              • Destructible - Kill (Picked destructible)
                            • Else - Actions
                          • Unit - Order BP_TreeChecker to Stop
                    • Else - Actions
                  • -------- ------ --------
                • Else - Actions
              • -------- ------ --------
              • Custom script: call RemoveLocation(udg_BP_TempPoint2)
              • Custom script: call RemoveLocation(udg_BP_TempPoint)
              • -------- End of Knockback --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Load 16 of BP_UHandle from BP_Hash) Less than or equal to 0.00
                • Then - Actions
                  • Unit Group - Remove BP_U from BP_Plants
                  • Hashtable - Clear all child hashtables of child BP_UHandle in BP_Hash
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (BP_Plants is empty) Equal to True
                    • Then - Actions
                      • Trigger - Turn off (This trigger)
                    • Else - Actions
                • Else - Actions
              • -------- ------ --------
            • Else - Actions
          • -------- ------ --------
- Chaos Portal
  • Chaos Portal Configuration
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Do not touch --------
      • Hashtable - Create a hashtable
      • Set CP_Hash = (Last created hashtable)
      • -------- -------- --------
      • -------- Determines the area that will be caught --------
      • Set CP_AoeBase = 225.00
      • Set CP_AoePerLevel = 100.00
      • -------- Determines the damage dealt by Knockback/Pulses --------
      • Set CP_DamageBase = 10.00
      • Set CP_DamagePerLevel = 5.00
      • -------- Determines the strength of the knockback --------
      • Set CP_KnockbackStrengthBase = 14.00
      • Set CP_KnockbackStrengthPerLevel = 5.00
      • Set CP_KnockbackStrengthDetriment = 1.00
      • -------- Determines the amount of pulses --------
      • Set CP_PulsesBase = 2
      • Set CP_PulsesPerLevel = 2
      • -------- Determines the settings of the portal --------
      • Set CP_PortalStartSize = 2.00
      • Set CP_PortalGrowthSpeed = 2.00
      • Set CP_PortalMaxSize = 150.00
      • -------- Determines the settings of the Cage --------
      • -------- The Aoe of each part (comes into calculating how many parts there will be) --------
      • Set CP_CageSegmentAoe = 250.00
      • -------- Determines how fast each segment of the cage will fly --------
      • Set CP_CageSpeed = 20.00
      • -------- Determines the delay between each segment (also effects pulse rate) --------
      • Set CP_CageProjectileFireRate = 5
      • -------- Determines the height of the arc in relevence to the distance the Cage will be thrown at --------
      • Set CP_HeightMultiplyer = 0.75
      • -------- Determines the Dummy unit of the spell --------
      • Set CP_Portal = Chaos Portal
      • -------- Determines the unit model used as the Portal --------
      • Set CP_PortalModel = Abilities\Spells\Undead\Possession\PossessionCaster.mdl
      • -------- Determines the unit model used as the Cage --------
      • Set CP_CageModel = Abilities\Spells\Undead\OrbOfDeath\AnnihilationMissile.mdl
      • -------- Determines the unit model used as the Pulse --------
      • Set CP_PulseModel = Abilities\Spells\Other\HowlOfTerror\HowlCaster.mdl
      • -------- Determines the scale of the cage segments --------
      • Set CP_CageScale = 20.00
      • -------- Determines the spell used to act as the activation spell --------
      • Set CP_Spell = Chaos Portal
      • -------- Do not touch --------
      • -------- Tree Checking Set up --------
      • Set CP_TreeKill = True
      • Set CP_TreeAreaDestroy = 150.00
      • Set CP_TempPoint = (Center of (Playable map area))
      • Unit - Create 1 Peasant for Neutral Passive at CP_TempPoint facing Default building facing degrees
      • Set CP_TreeChecker = (Last created unit)
      • Unit - Hide CP_TreeChecker
      • Unit - Make CP_TreeChecker Invulnerable
      • Custom script: call RemoveLocation (udg_CP_TempPoint)
      • -------- ------ --------
  • Chaos Portal Activation
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to CP_Spell
    • Actions
      • -------- Spell setup --------
      • Set CP_U = (Triggering unit)
      • Set CP_TempPoint = (Target point of ability being cast)
      • Set CP_TempReal = (Real((Level of Chaos Portal for CP_U)))
      • -------- -------- --------
      • -------- Creating the portal --------
      • Unit - Create 1 CP_Portal for (Owner of CP_U) at CP_TempPoint facing Default building facing degrees
      • -------- -------- --------
      • Custom script: call RemoveLocation(udg_CP_TempPoint)
      • -------- Unit setup --------
      • Set CP_TempU = (Last created unit)
      • Custom script: set udg_CP_UHandle = GetHandleId(udg_CP_TempU)
      • Special Effect - Create a special effect attached to the overhead of CP_TempU using CP_PortalModel
      • -------- -------- --------
      • -------- Aoe calculation --------
      • Set CP_RealCache[1] = (CP_AoeBase + (CP_TempReal x CP_AoePerLevel))
      • -------- Original Casting Unit --------
      • Hashtable - Save Handle OfCP_U as 1 of CP_UHandle in CP_Hash
      • -------- Stage ID --------
      • Hashtable - Save 1 as 2 of CP_UHandle in CP_Hash
      • -------- Number of Pulses --------
      • Hashtable - Save (CP_PulsesBase + ((Integer(CP_TempReal)) x CP_PulsesPerLevel)) as 3 of CP_UHandle in CP_Hash
      • -------- AOE --------
      • Hashtable - Save CP_RealCache[1] as 4 of CP_UHandle in CP_Hash
      • -------- Damage --------
      • Hashtable - Save (CP_DamageBase + (CP_TempReal x CP_DamagePerLevel)) as 5 of CP_UHandle in CP_Hash
      • -------- Knockback Strength --------
      • Hashtable - Save (CP_KnockbackStrengthBase + (CP_TempReal x CP_KnockbackStrengthPerLevel)) as 6 of CP_UHandle in CP_Hash
      • -------- Number of Cage Segments Needed --------
      • Hashtable - Save (Integer(((3.12 x (2.00 x CP_RealCache[1])) / CP_CageSegmentAoe))) as 7 of CP_UHandle in CP_Hash
      • -------- Current Size --------
      • Hashtable - Save CP_PortalStartSize as 8 of CP_UHandle in CP_Hash
      • -------- Current Projectile Counter --------
      • Hashtable - Save 0 as 9 of CP_UHandle in CP_Hash
      • -------- Current Pulse Counter --------
      • Hashtable - Save 0 as 10 of CP_UHandle in CP_Hash
      • -------- Current Pulses released --------
      • Hashtable - Save 0 as 11 of CP_UHandle in CP_Hash
      • -------- Starting size applied --------
      • Animation - Change CP_TempU's size to (CP_PortalStartSize%, CP_PortalStartSize%, CP_PortalMaxSize%) of its original size
      • -------- Added to unit group --------
      • Unit Group - Add CP_TempU to CP_PortalGroup
      • Trigger - Turn on Chaos Portal Loop <gen>
  • Chaos Portal Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in CP_PortalGroup and do (Actions)
        • Loop - Actions
          • Set CP_U = (Picked unit)
          • Custom script: set udg_CP_UHandle = GetHandleId(udg_CP_U)
          • Set CP_TempInteger = (Load 2 of CP_UHandle from CP_Hash)
          • -------- Stage 1 (of 4) --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • CP_TempInteger Equal to 1
            • Then - Actions
              • -------- Calculate current growth --------
              • Set CP_RealCache[1] = ((Load 8 of CP_UHandle from CP_Hash) + CP_PortalGrowthSpeed)
              • -------- Check current size --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • CP_RealCache[1] Less than CP_PortalMaxSize
                • Then - Actions
                  • -------- Change size --------
                  • Animation - Change CP_U's size to (CP_RealCache[1]%, CP_RealCache[1]%, CP_RealCache[1]%) of its original size
                  • -------- Save size --------
                  • Hashtable - Save CP_RealCache[1] as 8 of CP_UHandle in CP_Hash
                • Else - Actions
                  • -------- Change stage --------
                  • Hashtable - Save 2 as 2 of CP_UHandle in CP_Hash
            • Else - Actions
              • -------- Stage 2 --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • CP_TempInteger Equal to 2
                • Then - Actions
                  • -------- Check Projectile delay timer --------
                  • Set CP_TempInteger = (Load 9 of CP_UHandle from CP_Hash)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • CP_TempInteger Equal to CP_CageProjectileFireRate
                    • Then - Actions
                      • -------- Resetting delay timer --------
                      • Hashtable - Save 0 as 9 of CP_UHandle in CP_Hash
                      • -------- Porjectile setup --------
                      • Set CP_TempPoint = (Position of CP_U)
                      • Set CP_Angle = 0.00
                      • -------- Launching projectiles --------
                      • Set CP_TempU2 = (Load 1 of CP_UHandle in CP_Hash)
                      • Set CP_RealCache[0] = (Real((Load 7 of CP_UHandle from CP_Hash)))
                      • Set CP_RealCache[1] = (Load 4 of CP_UHandle from CP_Hash)
                      • Set CP_RealCache[2] = (Load 5 of CP_UHandle from CP_Hash)
                      • Set CP_RealCache[3] = (Load 6 of CP_UHandle from CP_Hash)
                      • For each (Integer CP_i) from 1 to (Load 7 of CP_UHandle from CP_Hash), do (Actions)
                        • Loop - Actions
                          • -------- Projectile data setup --------
                          • Set CP_Angle = (CP_Angle + (360.00 / CP_RealCache[0]))
                          • Set CP_TempPoint2 = (CP_TempPoint offset by CP_RealCache[1] towards CP_Angle degrees)
                          • Set CP_TempReal = (Distance between CP_TempPoint and CP_TempPoint2)
                          • Custom script: call RemoveLocation(udg_CP_TempPoint2)
                          • -------- Creating projectile --------
                          • Unit - Create 1 CP_Portal for (Owner of CP_U) at CP_TempPoint facing CP_Angle degrees
                          • Set CP_TempU = (Last created unit)
                          • Custom script: set udg_CP_UHandleC = GetHandleId(udg_CP_TempU)
                          • Special Effect - Create a special effect attached to the chest of CP_TempU using CP_CageModel
                          • Hashtable - Save Handle Of(Last created special effect) as 20 of CP_UHandleC in CP_Hash
                          • Animation - Change CP_TempU's size to (CP_CageScale%, CP_CageScale%, CP_CageScale%) of its original size
                          • -------- Original Casting Unit --------
                          • Hashtable - Save Handle OfCP_TempU2 as 1 of CP_UHandleC in CP_Hash
                          • -------- Stage ID --------
                          • Hashtable - Save 3 as 2 of CP_UHandleC in CP_Hash
                          • -------- Damage --------
                          • Hashtable - Save CP_RealCache[2] as 5 of CP_UHandleC in CP_Hash
                          • -------- Knockback Strength --------
                          • Hashtable - Save CP_RealCache[3] as 6 of CP_UHandleC in CP_Hash
                          • -------- Saving Max distance --------
                          • Hashtable - Save CP_TempReal as 7 of CP_UHandleC in CP_Hash
                          • -------- Saving Max height --------
                          • Hashtable - Save (CP_TempReal x CP_HeightMultiplyer) as 8 of CP_UHandleC in CP_Hash
                          • -------- Initialising starting distance --------
                          • Hashtable - Save 0.00 as 9 of CP_UHandleC in CP_Hash
                          • -------- Original Portal --------
                          • Hashtable - Save Handle OfCP_U as 10 of CP_UHandleC in CP_Hash
                          • -------- Adding to unit group --------
                          • Unit Group - Add CP_TempU to CP_PortalGroup
                      • Custom script: call RemoveLocation(udg_CP_TempPoint)
                    • Else - Actions
                      • -------- Increasing delay timer --------
                      • Hashtable - Save (CP_TempInteger + 1) as 9 of CP_UHandle in CP_Hash
                  • -------- Check Pulse delay timer --------
                  • Set CP_TempInteger = (Load 10 of CP_UHandle from CP_Hash)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • CP_TempInteger Equal to (CP_CageProjectileFireRate x 10)
                    • Then - Actions
                      • -------- Resetting delay timer --------
                      • Hashtable - Save 0 as 10 of CP_UHandle in CP_Hash
                      • -------- Checking pulse count --------
                      • Set CP_TempInteger = (Load 11 of CP_UHandle from CP_Hash)
                      • Set CP_TempPoint = (Position of CP_U)
                      • -------- Creating pulse --------
                      • Unit - Create 1 CP_Portal for (Owner of CP_U) at CP_TempPoint facing Default building facing degrees
                      • -------- Scaling pulse --------
                      • Set CP_RealCache[1] = ((Load 4 of CP_UHandle from CP_Hash) / 3.00)
                      • Animation - Change (Last created unit)'s size to (CP_RealCache[1]%, CP_RealCache[1]%, CP_RealCache[1]%) of its original size
                      • Special Effect - Create a special effect attached to the overhead of (Last created unit) using CP_PulseModel
                      • -------- Removing pulse --------
                      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
                      • -------- Pulse effects setup --------
                      • Set CP_TempGroup = (Units within (Load 4 of CP_UHandle from CP_Hash) of CP_TempPoint)
                      • Custom script: set udg_CP_TempX = GetUnitX(udg_CP_U)
                      • Custom script: set udg_CP_TempY = GetUnitY(udg_CP_U)
                      • -------- Pulse effects --------
                      • Unit Group - Pick every unit in CP_TempGroup and do (Actions)
                        • Loop - Actions
                          • -------- Finding target units --------
                          • Set CP_TempU = (Picked unit)
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (CP_TempU is Magic Immune) Equal to False
                              • (CP_TempU is A structure) Equal to False
                              • (CP_TempU is alive) Equal to True
                              • (CP_TempU belongs to an enemy of (Owner of CP_U)) Equal to True
                              • (CP_TempU is A ground unit) Equal to True
                            • Then - Actions
                              • -------- Getting co-ordinates and setup --------
                              • Custom script: set udg_CP_TempX2 = GetUnitX(udg_CP_TempU)
                              • Custom script: set udg_CP_TempY2 = GetUnitY(udg_CP_TempU)
                              • Custom script: set udg_CP_UHandleC = GetHandleId(udg_CP_TempU)
                              • -------- Damage --------
                              • Unit - Cause (Load 1 of CP_UHandle in CP_Hash) to damage CP_TempU, dealing (Load 5 of CP_UHandle from CP_Hash) damage of attack type Spells and damage type Normal
                              • -------- Knockback setup --------
                              • -------- Knockback strength --------
                              • Hashtable - Save (Load 6 of CP_UHandle from CP_Hash) as 13 of CP_UHandleC in CP_Hash
                              • -------- Knockback Angle setup --------
                              • Hashtable - Save CP_TempX as 14 of CP_UHandleC in CP_Hash
                              • Hashtable - Save CP_TempY as 15 of CP_UHandleC in CP_Hash
                              • Hashtable - Save CP_TempX2 as 16 of CP_UHandleC in CP_Hash
                              • Hashtable - Save CP_TempY2 as 17 of CP_UHandleC in CP_Hash
                              • -------- Added to group --------
                              • Unit Group - Add CP_TempU to CP_PortalGroup
                              • -------- Stage ID --------
                              • Hashtable - Save 4 as 2 of CP_UHandleC in CP_Hash
                            • Else - Actions
                      • -------- Cleanup --------
                      • Custom script: call DestroyGroup (udg_CP_TempGroup)
                      • Custom script: call RemoveLocation (udg_CP_TempPoint)
                      • -------- Checking pulse count (cleanup) --------
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • CP_TempInteger Equal to (Load 3 of CP_UHandle from CP_Hash)
                        • Then - Actions
                          • Unit Group - Remove CP_U from CP_PortalGroup
                          • Hashtable - Clear all child hashtables of child CP_UHandle in CP_Hash
                          • Unit - Kill CP_U
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (CP_PortalGroup is empty) Equal to True
                            • Then - Actions
                              • Trigger - Turn off (This trigger)
                            • Else - Actions
                        • Else - Actions
                          • Hashtable - Save (CP_TempInteger + 1) as 11 of CP_UHandle in CP_Hash
                    • Else - Actions
                      • -------- Increasing delay timer --------
                      • Hashtable - Save (CP_TempInteger + 1) as 10 of CP_UHandle in CP_Hash
                • Else - Actions
                  • -------- Stage 3 --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • CP_TempInteger Equal to 3
                    • Then - Actions
                      • -------- Projectile movement setup --------
                      • Custom script: set udg_CP_TempX = GetUnitX(udg_CP_U)
                      • Custom script: set udg_CP_TempY = GetUnitY(udg_CP_U)
                      • Custom script: set udg_CP_Angle = (GetUnitFacing(udg_CP_U) * bj_DEGTORAD)
                      • -------- Projectile movement --------
                      • Custom script: call SetUnitX(udg_CP_U, udg_CP_TempX + udg_CP_CageSpeed * Cos(udg_CP_Angle))
                      • Custom script: call SetUnitY(udg_CP_U, udg_CP_TempY + udg_CP_CageSpeed * Sin(udg_CP_Angle))
                      • -------- Height calculation --------
                      • Set CP_RealCache[1] = (Load 7 of CP_UHandle from CP_Hash)
                      • Set CP_RealCache[2] = (Load 8 of CP_UHandle from CP_Hash)
                      • Set CP_RealCache[3] = ((Load 9 of CP_UHandle from CP_Hash) + CP_CageSpeed)
                      • Hashtable - Save CP_RealCache[3] as 9 of CP_UHandle in CP_Hash
                      • Set CP_RealCache[4] = (((4.00 x CP_RealCache[2]) / CP_RealCache[1]) x ((CP_RealCache[3] / CP_RealCache[1]) x (CP_RealCache[1] - CP_RealCache[3])))
                      • Animation - Change CP_U flying height to CP_RealCache[4] at 0.00
                      • -------- Checking height --------
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • CP_RealCache[4] Less than 0.00
                        • Then - Actions
                          • -------- Damage and target setup --------
                          • Set CP_TempU2 = (Load 10 of CP_UHandle in CP_Hash)
                          • Custom script: set udg_CP_UHandleC2 = GetHandleId(udg_CP_TempU2)
                          • Custom script: set udg_CP_TempX2 = GetUnitX(udg_CP_TempU2)
                          • Custom script: set udg_CP_TempY2 = GetUnitY(udg_CP_TempU2)
                          • Set CP_TempPoint2 = (Position of CP_TempU2)
                          • Set CP_TempPoint = (Position of CP_U)
                          • Set CP_TempGroup = (Units within CP_CageSegmentAoe of CP_TempPoint)
                          • -------- Damage and knockback --------
                          • Unit Group - Pick every unit in CP_TempGroup and do (Actions)
                            • Loop - Actions
                              • -------- Finding targets --------
                              • Set CP_TempU = (Picked unit)
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (CP_TempU is Magic Immune) Equal to False
                                  • (CP_TempU is A structure) Equal to False
                                  • (CP_TempU is alive) Equal to True
                                  • (CP_TempU belongs to an enemy of (Owner of CP_U)) Equal to True
                                  • (CP_TempU is A ground unit) Equal to True
                                • Then - Actions
                                  • -------- setup --------
                                  • Custom script: set udg_CP_UHandleC = GetHandleId(udg_CP_TempU)
                                  • -------- Damage --------
                                  • Unit - Cause (Load 1 of CP_UHandle in CP_Hash) to damage CP_TempU, dealing (Load 5 of CP_UHandle from CP_Hash) damage of attack type Spells and damage type Normal
                                  • -------- Knockback setup --------
                                  • -------- Knockback strength --------
                                  • Hashtable - Save (Load 6 of CP_UHandle from CP_Hash) as 13 of CP_UHandleC in CP_Hash
                                  • -------- Knockback Angle setup --------
                                  • Set CP_TempPoint3 = (Position of CP_TempU)
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • (Distance between CP_TempPoint2 and CP_TempPoint3) Greater than or equal to ((Load 4 of CP_UHandleC2 from CP_Hash) + (CP_CageSegmentAoe / 2.00))
                                    • Then - Actions
                                      • Hashtable - Save CP_TempX2 as 14 of CP_UHandleC in CP_Hash
                                      • Hashtable - Save CP_TempY2 as 15 of CP_UHandleC in CP_Hash
                                      • Hashtable - Save CP_TempY as 17 of CP_UHandleC in CP_Hash
                                      • Hashtable - Save CP_TempX as 16 of CP_UHandleC in CP_Hash
                                    • Else - Actions
                                      • Hashtable - Save CP_TempX as 14 of CP_UHandleC in CP_Hash
                                      • Hashtable - Save CP_TempY as 15 of CP_UHandleC in CP_Hash
                                      • Hashtable - Save CP_TempX2 as 16 of CP_UHandleC in CP_Hash
                                      • Hashtable - Save CP_TempY2 as 17 of CP_UHandleC in CP_Hash
                                  • -------- Added to group --------
                                  • Unit Group - Add CP_TempU to CP_PortalGroup
                                  • -------- Stage ID --------
                                  • Hashtable - Save 4 as 2 of CP_UHandleC in CP_Hash
                                  • Custom script: call RemoveLocation (udg_CP_TempPoint3)
                                • Else - Actions
                          • Custom script: call DestroyGroup (udg_CP_TempGroup)
                          • Custom script: call RemoveLocation (udg_CP_TempPoint2)
                          • Custom script: call RemoveLocation (udg_CP_TempPoint)
                          • -------- Cleanup --------
                          • Special Effect - Destroy (Load 20 of CP_UHandle in CP_Hash)
                          • Unit Group - Remove CP_U from CP_PortalGroup
                          • Hashtable - Clear all child hashtables of child CP_UHandle in CP_Hash
                          • Unit - Kill CP_U
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (CP_PortalGroup is empty) Equal to True
                            • Then - Actions
                              • Trigger - Turn off (This trigger)
                            • Else - Actions
                        • Else - Actions
                    • Else - Actions
                      • -------- Stage 4 --------
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • CP_TempInteger Equal to 4
                        • Then - Actions
                          • -------- Movement setup --------
                          • Set CP_TempPoint = (Point((Load 14 of CP_UHandle from CP_Hash), (Load 15 of CP_UHandle from CP_Hash)))
                          • Set CP_TempPoint2 = (Point((Load 16 of CP_UHandle from CP_Hash), (Load 17 of CP_UHandle from CP_Hash)))
                          • -------- ------ --------
                          • -------- Movement --------
                          • Set CP_TempReal = ((Load 13 of CP_UHandle from CP_Hash) - CP_KnockbackStrengthDetriment)
                          • Hashtable - Save CP_TempReal as 13 of CP_UHandle in CP_Hash
                          • Custom script: set udg_CP_Angle = AngleBetweenPoints(udg_CP_TempPoint, udg_CP_TempPoint2) * bj_DEGTORAD
                          • Custom script: call RemoveLocation(udg_CP_TempPoint)
                          • Set CP_TempPoint = (CP_TempPoint2 offset by CP_TempReal towards CP_Angle degrees)
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • ((Playable map area) contains CP_TempPoint) Equal to True
                              • (Terrain pathing at CP_TempPoint of type Walkability is off) Equal to False
                            • Then - Actions
                              • Custom script: set udg_CP_TempX = GetUnitX(udg_CP_U)
                              • Custom script: set udg_CP_TempY = GetUnitY(udg_CP_U)
                              • Custom script: call SetUnitX(udg_CP_U, udg_CP_TempX + udg_CP_TempReal * Cos(udg_CP_Angle))
                              • Custom script: call SetUnitY(udg_CP_U, udg_CP_TempY + udg_CP_TempReal * Sin(udg_CP_Angle))
                              • -------- Tree Destruction --------
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • CP_TreeKill Equal to True
                                • Then - Actions
                                  • Destructible - Pick every destructible within CP_TreeAreaDestroy of CP_TempPoint and do (Actions)
                                    • Loop - Actions
                                      • Unit - Order CP_TreeChecker to Harvest (Picked destructible)
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • (Current order of CP_TreeChecker) Equal to (Order(harvest))
                                        • Then - Actions
                                          • Destructible - Kill (Picked destructible)
                                        • Else - Actions
                                      • Unit - Order CP_TreeChecker to Stop
                                • Else - Actions
                              • -------- ------ --------
                            • Else - Actions
                          • -------- ------ --------
                          • Custom script: call RemoveLocation(udg_CP_TempPoint2)
                          • Custom script: call RemoveLocation(udg_CP_TempPoint)
                          • -------- End of Knockback --------
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Load 13 of CP_UHandle from CP_Hash) Less than or equal to 0.00
                            • Then - Actions
                              • Unit Group - Remove CP_U from CP_PortalGroup
                              • Hashtable - Clear all child hashtables of child CP_UHandle in CP_Hash
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (CP_PortalGroup is empty) Equal to True
                                • Then - Actions
                                  • Trigger - Turn off (This trigger)
                                • Else - Actions
                            • Else - Actions
                          • -------- ------ --------
                        • Else - Actions
- Energy Glyph
  • Energy Glyph Configuration
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Do not touch --------
      • Hashtable - Create a hashtable
      • Set EG_EnergyGlyphHash = (Last created hashtable)
      • -------- ---------- --------
      • -------- Determines how big the Glyph will appear (should be set to match the AOE) --------
      • -------- The AOE of the spell should be 10x the scale --------
      • -------- level 1 AOE = 300. 3.00 x 100 = 300.00 --------
      • Set EG_GlyphScalingBase = 2.00
      • Set EG_GlyphScalingPerLevel = 1.00
      • -------- Determines how long the Glyph will extract mana for (assuming it doesn't hit the limit) before activating or being destroyed --------
      • -------- Time is in seconds --------
      • Set EG_GlyphDurationBase = 10.00
      • Set EG_GlyphDurationPerLevel = 0.00
      • -------- Determines the max amount of Mana the Glyph will absorb before activating --------
      • -------- The absorbing will be spread evenly among the target units --------
      • Set EG_GlyphManaStealMax = 400.00
      • -------- Determines the rate of mana draining --------
      • -------- divide by 0.03 to get how much mana this is per second --------
      • Set EG_EnergyDrainBase = 0.75
      • Set EG_EnergyDrainPerLevel = 0.00
      • -------- Determines the strength of the slowing effect of the Glyph by dividing the standard speed by this number --------
      • -------- Standard is 2 (meaning / 2, meaning 50% speed reduction) --------
      • -------- Shouldn't really be anything higher than 2 --------
      • Set EG_EnergySlowDivider = 2.00
      • -------- Determines the damage each Orb will deal --------
      • -------- level one Orbs deal 15 damage (base 10 + per level 5) --------
      • Set EG_OrbDamageBase = 10.00
      • Set EG_OrbDamagePerLevel = 5.00
      • -------- Determines the AOE of the Orbs for them to damage --------
      • -------- 90 = melee range --------
      • Set EG_OrbAoeBase = 90.00
      • Set EG_OrbAoePerLevel = 0.00
      • -------- This is the AOE of the spell --------
      • -------- Should be 100x the scaling settings --------
      • Set EG_OrbRangeAOEBase = 200.00
      • Set EG_OrbRangeAOEPerLevel = 100.00
      • -------- This is how fast the Orbs will travel when moving --------
      • -------- / 0.03 to find how far this is per second --------
      • Set EG_OrbSpeed = 5.00
      • -------- This determines the arc the Orbs create while moving based on how high they will go in relivence to distance --------
      • -------- 1 = every unit it moves across it goes up as high as it goes far --------
      • -------- 1.1 = it goes up higher than it goes far --------
      • -------- 0.9 = it goes up lower than it goes far --------
      • Set EG_OrbHeightMultiplyer = 1.10
      • -------- ---------- --------
      • -------- This will set the difference between each draining level --------
      • -------- the minimum required to activate is 2x this number --------
      • Set EG_EnergyPerDrainingLevel = 100
      • -------- Number of Orbs created --------
      • Set EG_GlyphOrbsBase = 40
      • Set EG_GlyphOrbsPerLevel = 20
      • -------- Draining level: every 100 mana after 200 adds this many Orbs --------
      • Set EG_GlyphOrbsPerDrainedLevel = 30
      • -------- Example: Fully "Charged" level 1: (((400-100)/100) * PerDrainedLevel) + (Base + (PerLevel * AbilityLevel) = Number of orbs --------
      • -------- ---------------------------------------------------- (((400-100)/100) * 30) + (40 + (20 * 1) = Number of orbs --------
      • -------- ---------------------------------------------------- (90) + (60) = Number of orbs --------
      • -------- ---------------------------------------------------- 150 = Number of orbs --------
      • -------- Unit used as the Glyph --------
      • Set EG_Unit_Glyph = Energy Glyph
      • -------- Unit used as the Orb --------
      • Set EG_Unit_Orb = Energy Orb
      • -------- Unit used as the summoning SFX --------
      • Set EG_Unit_SFX = Energy Glyph SFX
      • -------- Model used for the draining SFX --------
      • Set EG_Unit_SFX2 = Abilities\Spells\Items\AIil\AIilTarget.mdl
      • -------- Spell used to activate the ability --------
      • Set EG_Spell = Energy Glyph
  • Energy Glyph Activation
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to EG_Unit_Glyph
    • Actions
      • Set EG_UHandle = (Key (Triggering unit))
      • Set EG_u = (Triggering unit)
      • Set EG_TempPoint = (Position of EG_u)
      • Set EG_TempRealStore = (Load 8 of EG_UHandle from EG_EnergyGlyphHash)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Load 1 of EG_UHandle from EG_EnergyGlyphHash) Equal to 1
          • (Mana of (Triggering unit)) Greater than or equal to (2.00 x (Real(EG_EnergyPerDrainingLevel)))
        • Then - Actions
          • Unit - Create 1 Energy Glyph for (Owner of EG_u) at EG_TempPoint facing Default building facing degrees
          • Set EG_UHandleC = (Key (Last created unit))
          • Set EG_Tempu = (Last created unit)
          • Animation - Change EG_Tempu's size to (EG_TempRealStore%, EG_TempRealStore%, EG_TempRealStore%) of its original size
          • -------- Glyph Stage Indicator --------
          • Hashtable - Save 2 as 1 of EG_UHandleC in EG_EnergyGlyphHash
          • -------- Glyph Creator Indicator --------
          • Hashtable - Save Handle Of(Load 3 of EG_UHandle in EG_EnergyGlyphHash) as 3 of EG_UHandleC in EG_EnergyGlyphHash
          • -------- Orb Damage --------
          • Hashtable - Save (Load 4 of EG_UHandle from EG_EnergyGlyphHash) as 4 of EG_UHandleC in EG_EnergyGlyphHash
          • -------- Orb AOE --------
          • Hashtable - Save (Load 5 of EG_UHandle from EG_EnergyGlyphHash) as 5 of EG_UHandleC in EG_EnergyGlyphHash
          • -------- Orb Count --------
          • Hashtable - Save ((((Integer((Mana of EG_u))) - EG_EnergyPerDrainingLevel) / EG_EnergyPerDrainingLevel) x (EG_GlyphOrbsPerDrainedLevel + (Load 6 of EG_UHandle from EG_EnergyGlyphHash))) as 6 of EG_UHandleC in EG_EnergyGlyphHash
          • -------- Orb AOE Range --------
          • Hashtable - Save (Load 7 of EG_UHandle from EG_EnergyGlyphHash) as 7 of EG_UHandleC in EG_EnergyGlyphHash
          • -------- Scaling --------
          • Hashtable - Save (Load 8 of EG_UHandle from EG_EnergyGlyphHash) as 8 of EG_UHandleC in EG_EnergyGlyphHash
          • Unit Group - Add (Last created unit) to EG_EnergyGlyphs
          • Hashtable - Clear all child hashtables of child EG_UHandle in EG_EnergyGlyphHash
        • Else - Actions
          • -------- Death sfx --------
          • Hashtable - Clear all child hashtables of child EG_UHandle in EG_EnergyGlyphHash
          • Unit - Create 1 EG_Unit_SFX for (Owner of EG_u) at EG_TempPoint facing Default building facing degrees
          • Set EG_Tempu = (Last created unit)
          • Animation - Change EG_Tempu's size to (EG_TempRealStore%, EG_TempRealStore%, EG_TempRealStore%) of its original size
          • Unit - Add a 3.00 second Generic expiration timer to EG_Tempu
          • If ((Number of units in EG_EnergyGlyphs) Equal to 0) then do (Trigger - Turn off (This trigger)) else do (Do nothing)
          • -------- ---------- --------
      • Custom script: call RemoveLocation (udg_EG_TempPoint)
  • Energy Glyph
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to EG_Spell
    • Actions
      • Set EG_u = (Triggering unit)
      • Trigger - Turn on Energy Glyph Loop <gen>
      • Trigger - Turn on Energy Glyph Activation <gen>
      • Set EG_TempPoint = (Target point of ability being cast)
      • -------- Glyph --------
      • Unit - Create 1 Energy Glyph for (Owner of EG_u) at EG_TempPoint facing Default building facing degrees
      • Set EG_Tempu = (Last created unit)
      • Set EG_UHandleC = (Key (Last created unit))
      • Hashtable - Save (100.00 x (EG_GlyphScalingBase + (EG_GlyphScalingPerLevel x (Real((Level of Energy Glyph for EG_u)))))) as 8 of EG_UHandleC in EG_EnergyGlyphHash
      • Set EG_TempRealStore = (Load 8 of EG_UHandleC from EG_EnergyGlyphHash)
      • Animation - Change EG_Tempu's size to (EG_TempRealStore%, EG_TempRealStore%, EG_TempRealStore%) of its original size
      • Unit - Add a (EG_GlyphDurationBase + (EG_GlyphDurationPerLevel x (Real((Level of Energy Glyph for EG_u))))) second Generic expiration timer to EG_Tempu
      • Unit Group - Add EG_Tempu to EG_EnergyGlyphs
      • -------- ---------- --------
      • -------- Creation SFX --------
      • Unit - Create 1 Energy Glyph SFX for (Owner of EG_u) at EG_TempPoint facing Default building facing degrees
      • Set EG_Tempu = (Last created unit)
      • Animation - Change EG_Tempu's size to (EG_TempRealStore%, EG_TempRealStore%, EG_TempRealStore%) of its original size
      • Unit - Add a 3.00 second Generic expiration timer to EG_Tempu
      • -------- ---------- --------
      • Custom script: call RemoveLocation (udg_EG_TempPoint)
      • -------- Passing Information --------
      • Set EG_TempRealStore = (Real((Level of Energy Glyph for EG_u)))
      • -------- Glyph Stage Indicator --------
      • Hashtable - Save 1 as 1 of EG_UHandleC in EG_EnergyGlyphHash
      • -------- Energy drain speed --------
      • Hashtable - Save (EG_EnergyDrainBase + (EG_EnergyDrainPerLevel x EG_TempRealStore)) as 2 of EG_UHandleC in EG_EnergyGlyphHash
      • -------- Glyph Creator Indicator --------
      • Hashtable - Save Handle OfEG_u as 3 of EG_UHandleC in EG_EnergyGlyphHash
      • -------- Orb Damage --------
      • Hashtable - Save (EG_OrbDamageBase + (EG_OrbDamagePerLevel x EG_TempRealStore)) as 4 of EG_UHandleC in EG_EnergyGlyphHash
      • -------- Orb AOE --------
      • Hashtable - Save (EG_OrbAoeBase + (EG_OrbAoePerLevel x EG_TempRealStore)) as 5 of EG_UHandleC in EG_EnergyGlyphHash
      • -------- Orb Count --------
      • Hashtable - Save (EG_GlyphOrbsBase + (EG_GlyphOrbsPerLevel x (Level of Energy Glyph for EG_u))) as 6 of EG_UHandleC in EG_EnergyGlyphHash
      • -------- Orb AOE Range --------
      • Hashtable - Save (EG_OrbRangeAOEBase + (EG_OrbRangeAOEPerLevel x (Real((Level of Energy Glyph for EG_u))))) as 7 of EG_UHandleC in EG_EnergyGlyphHash
      • -------- ---------- --------
  • Energy Glyph Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in EG_EnergyGlyphs and do (Actions)
        • Loop - Actions
          • Set EG_UHandle = (Key (Picked unit))
          • Set EG_u = (Picked unit)
          • -------- Stage 1 - Mana drain --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Load 1 of EG_UHandle from EG_EnergyGlyphHash) Equal to 1
            • Then - Actions
              • Set EG_TempPoint = (Position of EG_u)
              • Set EG_TempGroup = (Units within (Load 7 of EG_UHandle from EG_EnergyGlyphHash) of EG_TempPoint)
              • Custom script: call RemoveLocation (udg_EG_TempPoint)
              • Unit Group - Pick every unit in EG_TempGroup and do (Actions)
                • Loop - Actions
                  • Set EG_Tempu = (Picked unit)
                  • Set EG_TempRealStore = (Load 2 of EG_UHandle from EG_EnergyGlyphHash)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (EG_Tempu is A ground unit) Equal to True
                      • (EG_Tempu is alive) Equal to True
                      • (EG_Tempu is Magic Immune) Equal to False
                      • (Mana of EG_Tempu) Greater than or equal to EG_TempRealStore
                    • Then - Actions
                      • Unit - Set mana of EG_Tempu to ((Mana of EG_Tempu) - EG_TempRealStore)
                      • Set EG_TempPoint = (Position of EG_Tempu)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Load 15 of EG_UHandle from EG_EnergyGlyphHash) Equal to 20
                        • Then - Actions
                          • Special Effect - Create a special effect at EG_TempPoint using EG_Unit_SFX2
                          • Special Effect - Destroy (Last created special effect)
                          • Hashtable - Save 0 as 15 of EG_UHandle in EG_EnergyGlyphHash
                        • Else - Actions
                      • Hashtable - Save ((Load 15 of EG_UHandle from EG_EnergyGlyphHash) + 1) as 15 of EG_UHandle in EG_EnergyGlyphHash
                      • Custom script: call RemoveLocation (udg_EG_TempPoint)
                      • Unit - Set mana of EG_u to ((Mana of EG_u) + EG_TempRealStore)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Mana of EG_u) Greater than or equal to EG_GlyphManaStealMax
                        • Then - Actions
                          • Unit Group - Remove EG_u from EG_EnergyGlyphs
                          • Unit - Kill EG_u
                        • Else - Actions
                    • Else - Actions
              • Custom script: call DestroyGroup(udg_EG_TempGroup)
            • Else - Actions
          • -------- Stage 2 - Creating Orbs --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Load 1 of EG_UHandle from EG_EnergyGlyphHash) Equal to 2
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Load 6 of EG_UHandle from EG_EnergyGlyphHash) Greater than 0
                • Then - Actions
                  • Hashtable - Save ((Load 6 of EG_UHandle from EG_EnergyGlyphHash) - 1) as 6 of EG_UHandle in EG_EnergyGlyphHash
                  • Set EG_TempPoint = (Position of EG_u)
                  • Set EG_TempPoint2 = (EG_TempPoint offset by (Random real number between 50.00 and (Load 7 of EG_UHandle from EG_EnergyGlyphHash)) towards (Random angle) degrees)
                  • Unit - Create 1 EG_Unit_Orb for (Owner of EG_u) at EG_TempPoint facing (Angle from EG_TempPoint to EG_TempPoint2) degrees
                  • Set EG_UHandleC = (Key (Last created unit))
                  • Hashtable - Save (Distance between EG_TempPoint and EG_TempPoint2) as 9 of EG_UHandleC in EG_EnergyGlyphHash
                  • Hashtable - Save ((Load 9 of EG_UHandleC from EG_EnergyGlyphHash) x EG_OrbHeightMultiplyer) as 10 of EG_UHandleC in EG_EnergyGlyphHash
                  • Custom script: call RemoveLocation (udg_EG_TempPoint2)
                  • Custom script: call RemoveLocation (udg_EG_TempPoint)
                  • -------- Glyph Stage Indicator --------
                  • Hashtable - Save 3 as 1 of EG_UHandleC in EG_EnergyGlyphHash
                  • -------- Glyph Creator Indicator --------
                  • Hashtable - Save Handle Of(Load 3 of EG_UHandle in EG_EnergyGlyphHash) as 3 of EG_UHandleC in EG_EnergyGlyphHash
                  • -------- Orb Damage --------
                  • Hashtable - Save (Load 4 of EG_UHandle from EG_EnergyGlyphHash) as 4 of EG_UHandleC in EG_EnergyGlyphHash
                  • -------- Orb AOE --------
                  • Hashtable - Save (Load 5 of EG_UHandle from EG_EnergyGlyphHash) as 5 of EG_UHandleC in EG_EnergyGlyphHash
                  • Unit Group - Add (Last created unit) to EG_EnergyGlyphs
                • Else - Actions
                  • Unit - Kill EG_u
                  • Unit Group - Remove EG_u from EG_EnergyGlyphs
                  • If ((Number of units in EG_EnergyGlyphs) Equal to 0) then do (Trigger - Turn off (This trigger)) else do (Do nothing)
            • Else - Actions
          • -------- Stage 3 - Moving Orbs/Orb damage --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Load 1 of EG_UHandle from EG_EnergyGlyphHash) Equal to 3
            • Then - Actions
              • Custom script: set udg_EG_TempX = GetUnitX(udg_EG_u)
              • Custom script: set udg_EG_TempY = GetUnitY(udg_EG_u)
              • Set EG_Angle = (Facing of EG_u)
              • Custom script: call SetUnitX(udg_EG_u, udg_EG_TempX + udg_EG_OrbSpeed * Cos(udg_EG_Angle * bj_DEGTORAD))
              • Custom script: call SetUnitY(udg_EG_u, udg_EG_TempY + udg_EG_OrbSpeed * Sin(udg_EG_Angle * bj_DEGTORAD))
              • Hashtable - Save ((Load 11 of EG_UHandle from EG_EnergyGlyphHash) + EG_OrbSpeed) as 11 of EG_UHandle in EG_EnergyGlyphHash
              • Hashtable - Save (((4.00 x (Load 10 of EG_UHandle from EG_EnergyGlyphHash)) / (Load 9 of EG_UHandle from EG_EnergyGlyphHash)) x (((Load 11 of EG_UHandle from EG_EnergyGlyphHash) / (Load 9 of EG_UHandle from EG_EnergyGlyphHash)) x ((Load 9 of EG_UHandle from EG_EnergyGlyphHash as 12 of EG_UHandle in EG_EnergyGlyphHash
              • Animation - Change EG_u flying height to (Load 12 of EG_UHandle from EG_EnergyGlyphHash) at 0.00
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Load 12 of EG_UHandle from EG_EnergyGlyphHash) Less than 0.00
                • Then - Actions
                  • Set EG_TempPoint = (Position of EG_u)
                  • Set EG_TempGroup = (Units within (Load 5 of EG_UHandle from EG_EnergyGlyphHash) of EG_TempPoint)
                  • Unit Group - Pick every unit in EG_TempGroup and do (Actions)
                    • Loop - Actions
                      • Set EG_Tempu = (Picked unit)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (EG_Tempu is A ground unit) Equal to True
                          • (EG_Tempu is alive) Equal to True
                          • (EG_Tempu is Magic Immune) Equal to False
                          • (EG_Tempu belongs to an enemy of (Owner of EG_u)) Equal to True
                        • Then - Actions
                          • Unit - Cause (Load 3 of EG_UHandle in EG_EnergyGlyphHash) to damage EG_Tempu, dealing (Load 4 of EG_UHandle from EG_EnergyGlyphHash) damage of attack type Spells and damage type Normal
                        • Else - Actions
                  • Custom script: call RemoveLocation (udg_EG_TempPoint)
                  • Custom script: call DestroyGroup(udg_EG_TempGroup)
                  • Unit Group - Remove EG_u from EG_EnergyGlyphs
                  • Unit - Kill EG_u
                • Else - Actions
            • Else - Actions
          • -------- Movement speed reduction/increase (entry/exit) --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Load 1 of EG_UHandle from EG_EnergyGlyphHash) Equal to 4
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Load 13 of EG_UHandle from EG_EnergyGlyphHash) Greater than 0
                • Then - Actions
                  • Unit - Set EG_u movement speed to ((Current movement speed of EG_u) / EG_EnergySlowDivider)
                  • Hashtable - Save ((Load 13 of EG_UHandle from EG_EnergyGlyphHash) - 1) as 13 of EG_UHandle in EG_EnergyGlyphHash
                • Else - Actions
                  • Unit - Set EG_u movement speed to ((Current movement speed of EG_u) x EG_EnergySlowDivider)
                  • Unit Group - Remove EG_u from EG_EnergyGlyphs
                  • Hashtable - Save 0 as 1 of EG_UHandle in EG_EnergyGlyphHash
            • Else - Actions
          • -------- Adding units to the movement speed reduction --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of EG_u) Equal to Energy Glyph
            • Then - Actions
              • Set EG_TempPoint = (Position of EG_u)
              • Set EG_TempGroup = (Units within (Load 7 of EG_UHandle from EG_EnergyGlyphHash) of EG_TempPoint)
              • Unit Group - Pick every unit in EG_TempGroup and do (Actions)
                • Loop - Actions
                  • Set EG_Tempu = (Picked unit)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (EG_Tempu is A ground unit) Equal to True
                      • (EG_Tempu is alive) Equal to True
                      • (EG_Tempu is Magic Immune) Equal to False
                      • (EG_Tempu belongs to an enemy of (Owner of EG_u)) Equal to True
                    • Then - Actions
                      • Set EG_UHandleC = (Key (Picked unit))
                      • Hashtable - Save ((Load 13 of EG_UHandleC from EG_EnergyGlyphHash) + 1) as 13 of EG_UHandleC in EG_EnergyGlyphHash
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • ((Matching unit) is in EG_EnergyGlyphs) Equal to False
                        • Then - Actions
                          • Hashtable - Save 4 as 1 of EG_UHandleC in EG_EnergyGlyphHash
                          • Unit Group - Add EG_Tempu to EG_EnergyGlyphs
                        • Else - Actions
                    • Else - Actions
              • Custom script: call RemoveLocation (udg_EG_TempPoint)
              • Custom script: call DestroyGroup(udg_EG_TempGroup)
            • Else - Actions
- Energy Matrix
  • Energy Matrix Configuration
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Do not touch --------
      • Hashtable - Create a hashtable
      • Set EM_Hash = (Last created hashtable)
      • -------- -------- --------
      • -------- Determines the area which the Energy Cores will drain from --------
      • Set EM_CoreAoeBase = 200.00
      • Set EM_CoreAoePerLevel = 50.00
      • -------- Determines how far out from the hero the Cores will be --------
      • Set EM_CoreDistanceBase = 300.00
      • Set EM_CoreDistancePerLevel = 0.00
      • -------- Determines how long the Cores will last for --------
      • Set EM_DurationBase = 2.00
      • Set EM_DurationPerLevel = 3.00
      • -------- Detmines the flying height of the cores --------
      • Set EM_FlyHeight = 200.00
      • -------- Determines how much health will be drained from a unit being effected by the spell --------
      • Set EM_HealthDrainBase = 0.00
      • Set EM_HealthDrainPerLevel = 0.15
      • -------- The higher section of the lightning (up to the core) should be 75 above the fly height of the cores (if standard model is being used) --------
      • Set EM_LightningHighHeight = 275.00
      • -------- Flying height of the low points (the targets and the caster) --------
      • Set EM_LightningLowHeightCaster = 75.00
      • Set EM_LightningLowHeightTarget = 75.00
      • -------- Determines the conversion rate of health into mana --------
      • Set EM_ManaConversionBase = 0.00
      • Set EM_ManaConversionPerLevel = 0.15
      • -------- Determines the number of cores created --------
      • Set EM_SidesBase = 2
      • Set EM_SidesPerLevel = 1
      • -------- Determines the max amount of targets for the spell --------
      • Set EM_MaxTargetsBase = 10
      • Set EM_MaxTargetsPerLevel = 5
      • -------- Determines how fast the Cores will revolve --------
      • Set EM_SpinSpeed = 5.00
      • -------- Unit used to create the Matrix --------
      • Set EM_CoreUnit = Energy Core
      • -------- Spell used to activate the triggers and create the matrix --------
      • Set EM_Spell = Energy Matrix
      • -------- SFX used on creation/death of the matrix --------
      • Set EM_SFX = Abilities\Spells\Items\AIre\AIreTarget.mdl
      • -------- Lightning effect used to link the caster and the matrix --------
      • -------- Standard is DRAM = Drain mana --------
      • Set EM_Lightning = DRAM
      • -------- Lightning effect used to link the targets and the matrix --------
      • -------- Standard is DRAL = Drain life --------
      • Set EM_Lightning2 = DRAL
      • -------- Go into the object editor and press Ctrl + D for raw data on things such as chain lightning over lightning effects to find the Code for it --------
      • -------- Pressing CTRL + D again will reset the data to the normal view --------
      • -------- -------- --------
  • Energy Matrix Activation
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to EM_Spell
    • Actions
      • Set EM_U = (Triggering unit)
      • Set EM_TempPoint = (Position of EM_U)
      • Set EM_TempRealStore = (Real((Level of EM_Spell for EM_U)))
      • For each (Integer EM_I) from 1 to (EM_SidesBase + (EM_SidesPerLevel x (Level of EM_Spell for EM_U))), do (Actions)
        • Loop - Actions
          • Set EM_Angle = (EM_Angle + (360.00 / ((Real(EM_SidesBase)) + ((Real(EM_SidesPerLevel)) x EM_TempRealStore))))
          • Set EM_TempRealStore2 = (EM_CoreDistanceBase + (EM_CoreDistancePerLevel x EM_TempRealStore))
          • Set EM_TempPoint2 = (EM_TempPoint offset by EM_TempRealStore2 towards EM_Angle degrees)
          • Unit - Create 1 EM_CoreUnit for (Owner of EM_U) at EM_TempPoint2 facing Default building facing degrees
          • Custom script: call RemoveLocation (udg_EM_TempPoint2)
          • Set EM_TempU = (Last created unit)
          • Special Effect - Create a special effect attached to the origin of EM_TempU using EM_SFX
          • Special Effect - Destroy (Last created special effect)
          • Custom script: set udg_EM_UHandle = GetHandleId(udg_EM_TempU)
          • Animation - Change EM_TempU flying height to EM_FlyHeight at 0.00
          • Unit Group - Add EM_TempU to EM_Cores
          • Unit - Change color of EM_TempU to (Color of Neutral Hostile)
          • Unit - Add a (EM_DurationBase + (EM_DurationPerLevel x EM_TempRealStore)) second Generic expiration timer to EM_TempU
          • Hashtable - Save Handle OfEM_U as 1 of EM_UHandle in EM_Hash
          • Hashtable - Save (EM_CoreAoeBase + (EM_CoreAoePerLevel x EM_TempRealStore)) as 2 of EM_UHandle in EM_Hash
          • Hashtable - Save (EM_HealthDrainBase + (EM_HealthDrainPerLevel x EM_TempRealStore)) as 3 of EM_UHandle in EM_Hash
          • Hashtable - Save (EM_ManaConversionBase + (EM_ManaConversionPerLevel x EM_TempRealStore)) as 4 of EM_UHandle in EM_Hash
          • Hashtable - Save EM_Angle as 6 of EM_UHandle in EM_Hash
          • Hashtable - Save EM_TempRealStore2 as 7 of EM_UHandle in EM_Hash
          • Hashtable - Save (EM_MaxTargetsBase + (EM_MaxTargetsPerLevel x (Level of Energy Matrix for EM_U))) as 10 of EM_UHandle in EM_Hash
      • Trigger - Turn on Energy Matrix Loop <gen>
      • Trigger - Turn on Energy Matrix End <gen>
      • Custom script: call RemoveLocation (udg_EM_TempPoint)
  • Energy Matrix Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in EM_Cores and do (Actions)
        • Loop - Actions
          • Set EM_U = (Picked unit)
          • Custom script: set udg_EM_UHandle = GetHandleId(udg_EM_U)
          • Lightning - Destroy (Load 8 of EM_UHandle in EM_Hash)
          • For each (Integer EM_I) from 11 to (Load 0 of EM_UHandle from EM_Hash), do (Actions)
            • Loop - Actions
              • Lightning - Destroy (Load EM_I of EM_UHandle in EM_Hash)
          • Set EM_TempPoint = (Position of (Load 1 of EM_UHandle in EM_Hash))
          • Set EM_Angle = ((Load 6 of EM_UHandle from EM_Hash) + EM_SpinSpeed)
          • Set EM_TempRealStore = (Load 7 of EM_UHandle from EM_Hash)
          • Hashtable - Save EM_Angle as 6 of EM_UHandle in EM_Hash
          • Custom script: call SetUnitX(udg_EM_U, GetLocationX(udg_EM_TempPoint) + udg_EM_TempRealStore * Cos(udg_EM_Angle * bj_DEGTORAD))
          • Custom script: call SetUnitY(udg_EM_U, GetLocationY(udg_EM_TempPoint) + udg_EM_TempRealStore * Sin(udg_EM_Angle * bj_DEGTORAD))
          • Set EM_TempPoint2 = (Position of EM_U)
          • Custom script: set udg_EM_TempZ = GetLocationZ(udg_EM_TempPoint) + udg_EM_LightningLowHeightCaster
          • Custom script: set udg_EM_TempZ2 = GetLocationZ(udg_EM_TempPoint2) + udg_EM_LightningHighHeight
          • Custom script: set udg_EM_TempLightning = AddLightningEx(udg_EM_Lightning, true, GetLocationX(udg_EM_TempPoint), GetLocationY(udg_EM_TempPoint), udg_EM_TempZ, GetLocationX(udg_EM_TempPoint2), GetLocationY(udg_EM_TempPoint2), udg_EM_TempZ2)
          • Hashtable - Save Handle OfEM_TempLightning as 8 of EM_UHandle in EM_Hash
          • Custom script: call RemoveLocation (udg_EM_TempPoint)
          • Set EM_LightningCounter = 10
          • Set EM_TempGroup = (Units within (Load 2 of EM_UHandle from EM_Hash) of EM_TempPoint2)
          • Unit Group - Pick every unit in EM_TempGroup and do (Actions)
            • Loop - Actions
              • Set EM_TempU = (Picked unit)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (EM_TempU is Magic Immune) Equal to False
                  • ((Unit-type of EM_TempU) is A structure) Equal to False
                  • (EM_TempU is A ground unit) Equal to True
                  • (EM_TempU is alive) Equal to True
                  • (EM_TempU belongs to an enemy of (Owner of EM_U)) Equal to True
                  • EM_LightningCounter Less than ((Load 10 of EM_UHandle from EM_Hash) + 10)
                • Then - Actions
                  • Set EM_LightningCounter = (EM_LightningCounter + 1)
                  • Set EM_TempPoint = (Position of EM_TempU)
                  • Custom script: set udg_EM_TempZ = GetLocationZ(udg_EM_TempPoint) + udg_EM_LightningLowHeightTarget
                  • Custom script: set udg_EM_TempLightning = AddLightningEx(udg_EM_Lightning2, true, GetLocationX(udg_EM_TempPoint), GetLocationY(udg_EM_TempPoint), udg_EM_TempZ, GetLocationX(udg_EM_TempPoint2), GetLocationY(udg_EM_TempPoint2), udg_EM_TempZ2)
                  • Hashtable - Save Handle OfEM_TempLightning as EM_LightningCounter of EM_UHandle in EM_Hash
                  • Custom script: call RemoveLocation (udg_EM_TempPoint)
                  • Unit - Cause (Load 1 of EM_UHandle in EM_Hash) to damage EM_TempU, dealing (Load 3 of EM_UHandle from EM_Hash) damage of attack type Spells and damage type Normal
                  • Unit - Set mana of (Load 1 of EM_UHandle in EM_Hash) to ((Mana of (Load 1 of EM_UHandle in EM_Hash)) + ((Load 3 of EM_UHandle from EM_Hash) x (Load 4 of EM_UHandle from EM_Hash)))
                • Else - Actions
          • Custom script: call DestroyGroup(udg_EM_TempGroup)
          • Hashtable - Save EM_LightningCounter as 0 of EM_UHandle in EM_Hash
          • Custom script: call RemoveLocation (udg_EM_TempPoint2)
  • Energy Matrix End
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to EM_CoreUnit
    • Actions
      • Set EM_U = (Triggering unit)
      • Custom script: set udg_EM_UHandle = GetHandleId(udg_EM_U)
      • Lightning - Destroy (Load 8 of EM_UHandle in EM_Hash)
      • For each (Integer EM_I) from 11 to (Load 0 of EM_UHandle from EM_Hash), do (Actions)
        • Loop - Actions
          • Lightning - Destroy (Load EM_I of EM_UHandle in EM_Hash)
      • Special Effect - Create a special effect attached to the origin of EM_U using EM_SFX
      • Special Effect - Destroy (Last created special effect)
      • Hashtable - Clear all child hashtables of child EM_UHandle in EM_Hash
      • Unit Group - Remove EM_U from EM_Cores
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (EM_Cores is empty) Equal to True
        • Then - Actions
          • Trigger - Turn off Energy Matrix Loop <gen>
          • Trigger - Turn off (This trigger)
        • Else - Actions
- Explosive Toxic Gas
  • ETG Configuration
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Do not touch --------
      • Hashtable - Create a hashtable
      • Set ETG_Hash = (Last created hashtable)
      • -------- -------- --------
      • -------- Determines the size of the gas projectile --------
      • Set ETG_GasProjectileScale = 200.00
      • -------- Determines the size of the volcanic Rock --------
      • Set ETG_VolcanicProjectileScale = 100.00
      • -------- Determines how random the Gas spread will be --------
      • Set ETG_SpreadRandomiser = 40.00
      • -------- Determines the Arc for the volcanic rock --------
      • Set ETG_HeightMultiplyer = 0.45
      • -------- Determines how much ground each Gas segment will cover --------
      • Set ETG_GasCloudAOE = 100.00
      • -------- Determines how big the Volcanic Rock AOE is --------
      • Set ETG_VolcanicRockAoeBase = 50.00
      • Set ETG_VolcanicRockAoePerLevel = 50.00
      • -------- Determines the damage dealt by the poison --------
      • Set ETG_PoisonDamageBase = 0.50
      • Set ETG_PoisonDamagePerLevel = 0.10
      • -------- Determines the damage deal by the burning --------
      • Set ETG_BurnDamageBase = 0.30
      • Set ETG_BurnDamagePerLevel = 0.20
      • -------- Determines the damage upon explosion --------
      • Set ETG_ExplosionDamageBase = 50.00
      • Set ETG_ExplosionDamagePerLevel = 25.00
      • -------- Determines the gas poison duration --------
      • Set ETG_PoisonDurationBase = 50.00
      • Set ETG_PoisonDurationPerLevel = 20.00
      • -------- Determines the duration of the Clouds --------
      • Set ETG_GasCloudDurationBase = 8.00
      • Set ETG_GasCloudDurationPerLevel = 2.00
      • -------- Determines the duration of the Burning --------
      • Set ETG_BurnDurationBase = 100.00
      • Set ETG_BurnDurationPerLevel = 40.00
      • -------- Sets the minimum range of the Volcanic Rock Spell --------
      • Set ETG_MinRange = 100.00
      • -------- Determines the amount of directions the gas will spread out in --------
      • Set ETG_GasHeadsBase = 2
      • Set ETG_GasHeadsPerLevel = 2
      • -------- Determines how far the gas will spread --------
      • Set ETG_GasSpreadBase = 3.00
      • Set ETG_GasSpreadPerLevel = 2.00
      • -------- Determines how fast the cloud of Gas will be sent out --------
      • Set ETG_GasSpeed = 20.00
      • -------- Determines the delay between each part of gas being created --------
      • Set ETG_GasSpreadSpeed = 2
      • -------- Determines the fly height for the Gas projectile --------
      • Set ETG_GasProjectileFlyHeight = 100.00
      • -------- Determines the Dummy unit of the spell --------
      • Set ETG_Dummy = ETG Dummy
      • -------- Determines the unit model used as the Gas --------
      • Set ETG_GasModel = Abilities\Spells\Undead\PlagueCloud\PlagueCloudCaster.mdl
      • -------- Determines the unit model used as the Gas Projectile --------
      • Set ETG_GasProjectileModel = Abilities\Weapons\ChimaeraAcidMissile\ChimaeraAcidMissile.mdl
      • -------- Determines the unit model used as the Volcanic Rock --------
      • Set ETG_RockModel = Abilities\Spells\Other\Volcano\VolcanoMissile.mdl
      • -------- Determines the unit model used when the cloud dissapates --------
      • Set ETG_DissapateModel = Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • -------- Determines the unit model used when the cloud explodes --------
      • Set ETG_ExplosionModel = Abilities\Spells\Other\Incinerate\FireLordDeathExplode.mdl
      • -------- Determines the unit model used as the Fire --------
      • Set ETG_FireModel = Environment\LargeBuildingFire\LargeBuildingFire2.mdl
      • -------- Determines the unit model used as the Poison mark --------
      • Set ETG_PoisonModel = Abilities\Spells\Undead\AntiMagicShell\AntiMagicShell.mdl
      • -------- Determines the spell used to act as the activation spell --------
      • -------- Toxic Gas --------
      • Set ETG_Spell = Toxic Gas
      • -------- Volcanic Rock --------
      • Set ETG_Spell2 = Volcanic Rock
      • -------- ------ --------
      • -------- Ability to add burn buff --------
      • Set ETG_BuffAbilityBurn = Burn
      • -------- Ability to add poison buff --------
      • Set ETG_BuffAbilityPoison = Poison
  • ETG Activation
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Ability being cast) Equal to ETG_Spell
          • (Ability being cast) Equal to ETG_Spell2
    • Actions
      • -------- Spell setup --------
      • Set ETG_U = (Triggering unit)
      • Set ETG_TempPoint = (Position of (Triggering unit))
      • Set ETG_TempPoint2 = (Target point of ability being cast)
      • Set ETG_TempReal = (Real((Level of ETG_Spell for ETG_U)))
      • Set ETG_Angle = (Angle from ETG_TempPoint to ETG_TempPoint2)
      • -------- -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to ETG_Spell
        • Then - Actions
          • -------- Creating the Gas --------
          • Unit - Create 1 ETG_Dummy for (Owner of ETG_U) at ETG_TempPoint facing ETG_Angle degrees
          • -------- Unit setup --------
          • Set ETG_TempU = (Last created unit)
          • Custom script: set udg_ETG_UHandle = GetHandleId(udg_ETG_TempU)
          • Special Effect - Create a special effect attached to the origin of ETG_TempU using ETG_GasProjectileModel
          • Animation - Change ETG_TempU's size to (ETG_GasProjectileScale%, ETG_GasProjectileScale%, ETG_GasProjectileScale%) of its original size
          • Animation - Change ETG_TempU flying height to ETG_GasProjectileFlyHeight at 0.00
          • -------- -------- --------
          • -------- Original Casting Unit --------
          • Hashtable - Save Handle OfETG_U as 1 of ETG_UHandle in ETG_Hash
          • -------- Stage ID --------
          • Hashtable - Save 1 as 2 of ETG_UHandle in ETG_Hash
          • -------- Number of Gas Heads --------
          • Hashtable - Save (ETG_GasHeadsBase + ((Integer(ETG_TempReal)) x ETG_GasHeadsPerLevel)) as 3 of ETG_UHandle in ETG_Hash
          • -------- Duration of each Gas cloud --------
          • Hashtable - Save (ETG_GasCloudDurationBase + (ETG_TempReal x ETG_GasCloudDurationPerLevel)) as 4 of ETG_UHandle in ETG_Hash
          • -------- Poison Damage --------
          • Hashtable - Save (ETG_PoisonDamageBase + (ETG_TempReal x ETG_PoisonDamagePerLevel)) as 5 of ETG_UHandle in ETG_Hash
          • -------- Poison Duration --------
          • Hashtable - Save (ETG_PoisonDurationBase + (ETG_TempReal x ETG_PoisonDurationPerLevel)) as 6 of ETG_UHandle in ETG_Hash
          • -------- Amount of spreading Gas --------
          • Hashtable - Save (ETG_GasSpreadBase + (ETG_TempReal x ETG_GasSpreadPerLevel)) as 10 of ETG_UHandle in ETG_Hash
          • -------- Distance To Travel --------
          • Hashtable - Save (Distance between ETG_TempPoint and ETG_TempPoint2) as 11 of ETG_UHandle in ETG_Hash
          • -------- Distance Initalisation --------
          • Hashtable - Save 0.00 as 12 of ETG_UHandle in ETG_Hash
          • -------- Cloud effect --------
          • Hashtable - Save Handle Of(Last created special effect) as 13 of ETG_UHandle in ETG_Hash
          • -------- Added to unit group --------
          • Unit Group - Add ETG_TempU to ETG_Group
        • Else - Actions
          • -------- Minimum Range check --------
          • Set ETG_RealCache[0] = (Distance between ETG_TempPoint and ETG_TempPoint2)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ETG_RealCache[0] Less than ETG_MinRange
            • Then - Actions
              • Custom script: call RemoveLocation(udg_ETG_TempPoint2)
              • Set ETG_Angle = (Facing of ETG_U)
              • Set ETG_TempPoint2 = (ETG_TempPoint offset by ETG_MinRange towards ETG_Angle degrees)
              • Set ETG_RealCache[0] = (Distance between ETG_TempPoint and ETG_TempPoint2)
            • Else - Actions
          • -------- Creating the Rock --------
          • Unit - Create 1 ETG_Dummy for (Owner of ETG_U) at ETG_TempPoint facing ETG_Angle degrees
          • -------- Unit setup --------
          • Set ETG_TempU = (Last created unit)
          • Custom script: set udg_ETG_UHandle = GetHandleId(udg_ETG_TempU)
          • Special Effect - Create a special effect attached to the overhead of ETG_TempU using ETG_RockModel
          • Animation - Change ETG_TempU's size to (ETG_VolcanicProjectileScale%, ETG_VolcanicProjectileScale%, ETG_VolcanicProjectileScale%) of its original size
          • -------- -------- --------
          • -------- Original Casting Unit --------
          • Hashtable - Save Handle OfETG_U as 1 of ETG_UHandle in ETG_Hash
          • -------- Stage ID --------
          • Hashtable - Save 4 as 2 of ETG_UHandle in ETG_Hash
          • -------- Explosion Aoe --------
          • Hashtable - Save (ETG_VolcanicRockAoeBase + (ETG_TempReal x ETG_VolcanicRockAoePerLevel)) as 6 of ETG_UHandle in ETG_Hash
          • -------- Distance To Travel --------
          • Hashtable - Save ETG_RealCache[0] as 11 of ETG_UHandle in ETG_Hash
          • -------- Distance Initalisation --------
          • Hashtable - Save 0.00 as 12 of ETG_UHandle in ETG_Hash
          • Hashtable - Save (ETG_RealCache[0] x ETG_HeightMultiplyer) as 13 of ETG_UHandle in ETG_Hash
          • -------- Rock effect --------
          • Hashtable - Save Handle Of(Last created special effect) as 14 of ETG_UHandle in ETG_Hash
          • -------- Added to unit group --------
          • Unit Group - Add ETG_TempU to ETG_Group
      • -------- Explosion Damage --------
      • Hashtable - Save (ETG_ExplosionDamageBase + (ETG_TempReal x ETG_ExplosionDamagePerLevel)) as 9 of ETG_UHandle in ETG_Hash
      • -------- Burn Damage --------
      • Hashtable - Save (ETG_BurnDamageBase + (ETG_TempReal x ETG_BurnDamagePerLevel)) as 7 of ETG_UHandle in ETG_Hash
      • -------- Burn Duration --------
      • Hashtable - Save (ETG_BurnDurationBase + (ETG_TempReal x ETG_BurnDurationPerLevel)) as 8 of ETG_UHandle in ETG_Hash
      • -------- Clearing Leaks --------
      • Custom script: call RemoveLocation(udg_ETG_TempPoint2)
      • Custom script: call RemoveLocation(udg_ETG_TempPoint)
      • Trigger - Turn on ETG Loop <gen>
  • ETG Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in ETG_Group and do (Actions)
        • Loop - Actions
          • -------- Unit Setup --------
          • Set ETG_U = (Picked unit)
          • Custom script: set udg_ETG_UHandle = GetHandleId(udg_ETG_U)
          • Set ETG_TempInteger = (Load 2 of ETG_UHandle from ETG_Hash)
          • -------- Stage 1 (of 4) --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ETG_TempInteger Equal to 1
            • Then - Actions
              • -------- Movement --------
              • Custom script: set udg_ETG_TempX = GetUnitX(udg_ETG_U)
              • Custom script: set udg_ETG_TempY = GetUnitY(udg_ETG_U)
              • Custom script: set udg_ETG_Angle = (GetUnitFacing(udg_ETG_U) * bj_DEGTORAD)
              • Custom script: call SetUnitX(udg_ETG_U, udg_ETG_TempX + udg_ETG_GasSpeed * Cos(udg_ETG_Angle))
              • Custom script: call SetUnitY(udg_ETG_U, udg_ETG_TempY + udg_ETG_GasSpeed * Sin(udg_ETG_Angle))
              • Set ETG_TempReal = ((Load 12 of ETG_UHandle from ETG_Hash) + ETG_GasSpeed)
              • -------- Arrival --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ETG_TempReal Greater than or equal to (Load 11 of ETG_UHandle from ETG_Hash)
                • Then - Actions
                  • Set ETG_TempPoint = (Position of ETG_U)
                  • Set ETG_Angle = 0.00
                  • -------- Creating Gas --------
                  • Set ETG_TempU = (Load 1 of ETG_UHandle in ETG_Hash)
                  • -------- Amount of gas heads --------
                  • Set ETG_RealCache[0] = (Real((Load 3 of ETG_UHandle from ETG_Hash)))
                  • -------- Duration of each Gas cloud --------
                  • Set ETG_RealCache[1] = (Load 4 of ETG_UHandle from ETG_Hash)
                  • -------- Poison Damage --------
                  • Set ETG_RealCache[2] = (Load 5 of ETG_UHandle from ETG_Hash)
                  • -------- Poison Duration --------
                  • Set ETG_RealCache[3] = (Load 6 of ETG_UHandle from ETG_Hash)
                  • -------- Burn Damage --------
                  • Set ETG_RealCache[4] = (Load 7 of ETG_UHandle from ETG_Hash)
                  • -------- Burn Duration --------
                  • Set ETG_RealCache[5] = (Load 8 of ETG_UHandle from ETG_Hash)
                  • -------- Explosion Damage --------
                  • Set ETG_RealCache[6] = (Load 9 of ETG_UHandle from ETG_Hash)
                  • -------- Amount of spreading Gas --------
                  • Set ETG_RealCache[7] = (Load 10 of ETG_UHandle from ETG_Hash)
                  • For each (Integer ETG_i) from 1 to (Load 3 of ETG_UHandle from ETG_Hash), do (Actions)
                    • Loop - Actions
                      • -------- Gas data Setup --------
                      • Set ETG_Angle = (ETG_Angle + (360.00 / ETG_RealCache[0]))
                      • Set ETG_TempPoint2 = (ETG_TempPoint offset by ETG_GasCloudAOE towards ETG_Angle degrees)
                      • -------- Creating Gas --------
                      • Unit - Create 1 ETG_Dummy for (Owner of ETG_U) at ETG_TempPoint2 facing ETG_Angle degrees
                      • Set ETG_TempU2 = (Last created unit)
                      • Custom script: call RemoveLocation(udg_ETG_TempPoint2)
                      • Custom script: set udg_ETG_UHandleC = GetHandleId(udg_ETG_TempU2)
                      • Special Effect - Create a special effect attached to the chest of ETG_TempU2 using ETG_GasModel
                      • -------- Original Casting Unit --------
                      • Hashtable - Save Handle OfETG_TempU as 1 of ETG_UHandleC in ETG_Hash
                      • -------- Stage ID --------
                      • Hashtable - Save 2 as 2 of ETG_UHandleC in ETG_Hash
                      • -------- Duration of each Gas cloud --------
                      • Hashtable - Save ETG_RealCache[1] as 4 of ETG_UHandleC in ETG_Hash
                      • -------- Poison Damage --------
                      • Hashtable - Save ETG_RealCache[2] as 5 of ETG_UHandleC in ETG_Hash
                      • -------- Poison Duration --------
                      • Hashtable - Save ETG_RealCache[3] as 6 of ETG_UHandleC in ETG_Hash
                      • -------- Burn Damage --------
                      • Hashtable - Save ETG_RealCache[4] as 7 of ETG_UHandleC in ETG_Hash
                      • -------- Burn Duration --------
                      • Hashtable - Save ETG_RealCache[5] as 8 of ETG_UHandleC in ETG_Hash
                      • -------- Explosion Damage --------
                      • Hashtable - Save ETG_RealCache[6] as 9 of ETG_UHandleC in ETG_Hash
                      • -------- Amount of spreading Gas --------
                      • Hashtable - Save ETG_RealCache[7] as 10 of ETG_UHandleC in ETG_Hash
                      • -------- Ignition setup --------
                      • Hashtable - Save False as 11 of ETG_UHandleC in ETG_Hash
                      • -------- Effect --------
                      • Hashtable - Save Handle Of(Last created special effect) as 12 of ETG_UHandleC in ETG_Hash
                      • -------- Spread delay --------
                      • Hashtable - Save 0 as 13 of ETG_UHandleC in ETG_Hash
                      • -------- Amount of spreads --------
                      • Hashtable - Save 1 as 14 of ETG_UHandleC in ETG_Hash
                      • -------- Gas setup --------
                      • Unit - Add a ETG_RealCache[1] second Generic expiration timer to ETG_TempU2
                      • Unit Group - Add ETG_TempU2 to ETG_Group
                      • Unit Group - Add ETG_TempU2 to ETG_Explodeables
                  • Custom script: call RemoveLocation(udg_ETG_TempPoint)
                  • Special Effect - Destroy (Load 13 of ETG_UHandle in ETG_Hash)
                  • Unit Group - Remove ETG_U from ETG_Group
                  • Unit - Kill ETG_U
                  • Hashtable - Clear all child hashtables of child ETG_UHandle in ETG_Hash
                • Else - Actions
                  • Hashtable - Save ETG_TempReal as 12 of ETG_UHandle in ETG_Hash
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ETG_TempInteger Equal to 2
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (ETG_U is dead) Equal to True
                    • Then - Actions
                      • Set ETG_TempPoint = (Position of ETG_U)
                      • -------- Ignition Check --------
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Load 11 of ETG_UHandle from ETG_Hash) Equal to True
                        • Then - Actions
                          • -------- Explode effects --------
                          • Special Effect - Create a special effect at ETG_TempPoint using ETG_ExplosionModel
                          • Special Effect - Destroy (Last created special effect)
                          • -------- Explosion/Burn setup --------
                          • Set ETG_TempPoint = (Position of ETG_U)
                          • Set ETG_RealCache[5] = (ETG_GasCloudAOE + 50.00)
                          • Set ETG_TempGroup = (Units within ETG_RealCache[5] of ETG_TempPoint)
                          • Set ETG_TempU2 = (Load 1 of ETG_UHandle in ETG_Hash)
                          • Set ETG_RealCache[0] = (Load 7 of ETG_UHandle from ETG_Hash)
                          • Set ETG_RealCache[1] = (Load 8 of ETG_UHandle from ETG_Hash)
                          • -------- Explosion/Burn --------
                          • Unit Group - Pick every unit in ETG_TempGroup and do (Actions)
                            • Loop - Actions
                              • -------- Finding Targets --------
                              • Set ETG_TempU = (Picked unit)
                              • Custom script: set udg_ETG_UHandleC = GetHandleId(udg_ETG_TempU)
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (ETG_TempU is Magic Immune) Equal to False
                                  • (ETG_TempU is A structure) Equal to False
                                  • (ETG_TempU is alive) Equal to True
                                  • (ETG_TempU belongs to an enemy of (Owner of ETG_U)) Equal to True
                                  • (ETG_TempU is A ground unit) Equal to True
                                • Then - Actions
                                  • -------- Burn --------
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • (Load 8 of ETG_UHandleC from ETG_Hash) Less than or equal to 0.00
                                    • Then - Actions
                                      • Special Effect - Destroy (Load 10 of ETG_UHandleC in ETG_Hash)
                                      • Hashtable - Save Handle OfETG_TempU2 as 1 of ETG_UHandleC in ETG_Hash
                                      • Hashtable - Save ETG_RealCache[0] as 7 of ETG_UHandleC in ETG_Hash
                                      • Hashtable - Save ETG_RealCache[1] as 8 of ETG_UHandleC in ETG_Hash
                                      • Hashtable - Save 3 as 2 of ETG_UHandleC in ETG_Hash
                                      • Special Effect - Create a special effect attached to the chest of ETG_TempU using ETG_FireModel
                                      • Hashtable - Save Handle Of(Last created special effect) as 10 of ETG_UHandleC in ETG_Hash
                                      • Unit - Add ETG_BuffAbilityBurn to ETG_TempU
                                      • Unit Group - Add ETG_TempU to ETG_Group
                                    • Else - Actions
                                  • -------- Explosion Damage --------
                                  • Unit - Cause ETG_TempU2 to damage ETG_TempU, dealing (Load 9 of ETG_UHandle from ETG_Hash) damage of attack type Spells and damage type Normal
                                • Else - Actions
                          • Unit Group - Pick every unit in ETG_Explodeables and do (Actions)
                            • Loop - Actions
                              • Set ETG_TempU = (Picked unit)
                              • Set ETG_TempPoint2 = (Position of ETG_TempU)
                              • -------- Check Chain Ignition --------
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Distance between ETG_TempPoint and ETG_TempPoint2) Less than or equal to ETG_RealCache[5]
                                • Then - Actions
                                  • -------- Ignition setup --------
                                  • Custom script: set udg_ETG_UHandleC = GetHandleId(udg_ETG_TempU)
                                  • Unit - Add a 0.10 second Generic expiration timer to ETG_TempU
                                  • Hashtable - Save True as 11 of ETG_UHandleC in ETG_Hash
                                • Else - Actions
                              • Custom script: call RemoveLocation (udg_ETG_TempPoint2)
                          • Custom script: call DestroyGroup (udg_ETG_TempGroup)
                          • Custom script: call RemoveLocation (udg_ETG_TempPoint)
                        • Else - Actions
                          • -------- Dissapation SFX --------
                          • Special Effect - Create a special effect at ETG_TempPoint using ETG_DissapateModel
                          • Special Effect - Destroy (Last created special effect)
                      • Custom script: call RemoveLocation (udg_ETG_TempPoint)
                      • -------- Unit Cleaup --------
                      • Unit Group - Remove ETG_U from ETG_Group
                      • Unit Group - Remove ETG_U from ETG_Explodeables
                      • Special Effect - Destroy (Load 13 of ETG_UHandle in ETG_Hash)
                      • Hashtable - Clear all child hashtables of child ETG_UHandle in ETG_Hash
                      • Unit - Remove ETG_U from the game
                      • -------- Check unit group is empty --------
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Number of units in ETG_Group) Equal to 0
                        • Then - Actions
                          • Trigger - Turn off (This trigger)
                        • Else - Actions
                    • Else - Actions
                      • -------- Spread Delay --------
                      • Set ETG_TempInteger = (Load 13 of ETG_UHandle from ETG_Hash)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • ETG_TempInteger Equal to ETG_GasSpreadSpeed
                          • (Load 14 of ETG_UHandle from ETG_Hash) Equal to 1
                          • (Load 10 of ETG_UHandle from ETG_Hash) Greater than 0.00
                        • Then - Actions
                          • -------- Spread Reconfiguration --------
                          • Hashtable - Save 0 as 13 of ETG_UHandle in ETG_Hash
                          • Hashtable - Save 0 as 14 of ETG_UHandle in ETG_Hash
                          • -------- Spread Setup --------
                          • Set ETG_TempPoint = (Position of ETG_U)
                          • Set ETG_TempReal = (Facing of ETG_U)
                          • Set ETG_TempPoint2 = (ETG_TempPoint offset by ETG_GasCloudAOE towards ETG_TempReal degrees)
                          • Set ETG_Angle = (Random real number between (ETG_TempReal - ETG_SpreadRandomiser) and (ETG_TempReal + ETG_SpreadRandomiser))
                          • Set ETG_TempU = (Load 1 of ETG_UHandle in ETG_Hash)
                          • -------- Duration of each Gas cloud --------
                          • Set ETG_RealCache[1] = (Load 4 of ETG_UHandle from ETG_Hash)
                          • -------- Poison Damage --------
                          • Set ETG_RealCache[2] = (Load 5 of ETG_UHandle from ETG_Hash)
                          • -------- Poison Duration --------
                          • Set ETG_RealCache[3] = (Load 6 of ETG_UHandle from ETG_Hash)
                          • -------- Burn Damage --------
                          • Set ETG_RealCache[4] = (Load 7 of ETG_UHandle from ETG_Hash)
                          • -------- Burn Duration --------
                          • Set ETG_RealCache[5] = (Load 8 of ETG_UHandle from ETG_Hash)
                          • -------- Explosion Damage --------
                          • Set ETG_RealCache[6] = (Load 9 of ETG_UHandle from ETG_Hash)
                          • -------- Amount of spreading Gas --------
                          • Set ETG_RealCache[7] = ((Load 10 of ETG_UHandle from ETG_Hash) - 1.00)
                          • -------- Create Gas --------
                          • Unit - Create 1 ETG_Dummy for (Owner of ETG_U) at ETG_TempPoint2 facing ETG_Angle degrees
                          • Set ETG_TempU2 = (Last created unit)
                          • Custom script: call RemoveLocation(udg_ETG_TempPoint2)
                          • Custom script: call RemoveLocation(udg_ETG_TempPoint)
                          • Custom script: set udg_ETG_UHandleC = GetHandleId(udg_ETG_TempU2)
                          • Special Effect - Create a special effect attached to the origin of ETG_TempU2 using ETG_GasModel
                          • -------- Original Casting Unit --------
                          • Hashtable - Save Handle OfETG_TempU as 1 of ETG_UHandleC in ETG_Hash
                          • -------- Stage ID --------
                          • Hashtable - Save 2 as 2 of ETG_UHandleC in ETG_Hash
                          • -------- Duration of each Gas cloud --------
                          • Hashtable - Save ETG_RealCache[1] as 4 of ETG_UHandleC in ETG_Hash
                          • -------- Poison Damage --------
                          • Hashtable - Save ETG_RealCache[2] as 5 of ETG_UHandleC in ETG_Hash
                          • -------- Poison Duration --------
                          • Hashtable - Save ETG_RealCache[3] as 6 of ETG_UHandleC in ETG_Hash
                          • -------- Burn Damage --------
                          • Hashtable - Save ETG_RealCache[4] as 7 of ETG_UHandleC in ETG_Hash
                          • -------- Burn Duration --------
                          • Hashtable - Save ETG_RealCache[5] as 8 of ETG_UHandleC in ETG_Hash
                          • -------- Explosion Damage --------
                          • Hashtable - Save ETG_RealCache[6] as 9 of ETG_UHandleC in ETG_Hash
                          • -------- Amount of spreading Gas --------
                          • Hashtable - Save ETG_RealCache[7] as 10 of ETG_UHandleC in ETG_Hash
                          • -------- Ignition setup --------
                          • Hashtable - Save False as 11 of ETG_UHandleC in ETG_Hash
                          • -------- Effect --------
                          • Hashtable - Save Handle Of(Last created special effect) as 12 of ETG_UHandleC in ETG_Hash
                          • -------- Spread delay --------
                          • Hashtable - Save 0 as 13 of ETG_UHandleC in ETG_Hash
                          • -------- Amount of spreads --------
                          • Hashtable - Save 1 as 14 of ETG_UHandleC in ETG_Hash
                          • -------- Gas setup --------
                          • Unit - Add a ETG_RealCache[1] second Generic expiration timer to ETG_TempU2
                          • Unit Group - Add ETG_TempU2 to ETG_Group
                          • Unit Group - Add ETG_TempU2 to ETG_Explodeables
                        • Else - Actions
                          • Hashtable - Save (ETG_TempInteger + 1) as 13 of ETG_UHandle in ETG_Hash
                      • -------- Poisoned Units setup --------
                      • Set ETG_TempPoint = (Position of ETG_U)
                      • Set ETG_TempGroup = (Units within ETG_GasCloudAOE of ETG_TempPoint)
                      • Set ETG_TempU2 = (Load 1 of ETG_UHandle in ETG_Hash)
                      • Set ETG_RealCache[0] = (Load 5 of ETG_UHandle from ETG_Hash)
                      • Set ETG_RealCache[1] = (Load 6 of ETG_UHandle from ETG_Hash)
                      • -------- Poison --------
                      • Unit Group - Pick every unit in ETG_TempGroup and do (Actions)
                        • Loop - Actions
                          • -------- Finding Targets --------
                          • Set ETG_TempU = (Picked unit)
                          • Custom script: set udg_ETG_UHandleC = GetHandleId(udg_ETG_TempU)
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (ETG_TempU is Magic Immune) Equal to False
                              • (ETG_TempU is A structure) Equal to False
                              • (ETG_TempU is alive) Equal to True
                              • (ETG_TempU belongs to an enemy of (Owner of ETG_U)) Equal to True
                              • (ETG_TempU is A ground unit) Equal to True
                              • (Load 6 of ETG_UHandleC from ETG_Hash) Less than or equal to 0.00
                            • Then - Actions
                              • -------- Poison --------
                              • Special Effect - Destroy (Load 9 of ETG_UHandleC in ETG_Hash)
                              • Hashtable - Save Handle OfETG_TempU2 as 1 of ETG_UHandleC in ETG_Hash
                              • Hashtable - Save ETG_RealCache[0] as 5 of ETG_UHandleC in ETG_Hash
                              • Hashtable - Save ETG_RealCache[1] as 6 of ETG_UHandleC in ETG_Hash
                              • Hashtable - Save 3 as 2 of ETG_UHandleC in ETG_Hash
                              • Special Effect - Create a special effect attached to the chest of ETG_TempU using ETG_PoisonModel
                              • Hashtable - Save Handle Of(Last created special effect) as 9 of ETG_UHandleC in ETG_Hash
                              • Unit - Add ETG_BuffAbilityPoison to ETG_TempU
                              • Unit Group - Add ETG_TempU to ETG_Group
                            • Else - Actions
                      • Custom script: call DestroyGroup (udg_ETG_TempGroup)
                      • Custom script: call RemoveLocation (udg_ETG_TempPoint)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ETG_TempInteger Equal to 3
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (ETG_U is dead) Equal to True
                        • Then - Actions
                          • -------- Unit cleanup --------
                          • Special Effect - Destroy (Load 9 of ETG_UHandle in ETG_Hash)
                          • Special Effect - Destroy (Load 10 of ETG_UHandle in ETG_Hash)
                          • Unit Group - Remove ETG_U from ETG_Group
                          • Hashtable - Clear all child hashtables of child ETG_UHandle in ETG_Hash
                          • -------- Check if the unit group is empty --------
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Number of units in ETG_Group) Equal to 0
                            • Then - Actions
                              • Trigger - Turn off (This trigger)
                            • Else - Actions
                        • Else - Actions
                          • -------- Burn/Poison Check --------
                          • Set ETG_TempU2 = (Load 1 of ETG_UHandle in ETG_Hash)
                          • Set ETG_RealCache[1] = (Load 6 of ETG_UHandle from ETG_Hash)
                          • Set ETG_RealCache[3] = (Load 8 of ETG_UHandle from ETG_Hash)
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • Or - Any (Conditions) are true
                                • Conditions
                                  • ETG_RealCache[1] Greater than 0.00
                                  • ETG_RealCache[3] Greater than 0.00
                            • Then - Actions
                              • -------- Poison --------
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • ETG_RealCache[1] Greater than 0.00
                                • Then - Actions
                                  • Set ETG_RealCache[0] = (Load 5 of ETG_UHandle from ETG_Hash)
                                  • Unit - Cause ETG_TempU2 to damage ETG_U, dealing ETG_RealCache[0] damage of attack type Spells and damage type Normal
                                  • Hashtable - Save (ETG_RealCache[1] - 1.00) as 6 of ETG_UHandle in ETG_Hash
                                • Else - Actions
                              • -------- Burn --------
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • ETG_RealCache[3] Greater than 0.00
                                • Then - Actions
                                  • Set ETG_RealCache[2] = (Load 7 of ETG_UHandle from ETG_Hash)
                                  • Unit - Cause ETG_TempU2 to damage ETG_U, dealing ETG_RealCache[2] damage of attack type Spells and damage type Normal
                                  • Hashtable - Save (ETG_RealCache[3] - 1.00) as 8 of ETG_UHandle in ETG_Hash
                                • Else - Actions
                            • Else - Actions
                              • -------- Unit Cleanup --------
                              • Special Effect - Destroy (Load 9 of ETG_UHandle in ETG_Hash)
                              • Special Effect - Destroy (Load 10 of ETG_UHandle in ETG_Hash)
                              • Unit - Remove ETG_BuffAbilityPoison from ETG_U
                              • Unit - Remove ETG_BuffAbilityBurn from ETG_U
                              • Unit Group - Remove ETG_U from ETG_Group
                              • Hashtable - Clear all child hashtables of child ETG_UHandle in ETG_Hash
                              • -------- Check unit group is empty --------
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Number of units in ETG_Group) Equal to 0
                                • Then - Actions
                                  • Trigger - Turn off (This trigger)
                                • Else - Actions
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • ETG_TempInteger Equal to 4
                        • Then - Actions
                          • -------- Movement --------
                          • Custom script: set udg_ETG_TempX = GetUnitX(udg_ETG_U)
                          • Custom script: set udg_ETG_TempY = GetUnitY(udg_ETG_U)
                          • Custom script: set udg_ETG_Angle = (GetUnitFacing(udg_ETG_U) * bj_DEGTORAD)
                          • Custom script: call SetUnitX(udg_ETG_U, udg_ETG_TempX + udg_ETG_GasSpeed * Cos(udg_ETG_Angle))
                          • Custom script: call SetUnitY(udg_ETG_U, udg_ETG_TempY + udg_ETG_GasSpeed * Sin(udg_ETG_Angle))
                          • -------- ------ --------
                          • -------- Fly Height --------
                          • Set ETG_RealCache[1] = (Load 11 of ETG_UHandle from ETG_Hash)
                          • Set ETG_RealCache[2] = (Load 13 of ETG_UHandle from ETG_Hash)
                          • Set ETG_RealCache[3] = ((Load 12 of ETG_UHandle from ETG_Hash) + ETG_GasSpeed)
                          • Hashtable - Save ETG_RealCache[3] as 12 of ETG_UHandle in ETG_Hash
                          • Set ETG_RealCache[4] = (((4.00 x ETG_RealCache[2]) / ETG_RealCache[1]) x ((ETG_RealCache[3] / ETG_RealCache[1]) x (ETG_RealCache[1] - ETG_RealCache[3])))
                          • Animation - Change ETG_U flying height to ETG_RealCache[4] at 0.00
                          • -------- ------ --------
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • ETG_RealCache[4] Less than 0.00
                            • Then - Actions
                              • -------- Landing --------
                              • Set ETG_TempPoint = (Position of ETG_U)
                              • Special Effect - Create a special effect at ETG_TempPoint using ETG_ExplosionModel
                              • Special Effect - Destroy (Last created special effect)
                              • -------- Explosion Setup --------
                              • Set ETG_RealCache[5] = (Load 6 of ETG_UHandle from ETG_Hash)
                              • Set ETG_TempGroup = (Units within ETG_RealCache[5] of ETG_TempPoint)
                              • Set ETG_TempU2 = (Load 1 of ETG_UHandle in ETG_Hash)
                              • Set ETG_RealCache[0] = (Load 7 of ETG_UHandle from ETG_Hash)
                              • Set ETG_RealCache[1] = (Load 8 of ETG_UHandle from ETG_Hash)
                              • -------- Targets --------
                              • Unit Group - Pick every unit in ETG_TempGroup and do (Actions)
                                • Loop - Actions
                                  • -------- Finding Targets --------
                                  • Set ETG_TempU = (Picked unit)
                                  • Custom script: set udg_ETG_UHandleC = GetHandleId(udg_ETG_TempU)
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • (ETG_TempU is Magic Immune) Equal to False
                                      • (ETG_TempU is A structure) Equal to False
                                      • (ETG_TempU is alive) Equal to True
                                      • (ETG_TempU belongs to an enemy of (Owner of ETG_U)) Equal to True
                                      • (ETG_TempU is A ground unit) Equal to True
                                      • (Load 8 of ETG_UHandleC from ETG_Hash) Less than or equal to 0.00
                                    • Then - Actions
                                      • -------- Burn setup --------
                                      • Special Effect - Destroy (Load 10 of ETG_UHandleC in ETG_Hash)
                                      • Hashtable - Save Handle OfETG_TempU2 as 1 of ETG_UHandleC in ETG_Hash
                                      • Hashtable - Save ETG_RealCache[0] as 7 of ETG_UHandleC in ETG_Hash
                                      • Hashtable - Save ETG_RealCache[1] as 8 of ETG_UHandleC in ETG_Hash
                                      • Hashtable - Save 3 as 2 of ETG_UHandleC in ETG_Hash
                                      • -------- Damage --------
                                      • Unit - Cause ETG_TempU2 to damage ETG_TempU, dealing (Load 9 of ETG_UHandle from ETG_Hash) damage of attack type Spells and damage type Normal
                                      • -------- Burn --------
                                      • Special Effect - Create a special effect attached to the chest of ETG_TempU using ETG_FireModel
                                      • Hashtable - Save Handle Of(Last created special effect) as 10 of ETG_UHandleC in ETG_Hash
                                      • Unit - Add ETG_BuffAbilityBurn to ETG_TempU
                                      • Unit Group - Add ETG_TempU to ETG_Group
                                    • Else - Actions
                              • -------- Ignited Gas --------
                              • Unit Group - Pick every unit in ETG_Explodeables and do (Actions)
                                • Loop - Actions
                                  • Set ETG_TempU = (Picked unit)
                                  • Set ETG_TempPoint2 = (Position of ETG_TempU)
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • (Distance between ETG_TempPoint and ETG_TempPoint2) Less than or equal to ETG_RealCache[5]
                                    • Then - Actions
                                      • -------- Get Ignition Setup --------
                                      • Custom script: set udg_ETG_UHandleC = GetHandleId(udg_ETG_TempU)
                                      • Unit - Add a 0.10 second Generic expiration timer to ETG_TempU
                                      • Hashtable - Save True as 11 of ETG_UHandleC in ETG_Hash
                                    • Else - Actions
                                  • Custom script: call RemoveLocation (udg_ETG_TempPoint2)
                              • -------- Unit Cleanup --------
                              • Custom script: call DestroyGroup (udg_ETG_TempGroup)
                              • Custom script: call RemoveLocation (udg_ETG_TempPoint)
                              • Special Effect - Destroy (Load 14 of ETG_UHandle in ETG_Hash)
                              • Unit - Kill ETG_U
                              • Unit Group - Remove ETG_U from ETG_Group
                              • Hashtable - Clear all child hashtables of child ETG_UHandle in ETG_Hash
                              • -------- Checks if group is empty --------
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Number of units in ETG_Group) Equal to 0
                                • Then - Actions
                                  • Trigger - Turn off (This trigger)
                                • Else - Actions
                            • Else - Actions
                        • Else - Actions
- Helios Collision
  • Helios Collision Configuration
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- -------- --------
      • -------- Condition Configuration --------
      • -------- Unit is a ground unit --------
      • Set HC_ConditionConfig[0] = True
      • -------- Unit is a structure --------
      • Set HC_ConditionConfig[1] = False
      • -------- Unit is magic immune --------
      • Set HC_ConditionConfig[2] = False
      • -------- Unit belongs to an enemy player --------
      • Set HC_ConditionConfig[3] = True
      • -------- Unit is alive --------
      • Set HC_ConditionConfig[4] = True
      • -------- Determines the area that will be effected by Magnetism --------
      • Set HC_ExplosionAOE = 200.00
      • Set HC_AoeBase = 250.00
      • Set HC_AoePerLevel = 100.00
      • -------- Determines the strength of the magnetism --------
      • Set HC_MagnetismStrengthBase = 300.00
      • Set HC_MagnetismStrengthPerLevel = 200.00
      • Set HC_MagnetismDistanceMultiplyer = 0.80
      • Set HC_MagnetismCap = 20.00
      • -------- Determines the damage done by the blast --------
      • Set HC_ExplosionDamageBase = 200.00
      • Set HC_ExplosionDamagePerLevel = 25.00
      • -------- Determines the strength of the blast --------
      • Set HC_BlastDistanceBase = 900.00
      • Set HC_BlastDistanceMultiplyer = 0.05
      • Set HC_HeightMultiplyer = 0.80
      • Set HC_BlastSpeed = 12.00
      • Set HC_BlastCap = 550.00
      • -------- Determines the speed of the Sun travelling --------
      • Set HC_SunSpeed = 3.00
      • -------- Determines the amount of Orbs surround the Sun --------
      • Set HC_OrbCountBase = 3
      • Set HC_OrbCountPerLevel = 0
      • -------- Determines the amount of Wind that surrounds the Sun --------
      • Set HC_WindCountBase = 5
      • Set HC_WindCountPerLevel = 2
      • -------- Determines how fast the Orbs Spin around --------
      • Set HC_FireOrbSpinSpeed = 3.00
      • -------- Determines how fast the Wind Spins around --------
      • Set HC_WindSpinSpeed = 6.00
      • -------- Determines how far the orbs are from the sun --------
      • Set HC_OrbDistance = 150.00
      • -------- Determines how far the wind is from the sun --------
      • Set HC_WindDistance = 200.00
      • -------- Determines how long the dummies will remain after their usefulness has ended --------
      • Set HC_DummyExpirationTimers = 2.00
      • -------- Determines the scaling of the Sun and its SFX --------
      • Set HC_EffectScalingOrbs = 100.00
      • Set HC_EffectScalingWind = 100.00
      • Set HC_EffectScalingSun = 100.00
      • Set HC_EffectScalingBlast = 100.00
      • -------- Determines the Height given to the sun and its effects --------
      • Set HC_EffectZOrbs = 100.00
      • Set HC_EffectZSun = 0.00
      • Set HC_EffectZWind = 0.00
      • Set HC_EffectZBlast = 0.00
      • -------- Determines the unit model used as the Sun --------
      • Set HC_SunSFX = war3mapImported\Sun.mdx
      • -------- Determines the model used for the revolving fire orbs --------
      • Set HC_FireOrbSFX = Abilities\Weapons\PhoenixMissile\Phoenix_Missile.mdl
      • -------- Determines the unit model used for the burning of the targets --------
      • Set HC_BurnSFX = Abilities\Weapons\PhoenixMissile\Phoenix_Missile.mdl
      • -------- Determines the unit model used as the rotatingwind --------
      • Set HC_WindSFX = Abilities\Spells\Other\Tornado\Tornado_Target.mdl
      • -------- Determines the SFX used upon explosion --------
      • Set HC_ExplosionSFX = Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
      • -------- Determines the spell used to act as the activation spell --------
      • Set HC_Spell = Helios Collision
      • -------- Determines the Dummy used to attach all the effects to --------
      • Set HC_DummyType = Helios Collision Dummy
  • Helios Collision Activation
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to HC_Spell
    • Actions
      • Set HC_Caster = (Triggering unit)
      • Set HC_TempPoint = (Position of HC_Caster)
      • Set HC_TempPoint2 = (Target point of ability being cast)
      • Set HC_Angle = (Angle from HC_TempPoint to HC_TempPoint2)
      • Unit - Create 1 HC_DummyType for Neutral Passive at HC_TempPoint facing Default building facing degrees
      • Set HC_TempUnit = (Last created unit)
      • Special Effect - Create a special effect attached to the origin of HC_TempUnit using HC_SunSFX
      • Animation - Change HC_TempUnit's size to (HC_EffectScalingSun%, 0.00%, 0.00%) of its original size
      • Animation - Change HC_TempUnit flying height to HC_EffectZSun at 0.00
      • Set HC_MaxIndex = (HC_MaxIndex + 1)
      • Set HC_OriginalCaster[HC_MaxIndex] = HC_Caster
      • Set HC_OwningPlayer[HC_MaxIndex] = (Owner of HC_Caster)
      • Set HC_TempInteger = (Level of HC_Spell for HC_Caster)
      • Set HC_TempReal = (Real(HC_TempInteger))
      • Set HC_SpecialEffect[HC_MaxIndex] = (Last created special effect)
      • Set HC_Core[HC_MaxIndex] = HC_TempUnit
      • Set HC_Aoe[HC_MaxIndex] = (HC_AoeBase + (HC_AoePerLevel x HC_TempReal))
      • Set HC_ExplosionDamage[HC_MaxIndex] = (HC_ExplosionDamageBase + (HC_ExplosionDamagePerLevel x HC_TempReal))
      • Set HC_MagnetismStrength[HC_MaxIndex] = (HC_MagnetismStrengthBase + (HC_MagnetismStrengthPerLevel x HC_TempReal))
      • Set HC_Distance[HC_MaxIndex] = (Distance between HC_TempPoint and HC_TempPoint2)
      • Set HC_Core[HC_MaxIndex] = HC_TempUnit
      • Set HC_CurrentAngle[HC_MaxIndex] = HC_Angle
      • Set HC_CurrentSunDistance[HC_MaxIndex] = 0.00
      • Set HC_UnitIndex[HC_MaxIndex] = HC_TempUnit
      • Set HC_StageID[HC_MaxIndex] = 1
      • Set HC_Angle = 0.00
      • -------- --------
      • Set HC_BlastDistance[HC_MaxIndex] = 0.00
      • Set HC_CurrentBlastDistance[HC_MaxIndex] = 0.00
      • Set HC_MaxHeight[HC_MaxIndex] = 0.00
      • Set HC_CurrentHeight[HC_MaxIndex] = 0.00
      • -------- --------
      • Custom script: call RemoveLocation (udg_HC_TempPoint2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • HC_MaxIndex Equal to 1
        • Then - Actions
          • Trigger - Turn on Helios Collision Loop <gen>
        • Else - Actions
      • Set HC_TempInteger2 = (HC_OrbCountBase + (HC_OrbCountPerLevel x HC_TempInteger))
      • -------- Fire Orb Creation --------
      • For each (Integer HC_Index) from 1 to HC_TempInteger2, do (Actions)
        • Loop - Actions
          • Set HC_Angle = (HC_Angle + (360.00 / (Real(HC_TempInteger2))))
          • Set HC_TempPoint2 = (HC_TempPoint offset by HC_OrbDistance towards HC_Angle degrees)
          • Unit - Create 1 HC_DummyType for Neutral Passive at HC_TempPoint2 facing Default building facing degrees
          • Set HC_TempUnit2 = (Last created unit)
          • Special Effect - Create a special effect attached to the origin of HC_TempUnit2 using HC_FireOrbSFX
          • Animation - Change HC_TempUnit2's size to (HC_EffectScalingOrbs%, 0.00%, 0.00%) of its original size
          • Animation - Change HC_TempUnit2 flying height to HC_EffectScalingOrbs at 0.00
          • Custom script: call RemoveLocation (udg_HC_TempPoint2)
          • Set HC_MaxIndex = (HC_MaxIndex + 1)
          • Set HC_SpecialEffect[HC_MaxIndex] = (Last created special effect)
          • Set HC_CurrentAngle[HC_MaxIndex] = HC_Angle
          • Set HC_StageID[HC_MaxIndex] = 2
          • Set HC_Core[HC_MaxIndex] = HC_TempUnit
          • Set HC_UnitIndex[HC_MaxIndex] = HC_TempUnit2
          • -------- --------
          • Set HC_Aoe[HC_MaxIndex] = 0.00
          • Set HC_OriginalCaster[HC_MaxIndex] = HC_Caster
          • Set HC_OwningPlayer[HC_MaxIndex] = (Owner of HC_Caster)
          • Set HC_MaxHeight[HC_MaxIndex] = 0.00
          • Set HC_BlastDistance[HC_MaxIndex] = 0.00
          • Set HC_CurrentBlastDistance[HC_MaxIndex] = 0.00
          • Set HC_CurrentHeight[HC_MaxIndex] = 0.00
          • Set HC_CurrentSunDistance[HC_MaxIndex] = 0.00
          • Set HC_ExplosionDamage[HC_MaxIndex] = 0.00
          • Set HC_MagnetismStrength[HC_MaxIndex] = 0.00
      • Set HC_TempInteger2 = (HC_WindCountBase + (HC_WindCountPerLevel x HC_TempInteger))
      • -------- Wind Effect Creation --------
      • For each (Integer HC_Index) from 1 to HC_TempInteger2, do (Actions)
        • Loop - Actions
          • Set HC_Angle = (HC_Angle + (360.00 / (Real(HC_TempInteger2))))
          • Set HC_TempPoint2 = (HC_TempPoint offset by HC_OrbDistance towards HC_Angle degrees)
          • Unit - Create 1 HC_DummyType for Neutral Passive at HC_TempPoint2 facing Default building facing degrees
          • Set HC_TempUnit2 = (Last created unit)
          • Special Effect - Create a special effect attached to the origin of HC_TempUnit2 using HC_WindSFX
          • Animation - Change HC_TempUnit2's size to (HC_EffectScalingOrbs%, 0.00%, 0.00%) of its original size
          • Animation - Change HC_TempUnit2 flying height to HC_EffectZWind at 0.00
          • Custom script: call RemoveLocation (udg_HC_TempPoint2)
          • Set HC_MaxIndex = (HC_MaxIndex + 1)
          • Set HC_SpecialEffect[HC_MaxIndex] = (Last created special effect)
          • Set HC_CurrentAngle[HC_MaxIndex] = HC_Angle
          • Set HC_StageID[HC_MaxIndex] = 3
          • Set HC_Core[HC_MaxIndex] = HC_TempUnit
          • Set HC_UnitIndex[HC_MaxIndex] = HC_TempUnit2
          • -------- --------
          • Set HC_Aoe[HC_MaxIndex] = 0.00
          • Set HC_OriginalCaster[HC_MaxIndex] = HC_Caster
          • Set HC_OwningPlayer[HC_MaxIndex] = (Owner of HC_Caster)
          • Set HC_BlastDistance[HC_MaxIndex] = 0.00
          • Set HC_CurrentBlastDistance[HC_MaxIndex] = 0.00
          • Set HC_CurrentHeight[HC_MaxIndex] = 0.00
          • Set HC_CurrentSunDistance[HC_MaxIndex] = 0.00
          • Set HC_ExplosionDamage[HC_MaxIndex] = 0.00
          • Set HC_MagnetismStrength[HC_MaxIndex] = 0.00
      • Custom script: call RemoveLocation (udg_HC_TempPoint)
  • Helios Collision Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer HC_Index) from 1 to HC_MaxIndex, do (Actions)
        • Loop - Actions
          • Set HC_Angle = 0.00
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of HC_UnitIndex[HC_Index]) Equal to HC_DummyType
            • Then - Actions
              • -------- Control over Sun --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • HC_StageID[HC_Index] Equal to 1
                • Then - Actions
                  • Custom script: set udg_HC_TempX = GetUnitX(udg_HC_UnitIndex[udg_HC_Index])
                  • Custom script: set udg_HC_TempY = GetUnitY(udg_HC_UnitIndex[udg_HC_Index])
                  • Custom script: set udg_HC_Angle = udg_HC_CurrentAngle[udg_HC_Index] * bj_DEGTORAD
                  • Custom script: call SetUnitX(udg_HC_UnitIndex[udg_HC_Index], udg_HC_TempX + udg_HC_SunSpeed * Cos(udg_HC_Angle))
                  • Custom script: call SetUnitY(udg_HC_UnitIndex[udg_HC_Index], udg_HC_TempY + udg_HC_SunSpeed* Sin(udg_HC_Angle))
                  • -------- Magnetism Control --------
                  • Set HC_TempPoint = (Position of HC_UnitIndex[HC_Index])
                  • Set HC_TempGroup = (Units within HC_Aoe[HC_Index] of HC_TempPoint)
                  • Unit Group - Pick every unit in HC_TempGroup and do (Actions)
                    • Loop - Actions
                      • Set HC_TempUnit = (Picked unit)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (HC_TempUnit is A ground unit) Equal to HC_ConditionConfig[0]
                          • (HC_TempUnit is A structure) Equal to HC_ConditionConfig[1]
                          • (HC_TempUnit is Magic Immune) Equal to HC_ConditionConfig[2]
                          • (HC_TempUnit belongs to an enemy of HC_OwningPlayer[HC_Index]) Equal to HC_ConditionConfig[3]
                          • (HC_TempUnit is alive) Equal to HC_ConditionConfig[4]
                          • (HC_TempUnit is paused) Equal to False
                        • Then - Actions
                          • Set HC_TempPoint2 = (Position of HC_TempUnit)
                          • Custom script: set udg_HC_TempX = GetUnitX(udg_HC_TempUnit)
                          • Custom script: set udg_HC_TempY = GetUnitY(udg_HC_TempUnit)
                          • Custom script: set udg_HC_Angle = Atan2(GetUnitY(udg_HC_UnitIndex[udg_HC_Index]) - GetUnitY(udg_HC_TempUnit), GetUnitX(udg_HC_UnitIndex[udg_HC_Index]) - GetUnitX(udg_HC_TempUnit))
                          • Set HC_CurrentMagnetism = (HC_MagnetismStrength[HC_Index] / ((Distance between HC_TempPoint and HC_TempPoint2) x HC_MagnetismDistanceMultiplyer))
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • HC_CurrentMagnetism Greater than HC_MagnetismCap
                            • Then - Actions
                              • Set HC_CurrentMagnetism = HC_MagnetismCap
                            • Else - Actions
                          • Custom script: call SetUnitX(udg_HC_TempUnit, udg_HC_TempX + udg_HC_CurrentMagnetism * Cos(udg_HC_Angle))
                          • Custom script: call SetUnitY(udg_HC_TempUnit, udg_HC_TempY + udg_HC_CurrentMagnetism * Sin(udg_HC_Angle))
                          • Custom script: call RemoveLocation (udg_HC_TempPoint2)
                        • Else - Actions
                  • Custom script: call DestroyGroup(udg_HC_TempGroup)
                  • Set HC_CurrentSunDistance[HC_Index] = (HC_CurrentSunDistance[HC_Index] + HC_SunSpeed)
                  • -------- Explosion Control --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • HC_CurrentSunDistance[HC_Index] Greater than or equal to HC_Distance[HC_Index]
                    • Then - Actions
                      • Set HC_TempGroup = (Units within HC_ExplosionAOE of HC_TempPoint)
                      • -------- Effected Units --------
                      • Unit Group - Pick every unit in HC_TempGroup and do (Actions)
                        • Loop - Actions
                          • Set HC_TempUnit = (Picked unit)
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (HC_TempUnit is A ground unit) Equal to HC_ConditionConfig[0]
                              • (HC_TempUnit is A structure) Equal to HC_ConditionConfig[1]
                              • (HC_TempUnit is Magic Immune) Equal to HC_ConditionConfig[2]
                              • (HC_TempUnit belongs to an enemy of HC_OwningPlayer[HC_Index]) Equal to HC_ConditionConfig[3]
                              • (HC_TempUnit is alive) Equal to HC_ConditionConfig[4]
                              • (HC_TempUnit is paused) Equal to False
                            • Then - Actions
                              • Set HC_TempPoint2 = (Position of HC_TempUnit)
                              • Unit - Cause HC_OriginalCaster[HC_Index] to damage HC_TempUnit, dealing HC_ExplosionDamage[HC_Index] damage of attack type Spells and damage type Normal
                              • Set HC_MaxIndex = (HC_MaxIndex + 1)
                              • Special Effect - Create a special effect attached to the origin of HC_TempUnit using HC_BurnSFX
                              • Set HC_SpecialEffect[HC_MaxIndex] = (Last created special effect)
                              • Set HC_CurrentAngle[HC_MaxIndex] = (Angle from HC_TempPoint to HC_TempPoint2)
                              • Set HC_CurrentBlastDistance[HC_MaxIndex] = 0.00
                              • Set HC_BlastDistance[HC_MaxIndex] = (HC_BlastDistanceBase / ((Distance between HC_TempPoint and HC_TempPoint2) x HC_BlastDistanceMultiplyer))
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • HC_BlastDistance[HC_MaxIndex] Greater than HC_BlastCap
                                • Then - Actions
                                  • Set HC_BlastDistance[HC_MaxIndex] = HC_BlastCap
                                • Else - Actions
                              • Set HC_MaxHeight[HC_MaxIndex] = (HC_BlastDistance[HC_MaxIndex] x HC_HeightMultiplyer)
                              • Set HC_CurrentHeight[HC_MaxIndex] = (Current flying height of HC_TempUnit)
                              • Set HC_StageID[HC_MaxIndex] = 4
                              • Set HC_UnitIndex[HC_MaxIndex] = HC_TempUnit
                              • -------- --------
                              • Set HC_Aoe[HC_MaxIndex] = 0.00
                              • Set HC_OriginalCaster[HC_MaxIndex] = HC_TempUnit
                              • Set HC_OwningPlayer[HC_MaxIndex] = (Owner of HC_TempUnit)
                              • Set HC_CurrentSunDistance[HC_MaxIndex] = 0.00
                              • Set HC_Core[HC_MaxIndex] = HC_TempUnit
                              • Set HC_ExplosionDamage[HC_MaxIndex] = 0.00
                              • Set HC_MagnetismStrength[HC_MaxIndex] = 0.00
                              • Unit - Add Storm Crow Form to HC_TempUnit
                              • Unit - Remove Storm Crow Form from HC_TempUnit
                              • Unit - Pause HC_TempUnit
                              • Custom script: call RemoveLocation (udg_HC_TempPoint2)
                            • Else - Actions
                      • Custom script: call DestroyGroup(udg_HC_TempGroup)
                      • -------- Cleanup --------
                      • For each (Integer HC_SecondaryIndex) from 1 to HC_MaxIndex, do (Actions)
                        • Loop - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • HC_Core[HC_SecondaryIndex] Equal to HC_UnitIndex[HC_Index]
                              • HC_UnitIndex[HC_SecondaryIndex] Not equal to HC_UnitIndex[HC_Index]
                            • Then - Actions
                              • Set HC_TempUnit = HC_UnitIndex[HC_SecondaryIndex]
                              • Set HC_TempPoint2 = (Position of HC_TempUnit)
                              • Special Effect - Destroy HC_SpecialEffect[HC_SecondaryIndex]
                              • Unit - Create 1 HC_DummyType for Neutral Passive at HC_TempPoint2 facing Default building facing degrees
                              • Set HC_TempUnit2 = (Last created unit)
                              • Special Effect - Create a special effect attached to the origin of HC_TempUnit2 using HC_ExplosionSFX
                              • Animation - Change HC_TempUnit2's size to (HC_EffectScalingBlast%, 0.00%, 0.00%) of its original size
                              • Animation - Change HC_TempUnit2 flying height to HC_EffectZBlast at 0.00
                              • Special Effect - Destroy (Last created special effect)
                              • Unit - Add a HC_DummyExpirationTimers second Generic expiration timer to HC_TempUnit2
                              • Set HC_StageID[HC_SecondaryIndex] = HC_StageID[HC_MaxIndex]
                              • Set HC_Aoe[HC_SecondaryIndex] = HC_Aoe[HC_MaxIndex]
                              • Set HC_OriginalCaster[HC_SecondaryIndex] = HC_OriginalCaster[HC_MaxIndex]
                              • Set HC_BlastDistance[HC_SecondaryIndex] = HC_BlastDistance[HC_MaxIndex]
                              • Set HC_CurrentAngle[HC_SecondaryIndex] = HC_CurrentAngle[HC_MaxIndex]
                              • Set HC_CurrentBlastDistance[HC_SecondaryIndex] = HC_CurrentBlastDistance[HC_MaxIndex]
                              • Set HC_OwningPlayer[HC_SecondaryIndex] = HC_OwningPlayer[HC_MaxIndex]
                              • Set HC_MaxHeight[HC_SecondaryIndex] = HC_MaxHeight[HC_MaxIndex]
                              • Set HC_SpecialEffect[HC_SecondaryIndex] = HC_SpecialEffect[HC_MaxIndex]
                              • Set HC_CurrentHeight[HC_SecondaryIndex] = HC_CurrentHeight[HC_MaxIndex]
                              • Set HC_CurrentSunDistance[HC_SecondaryIndex] = HC_CurrentSunDistance[HC_MaxIndex]
                              • Set HC_ExplosionDamage[HC_SecondaryIndex] = HC_ExplosionDamage[HC_MaxIndex]
                              • Set HC_Core[HC_SecondaryIndex] = HC_Core[HC_MaxIndex]
                              • Set HC_UnitIndex[HC_SecondaryIndex] = HC_UnitIndex[HC_MaxIndex]
                              • Set HC_MagnetismStrength[HC_SecondaryIndex] = HC_MagnetismStrength[HC_MaxIndex]
                              • Set HC_MaxIndex = (HC_MaxIndex - 1)
                              • Set HC_SecondaryIndex = (HC_SecondaryIndex - 1)
                              • Unit - Remove HC_TempUnit from the game
                              • Custom script: call RemoveLocation(udg_HC_TempPoint2)
                            • Else - Actions
                      • Unit - Create 1 HC_DummyType for Neutral Passive at HC_TempPoint facing Default building facing degrees
                      • Set HC_TempUnit = (Last created unit)
                      • Special Effect - Destroy HC_SpecialEffect[HC_Index]
                      • Special Effect - Create a special effect attached to the origin of HC_TempUnit using HC_ExplosionSFX
                      • Animation - Change HC_TempUnit's size to (HC_EffectScalingBlast%, 0.00%, 0.00%) of its original size
                      • Animation - Change HC_TempUnit flying height to HC_EffectZBlast at 0.00
                      • Special Effect - Destroy (Last created special effect)
                      • Unit - Add a HC_DummyExpirationTimers second Generic expiration timer to HC_TempUnit
                      • Set HC_TempUnit = HC_UnitIndex[HC_Index]
                      • Set HC_StageID[HC_Index] = HC_StageID[HC_MaxIndex]
                      • Set HC_Aoe[HC_Index] = HC_Aoe[HC_MaxIndex]
                      • Set HC_OriginalCaster[HC_Index] = HC_OriginalCaster[HC_MaxIndex]
                      • Set HC_BlastDistance[HC_Index] = HC_BlastDistance[HC_MaxIndex]
                      • Set HC_CurrentAngle[HC_Index] = HC_CurrentAngle[HC_MaxIndex]
                      • Set HC_OwningPlayer[HC_Index] = HC_OwningPlayer[HC_MaxIndex]
                      • Set HC_MaxHeight[HC_Index] = HC_MaxHeight[HC_MaxIndex]
                      • Set HC_CurrentBlastDistance[HC_Index] = HC_CurrentBlastDistance[HC_MaxIndex]
                      • Set HC_CurrentHeight[HC_Index] = HC_CurrentHeight[HC_MaxIndex]
                      • Set HC_SpecialEffect[HC_Index] = HC_SpecialEffect[HC_MaxIndex]
                      • Set HC_CurrentSunDistance[HC_Index] = HC_CurrentSunDistance[HC_MaxIndex]
                      • Set HC_Core[HC_Index] = HC_Core[HC_MaxIndex]
                      • Set HC_UnitIndex[HC_Index] = HC_UnitIndex[HC_MaxIndex]
                      • Set HC_ExplosionDamage[HC_Index] = HC_ExplosionDamage[HC_MaxIndex]
                      • Set HC_MagnetismStrength[HC_Index] = HC_MagnetismStrength[HC_MaxIndex]
                      • Set HC_MaxIndex = (HC_MaxIndex - 1)
                      • Set HC_Index = (HC_Index - 1)
                      • Unit - Remove HC_TempUnit from the game
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • HC_MaxIndex Equal to 0
                        • Then - Actions
                          • Trigger - Turn off (This trigger)
                        • Else - Actions
                    • Else - Actions
                  • Custom script: call RemoveLocation (udg_HC_TempPoint)
                • Else - Actions
              • -------- Fire balls Spin Control --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • HC_StageID[HC_Index] Equal to 2
                • Then - Actions
                  • Custom script: set udg_HC_TempX = GetUnitX(udg_HC_Core[udg_HC_Index])
                  • Custom script: set udg_HC_TempY = GetUnitY(udg_HC_Core[udg_HC_Index])
                  • Set HC_CurrentAngle[HC_Index] = (HC_CurrentAngle[HC_Index] + HC_FireOrbSpinSpeed)
                  • Custom script: set udg_HC_Angle = udg_HC_CurrentAngle[udg_HC_Index] * bj_DEGTORAD
                  • Custom script: call SetUnitX(udg_HC_UnitIndex[udg_HC_Index], udg_HC_TempX + udg_HC_OrbDistance * Cos(udg_HC_Angle))
                  • Custom script: call SetUnitY(udg_HC_UnitIndex[udg_HC_Index], udg_HC_TempY + udg_HC_OrbDistance * Sin(udg_HC_Angle))
                  • Set HC_TempPoint = (Position of HC_Core[HC_Index])
                  • Unit - Make HC_UnitIndex[HC_Index] face HC_TempPoint over 0.00 seconds
                  • Custom script: call RemoveLocation(udg_HC_TempPoint)
                • Else - Actions
              • -------- Wind Spin Control --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • HC_StageID[HC_Index] Equal to 3
                • Then - Actions
                  • Custom script: set udg_HC_TempX = GetUnitX(udg_HC_Core[udg_HC_Index])
                  • Custom script: set udg_HC_TempY = GetUnitY(udg_HC_Core[udg_HC_Index])
                  • Set HC_CurrentAngle[HC_Index] = (HC_CurrentAngle[HC_Index] + HC_WindSpinSpeed)
                  • Custom script: set udg_HC_Angle = udg_HC_CurrentAngle[udg_HC_Index] * bj_DEGTORAD
                  • Custom script: call SetUnitX(udg_HC_UnitIndex[udg_HC_Index], udg_HC_TempX + udg_HC_WindDistance * Cos(udg_HC_Angle))
                  • Custom script: call SetUnitY(udg_HC_UnitIndex[udg_HC_Index], udg_HC_TempY + udg_HC_WindDistance * Sin(udg_HC_Angle))
                • Else - Actions
            • Else - Actions
              • -------- Control of Knockbacked units --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • HC_StageID[HC_Index] Equal to 4
                • Then - Actions
                  • Custom script: set udg_HC_TempX = GetUnitX(udg_HC_UnitIndex[udg_HC_Index])
                  • Custom script: set udg_HC_TempY = GetUnitY(udg_HC_UnitIndex[udg_HC_Index])
                  • Custom script: set udg_HC_Angle = udg_HC_CurrentAngle[udg_HC_Index] * bj_DEGTORAD
                  • Custom script: call SetUnitX(udg_HC_UnitIndex[udg_HC_Index], udg_HC_TempX + udg_HC_BlastSpeed * Cos(udg_HC_Angle))
                  • Custom script: call SetUnitY(udg_HC_UnitIndex[udg_HC_Index], udg_HC_TempY + udg_HC_BlastSpeed* Sin(udg_HC_Angle))
                  • Set HC_CurrentBlastDistance[HC_Index] = (HC_CurrentBlastDistance[HC_Index] + HC_BlastSpeed)
                  • Set HC_CurrentHeight[HC_Index] = (((4.00 x HC_MaxHeight[HC_Index]) / HC_BlastDistance[HC_Index]) x ((HC_CurrentBlastDistance[HC_Index] / HC_BlastDistance[HC_Index]) x (HC_BlastDistance[HC_Index] - HC_CurrentBlastDistance[HC_Index])))
                  • Animation - Change HC_UnitIndex[HC_Index] flying height to HC_CurrentHeight[HC_Index] at 0.00
                  • -------- Unit Release --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • HC_CurrentHeight[HC_Index] Less than 0.00
                    • Then - Actions
                      • Special Effect - Destroy HC_SpecialEffect[HC_Index]
                      • Unit - Unpause HC_UnitIndex[HC_Index]
                      • Set HC_StageID[HC_Index] = HC_StageID[HC_MaxIndex]
                      • Set HC_Aoe[HC_Index] = HC_Aoe[HC_MaxIndex]
                      • Set HC_OriginalCaster[HC_Index] = HC_OriginalCaster[HC_MaxIndex]
                      • Set HC_OwningPlayer[HC_Index] = HC_OwningPlayer[HC_MaxIndex]
                      • Set HC_BlastDistance[HC_Index] = HC_BlastDistance[HC_MaxIndex]
                      • Set HC_CurrentAngle[HC_Index] = HC_CurrentAngle[HC_MaxIndex]
                      • Set HC_CurrentBlastDistance[HC_Index] = HC_CurrentBlastDistance[HC_MaxIndex]
                      • Set HC_SpecialEffect[HC_Index] = HC_SpecialEffect[HC_MaxIndex]
                      • Set HC_CurrentHeight[HC_Index] = HC_CurrentHeight[HC_MaxIndex]
                      • Set HC_MaxHeight[HC_Index] = HC_MaxHeight[HC_MaxIndex]
                      • Set HC_CurrentSunDistance[HC_Index] = HC_CurrentSunDistance[HC_MaxIndex]
                      • Set HC_Core[HC_Index] = HC_Core[HC_MaxIndex]
                      • Set HC_UnitIndex[HC_Index] = HC_UnitIndex[HC_MaxIndex]
                      • Set HC_ExplosionDamage[HC_Index] = HC_ExplosionDamage[HC_MaxIndex]
                      • Set HC_MagnetismStrength[HC_Index] = HC_MagnetismStrength[HC_MaxIndex]
                      • Set HC_MaxIndex = (HC_MaxIndex - 1)
                      • Set HC_Index = (HC_Index - 1)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • HC_MaxIndex Equal to 0
                        • Then - Actions
                          • Trigger - Turn off (This trigger)
                        • Else - Actions
                    • Else - Actions
                • Else - Actions
  • Helios Collision Dummy Removal
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set HC_TempUnit = (Triggering unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of HC_TempUnit) Equal to HC_DummyType
        • Then - Actions
          • Unit - Remove HC_TempUnit from the game
        • Else - Actions
- Magnetised Energy Bombs
  • MEB Configuration
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Do not touch --------
      • Hashtable - Create a hashtable
      • Set MEB_Hash = (Last created hashtable)
      • -------- ------- --------
      • -------- Determines the damage the explosion when the Bombs explode --------
      • Set MEB_DamageBase = 100.00
      • Set MEB_DamagePerLevel = 50.00
      • -------- Determines the area of where the damage will be dealt --------
      • Set MEB_ExplosionAOEBase = 150.00
      • Set MEB_ExplosionAOPerLevel = 50.00
      • -------- Determines how fast the Orbs will leave the centre --------
      • Set MEB_DistanceIncrease = 4.00
      • -------- Determines how long each Bomb will last for before exploding --------
      • Set MEB_DurationBase = 2.00
      • Set MEB_DurationPerLevel = 0.50
      • -------- Determines the height of the lightning effects --------
      • Set MEB_LightningHeight = 75.00
      • -------- Determines the rate of the Knockback decreasing to 0 --------
      • Set MEB_KnockbackDetriment = 1.00
      • -------- Determines the strength behind the knockback/how far it will push --------
      • Set MEB_KnockbackStrengthBase = 25.00
      • Set MEB_KnockbackStrengthPerLevel = 10.00
      • -------- Determines the area effected by the magnetism of each Bomb --------
      • Set MEB_MagneticAOEBase = 100.00
      • Set MEB_MagneticAOEPerLevel = 25.00
      • -------- Determines the strength of the Magnetism --------
      • Set MEB_MagneticStrengthBase = 25.00
      • Set MEB_MagneticStrengthPerLevel = 5.00
      • -------- Determines the damage done to the mana of units --------
      • Set MEB_ManaDamageBase = 50.00
      • Set MEB_ManaDamagePerLevel = 25.00
      • -------- Determines the feedback ratio from mana to health damage --------
      • Set MEB_ManaToHealthDamageBase = 0.75
      • Set MEB_ManaToHealthDamagePerLevel = 0.25
      • -------- Determines the speed of revolution --------
      • Set MEB_Speed = 4.00
      • -------- Determines how far out the Bombs start from the caster --------
      • Set MEB_StartDistance = 150.00
      • -------- Determines how many Bombs are made --------
      • Set MEB_SidesBase = 1
      • Set MEB_SidesPerLevel = 1
      • -------- Determines the bonus damage for hitting against rocks --------
      • Set MEB_RockSmash = 75.00
      • -------- Determines how much damage the burning fire does --------
      • Set MEB_BurnDamageBase = 0.25
      • Set MEB_BurnDamagePerLevel = 0.10
      • -------- Determines the AOE of the burning fire --------
      • Set MEB_BurnAoe = 50.00
      • -------- Determines how far back the burning tail goes --------
      • Set MEB_TailDurationBase = 0.05
      • Set MEB_TailDurationPerLevel = 0.00
      • -------- Determines what unit will be used as the bomb --------
      • Set MEB_Bomb = Energy Magnet
      • -------- Determines what unit will be used as the tail --------
      • Set MEB_Tail = Energy Tail
      • -------- Determines what unit will be used as the spell --------
      • Set MEB_Spell = Magnetised Energy Bombs
      • -------- Determines what Lightning effect will be used for the magnetism --------
      • Set MEB_Lightning = CLPB
      • -------- Determines what Special effects will be used at different points of the spell --------
      • -------- Creation of the Bombs --------
      • Set MEB_SFXSpawn = Abilities\Spells\Items\AIre\AIreTarget.mdl
      • -------- Explosion --------
      • Set MEB_SFXDeath = Objects\Spawnmodels\NightElf\NEDeathSmall\NEDeathSmall.mdl
      • -------- Effect created on knockback --------
      • Set MEB_SFXKnockback = Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
      • -------- Destroy Trees when knockbacked/dragged through them? --------
      • Set MEB_TreeKill = True
      • -------- Area of trees destroyed --------
      • Set MEB_TreeDestroyArea = 100.00
      • -------- ------- --------
      • -------- Do not touch --------
      • -------- Tree Checking Set up --------
      • Set MEB_TempPoint = (Center of (Playable map area))
      • Unit - Create 1 Peasant for Neutral Passive at MEB_TempPoint facing Default building facing degrees
      • Set MEB_TreeChecker = (Last created unit)
      • Unit - Hide MEB_TreeChecker
      • Unit - Make MEB_TreeChecker Invulnerable
      • Custom script: call RemoveLocation (udg_MEB_TempPoint)
      • -------- ------ --------
  • MEB Activation
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to MEB_Spell
    • Actions
      • -------- Cricle Set up --------
      • Set MEB_U = (Triggering unit)
      • Set MEB_TempI = (Level of MEB_Spell for MEB_U)
      • Set MEB_TempReal = (Real(MEB_TempI))
      • Set MEB_TempPoint = (Position of MEB_U)
      • Set MEB_Angle = 0.00
      • -------- ------ --------
      • -------- Spell Start --------
      • For each (Integer MEB_I) from 1 to (MEB_SidesBase + (MEB_SidesPerLevel x MEB_TempI)), do (Actions)
        • Loop - Actions
          • -------- Creation --------
          • Set MEB_Angle = (MEB_Angle + (360.00 / ((Real(MEB_SidesBase)) + ((Real(MEB_SidesPerLevel)) x MEB_TempReal))))
          • Set MEB_TempPoint2 = (MEB_TempPoint offset by MEB_StartDistance towards MEB_Angle degrees)
          • Unit - Create 1 MEB_Bomb for Neutral Passive at MEB_TempPoint2 facing Default building facing degrees
          • Special Effect - Create a special effect at MEB_TempPoint2 using MEB_SFXSpawn
          • Special Effect - Destroy (Last created special effect)
          • Custom script: call RemoveLocation (udg_MEB_TempPoint2)
          • -------- ------ --------
          • -------- Set up --------
          • Set MEB_TempU = (Last created unit)
          • Unit - Add a (MEB_DurationBase + (MEB_DurationPerLevel x MEB_TempReal)) second Generic expiration timer to MEB_TempU
          • Unit Group - Add MEB_TempU to MEB_Bombs
          • Custom script: set udg_MEB_UHandle = GetHandleId(udg_MEB_TempU)
          • -------- ------ --------
          • -------- Passing Information --------
          • Hashtable - Save Handle OfMEB_U as 1 of MEB_UHandle in MEB_Hash
          • Hashtable - Save (MEB_BurnDamageBase + (MEB_BurnDamagePerLevel x MEB_TempReal)) as 2 of MEB_UHandle in MEB_Hash
          • Hashtable - Save (MEB_DamageBase + (MEB_DamagePerLevel x MEB_TempReal)) as 3 of MEB_UHandle in MEB_Hash
          • Hashtable - Save (MEB_KnockbackStrengthBase + (MEB_KnockbackStrengthPerLevel x MEB_TempReal)) as 4 of MEB_UHandle in MEB_Hash
          • Hashtable - Save (MEB_MagneticStrengthBase + (MEB_MagneticStrengthPerLevel x MEB_TempReal)) as 5 of MEB_UHandle in MEB_Hash
          • Hashtable - Save (MEB_ManaDamageBase + (MEB_ManaDamagePerLevel x MEB_TempReal)) as 6 of MEB_UHandle in MEB_Hash
          • Hashtable - Save (MEB_ManaToHealthDamageBase + (MEB_ManaToHealthDamagePerLevel x MEB_TempReal)) as 7 of MEB_UHandle in MEB_Hash
          • Hashtable - Save (MEB_TailDurationBase + (MEB_TailDurationPerLevel x MEB_TempReal)) as 8 of MEB_UHandle in MEB_Hash
          • Hashtable - Save (MEB_MagneticAOEBase + (MEB_MagneticAOEPerLevel x MEB_TempReal)) as 9 of MEB_UHandle in MEB_Hash
          • Hashtable - Save (MEB_ExplosionAOEBase + (MEB_MagneticAOEPerLevel x MEB_TempReal)) as 15 of MEB_UHandle in MEB_Hash
          • Hashtable - Save MEB_Angle as 10 of MEB_UHandle in MEB_Hash
          • Hashtable - Save MEB_StartDistance as 11 of MEB_UHandle in MEB_Hash
          • Hashtable - Save 1 as 12 of MEB_UHandle in MEB_Hash
          • -------- ------ --------
      • Trigger - Turn on MEB Death <gen>
      • Trigger - Turn on MEB Loop <gen>
      • -------- ------ --------
  • MEB Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in MEB_Bombs and do (Actions)
        • Loop - Actions
          • Set MEB_U = (Picked unit)
          • Custom script: set udg_MEB_UHandle = GetHandleId(udg_MEB_U)
          • -------- Bomb Spinning --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Load 12 of MEB_UHandle from MEB_Hash) Equal to 1
            • Then - Actions
              • -------- Movement --------
              • Set MEB_Angle = ((Load 10 of MEB_UHandle from MEB_Hash) + MEB_Speed)
              • Hashtable - Save MEB_Angle as 10 of MEB_UHandle in MEB_Hash
              • Set MEB_TempReal = ((Load 11 of MEB_UHandle from MEB_Hash) + MEB_DistanceIncrease)
              • Hashtable - Save MEB_TempReal as 11 of MEB_UHandle in MEB_Hash
              • Set MEB_TempPoint = (Position of (Load 1 of MEB_UHandle in MEB_Hash))
              • Set MEB_TempPoint2 = (MEB_TempPoint offset by MEB_TempReal towards MEB_Angle degrees)
              • -------- For Flame Trail --------
              • Set MEB_TempReal2 = (Load 8 of MEB_UHandle from MEB_Hash)
              • -------- ------ --------
              • -------- Spinning Movement --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Playable map area) contains MEB_TempPoint2) Equal to True
                  • (Terrain pathing at MEB_TempPoint2 of type Walkability is off) Equal to False
                • Then - Actions
                  • Custom script: set udg_MEB_TempX = GetLocationX(udg_MEB_TempPoint)
                  • Custom script: set udg_MEB_TempY = GetLocationY(udg_MEB_TempPoint)
                  • Custom script: call SetUnitX(udg_MEB_U, udg_MEB_TempX + udg_MEB_TempReal * Cos(udg_MEB_Angle * bj_DEGTORAD))
                  • Custom script: call SetUnitY(udg_MEB_U, udg_MEB_TempY + udg_MEB_TempReal * Sin(udg_MEB_Angle * bj_DEGTORAD))
                • Else - Actions
                  • -------- Rock Smash --------
                  • Unit - Kill MEB_U
                  • Set MEB_TempGroup = (Units in (Playable map area) matching ((Load 14 of (Key (Matching unit)) in MEB_Hash) Equal to MEB_U))
                  • Unit Group - Pick every unit in MEB_TempGroup and do (Actions)
                    • Loop - Actions
                      • Set MEB_TempU = (Picked unit)
                      • Set MEB_TempPoint3 = (Position of MEB_TempU)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Distance between MEB_TempPoint and MEB_TempPoint2) Less than or equal to (Load 15 of MEB_UHandle from MEB_Hash)
                        • Then - Actions
                          • Unit - Cause (Load 1 of MEB_UHandle in MEB_Hash) to damage MEB_TempU, dealing MEB_RockSmash damage of attack type Spells and damage type Normal
                        • Else - Actions
                      • Custom script: call RemoveLocation(udg_MEB_TempPoint3)
                  • Custom script: call DestroyGroup(udg_MEB_TempGroup)
                  • -------- ------ --------
              • -------- ------ --------
              • Custom script: call RemoveLocation(udg_MEB_TempPoint2)
              • Custom script: call RemoveLocation(udg_MEB_TempPoint)
              • -------- Flame Trail --------
              • Set MEB_TempPoint = (Position of MEB_U)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Load 20 of MEB_UHandle from MEB_Hash) Equal to 1
                • Then - Actions
                  • Unit - Create 1 Energy Tail for (Owner of MEB_U) at MEB_TempPoint facing Default building facing degrees
                  • Set MEB_TempU = (Last created unit)
                  • Custom script: set udg_MEB_UHandleC = GetHandleId(udg_MEB_TempU)
                  • Unit - Add a MEB_TempReal2 second Generic expiration timer to MEB_TempU
                  • Hashtable - Save Handle Of(Load 1 of MEB_UHandle in MEB_Hash) as 1 of MEB_UHandleC in MEB_Hash
                  • Hashtable - Save 4 as 12 of MEB_UHandleC in MEB_Hash
                  • Hashtable - Save (Load 2 of MEB_UHandle from MEB_Hash) as 17 of MEB_UHandleC in MEB_Hash
                  • Hashtable - Save Handle Of(Load 1 of MEB_UHandle in MEB_Hash) as 1 of MEB_UHandleC in MEB_Hash
                  • Unit Group - Add MEB_TempU to MEB_Bombs
                  • Hashtable - Save 0 as 20 of MEB_UHandle in MEB_Hash
                • Else - Actions
                  • Hashtable - Save ((Load 20 of MEB_UHandle from MEB_Hash) + 1) as 20 of MEB_UHandle in MEB_Hash
              • -------- ------ --------
              • -------- Magnetising units --------
              • Set MEB_TempGroup = (Units within (Load 9 of MEB_UHandle from MEB_Hash) of MEB_TempPoint)
              • Unit Group - Pick every unit in MEB_TempGroup and do (Actions)
                • Loop - Actions
                  • Set MEB_TempU = (Picked unit)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (MEB_TempU is Magic Immune) Equal to False
                      • (MEB_TempU is A structure) Equal to False
                      • (MEB_TempU is alive) Equal to True
                      • (MEB_TempU belongs to an enemy of (Owner of (Load 1 of MEB_UHandle in MEB_Hash))) Equal to True
                      • (MEB_TempU is A ground unit) Equal to True
                      • (MEB_TempU is in MEB_Bombs) Equal to False
                    • Then - Actions
                      • Custom script: set udg_MEB_UHandleC = GetHandleId(udg_MEB_TempU)
                      • Unit Group - Add MEB_TempU to MEB_Bombs
                      • Hashtable - Save 2 as 12 of MEB_UHandleC in MEB_Hash
                      • Hashtable - Save Handle OfMEB_U as 14 of MEB_UHandleC in MEB_Hash
                      • Hashtable - Save Handle Of(Load 1 of MEB_UHandle in MEB_Hash) as 1 of MEB_UHandleC in MEB_Hash
                    • Else - Actions
              • -------- ------ --------
              • Custom script: call DestroyGroup(udg_MEB_TempGroup)
              • Custom script: call RemoveLocation(udg_MEB_TempPoint)
            • Else - Actions
          • -------- Magnetised Units --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Load 12 of MEB_UHandle from MEB_Hash) Equal to 2
            • Then - Actions
              • -------- Lightning effects --------
              • Lightning - Destroy (Load 13 of MEB_UHandle in MEB_Hash)
              • Set MEB_TempPoint = (Position of MEB_U)
              • Set MEB_TempPoint2 = (Position of (Load 14 of MEB_UHandle in MEB_Hash))
              • Set MEB_TempU = (Load 14 of MEB_UHandle in MEB_Hash)
              • Custom script: set udg_MEB_UHandleC = GetHandleId(udg_MEB_TempU)
              • Set MEB_TempReal = (Load 5 of MEB_UHandleC from MEB_Hash)
              • Custom script: set udg_MEB_TempZ = GetLocationZ(udg_MEB_TempPoint) + udg_MEB_LightningHeight
              • Custom script: set udg_MEB_TempZ2 = GetLocationZ(udg_MEB_TempPoint2) + udg_MEB_LightningHeight
              • Custom script: set udg_MEB_TempLightning = AddLightningEx(udg_MEB_Lightning, true, GetLocationX(udg_MEB_TempPoint), GetLocationY(udg_MEB_TempPoint), udg_MEB_TempZ, GetLocationX(udg_MEB_TempPoint2), GetLocationY(udg_MEB_TempPoint2), udg_MEB_TempZ2)
              • Hashtable - Save Handle OfMEB_TempLightning as 13 of MEB_UHandle in MEB_Hash
              • -------- ------ --------
              • -------- Magnetised movement --------
              • Set MEB_Angle = (Angle from MEB_TempPoint to MEB_TempPoint2)
              • Custom script: call RemoveLocation(udg_MEB_TempPoint2)
              • Set MEB_TempPoint2 = (MEB_TempPoint offset by MEB_TempReal towards MEB_Angle degrees)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Playable map area) contains MEB_TempPoint2) Equal to True
                  • (Terrain pathing at MEB_TempPoint2 of type Walkability is off) Equal to False
                • Then - Actions
                  • Custom script: set udg_MEB_TempX = GetUnitX(udg_MEB_U)
                  • Custom script: set udg_MEB_TempY = GetUnitY(udg_MEB_U)
                  • Custom script: call SetUnitX(udg_MEB_U, udg_MEB_TempX + udg_MEB_TempReal * Cos(udg_MEB_Angle * bj_DEGTORAD))
                  • Custom script: call SetUnitY(udg_MEB_U, udg_MEB_TempY + udg_MEB_TempReal * Sin(udg_MEB_Angle * bj_DEGTORAD))
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • MEB_TreeKill Equal to True
                    • Then - Actions
                      • -------- Tree Destruction --------
                      • Destructible - Pick every destructible within MEB_TreeDestroyArea of MEB_TempPoint2 and do (Actions)
                        • Loop - Actions
                          • Unit - Order MEB_TreeChecker to Harvest (Picked destructible)
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Current order of MEB_TreeChecker) Equal to (Order(harvest))
                            • Then - Actions
                              • Destructible - Kill (Picked destructible)
                            • Else - Actions
                          • Unit - Order MEB_TreeChecker to Stop
                      • -------- ------ --------
                    • Else - Actions
                • Else - Actions
              • -------- ------ --------
              • Custom script: call RemoveLocation(udg_MEB_TempPoint2)
              • Custom script: call RemoveLocation(udg_MEB_TempPoint)
            • Else - Actions
          • -------- Knocked Back Units --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Load 12 of MEB_UHandle from MEB_Hash) Equal to 3
            • Then - Actions
              • -------- Movement --------
              • Set MEB_TempPoint = (Load 15 of MEB_UHandle in MEB_Hash)
              • Set MEB_TempPoint2 = (Position of MEB_U)
              • -------- ------ --------
              • -------- Knockback effects --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Load 20 of MEB_UHandle from MEB_Hash) Equal to 3
                • Then - Actions
                  • Special Effect - Create a special effect at MEB_TempPoint2 using MEB_SFXKnockback
                  • Special Effect - Destroy (Last created special effect)
                  • Hashtable - Save 0 as 20 of MEB_UHandle in MEB_Hash
                • Else - Actions
                  • Hashtable - Save ((Load 20 of MEB_UHandle from MEB_Hash) + 1) as 20 of MEB_UHandle in MEB_Hash
              • -------- ------ --------
              • -------- Movement --------
              • Set MEB_TempReal = ((Load 16 of MEB_UHandle from MEB_Hash) - MEB_KnockbackDetriment)
              • Hashtable - Save MEB_TempReal as 16 of MEB_UHandle in MEB_Hash
              • Set MEB_Angle = (Angle from MEB_TempPoint to MEB_TempPoint2)
              • Custom script: call RemoveLocation(udg_MEB_TempPoint)
              • Set MEB_TempPoint = (MEB_TempPoint2 offset by MEB_TempReal towards MEB_Angle degrees)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Playable map area) contains MEB_TempPoint) Equal to True
                  • (Terrain pathing at MEB_TempPoint of type Walkability is off) Equal to False
                  • (Terrain pathing at MEB_TempPoint of type Walkability is off) Equal to False
                • Then - Actions
                  • Custom script: set udg_MEB_TempX = GetUnitX(udg_MEB_U)
                  • Custom script: set udg_MEB_TempY = GetUnitY(udg_MEB_U)
                  • Custom script: call SetUnitX(udg_MEB_U, udg_MEB_TempX + udg_MEB_TempReal * Cos(udg_MEB_Angle * bj_DEGTORAD))
                  • Custom script: call SetUnitY(udg_MEB_U, udg_MEB_TempY + udg_MEB_TempReal * Sin(udg_MEB_Angle * bj_DEGTORAD))
                  • -------- Tree Destruction --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • MEB_TreeKill Equal to True
                    • Then - Actions
                      • Destructible - Pick every destructible within MEB_TreeDestroyArea of MEB_TempPoint and do (Actions)
                        • Loop - Actions
                          • Unit - Order MEB_TreeChecker to Harvest (Picked destructible)
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Current order of MEB_TreeChecker) Equal to (Order(harvest))
                            • Then - Actions
                              • Destructible - Kill (Picked destructible)
                            • Else - Actions
                          • Unit - Order MEB_TreeChecker to Stop
                    • Else - Actions
                  • -------- ------ --------
                • Else - Actions
                  • -------- Rock Smash --------
                  • Unit - Cause (Load 1 of MEB_UHandle in MEB_Hash) to damage MEB_U, dealing MEB_RockSmash damage of attack type Spells and damage type Normal
                  • Hashtable - Save 0.00 as 16 of MEB_UHandle in MEB_Hash
                  • -------- ------ --------
              • -------- ------ --------
              • Custom script: call RemoveLocation(udg_MEB_TempPoint2)
              • Custom script: call RemoveLocation(udg_MEB_TempPoint)
              • -------- End of Knockback --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Load 16 of MEB_UHandle from MEB_Hash) Less than or equal to 0.00
                • Then - Actions
                  • Unit Group - Remove MEB_U from MEB_Bombs
                  • Hashtable - Save 0 as 12 of MEB_UHandle in MEB_Hash
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (MEB_Bombs is empty) Equal to True
                    • Then - Actions
                      • Trigger - Turn off (This trigger)
                      • Trigger - Turn off MEB Death <gen>
                    • Else - Actions
                • Else - Actions
              • -------- ------ --------
            • Else - Actions
          • -------- Fire Trail damage --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Load 12 of MEB_UHandle from MEB_Hash) Equal to 4
            • Then - Actions
              • -------- Burn Damage --------
              • Set MEB_TempPoint = (Position of MEB_U)
              • Set MEB_TempGroup = (Units within MEB_BurnAoe of MEB_TempPoint)
              • Unit Group - Pick every unit in MEB_TempGroup and do (Actions)
                • Loop - Actions
                  • Set MEB_TempU = (Picked unit)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (MEB_TempU is Magic Immune) Equal to False
                      • (MEB_TempU is A structure) Equal to False
                      • (MEB_TempU is alive) Equal to True
                      • (MEB_TempU belongs to an enemy of (Owner of (Load 1 of MEB_UHandle in MEB_Hash))) Equal to True
                      • (MEB_TempU is A ground unit) Equal to True
                    • Then - Actions
                      • Unit - Cause (Load 1 of MEB_UHandle in MEB_Hash) to damage MEB_TempU, dealing (Load 17 of MEB_UHandle from MEB_Hash) damage of attack type Spells and damage type Normal
                    • Else - Actions
              • -------- ------ --------
              • Custom script: call DestroyGroup(udg_MEB_TempGroup)
              • Custom script: call RemoveLocation(udg_MEB_TempPoint)
            • Else - Actions
  • MEB Death
    • Events
      • Unit - A unit owned by Neutral Passive Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to MEB_Bomb
    • Actions
      • -------- Death Setup --------
      • Set MEB_U = (Triggering unit)
      • Custom script: set udg_MEB_UHandle = GetHandleId(udg_MEB_U)
      • Set MEB_TempPoint = (Position of MEB_U)
      • Special Effect - Create a special effect at MEB_TempPoint using MEB_SFXDeath
      • Special Effect - Destroy (Last created special effect)
      • -------- ------ --------
      • -------- Explosion --------
      • Set MEB_TempGroup = (Units in (Playable map area) matching ((Load 14 of (Key (Matching unit)) in MEB_Hash) Equal to MEB_U))
      • Unit Group - Pick every unit in MEB_TempGroup and do (Actions)
        • Loop - Actions
          • -------- Check Set up --------
          • Set MEB_TempU = (Picked unit)
          • Custom script: set udg_MEB_UHandleC = GetHandleId(udg_MEB_TempU)
          • Set MEB_TempPoint2 = (Position of MEB_TempU)
          • Lightning - Destroy (Load 13 of MEB_UHandleC in MEB_Hash)
          • -------- ------ --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Distance between MEB_TempPoint and MEB_TempPoint2) Greater than (Load 15 of MEB_UHandle from MEB_Hash)
            • Then - Actions
              • -------- Unit outside of range cleanup --------
              • Hashtable - Save 0 as 12 of MEB_UHandleC in MEB_Hash
              • Unit Group - Remove MEB_TempU from MEB_Bombs
              • Hashtable - Clear all child hashtables of child MEB_UHandleC in MEB_Hash
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in MEB_Bombs) Equal to 0
                • Then - Actions
                  • Trigger - Turn off MEB Loop <gen>
                • Else - Actions
              • -------- ------ --------
            • Else - Actions
              • -------- Explosion Damage effect --------
              • Unit - Cause (Load 1 of MEB_UHandle in MEB_Hash) to damage MEB_TempU, dealing (Load 3 of MEB_UHandle from MEB_Hash) damage of attack type Spells and damage type Normal
              • Set MEB_TempReal = (Mana of MEB_TempU)
              • Unit - Set mana of MEB_TempU to ((Mana of MEB_TempU) - (Load 6 of MEB_UHandle from MEB_Hash))
              • Unit - Cause (Load 1 of MEB_UHandle in MEB_Hash) to damage MEB_TempU, dealing ((MEB_TempReal - (Mana of MEB_TempU)) x (Load 7 of MEB_UHandle from MEB_Hash)) damage of attack type Spells and damage type Normal
              • -------- ------ --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (MEB_TempU is alive) Equal to True
                • Then - Actions
                  • -------- Knockback Setup --------
                  • Hashtable - Save Handle OfMEB_TempPoint as 15 of MEB_UHandleC in MEB_Hash
                  • Hashtable - Save 3 as 12 of MEB_UHandleC in MEB_Hash
                  • Hashtable - Save (Load 4 of MEB_UHandle from MEB_Hash) as 16 of MEB_UHandleC in MEB_Hash
                  • -------- ------ --------
                • Else - Actions
                  • -------- Dead unit clean up --------
                  • Hashtable - Clear all child hashtables of child MEB_UHandleC in MEB_Hash
                  • -------- ------ --------
          • Custom script: call RemoveSavedHandle(udg_MEB_Hash, udg_MEB_UHandleC, 14)
          • Custom script: call RemoveLocation(udg_MEB_TempPoint2)
      • -------- ------ --------
      • Custom script: call DestroyGroup(udg_MEB_TempGroup)
      • Custom script: call RemoveLocation(udg_MEB_TempPoint)
      • -------- Clean Up --------
      • Custom script: set bj_wantDestroyGroup = true
      • If ((Number of units in (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to MEB_Bomb))) Equal to 0) then do (Trigger - Turn off (This trigger)) else do (Do nothing)
      • Hashtable - Clear all child hashtables of child MEB_UHandle in MEB_Hash
      • Unit Group - Remove MEB_U from MEB_Bombs
      • -------- ------ --------
- Sentry Rocks
  • Sentry Rocks Configuration
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Do not touch --------
      • Hashtable - Create a hashtable
      • Set SR_Hash = (Last created hashtable)
      • -------- ----- --------
      • -------- Determines how fast the Rocks will get to their target --------
      • Set SR_MoveSpeedBase = 4.00
      • Set SR_MoveSpeedPerLevel = 1.00
      • -------- Determines how much damage the rocks will deal to their target --------
      • Set SR_RockDamageBase = 150.00
      • Set SR_RockDamagePerLevel = 50.00
      • -------- Determines the search radius of the Rocks --------
      • Set SR_RockSearchAoeBase = 200.00
      • Set SR_RockSearchAoePerLevel = 100.00
      • -------- Determines how many pairs of rocks will be created --------
      • Set SR_RocksBase = 3.00
      • Set SR_RocksPerLevel = 1.00
      • -------- Determines how long the rocks will last for --------
      • Set SR_DurationBase = 5.00
      • Set SR_DurationPerLevel = 2.00
      • -------- Constants --------
      • -------- Determines how fast the Rocks will fall --------
      • Set SR_RockFallSpeed = 20.00
      • -------- Determines how far from the caster the rocks will be created --------
      • Set SR_RockDistance = 200.00
      • -------- Determines the distance between the two revolving rocks in a pair --------
      • Set SR_RockSeperationDistance = 50.00
      • -------- Determines how fast the Cores spin around the caster --------
      • Set SR_RockSpinSpeed = 2.00
      • -------- Determines how fast the Rocks spin around their Core --------
      • Set SR_RockSpinSpeed2 = 5.00
      • -------- Determines how many rocks are in a pair --------
      • Set SR_RockPairCount = 2.00
      • -------- Determines how high the rocks are floating --------
      • Set SR_RockHeight = 300.00
      • -------- Determines how long the Summon Sfx will survive for --------
      • Set SR_SummonSFXDuration = 1.00
      • -------- Determines the spell that will be used --------
      • Set SR_Spell = Sentry Rocks
      • -------- Determines the unit that will be used as a rock --------
      • Set SR_Rock = Rock
      • -------- Determines the unit that will be used as a Core --------
      • Set SR_RockCore = RockCore
      • -------- Determines the unit that will be used as the summoning SFX --------
      • Set SR_SummonSFX = Rock Summon SFX
      • -------- Determines the explosion SFX --------
      • Set SR_CollisionSFX = Objects\Spawnmodels\NightElf\NEDeathSmall\NEDeathSmall.mdl
      • -------- Determines which lightning effect will be used to link the Rocks and their Core --------
      • Set SR_RockLinkLightning = CLPB
      • -------- ----- --------
  • Sentry Rocks Activation
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to SR_Spell
    • Actions
      • Set SR_U = (Triggering unit)
      • Set SR_TempPoint = (Position of SR_U)
      • Set SR_TempReal = (Real((Level of SR_Spell for SR_U)))
      • Set SR_Angle = 0.00
      • For each (Integer SR_I) from 1 to ((Integer(SR_RocksBase)) + ((Integer(SR_RocksPerLevel)) x (Level of SR_Spell for SR_U))), do (Actions)
        • Loop - Actions
          • Set SR_Angle = (SR_Angle + (360.00 / (SR_RocksBase + (SR_RocksPerLevel x SR_TempReal))))
          • Set SR_TempPoint2 = (SR_TempPoint offset by SR_RockDistance towards SR_Angle degrees)
          • Set SR_Angle2 = 0.00
          • Unit - Create 1 SR_RockCore for (Owner of SR_U) at SR_TempPoint2 facing Default building facing degrees
          • Set SR_TempU = (Last created unit)
          • Unit - Add a (SR_DurationBase + (SR_DurationPerLevel x SR_TempReal)) second Generic expiration timer to SR_TempU
          • Animation - Change SR_TempU flying height to SR_RockHeight at 0.00
          • For each (Integer SR_I2) from 1 to (Integer(SR_RockPairCount)), do (Actions)
            • Loop - Actions
              • Set SR_Angle2 = (SR_Angle2 + (360.00 / SR_RockPairCount))
              • Set SR_TempPoint3 = (SR_TempPoint2 offset by SR_RockSeperationDistance towards SR_Angle2 degrees)
              • Unit - Create 1 SR_Rock for Neutral Passive at SR_TempPoint3 facing Default building facing degrees
              • Set SR_TempU2 = (Last created unit)
              • Custom script: set udg_SR_UHandle = GetHandleId(udg_SR_TempU2)
              • Animation - Change SR_TempU2 flying height to SR_RockHeight at 0.00
              • Hashtable - Save Handle OfSR_U as 1 of SR_UHandle in SR_Hash
              • Hashtable - Save 4 as 2 of SR_UHandle in SR_Hash
              • Hashtable - Save Handle OfSR_TempU as 3 of SR_UHandle in SR_Hash
              • Hashtable - Save SR_Angle2 as 6 of SR_UHandle in SR_Hash
              • Hashtable - Save SR_RockSeperationDistance as 7 of SR_UHandle in SR_Hash
              • Hashtable - Save SR_RockHeight as 8 of SR_UHandle in SR_Hash
              • Unit Group - Add SR_TempU2 to SR_Rocks
              • Custom script: call RemoveLocation(udg_SR_TempPoint3)
          • Custom script: set udg_SR_UHandle = GetHandleId(udg_SR_TempU)
          • Unit - Create 1 SR_SummonSFX for Neutral Passive at SR_TempPoint2 facing Default building facing degrees
          • Animation - Change (Last created unit) flying height to SR_RockHeight at 0.00
          • Unit - Add a SR_SummonSFXDuration second Generic expiration timer to (Last created unit)
          • Hashtable - Save Handle OfSR_U as 1 of SR_UHandle in SR_Hash
          • Hashtable - Save 1 as 2 of SR_UHandle in SR_Hash
          • Hashtable - Save (SR_RockDamageBase + (SR_RockDamagePerLevel x SR_TempReal)) as 3 of SR_UHandle in SR_Hash
          • Hashtable - Save (SR_RockSearchAoeBase + (SR_RockSearchAoePerLevel x SR_TempReal)) as 4 of SR_UHandle in SR_Hash
          • Hashtable - Save (SR_MoveSpeedBase + (SR_MoveSpeedPerLevel x SR_TempReal)) as 5 of SR_UHandle in SR_Hash
          • Hashtable - Save SR_Angle as 6 of SR_UHandle in SR_Hash
          • Hashtable - Save SR_RockHeight as 8 of SR_UHandle in SR_Hash
          • Hashtable - Save Handle OfSR_U as 9 of SR_UHandle in SR_Hash
          • Unit Group - Add SR_TempU to SR_Rocks
          • Custom script: call RemoveLocation(udg_SR_TempPoint2)
      • Trigger - Turn on Sentry Rocks Loop <gen>
      • Trigger - Turn on Sentry Rocks Death <gen>
      • Custom script: call RemoveLocation(udg_SR_TempPoint)
  • Sentry Rocks Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in SR_Rocks and do (Actions)
        • Loop - Actions
          • Set SR_U = (Picked unit)
          • Custom script: set udg_SR_UHandle = GetHandleId(udg_SR_U)
          • -------- Rock Core Spin + Search --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Load 2 of SR_UHandle from SR_Hash) Equal to 1
            • Then - Actions
              • Set SR_Angle = ((Load 6 of SR_UHandle from SR_Hash) + SR_RockSpinSpeed)
              • Hashtable - Save SR_Angle as 6 of SR_UHandle in SR_Hash
              • Set SR_TempPoint = (Position of (Load 1 of SR_UHandle in SR_Hash))
              • Custom script: set udg_SR_TempX = GetLocationX(udg_SR_TempPoint)
              • Custom script: set udg_SR_TempY = GetLocationY(udg_SR_TempPoint)
              • Custom script: call SetUnitX(udg_SR_U, udg_SR_TempX + udg_SR_RockDistance * Cos(udg_SR_Angle * bj_DEGTORAD))
              • Custom script: call SetUnitY(udg_SR_U, udg_SR_TempY + udg_SR_RockDistance * Sin(udg_SR_Angle * bj_DEGTORAD))
              • Set SR_TempGroup = (Units within (Load 4 of SR_UHandle from SR_Hash) of SR_TempPoint)
              • Unit Group - Pick every unit in SR_TempGroup and do (Actions)
                • Loop - Actions
                  • Set SR_TempU = (Picked unit)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (SR_TempU is Magic Immune) Equal to False
                      • (SR_TempU is A structure) Equal to False
                      • (SR_TempU is in SR_Rocks) Equal to False
                      • (SR_TempU is alive) Equal to True
                      • (SR_TempU is A ground unit) Equal to True
                      • (SR_TempU belongs to an enemy of (Owner of SR_U)) Equal to True
                      • (Load 9 of SR_UHandle in SR_Hash) Equal to (Load 1 of SR_UHandle in SR_Hash)
                    • Then - Actions
                      • Hashtable - Save Handle OfSR_TempU as 9 of SR_UHandle in SR_Hash
                      • Hashtable - Save 2 as 2 of SR_UHandle in SR_Hash
                      • Unit Group - Add SR_TempU to SR_Rocks
                      • Unit - Pause the expiration timer for SR_U
                    • Else - Actions
              • Custom script: call RemoveLocation(udg_SR_TempPoint)
              • Custom script: call DestroyGroup (udg_SR_TempGroup)
            • Else - Actions
          • -------- Rock Movement --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Load 2 of SR_UHandle from SR_Hash) Equal to 2
            • Then - Actions
              • -------- Lightning effects --------
              • Set SR_TempPoint = (Position of SR_U)
              • Set SR_TempU = (Load 9 of SR_UHandle in SR_Hash)
              • Set SR_TempPoint2 = (Position of SR_TempU)
              • Set SR_TempReal = (Load 5 of SR_UHandle from SR_Hash)
              • -------- ------ --------
              • -------- Magnetised movement --------
              • Set SR_Angle = (Angle from SR_TempPoint to SR_TempPoint2)
              • Set SR_TempPoint3 = (SR_TempPoint offset by SR_TempReal towards SR_Angle degrees)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Playable map area) contains SR_TempPoint3) Equal to True
                • Then - Actions
                  • Custom script: set udg_SR_TempX = GetUnitX(udg_SR_U)
                  • Custom script: set udg_SR_TempY = GetUnitY(udg_SR_U)
                  • Custom script: call SetUnitX(udg_SR_U, udg_SR_TempX + udg_SR_TempReal * Cos(udg_SR_Angle * bj_DEGTORAD))
                  • Custom script: call SetUnitY(udg_SR_U, udg_SR_TempY + udg_SR_TempReal * Sin(udg_SR_Angle * bj_DEGTORAD))
                • Else - Actions
                  • Unit - Kill SR_U
              • -------- ------ --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Distance between SR_TempPoint and SR_TempPoint2) Less than or equal to 50.00
                • Then - Actions
                  • Hashtable - Save 3 as 2 of SR_UHandle in SR_Hash
                • Else - Actions
              • Custom script: call RemoveLocation(udg_SR_TempPoint2)
              • Custom script: call RemoveLocation(udg_SR_TempPoint)
            • Else - Actions
          • -------- Rock Fall --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Load 2 of SR_UHandle from SR_Hash) Equal to 3
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Load 8 of SR_UHandle from SR_Hash) Less than or equal to 10.00
                • Then - Actions
                  • Set SR_TempPoint = (Position of SR_U)
                  • Unit - Cause (Load 1 of SR_UHandle in SR_Hash) to damage (Load 9 of SR_UHandle in SR_Hash), dealing (Load 3 of SR_UHandle from SR_Hash) damage of attack type Spells and damage type Normal
                  • Special Effect - Create a special effect at SR_TempPoint using SR_CollisionSFX
                  • Special Effect - Destroy (Last created special effect)
                  • Unit Group - Remove (Load 9 of SR_UHandle in SR_Hash) from SR_Rocks
                  • Unit - Kill SR_U
                  • Custom script: call RemoveLocation (udg_SR_TempPoint)
                • Else - Actions
                  • Set SR_TempReal = ((Load 8 of SR_UHandle from SR_Hash) - SR_RockFallSpeed)
                  • Hashtable - Save SR_TempReal as 8 of SR_UHandle in SR_Hash
                  • Animation - Change SR_TempU flying height to SR_TempReal at 0.00
            • Else - Actions
          • -------- Rock Spinning --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Load 2 of SR_UHandle from SR_Hash) Equal to 4
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Load 3 of SR_UHandle in SR_Hash) is alive) Equal to True
                • Then - Actions
                  • Lightning - Destroy (Load 9 of SR_UHandle in SR_Hash)
                  • Set SR_Angle = ((Load 6 of SR_UHandle from SR_Hash) + SR_RockSpinSpeed2)
                  • Hashtable - Save SR_Angle as 6 of SR_UHandle in SR_Hash
                  • Set SR_TempPoint = (Position of (Load 3 of SR_UHandle in SR_Hash))
                  • Set SR_TempPoint2 = (Position of SR_U)
                  • Hashtable - Save (Load 8 of (Key (Load 3 of SR_UHandle in SR_Hash)) from SR_Hash) as 8 of SR_UHandle in SR_Hash
                  • Set SR_TempReal = (Load 8 of SR_UHandle from SR_Hash)
                  • Animation - Change SR_U flying height to SR_TempReal at 0.00
                  • Custom script: set udg_SR_TempZ = GetLocationZ(udg_SR_TempPoint) + udg_SR_TempReal
                  • Custom script: set udg_SR_TempZ2 = GetLocationZ(udg_SR_TempPoint2) + udg_SR_TempReal
                  • Custom script: set udg_SR_TempLightning = AddLightningEx(udg_SR_RockLinkLightning, true, GetLocationX(udg_SR_TempPoint), GetLocationY(udg_SR_TempPoint), udg_SR_TempZ, GetLocationX(udg_SR_TempPoint2), GetLocationY(udg_SR_TempPoint2), udg_SR_TempZ2)
                  • Hashtable - Save Handle OfSR_TempLightning as 9 of SR_UHandle in SR_Hash
                  • Set SR_TempReal = (Load 7 of SR_UHandle from SR_Hash)
                  • Custom script: set udg_SR_TempX = GetLocationX(udg_SR_TempPoint)
                  • Custom script: set udg_SR_TempY = GetLocationY(udg_SR_TempPoint)
                  • Custom script: call SetUnitX(udg_SR_U, udg_SR_TempX + udg_SR_TempReal * Cos(udg_SR_Angle * bj_DEGTORAD))
                  • Custom script: call SetUnitY(udg_SR_U, udg_SR_TempY + udg_SR_TempReal * Sin(udg_SR_Angle * bj_DEGTORAD))
                  • Custom script: call RemoveLocation(udg_SR_TempPoint2)
                  • Custom script: call RemoveLocation(udg_SR_TempPoint)
                • Else - Actions
                  • Lightning - Destroy (Load 9 of SR_UHandle in SR_Hash)
                  • Hashtable - Clear all child hashtables of child SR_UHandle in SR_Hash
                  • Unit - Remove SR_U from the game
            • Else - Actions
  • Sentry Rocks Death
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to SR_RockCore
    • Actions
      • Set SR_U = (Triggering unit)
      • Custom script: set udg_SR_UHandle = GetHandleId(udg_SR_U)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Load 8 of SR_UHandle from SR_Hash) Greater than or equal to 10.00
        • Then - Actions
          • Set SR_TempPoint = (Position of SR_U)
          • Unit - Create 1 Rock Summon SFX for Neutral Passive at SR_TempPoint facing Default building facing degrees
          • Animation - Change (Last created unit) flying height to (Load 8 of SR_UHandle from SR_Hash) at 0.00
          • Unit - Add a SR_SummonSFXDuration second Generic expiration timer to (Last created unit)
          • Custom script: call RemoveLocation (udg_SR_TempPoint)
        • Else - Actions
      • Unit Group - Remove SR_U from SR_Rocks
      • Hashtable - Clear all child hashtables of child SR_UHandle in SR_Hash
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (SR_Rocks is empty) Equal to True
        • Then - Actions
          • Trigger - Turn off (This trigger)
          • Trigger - Turn off Sentry Rocks Loop <gen>
        • Else - Actions
      • Unit - Remove SR_U from the game
- Soul Tether
  • Soul Tether Configuration
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- -------- --------
      • -------- Determines the percentage of health needed to take control of a soul --------
      • Set ST_TriggeringHealthPercent = 20.00
      • -------- Determines the area that the Tether will revive/hold units --------
      • Set ST_AoeBase = 200.00
      • Set ST_AoePerLevel = 50.00
      • -------- Determines how much "space" in the barrier each rune reprisents --------
      • -------- Decrease - More Barrier Segments, Increase - Fewer Barrier Segments --------
      • Set ST_BarrierSpaceTaken = 10.00
      • -------- Determines how transparent a revived unit is --------
      • Set ST_UnitTransparency = 75.00
      • -------- Determines how much damage a unit takes when the tether is gone/they leave the range of the tether --------
      • Set ST_HealthPenaltyPerSecond = 250.00
      • -------- Determines how long the Tether will last for (seconds) --------
      • Set ST_TetherDurationBase = 10.00
      • Set ST_TetherDurationPerLevel = 5.00
      • -------- Determines how long the Tether can hold onto the souls of the fallen --------
      • Set ST_UndeadDurationBase = 5.00
      • Set ST_UndeadDurationPerLevel = 2.50
      • -------- Determines Lightning Colouration --------
      • Set ST_LightningRed = 1.00
      • Set ST_LightningGreen = 1.00
      • Set ST_LightningBlue = 0.00
      • -------- Determines the scaling of the spawn sfx --------
      • Set ST_EffectScalingSpawn = 150.00
      • -------- Determines the Height given to the lightning effects --------
      • Set ST_LightningZ = 100.00
      • -------- Determines the unit model used as the Tether --------
      • Set ST_TetherModel = buildings\other\BookOfSummoning\BookOfSummoning.mdl
      • -------- Determines the unit model used to reprisent the edge of the Tether's range --------
      • Set ST_BarrierModel = Doodads\Cinematic\GlowingRunes\GlowingRunes2.mdl
      • -------- Determines the SFX used to create create the spell --------
      • Set ST_SpawnSFX = Abilities\Spells\Undead\DarkRitual\DarkRitualTarget.mdl
      • -------- Determines the SFX used to End the spell --------
      • Set ST_DissappearenceSFX = Abilities\Spells\Undead\DarkRitual\DarkRitualTarget.mdl
      • -------- Determines the Lightning Effect used --------
      • Set ST_LightningEffect = CLPB
      • -------- Determines the spell used to act as the activation spell --------
      • Set ST_Spell = Soul Tether
      • -------- Determines the Dummy used to attach all the effects to --------
      • Set ST_DummyType = Soul Tether
  • Soul Tether Activation
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to ST_Spell
    • Actions
      • Set ST_TempPoint = (Target point of ability being cast)
      • Unit - Create 1 ST_DummyType for Neutral Passive at ST_TempPoint facing Default building facing degrees
      • Set ST_TempUnit = (Last created unit)
      • Special Effect - Create a special effect attached to the origin of ST_TempUnit using ST_SpawnSFX
      • Special Effect - Destroy (Last created special effect)
      • Animation - Change ST_TempUnit's size to (ST_EffectScalingSpawn%, 0.00%, 0.00%) of its original size
      • Unit - Add a 1.00 second Generic expiration timer to ST_TempUnit
      • Unit - Create 1 ST_DummyType for Neutral Passive at ST_TempPoint facing Default building facing degrees
      • Set ST_TempUnit = (Last created unit)
      • Set ST_TempUnit3 = (Triggering unit)
      • Special Effect - Create a special effect attached to the origin of ST_TempUnit using ST_TetherModel
      • Set ST_MaxIndex = (ST_MaxIndex + 1)
      • Set ST_OriginalCaster[ST_MaxIndex] = ST_TempUnit3
      • Set ST_TempReal = (Real((Level of ST_Spell for ST_TempUnit3)))
      • Set ST_SpecialEffect[ST_MaxIndex] = (Last created special effect)
      • Unit - Add a (ST_TetherDurationBase + (ST_TetherDurationPerLevel x ST_TempReal)) second Generic expiration timer to ST_TempUnit
      • Set ST_UndeadDuration[ST_MaxIndex] = (ST_UndeadDurationBase + (ST_UndeadDurationPerLevel x ST_TempReal))
      • Set ST_Core[ST_MaxIndex] = ST_TempUnit
      • Set ST_Aoe[ST_MaxIndex] = (ST_AoeBase + (ST_AoePerLevel x ST_TempReal))
      • Set ST_UnitIndex[ST_MaxIndex] = ST_TempUnit
      • Set ST_StageID[ST_MaxIndex] = 1
      • Set ST_TempInteger = (Integer((ST_Aoe[ST_MaxIndex] / ST_BarrierSpaceTaken)))
      • Set ST_TempReal = ST_Aoe[ST_MaxIndex]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ST_MaxIndex Equal to 1
        • Then - Actions
          • Trigger - Turn on Soul Tether Loop <gen>
        • Else - Actions
      • For each (Integer ST_Index) from 1 to ST_TempInteger, do (Actions)
        • Loop - Actions
          • Set ST_Angle = (ST_Angle + (360.00 / (Real(ST_TempInteger))))
          • Set ST_TempPoint2 = (ST_TempPoint offset by ST_TempReal towards ST_Angle degrees)
          • Unit - Create 1 ST_DummyType for Neutral Passive at ST_TempPoint2 facing Default building facing degrees
          • Set ST_TempUnit2 = (Last created unit)
          • Special Effect - Create a special effect attached to the origin of ST_TempUnit2 using ST_BarrierModel
          • Set ST_MaxIndex = (ST_MaxIndex + 1)
          • Set ST_StageID[ST_MaxIndex] = 3
          • Set ST_SpecialEffect[ST_MaxIndex] = (Last created special effect)
          • Set ST_OriginalCaster[ST_MaxIndex] = ST_TempUnit3
          • Set ST_UnitIndex[ST_MaxIndex] = ST_TempUnit2
          • Set ST_Core[ST_MaxIndex] = ST_TempUnit
          • Custom script: call RemoveLocation (udg_ST_TempPoint2)
      • Custom script: call RemoveLocation (udg_ST_TempPoint)
  • Soul Tether Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer ST_Index) from 1 to ST_MaxIndex, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ST_StageID[ST_Index] Equal to 1
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (ST_UnitIndex[ST_Index] is alive) Equal to True
                • Then - Actions
                  • Set ST_TempPoint = (Position of ST_UnitIndex[ST_Index])
                  • Set ST_TempGroup = (Units within ST_Aoe[ST_Index] of ST_TempPoint)
                  • Unit Group - Pick every unit in ST_TempGroup and do (Actions)
                    • Loop - Actions
                      • Set ST_TempUnit = (Picked unit)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (ST_TempUnit is A structure) Equal to False
                          • (ST_TempUnit is alive) Equal to True
                          • ((Unit-type of ST_TempUnit) is Magic Immune) Equal to False
                          • (ST_TempUnit belongs to an enemy of (Owner of ST_OriginalCaster[ST_Index])) Equal to True
                          • (Percentage life of ST_TempUnit) Less than or equal to ST_TriggeringHealthPercent
                          • (ST_TempUnit is A Hero) Equal to False
                          • (ST_TempUnit is A ground unit) Equal to True
                          • (ST_TempUnit is Mechanical) Equal to False
                        • Then - Actions
                          • Unit - Change ownership of ST_TempUnit to (Owner of ST_OriginalCaster[ST_Index]) and Change color
                          • Unit - Set life of ST_TempUnit to 100.00%
                          • Animation - Change ST_TempUnit's vertex coloring to (100.00%, 100.00%, 100.00%) with ST_UnitTransparency% transparency
                          • Unit - Add a ST_UndeadDuration[ST_Index] second Generic expiration timer to ST_TempUnit
                          • Unit - Make ST_TempUnit Explode on death
                          • Set ST_TempPoint2 = (Position of ST_TempUnit)
                          • Set ST_MaxIndex = (ST_MaxIndex + 1)
                          • Set ST_Core[ST_MaxIndex] = ST_UnitIndex[ST_Index]
                          • Set ST_OriginalCaster[ST_MaxIndex] = ST_OriginalCaster[ST_Index]
                          • Set ST_Aoe[ST_MaxIndex] = ST_Aoe[ST_Index]
                          • Set ST_UnitIndex[ST_MaxIndex] = ST_TempUnit
                          • Set ST_StageID[ST_MaxIndex] = 2
                          • Custom script: set udg_ST_TempX = GetUnitX(udg_ST_TempUnit)
                          • Custom script: set udg_ST_TempY = GetUnitY(udg_ST_TempUnit)
                          • Custom script: set udg_ST_TempX2 = GetUnitX(udg_ST_Core[udg_ST_Index])
                          • Custom script: set udg_ST_TempY2 = GetUnitY(udg_ST_Core[udg_ST_Index])
                          • Custom script: set udg_ST_TempZ = GetLocationZ(udg_ST_TempPoint2) + udg_ST_LightningZ
                          • Custom script: set udg_ST_TempZ2 = GetLocationZ(udg_ST_TempPoint) + udg_ST_LightningZ
                          • Custom script: set udg_ST_CurrentLightningEffect[udg_ST_MaxIndex] = AddLightningEx(udg_ST_LightningEffect, true, udg_ST_TempX2, udg_ST_TempY2, udg_ST_TempZ2, udg_ST_TempX, udg_ST_TempY, udg_ST_TempZ)
                          • Lightning - Change color of ST_CurrentLightningEffect[ST_MaxIndex] to (ST_LightningRed ST_LightningGreen ST_LightningBlue) with 1.00 alpha
                          • Custom script: call RemoveLocation (udg_ST_TempPoint2)
                        • Else - Actions
                  • Custom script: call RemoveLocation (udg_ST_TempPoint)
                  • Custom script: call DestroyGroup(udg_ST_TempGroup)
                • Else - Actions
                  • Set ST_UnitIDStorage = ST_UnitIndex[ST_Index]
                  • Special Effect - Create a special effect attached to the origin of ST_UnitIndex[ST_Index] using ST_DissappearenceSFX
                  • Special Effect - Destroy (Last created special effect)
                  • For each (Integer ST_SecondaryIndex) from 1 to ST_MaxIndex, do (Actions)
                    • Loop - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • ST_Core[ST_SecondaryIndex] Equal to ST_UnitIDStorage
                        • Then - Actions
                          • Unit - Add a 0.60 second Generic expiration timer to ST_UnitIndex[ST_SecondaryIndex]
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • ST_StageID[ST_SecondaryIndex] Equal to 2
                            • Then - Actions
                              • Lightning - Destroy ST_CurrentLightningEffect[ST_SecondaryIndex]
                            • Else - Actions
                              • Special Effect - Destroy ST_SpecialEffect[ST_SecondaryIndex]
                          • Set ST_OriginalCaster[ST_SecondaryIndex] = ST_OriginalCaster[ST_MaxIndex]
                          • Set ST_CurrentLightningEffect[ST_SecondaryIndex] = ST_CurrentLightningEffect[ST_MaxIndex]
                          • Set ST_SpecialEffect[ST_SecondaryIndex] = ST_SpecialEffect[ST_MaxIndex]
                          • Set ST_UndeadDuration[ST_SecondaryIndex] = ST_UndeadDuration[ST_MaxIndex]
                          • Set ST_Core[ST_SecondaryIndex] = ST_Core[ST_MaxIndex]
                          • Set ST_Aoe[ST_SecondaryIndex] = ST_Aoe[ST_MaxIndex]
                          • Set ST_UnitIndex[ST_SecondaryIndex] = ST_UnitIndex[ST_MaxIndex]
                          • Set ST_StageID[ST_SecondaryIndex] = ST_StageID[ST_MaxIndex]
                          • Set ST_MaxIndex = (ST_MaxIndex - 1)
                          • Set ST_SecondaryIndex = (ST_SecondaryIndex - 1)
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • ST_MaxIndex Equal to 0
                            • Then - Actions
                              • Trigger - Turn off (This trigger)
                            • Else - Actions
                        • Else - Actions
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ST_StageID[ST_Index] Equal to 2
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (ST_UnitIndex[ST_Index] is alive) Equal to True
                    • Then - Actions
                      • Set ST_TempPoint = (Position of ST_UnitIndex[ST_Index])
                      • Set ST_TempPoint2 = (Position of ST_Core[ST_Index])
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Distance between ST_TempPoint and ST_TempPoint2) Greater than ST_Aoe[ST_Index]
                        • Then - Actions
                          • Unit - Cause ST_OriginalCaster[ST_Index] to damage ST_UnitIndex[ST_Index], dealing (ST_HealthPenaltyPerSecond x 0.03) damage of attack type Spells and damage type Normal
                        • Else - Actions
                      • Custom script: set udg_ST_TempX = GetUnitX(udg_ST_UnitIndex[udg_ST_Index])
                      • Custom script: set udg_ST_TempY = GetUnitY(udg_ST_UnitIndex[udg_ST_Index])
                      • Custom script: set udg_ST_TempX2 = GetUnitX(udg_ST_Core[udg_ST_Index])
                      • Custom script: set udg_ST_TempY2 = GetUnitY(udg_ST_Core[udg_ST_Index])
                      • Custom script: call MoveLightningEx(udg_ST_CurrentLightningEffect[udg_ST_Index], true, udg_ST_TempX2, udg_ST_TempY2, udg_ST_TempZ2, udg_ST_TempX, udg_ST_TempY, udg_ST_TempZ)
                      • Custom script: call RemoveLocation (udg_ST_TempPoint2)
                      • Custom script: call RemoveLocation (udg_ST_TempPoint)
                    • Else - Actions
                      • Lightning - Destroy ST_CurrentLightningEffect[ST_Index]
                      • Set ST_OriginalCaster[ST_Index] = ST_OriginalCaster[ST_MaxIndex]
                      • Set ST_SpecialEffect[ST_Index] = ST_SpecialEffect[ST_MaxIndex]
                      • Set ST_UndeadDuration[ST_Index] = ST_UndeadDuration[ST_MaxIndex]
                      • Set ST_Core[ST_Index] = ST_Core[ST_MaxIndex]
                      • Set ST_Aoe[ST_Index] = ST_Aoe[ST_MaxIndex]
                      • Set ST_UnitIndex[ST_Index] = ST_UnitIndex[ST_MaxIndex]
                      • Set ST_StageID[ST_Index] = ST_StageID[ST_MaxIndex]
                      • Set ST_CurrentLightningEffect[ST_Index] = ST_CurrentLightningEffect[ST_MaxIndex]
                      • Set ST_MaxIndex = (ST_MaxIndex - 1)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • ST_MaxIndex Equal to 0
                        • Then - Actions
                          • Trigger - Turn off (This trigger)
                        • Else - Actions
                • Else - Actions
- Spirit Scorpions
  • Spirit Scorpions Configuration
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Do not touch --------
      • Hashtable - Create a hashtable
      • Set SS_Hash = (Last created hashtable)
      • -------- -------- --------
      • -------- Determines the area the eggs will be scattered on --------
      • Set SS_AoeBase = 150.00
      • Set SS_AoePerLevel = 50.00
      • -------- Determines the damage dealt by the curse being inflicted on the unit --------
      • Set SS_DamageBase = 50.00
      • Set SS_DamagePerLevel = 25.00
      • -------- Determines how long the curse will last for --------
      • Set SS_CurseDurationBase = 4.00
      • Set SS_CurseDurationPerLevel = 2.00
      • -------- Determines how many Eggs will be thrown --------
      • Set SS_EggCountBase = 6
      • Set SS_EggCountPerLevel = 2
      • -------- Determines how many attacks each Scorpion can make before disappearing --------
      • Set SS_AttackCountsBase = 0
      • Set SS_AttackCountsBasePerLevel = 1
      • -------- Determines how fast the eggs fly through the sky --------
      • Set SS_EggFlySpeed = 20.00
      • -------- Determines how long it takes for the eggs to hatch --------
      • Set SS_EggHatchTime = 1.00
      • -------- Determines the height of the arc in relevence to the distance the eggs being thrown will be --------
      • Set SS_HeightMultiplyer = 0.45
      • -------- Determines how close the spell must be casted at minimum --------
      • Set SS_MinRange = 200.00
      • -------- Determines the speed of the Scorpions chasing --------
      • Set SS_ScorpionRunSpeed = 4.00
      • -------- Determines the AOE in which the Scorpions will actively search for a target --------
      • Set SS_ScorpionSearchAoeBase = 200.00
      • Set SS_ScorpionSearchAoePerLevel = 50.00
      • -------- Determines the unit type used as the egg --------
      • Set SS_ScorpionEgg = Spirit Scorpion Egg
      • -------- Determines the unit type used as the Scorpion --------
      • Set SS_SpiritScorpion = Spirit Scorpion
      • -------- Determines the spell used to act as the activation spell --------
      • Set SS_Spell = Spirit Scorpions
      • -------- Determines the SFX used upon the Scorpions hatching --------
      • Set SS_HatchSFX = Abilities\Spells\Undead\DeathCoil\DeathCoilSpecialArt.mdl
      • -------- Determines the SFX used upon the Scorpions disappearing --------
      • Set SS_RemovalSFX = Abilities\Spells\Human\DispelMagic\DispelMagicTarget.mdl
      • -------- Determines the SFX used as the curse --------
      • Set SS_CurseSFX = Abilities\Spells\Undead\Curse\CurseTarget.mdl
  • Spirit Scorpions Activation
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to SS_Spell
    • Actions
      • -------- Target location setup --------
      • Set SS_U = (Triggering unit)
      • Set SS_TempPoint = (Position of SS_U)
      • Set SS_TempPoint2 = (Target point of ability being cast)
      • Set SS_TempReal = (Real((Level of SS_Spell for SS_U)))
      • Set SS_Angle = (Angle from SS_TempPoint to SS_TempPoint2)
      • -------- Minimum range check --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Distance between SS_TempPoint and SS_TempPoint2) Less than SS_MinRange
        • Then - Actions
          • Custom script: call RemoveLocation (udg_SS_TempPoint2)
          • Set SS_TempPoint2 = (SS_TempPoint offset by SS_MinRange towards SS_Angle degrees)
        • Else - Actions
      • -------- Egg creation --------
      • Set SS_EggCalc = (SS_EggCountBase + ((Integer(SS_TempReal)) x SS_EggCountPerLevel))
      • For each (Integer SS_i) from 1 to SS_EggCalc, do (Actions)
        • Loop - Actions
          • -------- Target selection --------
          • Set SS_TempPoint3 = (SS_TempPoint2 offset by (Random real number between 0.00 and (SS_AoeBase + (SS_TempReal x SS_AoePerLevel))) towards (Random angle) degrees)
          • Set SS_Angle = (Angle from SS_TempPoint to SS_TempPoint3)
          • -------- Creating Egg --------
          • Unit - Create 1 SS_ScorpionEgg for (Owner of SS_U) at SS_TempPoint facing SS_Angle degrees
          • -------- ------ --------
          • Set SS_TempU = (Last created unit)
          • Custom script: set udg_SS_UHandle = GetHandleId(udg_SS_TempU)
          • -------- Casting Unit ID --------
          • Hashtable - Save Handle OfSS_U as 1 of SS_UHandle in SS_Hash
          • -------- ------ --------
          • -------- Passing Parameters --------
          • -------- Saving the distance the egg will travel --------
          • Hashtable - Save (Distance between SS_TempPoint and SS_TempPoint3) as 2 of SS_UHandle in SS_Hash
          • -------- Saving the height the egg will reach in the arc --------
          • Hashtable - Save ((Distance between SS_TempPoint and SS_TempPoint3) x SS_HeightMultiplyer) as 3 of SS_UHandle in SS_Hash
          • -------- Saving the current distance travelled by the egg --------
          • Hashtable - Save 0.00 as 4 of SS_UHandle in SS_Hash
          • -------- Saving the damage of the curse --------
          • Hashtable - Save (SS_DamageBase + (SS_TempReal x SS_DamagePerLevel)) as 5 of SS_UHandle in SS_Hash
          • -------- Saving the duration of the Scorpion's curse --------
          • Hashtable - Save (SS_CurseDurationBase + (SS_TempReal x SS_CurseDurationPerLevel)) as 6 of SS_UHandle in SS_Hash
          • -------- Saving the search radius of the Scorpion --------
          • Hashtable - Save (SS_ScorpionSearchAoeBase + (SS_TempReal x SS_ScorpionSearchAoePerLevel)) as 7 of SS_UHandle in SS_Hash
          • -------- ------ --------
          • -------- Saving the amount of attacks possible by the Scorpion --------
          • Hashtable - Save (SS_AttackCountsBase + ((Integer(SS_TempReal)) x SS_AttackCountsBasePerLevel)) as 12 of SS_UHandle in SS_Hash
          • -------- Stage ID --------
          • Hashtable - Save 1 as 8 of SS_UHandle in SS_Hash
          • -------- ------ --------
          • -------- Setting up the egg for the loop --------
          • Unit Group - Add SS_TempU to SS_Scorpions
          • -------- ------ --------
          • -------- Leak removal --------
          • Custom script: call RemoveLocation (udg_SS_TempPoint3)
          • -------- ------ --------
      • -------- Leak removal --------
      • Custom script: call RemoveLocation (udg_SS_TempPoint2)
      • Custom script: call RemoveLocation (udg_SS_TempPoint)
      • -------- Starting the loop --------
      • Trigger - Turn on Spirit Scorpions Loop <gen>
  • Spirit Scorpions Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in SS_Scorpions and do (Actions)
        • Loop - Actions
          • -------- Setup --------
          • Set SS_U = (Picked unit)
          • Custom script: set udg_SS_UHandle = GetHandleId(udg_SS_U)
          • Set SS_TempU2 = (Load 1 of SS_UHandle in SS_Hash)
          • Set SS_TempInteger = (Load 8 of SS_UHandle from SS_Hash)
          • -------- ------ --------
          • -------- Stage 1 --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • SS_TempInteger Equal to 1
            • Then - Actions
              • -------- Movement --------
              • Custom script: set udg_SS_TempX = GetUnitX(udg_SS_U)
              • Custom script: set udg_SS_TempY = GetUnitY(udg_SS_U)
              • Set SS_Angle = (Facing of SS_U)
              • Custom script: call SetUnitX(udg_SS_U, udg_SS_TempX + udg_SS_EggFlySpeed * Cos(udg_SS_Angle * bj_DEGTORAD))
              • Custom script: call SetUnitY(udg_SS_U, udg_SS_TempY + udg_SS_EggFlySpeed * Sin(udg_SS_Angle * bj_DEGTORAD))
              • -------- ------ --------
              • -------- Fly Height Control --------
              • Set SS_RealCache[1] = (Load 2 of SS_UHandle from SS_Hash)
              • Set SS_RealCache[2] = (Load 3 of SS_UHandle from SS_Hash)
              • Set SS_RealCache[3] = ((Load 4 of SS_UHandle from SS_Hash) + SS_EggFlySpeed)
              • Hashtable - Save SS_RealCache[3] as 4 of SS_UHandle in SS_Hash
              • Set SS_RealCache[4] = (((4.00 x SS_RealCache[2]) / SS_RealCache[1]) x ((SS_RealCache[3] / SS_RealCache[1]) x (SS_RealCache[1] - SS_RealCache[3])))
              • Animation - Change SS_U flying height to SS_RealCache[4] at 0.00
              • -------- ------ --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • SS_RealCache[4] Less than 0.00
                • Then - Actions
                  • -------- Stage 2 Setup --------
                  • Hashtable - Save 2 as 8 of SS_UHandle in SS_Hash
                  • Unit - Add a SS_EggHatchTime second Generic expiration timer to SS_U
                  • -------- ------ --------
                • Else - Actions
            • Else - Actions
          • -------- ------ --------
          • -------- Stage 2 --------
          • -------- ------ --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • SS_TempInteger Equal to 2
              • (SS_U is dead) Equal to True
            • Then - Actions
              • Set SS_TempPoint = (Position of SS_U)
              • -------- Hatching SFX --------
              • Special Effect - Create a special effect at SS_TempPoint using SS_HatchSFX
              • Special Effect - Destroy (Last created special effect)
              • -------- ------ --------
              • -------- Hatching --------
              • Unit - Create 1 SS_SpiritScorpion for (Owner of SS_U) at SS_TempPoint facing 270.00 degrees
              • -------- ------ --------
              • Custom script: call RemoveLocation (udg_SS_TempPoint)
              • -------- Setup --------
              • Set SS_TempU = (Last created unit)
              • Custom script: set udg_SS_UHandleC = GetHandleId(udg_SS_TempU)
              • -------- ------ --------
              • -------- Passing Parameters --------
              • -------- Curse Damage --------
              • Hashtable - Save (Load 5 of SS_UHandle from SS_Hash) as 5 of SS_UHandleC in SS_Hash
              • -------- Curse Duration --------
              • Hashtable - Save (Load 6 of SS_UHandle from SS_Hash) as 6 of SS_UHandleC in SS_Hash
              • -------- Target search AOE --------
              • Hashtable - Save (Load 7 of SS_UHandle from SS_Hash) as 7 of SS_UHandleC in SS_Hash
              • -------- Amount of possible attacks --------
              • Hashtable - Save (Load 12 of SS_UHandle from SS_Hash) as 12 of SS_UHandleC in SS_Hash
              • -------- Current amount of attacks --------
              • Hashtable - Save 0 as 13 of SS_UHandle in SS_Hash
              • -------- Current Fade state --------
              • Hashtable - Save 0.00 as 11 of SS_UHandle in SS_Hash
              • -------- Stage ID --------
              • Hashtable - Save 3 as 8 of SS_UHandleC in SS_Hash
              • -------- ------ --------
              • -------- Casting Unit ID --------
              • Hashtable - Save Handle OfSS_TempU2 as 1 of SS_UHandleC in SS_Hash
              • -------- Target ID --------
              • Hashtable - Save Handle OfSS_TempU2 as 9 of SS_UHandleC in SS_Hash
              • -------- ------ --------
              • -------- Setting up unit groups --------
              • Unit Group - Add SS_TempU to SS_Scorpions
              • Unit Group - Remove SS_U from SS_Scorpions
              • -------- ------ --------
            • Else - Actions
          • -------- Stages 3 & 4 --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • SS_TempInteger Equal to 3
                  • SS_TempInteger Equal to 4
            • Then - Actions
              • -------- ------ --------
              • Set SS_TempU3 = (Load 9 of SS_UHandle in SS_Hash)
              • -------- Fading Control --------
              • Set SS_RealCache[5] = ((Load 11 of SS_UHandle from SS_Hash) + 0.20)
              • Animation - Change SS_U's vertex coloring to (100.00%, 100.00%, 100.00%) with SS_RealCache[5]% transparency
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • SS_RealCache[5] Greater than or equal to 80.00
                • Then - Actions
                  • -------- Unit cleanup --------
                  • Set SS_TempPoint = (Position of SS_U)
                  • -------- Unit disappear SFX --------
                  • Special Effect - Create a special effect at SS_TempPoint using SS_RemovalSFX
                  • Special Effect - Destroy (Last created special effect)
                  • Unit Group - Remove SS_U from SS_Scorpions
                  • Unit Group - Remove SS_TempU3 from SS_Targets
                  • -------- Trigger control --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Number of units in SS_Scorpions) Equal to 0
                    • Then - Actions
                      • Trigger - Turn off (This trigger)
                    • Else - Actions
                  • Hashtable - Clear all child hashtables of child SS_UHandle in SS_Hash
                  • Unit - Remove SS_U from the game
                  • -------- ------ --------
                  • Custom script: call RemoveLocation(udg_SS_TempPoint)
                • Else - Actions
              • Hashtable - Save SS_RealCache[5] as 11 of SS_UHandle in SS_Hash
              • Set SS_TempInteger2 = (Load 10 of SS_UHandle from SS_Hash)
              • -------- Stage 3 --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • SS_TempInteger Equal to 3
                • Then - Actions
                  • -------- Target finding --------
                  • Set SS_TempPoint = (Position of SS_U)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • SS_TempU3 Equal to SS_TempU2
                    • Then - Actions
                      • -------- Selection of possible targets --------
                      • Set SS_TempGroup = (Units within (Load 7 of SS_UHandle from SS_Hash) of SS_TempPoint)
                      • Unit Group - Pick every unit in SS_TempGroup and do (Actions)
                        • Loop - Actions
                          • -------- Target filter --------
                          • Set SS_TempU = (Picked unit)
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • SS_TempU3 Equal to SS_TempU2
                              • (SS_TempU is Magic Immune) Equal to False
                              • ((Unit-type of SS_TempU) is A structure) Equal to False
                              • (SS_TempU is A ground unit) Equal to True
                              • (SS_TempU is alive) Equal to True
                              • (SS_TempU belongs to an enemy of (Owner of SS_U)) Equal to True
                              • (SS_TempU is in SS_Targets) Equal to False
                              • (SS_TempU is in SS_Scorpions) Equal to False
                            • Then - Actions
                              • -------- Target setup --------
                              • Set SS_TempU3 = SS_TempU
                              • Hashtable - Save Handle OfSS_TempU3 as 9 of SS_UHandle in SS_Hash
                              • Hashtable - Save 30 as 10 of SS_UHandle in SS_Hash
                              • Unit Group - Add SS_TempU3 to SS_Targets
                            • Else - Actions
                      • Custom script: call DestroyGroup(udg_SS_TempGroup)
                    • Else - Actions
                      • -------- Animation Control --------
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • SS_TempInteger2 Equal to 30
                        • Then - Actions
                          • Animation - Play SS_U's morph animation
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • SS_TempInteger2 Equal to 60
                            • Then - Actions
                              • Animation - Play SS_U's morph alternate animation
                              • Hashtable - Save 0 as 10 of SS_UHandle in SS_Hash
                            • Else - Actions
                      • -------- Movement --------
                      • Set SS_TempPoint2 = (Position of SS_TempU3)
                      • Custom script: set udg_SS_TempX = GetUnitX(udg_SS_U)
                      • Custom script: set udg_SS_TempY = GetUnitY(udg_SS_U)
                      • Set SS_Angle = (Angle from SS_TempPoint to SS_TempPoint2)
                      • Custom script: call SetUnitX(udg_SS_U, udg_SS_TempX + udg_SS_ScorpionRunSpeed * Cos(udg_SS_Angle * bj_DEGTORAD))
                      • Custom script: call SetUnitY(udg_SS_U, udg_SS_TempY + udg_SS_ScorpionRunSpeed * Sin(udg_SS_Angle * bj_DEGTORAD))
                      • Custom script: call SetUnitFacing(udg_SS_U, udg_SS_Angle)
                      • -------- ------ --------
                      • -------- Animation control --------
                      • Hashtable - Save ((Load 10 of SS_UHandle from SS_Hash) + 1) as 10 of SS_UHandle in SS_Hash
                      • -------- Target within range check --------
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Distance between SS_TempPoint and SS_TempPoint2) Less than or equal to 90.00
                        • Then - Actions
                          • -------- Attack setup --------
                          • Hashtable - Save 4 as 8 of SS_UHandle in SS_Hash
                          • Hashtable - Save 30 as 10 of SS_UHandle in SS_Hash
                        • Else - Actions
                      • -------- ------ --------
                      • Custom script: call RemoveLocation (udg_SS_TempPoint2)
                  • -------- ------ --------
                  • Custom script: call RemoveLocation (udg_SS_TempPoint)
                • Else - Actions
              • -------- ------ --------
              • -------- Stage 4 --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • SS_TempInteger Equal to 4
                • Then - Actions
                  • -------- Animation control --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • SS_TempInteger2 Equal to 30
                    • Then - Actions
                      • Animation - Play SS_U's spell animation
                      • Hashtable - Save 0 as 10 of SS_UHandle in SS_Hash
                    • Else - Actions
                  • -------- Target Setup --------
                  • Custom script: set udg_SS_UHandleC = GetHandleId(udg_SS_TempU3)
                  • -------- Damage --------
                  • Unit - Cause SS_TempU2 to damage SS_TempU3, dealing (Load 5 of SS_UHandle from SS_Hash) damage of attack type Spells and damage type Normal
                  • -------- Curse setup --------
                  • Unit Group - Add SS_TempU3 to SS_Scorpions
                  • Hashtable - Save 5 as 8 of SS_UHandleC in SS_Hash
                  • Special Effect - Create a special effect attached to the overhead of SS_TempU3 using SS_CurseSFX
                  • -------- Saving curse effect --------
                  • Hashtable - Save Handle Of(Last created special effect) as 14 of SS_UHandleC in SS_Hash
                  • -------- Saving curse duration --------
                  • Hashtable - Save (Load 6 of SS_UHandle from SS_Hash) as 6 of SS_UHandleC in SS_Hash
                  • -------- Saving time to freeze countdown --------
                  • Hashtable - Save 100.00 as 15 of SS_UHandleC in SS_Hash
                  • -------- Saving Delayer Timer --------
                  • Hashtable - Save 0 as 16 of SS_UHandle in SS_Hash
                  • -------- Saving Current Curse duration timer --------
                  • Hashtable - Save 0.00 as 17 of SS_UHandleC in SS_Hash
                  • -------- Saving original caster as Target --------
                  • Hashtable - Save Handle OfSS_TempU2 as 9 of SS_UHandle in SS_Hash
                  • -------- Saving amount of attacks dealt --------
                  • Set SS_TempInteger2 = ((Load 13 of SS_UHandle from SS_Hash) + 1)
                  • Hashtable - Save SS_TempInteger2 as 13 of SS_UHandle in SS_Hash
                  • -------- New target find --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • SS_TempInteger2 Less than (Load 12 of SS_UHandle from SS_Hash)
                    • Then - Actions
                      • -------- New target setup --------
                      • Hashtable - Save 30 as 10 of SS_UHandle in SS_Hash
                      • Hashtable - Save 3 as 8 of SS_UHandle in SS_Hash
                    • Else - Actions
                      • -------- Unit cleanup --------
                      • Set SS_TempPoint = (Position of SS_U)
                      • -------- Disappear SFX --------
                      • Special Effect - Create a special effect at SS_TempPoint using SS_RemovalSFX
                      • Special Effect - Destroy (Last created special effect)
                      • Unit Group - Remove SS_U from SS_Scorpions
                      • Unit Group - Remove SS_TempU3 from SS_Targets
                      • -------- Trigger check --------
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Number of units in SS_Scorpions) Equal to 0
                        • Then - Actions
                          • Trigger - Turn off (This trigger)
                        • Else - Actions
                      • Hashtable - Clear all child hashtables of child SS_UHandle in SS_Hash
                      • Unit - Remove SS_U from the game
                      • -------- ------ --------
                      • Custom script: call RemoveLocation(udg_SS_TempPoint)
                • Else - Actions
              • -------- ------ --------
            • Else - Actions
          • -------- ------ --------
          • -------- Stages 5 & 6 --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (SS_U is dead) Equal to True
              • Or - Any (Conditions) are true
                • Conditions
                  • SS_TempInteger Equal to 5
                  • SS_TempInteger Equal to 6
            • Then - Actions
              • -------- Death cleanup --------
              • Animation - Change SS_U's animation speed to 100.00% of its original speed
              • Unit Group - Remove SS_U from SS_Targets
              • Special Effect - Destroy (Load 14 of SS_UHandle in SS_Hash)
              • Hashtable - Clear all child hashtables of child SS_UHandle in SS_Hash
              • -------- Trigger check --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in SS_Scorpions) Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
              • -------- Stage 5 --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Load 8 of SS_UHandle from SS_Hash) Equal to 5
                • Then - Actions
                  • -------- Current freeze Countdown setting --------
                  • Set SS_RealCache[6] = ((Load 15 of SS_UHandle from SS_Hash) - 1.00)
                  • -------- Animation slowing --------
                  • Animation - Change SS_U's animation speed to SS_RealCache[6]% of its original speed
                  • -------- Sacing current countdown --------
                  • Hashtable - Save SS_RealCache[6] as 15 of SS_UHandle in SS_Hash
                  • -------- Countdown complete --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • SS_RealCache[6] Equal to 0.00
                    • Then - Actions
                      • -------- Freezing unit --------
                      • Unit - Pause SS_U
                      • -------- Stage ID --------
                      • Hashtable - Save 6 as 8 of SS_UHandle in SS_Hash
                      • -------- ------ --------
                    • Else - Actions
                • Else - Actions
              • -------- ------ --------
              • -------- Stage 6 --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Load 8 of SS_UHandle from SS_Hash) Equal to 6
                • Then - Actions
                  • -------- Unfreeze timer --------
                  • Set SS_TempInteger2 = (Load 16 of SS_UHandle from SS_Hash)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • SS_TempInteger2 Equal to 20
                    • Then - Actions
                      • -------- Delayer reset --------
                      • Hashtable - Save 0 as 16 of SS_UHandle in SS_Hash
                      • -------- Current Curse duration expired increase --------
                      • Set SS_TempReal = ((Load 17 of SS_UHandle from SS_Hash) + 1.00)
                      • Hashtable - Save SS_TempReal as 17 of SS_UHandle in SS_Hash
                      • -------- Curse end check --------
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • SS_TempReal Greater than or equal to (Load 6 of SS_UHandle from SS_Hash)
                        • Then - Actions
                          • -------- Spell cleanup --------
                          • Unit - Unpause SS_U
                          • Animation - Change SS_U's animation speed to 100.00% of its original speed
                          • Special Effect - Destroy (Load 14 of SS_UHandle in SS_Hash)
                          • Unit Group - Remove SS_U from SS_Targets
                          • Unit Group - Remove SS_U from SS_Scorpions
                          • Hashtable - Clear all child hashtables of child SS_UHandle in SS_Hash
                          • -------- Trigger check --------
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Number of units in SS_Scorpions) Equal to 0
                            • Then - Actions
                              • Trigger - Turn off (This trigger)
                            • Else - Actions
                        • Else - Actions
                    • Else - Actions
                      • -------- Delayer Increase --------
                      • Hashtable - Save (SS_TempInteger2 + 1) as 16 of SS_UHandle in SS_Hash
                • Else - Actions
              • -------- ------ --------
          • -------- ------ --------
- Volcanic Crush
  • Volcanic Crush
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- -------- --------
      • -------- Theme Controls --------
      • -------- Randomise Theme --------
      • Set VC_Conditions[0] = False
      • -------- Cycle Themes --------
      • Set VC_Conditions[1] = True
      • -------- If cycle themes is set to False, this determines which Theme will be used --------
      • Set VC_DefaultTheme = 1
      • -------- Total amount of themes available (for randomisation) --------
      • Set VC_SpellsThemeCount = 3
      • -------- Damage Health --------
      • Set VC_Conditions[2] = True
      • -------- Damage Mana --------
      • Set VC_Conditions[3] = True
      • -------- Determines the targets available for the spell --------
      • -------- Target is alive --------
      • Set VC_Conditions[4] = True
      • -------- Target is Magic Immune --------
      • Set VC_Conditions[5] = False
      • -------- Target is Structure --------
      • Set VC_Conditions[6] = False
      • -------- Target is Ground unit --------
      • Set VC_Conditions[7] = True
      • -------- Target is Belongs to an enemy --------
      • Set VC_Conditions[8] = True
      • -------- Spin Clockwise/Spin AntiClockwise --------
      • Set VC_Conditions[9] = True
      • -------- Rock spin TrueSpeed/TimeSpeed --------
      • Set VC_Conditions[10] = False
      • -------- Rock fall TrueSpeed/TimeSpeed --------
      • Set VC_Conditions[11] = True
      • -------- Controls the Distance of the spinning sub-rocks from the centre --------
      • Set VC_RockDistanceBase = 150.00
      • Set VC_RockDistancePerLevel = 0.00
      • -------- Controls the Spinning speed of the rocks --------
      • Set VC_RockSpinSpeedBase = 7.00
      • Set VC_RockSpinSpeedPerLevel = 0.00
      • Set VC_ActivatedSpeedMultiplyer = 1.50
      • Set VC_RockSpinIncomingTimeBase = 1.50
      • Set VC_RockSpinIncomingTimePL = 0.00
      • -------- Controls the facing of the rocks (relative to the direction and from the target) --------
      • Set VC_RockFacingAngle = 90.00
      • -------- Determines the area that the Rock will damage upon falling --------
      • Set VC_AoeBase = 150.00
      • Set VC_AoePerLevel = 25.00
      • -------- Determines The Z offset of the various parts --------
      • Set VC_ZHeightSubRocksBase = 200.00
      • Set VC_ZHeightSubRocksPerLevel = 0.00
      • Set VC_ZHeightVolRockBase = 300.00
      • Set VC_ZHeightVolRockPerLevel = 0.00
      • -------- Determines the amount of Drain areas created --------
      • Set VC_SpinningRocksBase = 5
      • Set VC_SpinningRocksPerLevel = 0
      • -------- Determines how much Health damage a unit takes per second --------
      • Set VC_HealthDamageBase = 300.00
      • Set VC_HealthDamagePerLevel = 40.00
      • -------- Determines how much Mana damage a unit takes per second --------
      • Set VC_ManaDamageBase = 0.00
      • Set VC_ManaDamagePerLevel = 0.00
      • -------- Determines the Falling speed of the rock --------
      • Set VC_VolRockFallSpeedBase = 200.00
      • Set VC_VolRockFallSpeedPerLevel = 0.00
      • Set VC_VolRockFallIncomingTimeBase = 3.00
      • Set VC_VolRockFallIncomingTimePL = 0.00
      • Set VC_ImpactHeight = 90.00
      • -------- Determines the Max scaling of the rock --------
      • Set VC_EffectScalingVolRockMaxBase = 1000.00
      • Set VC_EffectScalingVolRockMaxPL = 300.00
      • -------- Determines the scaling of the spinning sub-rocks --------
      • Set VC_EffectScalingSpinRocksBase = 150.00
      • Set VC_EffectScalingSpinRocksPL = 0.00
      • -------- Determines the scaling of the Rock at the start of the spell --------
      • Set VC_EffectScalingVolRockBase = 0.00
      • Set VC_EffectScalingVolRockPL = 0.00
      • -------- Determines the scaling increase of the rock per second --------
      • Set VC_EffectScalingVolSpeedBase = 100.00
      • Set VC_EffectScalingVolSpeedPL = 100.00
      • -------- Determines the scaling of the explosion --------
      • Set VC_EffectScalingExplosionBase = 200.00
      • Set VC_EffectScalingExplosionPL = 50.00
      • -------- Determines the SFX used as the Volcanic Rock --------
      • Set VC_CrushingRockSFX[1] = Abilities\Weapons\BloodElfMissile\BloodElfMissile.mdl
      • Set VC_CrushingRockSFX[2] = Abilities\Weapons\BloodElfMissile\BloodElfMissile.mdl
      • Set VC_CrushingRockSFX[3] = Abilities\Weapons\BloodElfMissile\BloodElfMissile.mdl
      • -------- Determines the SFX used as the Summoning sfx --------
      • Set VC_SummonSFX[1] = Abilities\Spells\Other\Incinerate\FireLordDeathExplode.mdl
      • Set VC_SummonSFX[2] = Abilities\Spells\Other\Incinerate\FireLordDeathExplode.mdl
      • Set VC_SummonSFX[3] = Abilities\Spells\Other\Incinerate\FireLordDeathExplode.mdl
      • -------- Determines the unit model used for the spinning rocks --------
      • Set VC_SpinningRocksSFX[1] = Abilities\Weapons\LavaSpawnMissile\LavaSpawnMissile.mdl
      • Set VC_SpinningRocksSFX[2] = Abilities\Weapons\LavaSpawnMissile\LavaSpawnMissile.mdl
      • Set VC_SpinningRocksSFX[3] = Abilities\Weapons\LavaSpawnMissile\LavaSpawnMissile.mdl
      • -------- Determines the unit model used as the Explosion --------
      • Set VC_EndSpellSFX[1] = Abilities\Spells\Other\Incinerate\FireLordDeathExplode.mdl
      • Set VC_EndSpellSFX[2] = Abilities\Spells\Other\Incinerate\FireLordDeathExplode.mdl
      • Set VC_EndSpellSFX[3] = Abilities\Spells\Other\Incinerate\FireLordDeathExplode.mdl
      • -------- Determines the unit model used when the spell stops channeling --------
      • Set VC_EndChannelSFX[1] = Abilities\Spells\Other\Incinerate\FireLordDeathExplode.mdl
      • Set VC_EndChannelSFX[2] = Abilities\Spells\Other\Incinerate\FireLordDeathExplode.mdl
      • Set VC_EndChannelSFX[3] = Abilities\Spells\Other\Incinerate\FireLordDeathExplode.mdl
      • -------- Determines how fast dummys are removed (needs to be about a second and a half to allow ending effects to occur) --------
      • Set VC_ExpireTime = 1.50
      • -------- Determines the unit model use when the effect is cancelled early --------
      • Set VC_Spell = Volcanic Crush
      • -------- Determines the order string of the spell used (should match ability used as a base) --------
      • Set VC_Order = channel
      • -------- Determines the Dummy used to attach all the effects to --------
      • Set VC_DummyType = Volcanic Crush
      • -------- -------- --------
      • -------- Determines the Speed of the loop trigger --------
      • Set VC_TimerSpeed = 0.03
      • Trigger - Add to Volcanic Crush Loop <gen> the event (Time - Every VC_TimerSpeed seconds of game time)
      • -------- -------- --------
  • Volcanic Crush Activation
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to VC_Spell
    • Actions
      • Set VC_TempUnit2 = (Triggering unit)
      • Set VC_TempUnit3 = (Target unit of ability being cast)
      • Set VC_TempPlayer = (Owner of VC_TempUnit2)
      • Set VC_TempInteger2 = (Level of VC_Spell for VC_TempUnit2)
      • Set VC_TempReal = (Real(VC_TempInteger2))
      • Set VC_TempReal2 = 0.00
      • Set VC_TempInteger = (VC_SpinningRocksBase + (VC_SpinningRocksPerLevel x (Integer(VC_TempReal))))
      • Set VC_TempReal3 = (360.00 / (Real(VC_TempInteger)))
      • Set VC_TempPoint2 = (Position of VC_TempUnit3)
      • -------- Identifies if you want the theme to change upon level up, randomly, or not at all --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • VC_Conditions[0] Equal to True
        • Then - Actions
          • Set VC_TempInteger2 = (Random integer number between 1 and VC_SpellsThemeCount)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • VC_Conditions[1] Equal to False
            • Then - Actions
              • Set VC_TempInteger2 = VC_DefaultTheme
            • Else - Actions
      • -------- Deactivates any previous casts --------
      • For each (Integer VC_Index) from 1 to VC_MaxIndex, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • VC_OriginalCaster[VC_Index] Equal to VC_TempUnit2
              • VC_StageID[VC_Index] Equal to 1
            • Then - Actions
              • Special Effect - Create a special effect attached to the origin of VC_UnitIndex[VC_Index] using VC_EndChannelSFX[VC_Index]
              • Special Effect - Destroy (Last created special effect)
              • Set VC_StageID[VC_Index] = 2
            • Else - Actions
      • -------- Spinning sub-rocks creation --------
      • For each (Integer VC_Index) from 1 to VC_TempInteger, do (Actions)
        • Loop - Actions
          • Set VC_TempReal2 = (VC_TempReal2 + VC_TempReal3)
          • Set VC_MaxIndex = (VC_MaxIndex + 1)
          • Set VC_RockDistance[VC_MaxIndex] = (VC_RockDistanceBase + (VC_RockDistancePerLevel x VC_TempReal))
          • Set VC_TempPoint = (VC_TempPoint2 offset by VC_RockDistance[VC_MaxIndex] towards VC_TempReal2 degrees)
          • Set VC_CurrentAngle[VC_MaxIndex] = (Angle from VC_TempPoint2 to VC_TempPoint)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • VC_Conditions[10] Equal to True
            • Then - Actions
              • Set VC_RockSpinSpeed[VC_MaxIndex] = (VC_RockSpinSpeedBase + (VC_RockSpinSpeedPerLevel x VC_TempReal))
            • Else - Actions
              • Set VC_RockSpinSpeed[VC_MaxIndex] = ((360.00 x VC_TimerSpeed) / (VC_RockSpinIncomingTimeBase + (VC_RockSpinIncomingTimePL x VC_TempReal)))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • VC_Conditions[9] Equal to True
            • Then - Actions
              • Set VC_Rotation[VC_MaxIndex] = (VC_RockFacingAngle x -1.00)
              • Set VC_RockSpinSpeed[VC_MaxIndex] = (VC_RockSpinSpeed[VC_MaxIndex] x -1.00)
            • Else - Actions
              • Set VC_Rotation[VC_MaxIndex] = VC_RockFacingAngle
          • Unit - Create 1 VC_DummyType for VC_TempPlayer at VC_TempPoint facing (VC_CurrentAngle[VC_MaxIndex] + VC_Rotation[VC_MaxIndex]) degrees
          • Set VC_TempUnit = (Last created unit)
          • Custom script: call SetUnitFacing(udg_VC_TempUnit, udg_VC_CurrentAngle[udg_VC_Index] + udg_VC_Rotation[udg_VC_Index])
          • Animation - Change VC_TempUnit's size to ((VC_EffectScalingSpinRocksBase + (VC_EffectScalingSpinRocksPL x VC_TempReal))%, 0.00%, 0.00%) of its original size
          • Special Effect - Create a special effect attached to the origin of VC_TempUnit using VC_SummonSFX[VC_TempInteger2]
          • Special Effect - Destroy (Last created special effect)
          • Special Effect - Create a special effect attached to the origin of VC_TempUnit using VC_SpinningRocksSFX[VC_TempInteger2]
          • Set VC_SpecialEffect[VC_MaxIndex] = (Last created special effect)
          • Set VC_OriginalCaster[VC_MaxIndex] = VC_TempUnit2
          • Set VC_ZHeight[VC_MaxIndex] = (VC_ZHeightSubRocksBase + (VC_ZHeightSubRocksPerLevel x VC_TempReal))
          • Animation - Change VC_TempUnit flying height to VC_ZHeight[VC_MaxIndex] at 0.00
          • Set VC_VolRock[VC_MaxIndex] = False
          • Set VC_Target[VC_MaxIndex] = VC_TempUnit3
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • VC_Conditions[11] Equal to True
            • Then - Actions
              • Set VC_FallSpeed[VC_MaxIndex] = ((VC_VolRockFallSpeedBase + (VC_VolRockFallSpeedPerLevel x VC_TempReal)) x VC_TimerSpeed)
            • Else - Actions
              • Set VC_RockSpinSpeed[VC_MaxIndex] = ((VC_ZHeight[VC_MaxIndex] x VC_TimerSpeed) / (VC_VolRockFallIncomingTimeBase + (VC_VolRockFallIncomingTimePL x VC_TempReal)))
          • Set VC_GrowthSpeed[VC_MaxIndex] = ((VC_EffectScalingVolSpeedBase + (VC_EffectScalingVolSpeedPL x VC_TempReal)) x VC_TimerSpeed)
          • Set VC_MaxSize[VC_MaxIndex] = (VC_EffectScalingVolRockMaxBase + (VC_EffectScalingVolRockMaxPL x VC_TempReal))
          • Set VC_ExpirationTimer[VC_MaxIndex] = 0.00
          • Set VC_ZHeight[VC_MaxIndex] = (VC_ZHeightVolRockBase + (VC_ZHeightVolRockPerLevel x VC_TempReal))
          • Set VC_CurrentSize[VC_MaxIndex] = 0.00
          • Set VC_Theme[VC_MaxIndex] = VC_TempInteger2
          • Custom script: set udg_VC_CasterX[udg_VC_MaxIndex] = GetUnitX(udg_VC_TempUnit2)
          • Custom script: set udg_VC_CasterY[udg_VC_MaxIndex] = GetUnitY(udg_VC_TempUnit2)
          • Set VC_UnitIndex[VC_MaxIndex] = VC_TempUnit
          • Set VC_StageID[VC_MaxIndex] = 1
          • Custom script: call RemoveLocation (udg_VC_TempPoint)
          • Custom script: set udg_VC_TempPoint = null
      • -------- Main Rock creation --------
      • Set VC_MaxIndex = (VC_MaxIndex + 1)
      • Unit - Create 1 VC_DummyType for VC_TempPlayer at VC_TempPoint2 facing (VC_CurrentAngle[VC_MaxIndex] + VC_Rotation[VC_MaxIndex]) degrees
      • Set VC_TempUnit = (Last created unit)
      • Animation - Change VC_TempUnit's size to ((VC_EffectScalingVolRockBase + (VC_EffectScalingVolRockPL x VC_TempReal))%, 0.00%, 0.00%) of its original size
      • Special Effect - Create a special effect attached to the origin of VC_TempUnit using VC_CrushingRockSFX[VC_TempInteger2]
      • Set VC_SpecialEffect[VC_MaxIndex] = (Last created special effect)
      • Set VC_OriginalCaster[VC_MaxIndex] = VC_TempUnit2
      • Set VC_ZHeight[VC_MaxIndex] = (VC_ZHeightVolRockBase + (VC_ZHeightVolRockPerLevel x VC_TempReal))
      • Animation - Change VC_TempUnit flying height to VC_ZHeight[VC_MaxIndex] at 0.00
      • Set VC_VolRock[VC_MaxIndex] = True
      • Set VC_Target[VC_MaxIndex] = VC_TempUnit3
      • Set VC_CurrentAngle[VC_MaxIndex] = 0.00
      • Set VC_GrowthSpeed[VC_MaxIndex] = ((VC_EffectScalingVolSpeedBase + (VC_EffectScalingVolSpeedPL x VC_TempReal)) x VC_TimerSpeed)
      • Set VC_AOE[VC_MaxIndex] = (VC_AoeBase + (VC_AoePerLevel x VC_TempReal))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • VC_Conditions[11] Equal to True
        • Then - Actions
          • Set VC_FallSpeed[VC_MaxIndex] = ((VC_VolRockFallSpeedBase + (VC_VolRockFallSpeedPerLevel x VC_TempReal)) x VC_TimerSpeed)
        • Else - Actions
          • Set VC_FallSpeed[VC_MaxIndex] = ((VC_ZHeight[VC_MaxIndex] x VC_TimerSpeed) / (VC_VolRockFallIncomingTimeBase + (VC_VolRockFallIncomingTimePL x VC_TempReal)))
      • Set VC_HealthDamage[VC_MaxIndex] = (VC_HealthDamageBase + (VC_HealthDamagePerLevel x VC_TempReal))
      • Set VC_ManaDamage[VC_MaxIndex] = (VC_ManaDamageBase + (VC_ManaDamagePerLevel x VC_TempReal))
      • Set VC_ExplosionScale[VC_MaxIndex] = (VC_EffectScalingExplosionBase + (VC_EffectScalingExplosionPL x VC_TempReal))
      • Set VC_ExpirationTimer[VC_MaxIndex] = 0.00
      • Set VC_RockDistance[VC_MaxIndex] = 0.00
      • Set VC_MaxSize[VC_MaxIndex] = (VC_EffectScalingVolRockMaxBase + (VC_EffectScalingVolRockMaxPL x VC_TempReal))
      • Set VC_CurrentSize[VC_MaxIndex] = 0.00
      • Set VC_Theme[VC_MaxIndex] = VC_TempInteger2
      • Custom script: set udg_VC_CasterX[udg_VC_MaxIndex] = GetUnitX(udg_VC_TempUnit2)
      • Custom script: set udg_VC_CasterY[udg_VC_MaxIndex] = GetUnitY(udg_VC_TempUnit2)
      • Set VC_UnitIndex[VC_MaxIndex] = VC_TempUnit
      • Set VC_StageID[VC_MaxIndex] = 1
      • Custom script: call RemoveLocation (udg_VC_TempPoint2)
      • Custom script: set udg_VC_TempPoint2 = null
      • -------- Activates the loop --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Volcanic Crush Loop <gen> is on) Equal to False
          • VC_MaxIndex Greater than or equal to 1
        • Then - Actions
          • Trigger - Turn on Volcanic Crush Loop <gen>
        • Else - Actions
  • Volcanic Crush Loop
    • Events
    • Conditions
    • Actions
      • For each (Integer VC_Index) from 1 to VC_MaxIndex, do (Actions)
        • Loop - Actions
          • -------- Growth/Spin Controls --------
          • Set VC_TempUnit = VC_UnitIndex[VC_Index]
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • VC_StageID[VC_Index] Equal to 1
            • Then - Actions
              • Custom script: set udg_VC_TempX = GetUnitX(udg_VC_Target[udg_VC_Index])
              • Custom script: set udg_VC_TempY = GetUnitY(udg_VC_Target[udg_VC_Index])
              • Set VC_CurrentSize[VC_Index] = (VC_CurrentSize[VC_Index] + VC_GrowthSpeed[VC_Index])
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • VC_VolRock[VC_Index] Equal to True
                • Then - Actions
                  • Animation - Change VC_TempUnit's size to (VC_CurrentSize[VC_Index]%, 0.00%, 0.00%) of its original size
                  • Custom script: set udg_VC_Angle = 0.00
                • Else - Actions
                  • Custom script: set udg_VC_CurrentAngle[udg_VC_Index] = udg_VC_CurrentAngle[udg_VC_Index] + udg_VC_RockSpinSpeed[udg_VC_Index]
                  • Custom script: call SetUnitFacing(udg_VC_TempUnit, udg_VC_CurrentAngle[udg_VC_Index] + udg_VC_Rotation[udg_VC_Index])
                  • Custom script: set udg_VC_Angle = udg_VC_CurrentAngle[udg_VC_Index] * bj_DEGTORAD
              • Custom script: call SetUnitX(udg_VC_TempUnit, udg_VC_TempX + udg_VC_RockDistance[udg_VC_Index] * Cos(udg_VC_Angle))
              • Custom script: call SetUnitY(udg_VC_TempUnit, udg_VC_TempY + udg_VC_RockDistance[udg_VC_Index] * Sin(udg_VC_Angle))
              • Custom script: set udg_VC_TempX = GetUnitX(udg_VC_OriginalCaster[udg_VC_Index])
              • Custom script: set udg_VC_TempY = GetUnitY(udg_VC_OriginalCaster[udg_VC_Index])
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • VC_CurrentSize[VC_Index] Greater than or equal to VC_MaxSize[VC_Index]
                      • (Current order of VC_OriginalCaster[VC_Index]) Not equal to (Order(VC_Order))
                      • VC_CasterX[VC_Index] Not equal to VC_TempX
                      • VC_CasterY[VC_Index] Not equal to VC_TempY
                • Then - Actions
                  • Special Effect - Create a special effect attached to the origin of VC_TempUnit using VC_EndChannelSFX[VC_Theme[VC_Index]]
                  • Special Effect - Destroy (Last created special effect)
                  • Set VC_StageID[VC_Index] = 2
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • VC_VolRock[VC_Index] Equal to False
                    • Then - Actions
                      • Set VC_RockSpinSpeed[VC_Index] = (VC_RockSpinSpeed[VC_Index] x VC_ActivatedSpeedMultiplyer)
                      • Custom script: set udg_VC_TargetX[udg_VC_Index] = GetUnitX(udg_VC_Target[udg_VC_Index])
                      • Custom script: set udg_VC_TargetY[udg_VC_Index] = GetUnitY(udg_VC_Target[udg_VC_Index])
                    • Else - Actions
                      • Set VC_HealthDamage[VC_Index] = ((VC_CurrentSize[VC_Index] / VC_MaxSize[VC_Index]) x VC_HealthDamage[VC_Index])
                • Else - Actions
              • Custom script: set udg_VC_CasterX[udg_VC_Index] = udg_VC_TempX
              • Custom script: set udg_VC_CasterY[udg_VC_Index] = udg_VC_TempY
            • Else - Actions
              • -------- Falling/Detonation --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • VC_StageID[VC_Index] Equal to 2
                • Then - Actions
                  • Set VC_ZHeight[VC_Index] = (VC_ZHeight[VC_Index] - VC_FallSpeed[VC_Index])
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • VC_VolRock[VC_Index] Equal to True
                    • Then - Actions
                      • Animation - Change VC_TempUnit flying height to VC_ZHeight[VC_Index] at 0.00
                    • Else - Actions
                      • Custom script: set udg_VC_CurrentAngle[udg_VC_Index] = udg_VC_CurrentAngle[udg_VC_Index] + udg_VC_RockSpinSpeed[udg_VC_Index]
                      • Custom script: call SetUnitFacing(udg_VC_TempUnit, udg_VC_CurrentAngle[udg_VC_Index] + udg_VC_Rotation[udg_VC_Index])
                      • Custom script: set udg_VC_Angle = udg_VC_CurrentAngle[udg_VC_Index] * bj_DEGTORAD
                      • Custom script: call SetUnitX(udg_VC_TempUnit, udg_VC_TargetX[udg_VC_Index] + udg_VC_RockDistance[udg_VC_Index] * Cos(udg_VC_Angle))
                      • Custom script: call SetUnitY(udg_VC_TempUnit, udg_VC_TargetY[udg_VC_Index] + udg_VC_RockDistance[udg_VC_Index] * Sin(udg_VC_Angle))
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • VC_ZHeight[VC_Index] Less than or equal to VC_ImpactHeight
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • VC_VolRock[VC_Index] Equal to True
                        • Then - Actions
                          • Animation - Change VC_TempUnit's size to (VC_ExplosionScale[VC_Index]%, 0.00%, 0.00%) of its original size
                          • Animation - Change VC_TempUnit flying height to 0.00 at 0.00
                          • Set VC_TempPoint = (Position of VC_TempUnit)
                          • Set VC_TempGroup = (Units within VC_AOE[VC_Index] of VC_TempPoint)
                          • Unit Group - Pick every unit in VC_TempGroup and do (Actions)
                            • Loop - Actions
                              • Set VC_TempUnit2 = (Picked unit)
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (VC_TempUnit2 is alive) Equal to VC_Conditions[4]
                                  • (VC_TempUnit2 is Magic Immune) Equal to VC_Conditions[5]
                                  • (VC_TempUnit2 is A structure) Equal to VC_Conditions[6]
                                  • (VC_TempUnit2 is A ground unit) Equal to VC_Conditions[7]
                                  • (VC_TempUnit2 belongs to an enemy of (Owner of VC_OriginalCaster[VC_Index])) Equal to VC_Conditions[8]
                                • Then - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • VC_Conditions[2] Equal to True
                                    • Then - Actions
                                      • Unit - Cause VC_OriginalCaster[VC_Index] to damage VC_TempUnit2, dealing VC_HealthDamage[VC_Index] damage of attack type Spells and damage type Normal
                                    • Else - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • VC_Conditions[3] Equal to True
                                    • Then - Actions
                                      • Unit - Set mana of VC_TempUnit2 to ((Mana of VC_TempUnit2) - VC_ManaDamage[VC_Index])
                                    • Else - Actions
                                • Else - Actions
                          • Set VC_StageID[VC_Index] = 3
                          • Custom script: call RemoveLocation (udg_VC_TempPoint)
                          • Custom script: call DestroyGroup (udg_VC_TempGroup)
                          • Custom script: set udg_VC_TempGroup = null
                          • Custom script: set udg_VC_TempPoint = null
                        • Else - Actions
                      • Special Effect - Create a special effect attached to the origin of VC_TempUnit using VC_EndSpellSFX[VC_Theme[VC_Index]]
                      • Special Effect - Destroy (Last created special effect)
                      • Set VC_StageID[VC_Index] = 3
                      • Special Effect - Destroy VC_SpecialEffect[VC_Index]
                    • Else - Actions
                • Else - Actions
                  • -------- Cleanup --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • VC_StageID[VC_Index] Equal to 3
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • VC_ExpirationTimer[VC_Index] Greater than or equal to VC_ExpireTime
                        • Then - Actions
                          • Unit - Remove VC_TempUnit from the game
                          • Set VC_SpecialEffect[VC_Index] = VC_SpecialEffect[VC_MaxIndex]
                          • Set VC_OriginalCaster[VC_Index] = VC_OriginalCaster[VC_MaxIndex]
                          • Set VC_ZHeight[VC_Index] = VC_ZHeight[VC_MaxIndex]
                          • Set VC_VolRock[VC_Index] = VC_VolRock[VC_MaxIndex]
                          • Set VC_ExpirationTimer[VC_Index] = VC_ExpirationTimer[VC_MaxIndex]
                          • Set VC_Target[VC_Index] = VC_Target[VC_MaxIndex]
                          • Set VC_GrowthSpeed[VC_Index] = VC_GrowthSpeed[VC_MaxIndex]
                          • Set VC_FallSpeed[VC_Index] = VC_FallSpeed[VC_MaxIndex]
                          • Set VC_ExplosionScale[VC_Index] = VC_ExplosionScale[VC_MaxIndex]
                          • Set VC_CurrentAngle[VC_Index] = VC_CurrentAngle[VC_MaxIndex]
                          • Set VC_HealthDamage[VC_Index] = VC_HealthDamage[VC_MaxIndex]
                          • Set VC_Rotation[VC_Index] = VC_Rotation[VC_MaxIndex]
                          • Set VC_RockDistance[VC_Index] = VC_RockDistance[VC_MaxIndex]
                          • Set VC_RockSpinSpeed[VC_Index] = VC_RockSpinSpeed[VC_MaxIndex]
                          • Set VC_ManaDamage[VC_Index] = VC_ManaDamage[VC_MaxIndex]
                          • Set VC_AOE[VC_Index] = VC_AOE[VC_MaxIndex]
                          • Set VC_ExplosionScale[VC_Index] = VC_ExplosionScale[VC_MaxIndex]
                          • Set VC_MaxSize[VC_Index] = VC_MaxSize[VC_MaxIndex]
                          • Set VC_CurrentSize[VC_Index] = VC_CurrentSize[VC_MaxIndex]
                          • Set VC_Theme[VC_Index] = VC_Theme[VC_MaxIndex]
                          • Set VC_CasterX[VC_Index] = VC_CasterX[VC_MaxIndex]
                          • Set VC_CasterY[VC_Index] = VC_CasterY[VC_MaxIndex]
                          • Set VC_TargetX[VC_Index] = VC_TargetX[VC_MaxIndex]
                          • Set VC_TargetY[VC_Index] = VC_TargetY[VC_MaxIndex]
                          • Set VC_UnitIndex[VC_Index] = VC_UnitIndex[VC_MaxIndex]
                          • Set VC_StageID[VC_Index] = VC_StageID[VC_MaxIndex]
                          • Set VC_MaxIndex = (VC_MaxIndex - 1)
                          • Set VC_Index = (VC_Index - 1)
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • VC_MaxIndex Equal to 0
                            • Then - Actions
                              • Trigger - Turn off Volcanic Crush Loop <gen>
                            • Else - Actions
                        • Else - Actions
                          • Set VC_ExpirationTimer[VC_Index] = (VC_ExpirationTimer[VC_Index] + VC_TimerSpeed)
                    • Else - Actions
- Weeds
  • Weeds Config
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Do not touch --------
      • Hashtable - Create a hashtable
      • Set WD_Hash = (Last created hashtable)
      • -------- ------ --------
      • -------- Determines how far the seeds can be "thrown" --------
      • Set WD_AoeBase = 300.00
      • Set WD_AoePerLevel = 100.00
      • -------- Determines the attack damage of a fully grown plant --------
      • Set WD_AttackDamageBase = 25.00
      • Set WD_AttackDamagePerLevel = 15.00
      • -------- Determines the area the plant can drain from while growing --------
      • Set WD_DrainAoeBase = 200.00
      • Set WD_DrainAoePerLevel = 100.00
      • -------- Determines the damage of the draining ( / 0.03 to get dps) --------
      • Set WD_DrainDamageBase = 0.25
      • Set WD_DrainDamagePerLevel = 0.25
      • -------- Determines how long each plant lasts for --------
      • Set WD_DurationBase = 5.00
      • Set WD_DurationPerLevel = 2.00
      • -------- Determines how fast each plant will grow --------
      • Set WD_GrowthSpeedBase = 0.15
      • Set WD_GrowthSpeedPerLevel = 0.00
      • -------- Determines how many seeds will be thrown --------
      • Set WD_SeedsBase = 3.00
      • Set WD_SeedsPerLevel = 1.00
      • -------- Determines how fast the seeds fly through the air --------
      • Set WD_FlyingSpeed = 5.00
      • -------- Determines how high the seeds travel --------
      • Set WD_HeightMultiplyer = 1.00
      • -------- Determines how large the plants start off at (%) --------
      • Set WD_StartSize = 10.00
      • -------- Determines how large the plant will eventually become (%) --------
      • Set WD_MaxGrowth = 50.00
      • -------- Determines how many targets a plant can drain from at a time --------
      • Set WD_MaxDrainTargets = 5
      • -------- Determines the unit used as the seed --------
      • Set WD_Seed = Seed
      • -------- Determines the unit used as the weed --------
      • Set WD_Weed = Weed
      • -------- Determines the spell used the activate the triggers --------
      • Set WD_Spell = Weeds
      • -------- Determines the Sfx created when a plant hits its target --------
      • Set WD_AttackSfx = Abilities\Weapons\ChimaeraAcidMissile\ChimaeraAcidMissile.mdl
      • -------- Determines the Lightning used as the "drain" effect --------
      • Set WD_Lightning = DRAL
      • -------- Determines how high the lightning effect is --------
      • Set WD_LightningHeight = 10.00
  • Weeds Activation
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to WD_Spell
    • Actions
      • Set WD_U = (Triggering unit)
      • Set WD_TempReal = (Real((Level of WD_Spell for WD_U)))
      • Set WD_Angle = 0.00
      • Set WD_TempPoint = (Position of WD_U)
      • For each (Integer WD_I) from 1 to ((Integer(WD_SeedsBase)) + ((Integer(WD_SeedsPerLevel)) x (Level of WD_Spell for WD_U))), do (Actions)
        • Loop - Actions
          • Set WD_Angle = (WD_Angle + (360.00 / (WD_SeedsBase + (WD_SeedsPerLevel x WD_TempReal))))
          • Set WD_TempPoint2 = (WD_TempPoint offset by (Random real number between 50.00 and (WD_AoeBase + (WD_AoePerLevel x WD_TempReal))) towards 0.00 degrees)
          • Unit - Create 1 WD_Seed for (Owner of WD_U) at WD_TempPoint facing WD_Angle degrees
          • Set WD_TempU = (Last created unit)
          • Custom script: set udg_WD_UHandle = GetHandleId(udg_WD_TempU)
          • -------- Saving duration of the Weeds --------
          • Hashtable - Save (WD_DurationBase + (WD_DurationPerLevel x WD_TempReal)) as 0 of WD_UHandle in WD_Hash
          • -------- Saving the caster ID --------
          • Hashtable - Save Handle OfWD_U as 1 of WD_UHandle in WD_Hash
          • -------- Saving the attack damage of the Weeds --------
          • Hashtable - Save (WD_AttackDamageBase + (WD_AttackDamagePerLevel x WD_TempReal)) as 2 of WD_UHandle in WD_Hash
          • -------- Saving the Draining AOE --------
          • Hashtable - Save (WD_DrainAoeBase + (WD_DrainAoePerLevel x WD_TempReal)) as 3 of WD_UHandle in WD_Hash
          • -------- Saving the Draining Damage --------
          • Hashtable - Save (WD_DrainDamageBase + (WD_DrainDamagePerLevel x WD_TempReal)) as 4 of WD_UHandle in WD_Hash
          • -------- Saving the Speed of the Weeds Growing --------
          • Hashtable - Save (WD_GrowthSpeedBase + (WD_GrowthSpeedPerLevel x WD_TempReal)) as 5 of WD_UHandle in WD_Hash
          • -------- Saving the Stage ID --------
          • Hashtable - Save 1 as 6 of WD_UHandle in WD_Hash
          • -------- Saving the Distance to the landing point --------
          • Hashtable - Save (Distance between WD_TempPoint and WD_TempPoint2) as 7 of WD_UHandle in WD_Hash
          • Unit Group - Add WD_TempU to WD_WeedsGroup
          • Custom script: call RemoveLocation (udg_WD_TempPoint2)
      • Custom script: call RemoveLocation (udg_WD_TempPoint)
      • Trigger - Turn on Weeds Loop <gen>
  • Weeds Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in WD_WeedsGroup and do (Actions)
        • Loop - Actions
          • Set WD_U = (Picked unit)
          • Custom script: set udg_WD_UHandle = GetHandleId(udg_WD_U)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Load 6 of WD_UHandle from WD_Hash) Equal to 1
            • Then - Actions
              • Custom script: set udg_WD_TempX = GetUnitX(udg_WD_U)
              • Custom script: set udg_WD_TempY = GetUnitY(udg_WD_U)
              • Set WD_Angle = (Facing of WD_U)
              • Custom script: call SetUnitX(udg_WD_U, udg_WD_TempX + udg_WD_FlyingSpeed * Cos(udg_WD_Angle * bj_DEGTORAD))
              • Custom script: call SetUnitY(udg_WD_U, udg_WD_TempY + udg_WD_FlyingSpeed * Sin(udg_WD_Angle * bj_DEGTORAD))
              • -------- Loading Distance to landing point --------
              • Set WD_RealCache[1] = (Load 7 of WD_UHandle from WD_Hash)
              • -------- Loading Maximum height achieved in the arc --------
              • Set WD_RealCache[2] = (WD_RealCache[1] x WD_HeightMultiplyer)
              • -------- Loading the current distance travelled --------
              • Set WD_RealCache[3] = ((Load 9 of WD_UHandle from WD_Hash) + WD_FlyingSpeed)
              • -------- Saving the current distance travelled --------
              • Hashtable - Save WD_RealCache[3] as 9 of WD_UHandle in WD_Hash
              • Set WD_RealCache[4] = (((4.00 x WD_RealCache[2]) / WD_RealCache[1]) x ((WD_RealCache[3] / WD_RealCache[1]) x (WD_RealCache[1] - WD_RealCache[3])))
              • Animation - Change WD_U flying height to WD_RealCache[4] at 0.00
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • WD_RealCache[4] Less than 0.00
                • Then - Actions
                  • Unit - Kill WD_U
                  • Set WD_TempPoint = (Position of WD_U)
                  • Unit - Create 1 Weed for (Owner of WD_U) at WD_TempPoint facing WD_Angle degrees
                  • Set WD_TempU = (Last created unit)
                  • Custom script: set udg_WD_UHandleC = GetHandleId(udg_WD_TempU)
                  • Animation - Change WD_TempU's size to (WD_StartSize%, WD_StartSize%, WD_StartSize%) of its original size
                  • -------- Loading Duration of the Weeds --------
                  • Set WD_RealCache[5] = (Load 0 of WD_UHandle from WD_Hash)
                  • Unit - Add a WD_RealCache[5] second Generic expiration timer to WD_TempU
                  • Set WD_TempU2 = (Load 1 of WD_UHandle in WD_Hash)
                  • -------- Saving the caster ID --------
                  • Hashtable - Save Handle OfWD_TempU2 as 1 of WD_UHandleC in WD_Hash
                  • -------- Saving the caster ID --------
                  • Hashtable - Save Handle OfWD_TempU2 as 8 of WD_UHandleC in WD_Hash
                  • -------- Saving the attack damage of the Weeds --------
                  • Hashtable - Save (Load 2 of WD_UHandle from WD_Hash) as 2 of WD_UHandleC in WD_Hash
                  • -------- Saving the Draining AOE --------
                  • Hashtable - Save (Load 3 of WD_UHandle from WD_Hash) as 3 of WD_UHandleC in WD_Hash
                  • -------- Saving the Draining Damage --------
                  • Hashtable - Save (Load 4 of WD_UHandle from WD_Hash) as 4 of WD_UHandleC in WD_Hash
                  • -------- Saving the Speed of the Weeds Growing --------
                  • Hashtable - Save (Load 5 of WD_UHandle from WD_Hash) as 5 of WD_UHandleC in WD_Hash
                  • -------- Saving the Stage ID --------
                  • Hashtable - Save 2 as 6 of WD_UHandleC in WD_Hash
                  • Unit Group - Add WD_TempU to WD_WeedsGroup
                  • Hashtable - Clear all child hashtables of child WD_UHandle in WD_Hash
                  • Custom script: call RemoveLocation (udg_WD_TempPoint)
                • Else - Actions
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Load 6 of WD_UHandle from WD_Hash) Equal to 2
                  • (Load 6 of WD_UHandle from WD_Hash) Equal to 3
                  • (Load 6 of WD_UHandle from WD_Hash) Equal to 4
              • Or - Any (Conditions) are true
                • Conditions
                  • (WD_U is dead) Equal to True
                  • ((Load 8 of WD_UHandle in WD_Hash) is dead) Equal to True
            • Then - Actions
              • For each (Integer WD_I) from 11 to ((Load 16 of WD_UHandle from WD_Hash) + 10), do (Actions)
                • Loop - Actions
                  • -------- Loading Lightning Draining effect and destroying it --------
                  • Lightning - Destroy (Load WD_I of WD_UHandle in WD_Hash)
              • Unit Group - Remove (Load 8 of WD_UHandle in WD_Hash) from WD_CurrentTargets
              • Unit - Kill WD_U
              • Unit Group - Remove WD_U from WD_WeedsGroup
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (WD_WeedsGroup is empty) Equal to True
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Load 7 of WD_UHandle from WD_Hash) Equal to 0.00
                • Then - Actions
                  • Unit - Hide WD_U
                • Else - Actions
              • Hashtable - Clear all child hashtables of child WD_UHandle in WD_Hash
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Load 6 of WD_UHandle from WD_Hash) Equal to 2
                • Then - Actions
                  • -------- Loading Current Target Count --------
                  • For each (Integer WD_I) from 11 to ((Load 16 of WD_UHandle from WD_Hash) + 10), do (Actions)
                    • Loop - Actions
                      • -------- Loading Lightning Draining effect and destroying it --------
                      • Lightning - Destroy (Load WD_I of WD_UHandle in WD_Hash)
                  • -------- Saving Current Target Count --------
                  • Hashtable - Save 0 as 16 of WD_UHandle in WD_Hash
                  • Set WD_TempPoint = (Position of WD_U)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Load 7 of WD_UHandle from WD_Hash) Greater than or equal to 50.00
                    • Then - Actions
                      • -------- Loading draining AOE --------
                      • Set WD_TempGroup = (Units within (Load 3 of WD_UHandle from WD_Hash) of WD_TempPoint)
                      • Unit Group - Pick every unit in WD_TempGroup and do (Actions)
                        • Loop - Actions
                          • Set WD_TempU = (Picked unit)
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (WD_TempU is Magic Immune) Equal to False
                              • ((Unit-type of WD_TempU) is A structure) Equal to False
                              • (WD_TempU is A ground unit) Equal to True
                              • (WD_TempU is alive) Equal to True
                              • (WD_TempU belongs to an enemy of (Owner of WD_U)) Equal to True
                              • (Load 8 of WD_UHandle in WD_Hash) Equal to (Load 1 of WD_UHandle in WD_Hash)
                              • (WD_TempU is in WD_CurrentTargets) Equal to False
                            • Then - Actions
                              • -------- Saving Target ID --------
                              • Hashtable - Save Handle OfWD_TempU as 8 of WD_UHandle in WD_Hash
                              • -------- Saving Stage ID --------
                              • Hashtable - Save 3 as 6 of WD_UHandle in WD_Hash
                              • Unit Group - Add WD_TempU to WD_CurrentTargets
                            • Else - Actions
                      • Custom script: call DestroyGroup(udg_WD_TempGroup)
                    • Else - Actions
                      • Custom script: set udg_WD_TempZ = GetLocationZ(udg_WD_TempPoint) + udg_WD_LightningHeight
                      • Set WD_LightningCounter = 10
                      • -------- Loading draining AOE --------
                      • Set WD_TempGroup = (Units within (Load 3 of WD_UHandle from WD_Hash) of WD_TempPoint)
                      • Unit Group - Pick every unit in WD_TempGroup and do (Actions)
                        • Loop - Actions
                          • Set WD_TempU = (Picked unit)
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (WD_TempU is Magic Immune) Equal to False
                              • ((Unit-type of WD_TempU) is A structure) Equal to False
                              • (WD_TempU is A ground unit) Equal to True
                              • (WD_TempU is alive) Equal to True
                              • (WD_TempU belongs to an enemy of (Owner of WD_U)) Equal to True
                              • WD_LightningCounter Less than (WD_MaxDrainTargets + 10)
                            • Then - Actions
                              • Set WD_LightningCounter = (WD_LightningCounter + 1)
                              • Set WD_TempPoint2 = (Position of WD_TempU)
                              • Custom script: set udg_WD_TempZ2 = GetLocationZ(udg_WD_TempPoint2) + udg_WD_LightningHeight
                              • Custom script: set udg_WD_TempLightning = AddLightningEx(udg_WD_Lightning, true, GetLocationX(udg_WD_TempPoint), GetLocationY(udg_WD_TempPoint), udg_WD_TempZ, GetLocationX(udg_WD_TempPoint2), GetLocationY(udg_WD_TempPoint2), udg_WD_TempZ2)
                              • -------- Saving Lightning ID --------
                              • Hashtable - Save Handle OfWD_TempLightning as WD_LightningCounter of WD_UHandle in WD_Hash
                              • -------- Saving Current Target Count --------
                              • Hashtable - Save ((Load 16 of WD_UHandle from WD_Hash) + 1) as 16 of WD_UHandle in WD_Hash
                              • Custom script: call RemoveLocation (udg_WD_TempPoint2)
                              • Unit - Cause (Load 1 of WD_UHandle in WD_Hash) to damage WD_TempU, dealing (Load 4 of WD_UHandle from WD_Hash) damage of attack type Spells and damage type Normal
                              • -------- Loading Current Growth --------
                              • Set WD_RealCache[5] = ((Load 7 of WD_UHandle from WD_Hash) + (Load 5 of WD_UHandle from WD_Hash))
                              • -------- Saving Current Growth --------
                              • Hashtable - Save WD_RealCache[5] as 7 of WD_UHandle in WD_Hash
                              • Animation - Change WD_U's size to (WD_RealCache[5]%, WD_RealCache[5]%, WD_RealCache[5]%) of its original size
                            • Else - Actions
                      • Custom script: call DestroyGroup(udg_WD_TempGroup)
                      • Custom script: call RemoveLocation (udg_WD_TempPoint)
                  • Custom script: call RemoveLocation (udg_WD_TempPoint)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Load 6 of WD_UHandle from WD_Hash) Equal to 3
                • Then - Actions
                  • Set WD_TempPoint = (Position of WD_U)
                  • Set WD_TempPoint2 = (Position of (Load 8 of WD_UHandle in WD_Hash))
                  • Unit - Order WD_U to Move To WD_TempPoint2
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Distance between WD_TempPoint and WD_TempPoint2) Less than or equal to 50.00
                    • Then - Actions
                      • -------- Saving Animation Control --------
                      • Hashtable - Save 30 as 9 of WD_UHandle in WD_Hash
                      • -------- Saving Stage ID --------
                      • Hashtable - Save 4 as 6 of WD_UHandle in WD_Hash
                    • Else - Actions
                  • Custom script: call RemoveLocation(udg_WD_TempPoint2)
                  • Custom script: call RemoveLocation(udg_WD_TempPoint)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Load 6 of WD_UHandle from WD_Hash) Equal to 4
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Load 9 of WD_UHandle from WD_Hash) Greater than or equal to 30
                    • Then - Actions
                      • -------- Saving Animation Control --------
                      • Hashtable - Save 0 as 9 of WD_UHandle in WD_Hash
                      • Animation - Play WD_U's attack animation
                      • Set WD_TempU = (Load 8 of WD_UHandle in WD_Hash)
                      • -------- Loading Caster ID --------
                      • Set WD_TempU2 = (Load 1 of WD_UHandle in WD_Hash)
                      • -------- Loading Attack Damage --------
                      • Set WD_RealCache[6] = (Load 2 of WD_UHandle from WD_Hash)
                      • Unit - Cause WD_TempU2 to damage WD_TempU, dealing WD_RealCache[6] damage of attack type Spells and damage type Normal
                      • Special Effect - Create a special effect attached to the overhead of WD_TempU using WD_AttackSfx
                      • Special Effect - Destroy (Last created special effect)
                      • Set WD_TempPoint = (Position of WD_U)
                      • Set WD_TempPoint2 = (Position of (Load 8 of WD_UHandle in WD_Hash))
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Distance between WD_TempPoint and WD_TempPoint2) Greater than 50.00
                        • Then - Actions
                          • -------- Saving Stage ID --------
                          • Hashtable - Save 3 as 6 of WD_UHandle in WD_Hash
                        • Else - Actions
                      • Custom script: call RemoveLocation(udg_WD_TempPoint2)
                      • Custom script: call RemoveLocation(udg_WD_TempPoint)
                    • Else - Actions
                      • -------- Saving Animation Control --------
                      • Hashtable - Save ((Load 9 of WD_UHandle from WD_Hash) + 1) as 9 of WD_UHandle in WD_Hash
                • Else - Actions
- Wild Energy
  • Wild Energy Configuration
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Do not touch --------
      • Hashtable - Create a hashtable
      • Set WE_WildEnergyHash = (Last created hashtable)
      • -------- ---------- --------
      • -------- Sets the AOE of the damage of the Energy Sphere --------
      • Set WE_EnergyAOEBase = 100.00
      • Set WE_EnergyAOEPerLevel = 50.00
      • -------- Sets how close the Sphere must be to detonate --------
      • Set WE_EnergyDetonationRange = 50.00
      • -------- Sets the chance of the spell activating (%) --------
      • Set WE_EnergyChanceBase = 20
      • Set WE_EnergyChancePerLevel = 20
      • -------- Sets the search range for finding a target (if none is found the Sphere is not created) --------
      • Set WE_EnergyMaxSearchRangeBase = 400.00
      • Set WE_EnergyMaxSearchRangePerLevl = 100.00
      • -------- Sets the speed of how fast the search is made (change depending on your computer speed) --------
      • Set WE_EnergySearchGrowthSpeed = 10.00
      • -------- Sets the damage of the Sphere based on this x the missing mana (out of max) for the unit using it --------
      • Set WE_EnergyMultiplyerBase = 0.00
      • Set WE_EnergyMultiplyerPerLevel = 0.50
      • -------- Sets the speed the Sphere moves --------
      • Set WE_EnergySpeed = 6.00
      • -------- Sets how long the Sphere will follow for --------
      • Set WE_EnergyTime = 15.00
      • -------- Sets how high the lightning effect will be --------
      • Set WE_EnergyHeight = 75.00
      • -------- Sets the number of spheres created when it's activated --------
      • Set WE_EnergyCountMax = 1
      • -------- ---------- --------
  • Wild Energy Activation
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Level of Wild Energy for (Triggering unit)) Greater than or equal to 1
    • Actions
      • Set WE_u = (Triggering unit)
      • Set WE_EnergyChanceRandomiser = (Random integer number between 1 and 100)
      • Set TempIntStore = (Level of Wild Energy for WE_u)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WE_EnergyChanceRandomiser Less than or equal to (WE_EnergyChanceBase + (WE_EnergyChancePerLevel x TempIntStore))
          • (Mana of WE_u) Not equal to (Max mana of WE_u)
        • Then - Actions
          • Set WE_TempPoint = (Position of WE_u)
          • Set WE_EnergyCurrentSearchRange = 0.00
          • Set WE_EnergyCount = WE_EnergyCountMax
          • For each (Integer WE_i) from 1 to (((Integer(WE_EnergyMaxSearchRangeBase)) + ((Integer(WE_EnergyMaxSearchRangePerLevl)) x TempIntStore)) / (Integer(WE_EnergySearchGrowthSpeed))), do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • WE_EnergyCount Not equal to 0
                • Then - Actions
                  • Set WE_EnergyCurrentSearchRange = (WE_EnergyCurrentSearchRange + WE_EnergySearchGrowthSpeed)
                  • Set WE_TempGroup = (Units within WE_EnergyCurrentSearchRange of WE_TempPoint)
                  • Unit Group - Pick every unit in WE_TempGroup and do (Actions)
                    • Loop - Actions
                      • Set WE_TempU = (Picked unit)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (WE_TempU is A ground unit) Equal to True
                          • (WE_TempU is alive) Equal to True
                          • (WE_TempU is Magic Immune) Equal to False
                          • (WE_TempU is A structure) Equal to False
                          • (WE_TempU belongs to an enemy of (Owner of WE_u)) Equal to True
                        • Then - Actions
                          • Set WE_TempRealStore = (Real((Level of Wild Energy for WE_u)))
                          • Set WE_EnergyCount = (WE_EnergyCount - 1)
                          • Trigger - Turn on Wild Energy Loop <gen>
                          • Unit - Create 1 Energy Sphere for (Owner of WE_u) at WE_TempPoint facing Default building facing degrees
                          • Set WE_TempU = (Last created unit)
                          • Unit - Add a WE_EnergyTime second Generic expiration timer to WE_TempU
                          • Unit - Change color of WE_TempU to (Color of Neutral Hostile)
                          • Unit Group - Add WE_TempU to WE_WildEnergyGroup
                          • Special Effect - Create a special effect at WE_TempPoint using Abilities\Spells\Items\TomeOfRetraining\TomeOfRetrainingCaster.mdl
                          • Special Effect - Destroy (Last created special effect)
                          • Custom script: set udg_WE_UHandle = GetHandleId(udg_WE_TempU)
                          • Set WE_TempU = (Picked unit)
                          • Hashtable - Save Handle OfWE_TempU as 1 of WE_UHandle in WE_WildEnergyHash
                          • Hashtable - Save (((Max mana of WE_u) - (Mana of WE_u)) x (WE_EnergyMultiplyerBase + (WE_EnergyMultiplyerPerLevel x WE_TempRealStore))) as 2 of WE_UHandle in (Last created hashtable)
                          • Hashtable - Save (WE_EnergyAOEBase + (WE_EnergyAOEPerLevel x WE_TempRealStore)) as 3 of WE_UHandle in (Last created hashtable)
                          • Hashtable - Save Handle OfWE_u as 4 of WE_UHandle in WE_WildEnergyHash
                        • Else - Actions
                  • Custom script: call DestroyGroup (udg_WE_TempGroup)
                • Else - Actions
        • Else - Actions
          • Custom script: call RemoveLocation(udg_WE_TempPoint)
  • Wild Energy Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in WE_WildEnergyGroup and do (Actions)
        • Loop - Actions
          • Set WE_u = (Picked unit)
          • Set WE_UHandle = (Key (Picked unit))
          • Lightning - Destroy (Load 5 of WE_UHandle in WE_WildEnergyHash)
          • Set WE_TempPoint = (Position of WE_u)
          • Set WE_TempPoint2 = (Position of (Load 1 of WE_UHandle in WE_WildEnergyHash))
          • Custom script: set udg_WE_TempLightning = AddLightningEx("CLPB", true, GetLocationX(udg_WE_TempPoint), GetLocationY(udg_WE_TempPoint), udg_WE_EnergyHeight, GetLocationX(udg_WE_TempPoint2), GetLocationY(udg_WE_TempPoint2), udg_WE_EnergyHeight)
          • Hashtable - Save Handle OfWE_TempLightning as 5 of WE_UHandle in WE_WildEnergyHash
          • Set WE_Angle = (Angle from WE_TempPoint to WE_TempPoint2)
          • Custom script: call RemoveLocation(udg_WE_TempPoint2)
          • Custom script: set udg_WE_TempX = GetUnitX(udg_WE_u)
          • Custom script: set udg_WE_TempY = GetUnitY(udg_WE_u)
          • Custom script: call SetUnitX(udg_WE_u, udg_WE_TempX + udg_WE_EnergySpeed * Cos(udg_WE_Angle * bj_DEGTORAD))
          • Custom script: call SetUnitY(udg_WE_u, udg_WE_TempY + udg_WE_EnergySpeed * Sin(udg_WE_Angle * bj_DEGTORAD))
          • Set WE_TempGroup = (Units within WE_EnergyDetonationRange of WE_TempPoint matching ((((Matching unit) is A ground unit) Equal to True) and ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) belongs to an enemy of (Owner of WE_u)) Equal to True) and ((((M
          • Unit Group - Pick every unit in WE_TempGroup and do (Actions)
            • Loop - Actions
              • Set WE_TempU = (Picked unit)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (WE_TempU is Magic Immune) Equal to False
                  • ((Unit-type of WE_TempU) is A structure) Equal to False
                  • (WE_TempU is A ground unit) Equal to True
                  • (WE_TempU is alive) Equal to True
                  • (WE_TempU belongs to an enemy of (Owner of WE_u)) Equal to True
                  • (Number of units in WE_TempGroup) Greater than 0
                • Then - Actions
                  • Unit - Kill WE_u
                • Else - Actions
          • Custom script: call RemoveLocation(udg_WE_TempPoint)
          • Custom script: call DestroyGroup (udg_WE_TempGroup)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Load 1 of WE_UHandle in WE_WildEnergyHash) is dead) Equal to True
            • Then - Actions
              • Unit - Kill WE_u
            • Else - Actions
  • Wild Energy Sphere death
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Energy Sphere
    • Actions
      • Set WE_u = (Triggering unit)
      • Set WE_UHandle = (Key (Triggering unit))
      • Set WE_TempPoint = (Position of WE_u)
      • Unit - Kill WE_u
      • Unit Group - Remove WE_u from WE_WildEnergyGroup
      • Lightning - Destroy (Load 5 of WE_UHandle in WE_WildEnergyHash)
      • Special Effect - Create a special effect at WE_TempPoint using Objects\Spawnmodels\NightElf\NEDeathMedium\NEDeath.mdl
      • Special Effect - Destroy (Last created special effect)
      • Set WE_TempGroup = (Units within (Load 3 of WE_UHandle from WE_WildEnergyHash) of WE_TempPoint)
      • Unit Group - Pick every unit in WE_TempGroup and do (Actions)
        • Loop - Actions
          • Set WE_TempU = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (WE_TempU is Magic Immune) Equal to False
              • ((Unit-type of WE_TempU) is A structure) Equal to False
              • (WE_TempU is A ground unit) Equal to True
              • (WE_TempU is alive) Equal to True
              • (WE_TempU belongs to an enemy of (Owner of WE_u)) Equal to True
            • Then - Actions
              • Unit - Cause (Load 4 of WE_UHandle in WE_WildEnergyHash) to damage (Picked unit), dealing (Load 2 of WE_UHandle from WE_WildEnergyHash) damage of attack type Spells and damage type Normal
            • Else - Actions
      • Custom script: call DestroyGroup (udg_WE_TempGroup)
      • Custom script: call RemoveLocation(udg_WE_TempPoint)
      • If ((Number of units in WE_WildEnergyGroup) Equal to 0) then do (Trigger - Turn off Wild Energy Loop <gen>) else do (Do nothing)

Give credits to Tank-Commander if you use any of these spells in your map, the models in some of these maps belong to their respective owners and you should credit them as well (to view which credits go to that particular resource, each map contains its own import instructions.

CONSUMER WARNING: If you do not have a fast computer, then you may need to modify the configurations extensively to avoid Framerate drop, due to the amount of SFX in these spells, additionally, balancing them together to work in a singular map make take quite a bit of effort.

Keywords:
Chaos, Drain, Spells, Tank-Commander, SFX, Spam, Bomb, Arcane, Energy, Mana, Health, Spellpack, fire, Explosion.
Reviews
20:26, 4th Apr 2013 Vengeancekael: Quite a useful and flashy pack, you've worked hard for this. Good job!

Moderator

M

Moderator

20:26, 4th Apr 2013
Vengeancekael: Quite a useful and flashy pack, you've worked hard for this. Good job!
 
Top