Unreasonable Chaos Spellpack

This bundle is marked as approved. It works and satisfies the submission rules.
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)