Zephyr Contest #15: Touch of Nature V 1.0.0

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
Zephyr Contest #15 Entry: Touch of Nature
226535-cb0c443f1d5f780d5b26bc56ee7e54a5.jpg
Descriptions
T
Spell race: Nature/Ancient/Elves
Spell type: Diversity (Target/AOE)
Target categories can be disabled and enabled as you see fit
Made via GUI based triggers (5 triggers) + (3 third-party triggers)
Spell is instancable
Includes 128 configurables for every detail of the spell
Custom dummy units utilized: 8
Custom abilities utilized: 11
Custum buffs utilized: 1
Includes instructions for transferring the spell
Includes a debugging trigger with instructions
All damage types can be configured to dodge spell immunity
Can change the tree formation of the map
The map includes a Mini-Game to test the spell in game

Target categories:
1. Self (Caster)
2. Allied/Owned Non-Structure Units
3. Allied/Owned Structures
4. Enemy Non-Structure Units
5. Enemy/Neutral Structures
6. Neutral Passive Non-Structure Units
7. Trees
8. Ground (No Target)[Dead Trees, Corpses, and Trees]

Spell functions for each category:
----------------------------------------------------------------------------------------------------
1. Self (Caster):

By Gathering forces from the trees around himself, the caster heals himself.

Level 1:
15
HP is recovered for the target per tree
10 Damage is inflicted on each tree
450 Radius

Level 2:
20
HP is recovered for the target per tree
15 Damage is inflicted on each tree
450 Radius

Level 3:
25
HP is recovered for the target per tree
20 Damage is inflicted on each tree
450 Radius
----------------------------------------------------------------------------------------------------
2. Allied/Owned Non-Structure Units:

By Gathering forces from the trees around the target, the caster heals the target
allied/owned unit.

Level 1:
12
HP is recovered for the target per tree
8.5 Damage is inflicted on each tree
450 Radius

Level 2:
16
HP is recovered for the target per tree
12.5 Damage is inflicted on each tree
450 Radius

Level 3:
20
HP is recovered for the target per tree
16.5 Damage is inflicted on each tree
450 Radius
----------------------------------------------------------------------------------------------------
3. Allied/Owned Structures:

By damaging one tree near the target building, wraps the building in roots and increases its
armor and HP recovery.

Level 1:
+3
Armor
+3 HP regeneration
20 Damage is inflicted on each tree
500 Radius
12 Seconds

Level 2:
+5
Armor
+4.5 HP regeneration
35 Damage is inflicted on each tree
500 Radius
16 Seconds

Level 3:
+7
Armor
+6 HP regeneration
50 Damage is inflicted on each tree
500 Radius
20 Seconds
----------------------------------------------------------------------------------------------------
4. Enemy Non-Structure Units:

By Gathering forces from the trees around the target, the caster damages the targeted enemy
unit.

Level 1:
18 Damage is inflicted on the target per tree
9.5 Damage is inflicted on each tree
400 Radius

Level 2:
24 Damage is inflicted on the target per tree
14 Damage is inflicted on each tree
400 Radius

Level 3:
30 Damage is inflicted on the target per tree
18.5 Damage is inflicted on each tree
400 Radius
----------------------------------------------------------------------------------------------------
5. Enemy/Neutral Structures:

By damaging one tree near the target building, wraps the building in roots and decreases its
armor and HP regeneration.

Level 1:
-2
Armor
-3 HP regeneration
20 Damage is inflicted on each tree
450 Radius
12 Seconds

Level 2:
-4
Armor
-4.5 HP regeneration
35 Damage is inflicted on each tree
450 Radius
16 Seconds

Level 3:
-6
Armor
-6 HP regeneration
50 Damage is inflicted on each tree
450 Radius
20 Seconds
----------------------------------------------------------------------------------------------------
6. Neutral Passive Non-Structure Units:

By Gathering forces from the trees around the target, the caster captures the targeted neutral
unit's soul.

Level 1:
Each 90 Hp of target's maximum HP requires a tree
1000
Damage is inflicted on each tree
500 Radius

Level 2:
Each 105 Hp of target's maximum HP requires a tree
1000 Damage is inflicted on each tree
500 Radius

Level 3:
Each 120 Hp of target's maximum HP requires a tree
1000 Damage is inflicted on each tree
500 Radius
----------------------------------------------------------------------------------------------------
7. Trees:

Picks a target tree and releases its energy as damage to the surrounding enemy units.

Level 1:
Each pulse inflicts 12 damage on enemy units in the area
Interval between each pulse is 0.9 second
1.5 Damage is inflicted on each tree by each pulse
10 Seconds

Level 2:
Each pulse inflicts 18 damage on enemy units in the area
Interval between each pulse is 0.8 second
2 Damage is inflicted on each tree by each pulse
11 Seconds

Level 3:
Each pulse inflicts 24 damage on enemy units in the area
Interval between each pulse is 0.7 second
2.4 Damage is inflicted on each tree by each pulse
12 Seconds
----------------------------------------------------------------------------------------------------
8. Ground (No Target)[Dead Trees, Corpses, and Trees]:

Fertilizes the selected area around the targeted location, healing alive trees, and sprouting new
trees from dead ones and corpses.

Level 1:
3 Corpse limit
2 Dead tree limit
20 HP is recovered for each tree in 9 seconds
475 Radius

Level 2:
4
Corpse limit
4 Dead tree limit
25 HP is recovered for each tree in 9 seconds
550 Radius

Level 3:
5 Corpse limit
6 Dead tree limit
30 HP is recovered for each tree in 9 seconds
625 Radius
----------------------------------------------------------------------------------------------------
Tooltip
ton-tooltip-png.264378
Configurables
  • ToN Config
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Basic XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_TouchOfNature_Ability = ToN_Touch of Nature
      • Set ToN_DummyUnit_Main = ToN_DummyUnit_Main
      • Set ToN_DummyUnit_Scale = ToN_DummyUnit_ScaleFinder
      • Set ToN_DummyUnit_Pulse = ToN_DummyUnit_Pulse
      • -------- ^^^^^-----Main ability and dummy units. There is no need to change thses --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_TargetTreeType[1] = Northrend Tree Wall
      • Set ToN_TargetTreeType[2] = Summer Tree Wall
      • -------- ^^^^^-----Add all the trees that are used in your map (These two types are used in this map). --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • For each (Integer ToN_TempInteger_A[1]) from 1 to 1000, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ToN_TargetTreeType[ToN_TempInteger_A[1]] Not equal to (Destructible-type of No destructible)
            • Then - Actions
              • Set ToN_MaxTreeTypes = ToN_TempInteger_A[1]
            • Else - Actions
      • -------- ^^^^^-----Don't touch this one, unless the number of tree TYPES used in your map exceeds 1000. --------
      • -------- ^^^^^-----If it's so (which is highly unlikely), change the max number of loops. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_DefaultSummonedTreeTypes = True
      • -------- ^^^^^-----When you cast the spell on the ground, new trees will be spawned for each dead tree or corpse in the area. --------
      • -------- ^^^^^-----The types of spawned trees will be randomly chosen from the default tree types that you have set for the spell in the above. --------
      • -------- ^^^^^-----If you want to set your own custom types, set this boolean to false and modify the tree types in the following section. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ToN_DefaultSummonedTreeTypes Equal to False
        • Then - Actions
          • Set ToN_MaxCostumTreeTypes = 0
          • -------- vvvvv-----Pick any tree type's array number from the default tree types (ToN_TargetTreeType[x]), which you have set for the spell in the above. --------
          • -------- Note!! ==You just need to add or remove the conditions. Don't touch anything else! --------
          • For each (Integer ToN_TempInteger_A[1]) from 1 to ToN_MaxTreeTypes, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • ToN_TempInteger_A[1] Equal to 1
                      • ToN_TempInteger_A[1] Equal to 2
                • Then - Actions
                  • -------- ^^^^^-----For example, the ones that I have picked here are 1 and 2. So it means only the "ToN_TargetTreeType [1] and [2]" are summoned. --------
                  • Set ToN_MaxCostumTreeTypes = (ToN_MaxCostumTreeTypes + 1)
                  • Set ToN_CustomSummonedTreeType[ToN_MaxCostumTreeTypes] = ToN_TargetTreeType[ToN_TempInteger_A[1]]
                • Else - Actions
        • Else - Actions
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_TargetSelfEnabled = True
      • Set ToN_TargetAlliedEnabled = True
      • Set ToN_TargetAllyBuildingEnabled = True
      • Set ToN_TargetEnemyEnabled = True
      • Set ToN_TargetEnemyBuildingEnabled = True
      • Set ToN_TargetNeutralEnabled = True
      • Set ToN_TargetTreeEnabled = True
      • Set ToN_TargetGroundEnabled = True
      • -------- ^^^^^-----To modify the possible targets of the spell, turn true/false the above booleans. The names are obvious. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_ManaCost = 35.00
      • Set ToN_ManaCost_PerLvl = 10.00
      • -------- ^^^^^-----Set this according to the mana cost of each level of Touch of Nature (ToN) --------
      • -------- ^^^^^-----This amount is returned to the caster if no casting takes place; ie, if there are no trees available in the vicinity. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • -------- XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Target = Self XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX --------
      • Set ToN_SelfRadius = 450.00
      • Set ToN_SelfRadius_PerLvl = 0.00
      • -------- ^^^^^-----Radius around the caster in which the trees are selected. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_SelfTreeLimit = 100
      • Set ToN_SelfTreeLimit_PerLvl = 0
      • -------- ^^^^^-----Maximum number of selectable trees. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_SelfTreeDamage = 5.00
      • Set ToN_SelfTreeDamage_PerLvl = 5.00
      • -------- ^^^^^-----Damage inflicted to each tree after casting this ability on self. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_SelfHealPerTree = 10.00
      • Set ToN_SelfHealPerTree_PerLvl = 5.00
      • -------- ^^^^^-----Amount of HP recovered for the caster per each tree in the radius. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_SelfHealSFX = Units\NightElf\Wisp\WispExplode.mdl
      • Set ToN_SelfHealSFXPosition = origin
      • -------- ^^^^^-----Healing SFX and it's position on the caster. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_SelfSFX_Ability = ToN_Self SFX
      • -------- ^^^^^-----A dummy ability which is cast from each tree to mimic the energy that is sucked out of it. --------
      • -------- Note!! ==To change the SFX, change the "Lightning Effects" of the Spell "ToN_Slef SFX" in the object editor. --------
      • -------- Note!! ==And to change the sound of the SFX, change the "Sound Effect" of the Spell "ToN_Slef SFX" in the object editor. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • -------- XXXXXXXXXXXXXXXXXXXXXXXXXXXX Target = Allied/Owned Non-Structure Units XXXXXXXXXXXXXXXXXXXXXXXXXXXX --------
      • Set ToN_AlliedRadius = 450.00
      • Set ToN_AlliedRadius_PerLvl = 0.00
      • -------- ^^^^^-----Radius around the targeted allied/owned unit in which the trees are selected. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_AlliedTreeLimit = 100
      • Set ToN_AlliedTreeLimit_PerLvl = 0
      • -------- ^^^^^-----Maximum number of selectable trees. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_AlliedTreeDamage = 4.50
      • Set ToN_AlliedTreeDamage_PerLvl = 4.00
      • -------- ^^^^^-----Damage inflicted to each tree after casting this ability on owned/allied units. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_AlliedHealPerTree = 8.00
      • Set ToN_AlliedHealPerTree_PerLvl = 4.00
      • -------- ^^^^^-----Amount of HP recovered for the owned/allied unit per each tree in the radius. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_AlliedHealSFX = Units\NightElf\Wisp\WispExplode.mdl
      • Set ToN_AlliedHealSFXPosition = origin
      • -------- ^^^^^-----Healing SFX and it's position on the allied/owned unit. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_AlliedSFX_Ability = ToN_Allied SFX
      • -------- ^^^^^-----A dummy ability which is cast from each tree to mimic the energy that is sucked out of it. --------
      • -------- Note!! ==To change the SFX, change the "Lightning Effects" of the Spell "ToN_Allied SFX" in the object editor. --------
      • -------- Note!! ==And to change the sound of the SFX, change the "Sound Effect" of the Spell "ToN_Allied SFX" in the object editor. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • -------- XXXXXXXXXXXXXXXXXXXXXXXXXXXX Target = Allied/Owned Structure Units XXXXXXXXXXXXXXXXXXXXXXXXXXXX --------
      • Set ToN_AllyBuildingRadius = 500.00
      • Set ToN_AllyBuildingRadius_PerLvl = 0.00
      • -------- ^^^^^-----Radius around the owned/allied structure which a random tree is selected from. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_AllyBuildingTreeDamage = 5.00
      • Set ToN_AllyBuildTreeDamage_PerLvl = 15.00
      • -------- ^^^^^-----Damage inflicted to the randomly selected tree in the radius after casting this ability on owned/allied structures. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_AllyBuildingArmorTime = 8.00
      • Set ToN_AllyBuildArmorTime_PerLvl = 4.00
      • -------- ^^^^^-----The duration that the armor on the allied/owned structure will last. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_AllyBuildingArmor_Ability = ToN_Allied Building Armor
      • -------- ^^^^^-----This ability is used to cast an armor on the building and It is made of "Inner Fire" spell. --------
      • -------- Note!! ==To change the amount of armor and life regeneration of the spell, change the "Defence Increase" and "Life Regen Rate" of the spell "ToN_Allied Building Armor" in the object editor. --------
      • -------- Note!! ==The level of this ability should correspond to the level of Nature's Touch (ToN). --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_AllyBuildingArmorSFX_Unit = ToN_DummyUnit_Armor
      • -------- ^^^^^-----This dummy unit serves as the armor around the building. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_AllyBuildingArmorSFX_Scale = 2.00
      • -------- ^^^^^-----This is the coefficient for the scale of the armor around the building (The dummy unit in the above). --------
      • -------- ^^^^^-----This number is multiplied in the scale of the building. (Recommended value = 2) --------
      • -------- Note!! ==Be carful with this one. Setting it too high, results in the SFX bumping to the game camera! --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_AllyBuildingSFX_Ability = ToN_Allied Building SFX
      • -------- ^^^^^-----A dummy ability which is cast from the randomly selected tree to mimic the energy that is sucked out of it. --------
      • -------- Note!! ==To change the SFX, change the "Lightning Effects" of the Spell "ToN_Allied Building SFX" in the object editor. --------
      • -------- Note!! ==And to change the sound of the SFX, change the "Sound Effect" of the Spell "ToN_Allied Building SFX" in the object editor. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • -------- XXXXXXXXXXXXXXXXXXXXXXXXXXXX Target = Enemy Non-Structure Units XXXXXXXXXXXXXXXXXXXXXXXXXXXX --------
      • Set ToN_FoeRadius = 400.00
      • Set ToN_FoeRadius_PerLvl = 0.00
      • -------- ^^^^^-----Radius around the enemy non-structure unit in which the trees are selected. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_FoeTreeLimit = 100
      • Set ToN_FoeTreeLimit_PerLvl = 0
      • -------- ^^^^^-----Maximum number of selectable trees. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_FoeTreeDamage = 5.00
      • Set ToN_FoeTreeDamage_PerLvl = 4.50
      • -------- ^^^^^-----Damage inflicted to each selected tree after casting this ability on enemy non-structure units. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_FoeDamagePerTree = 12.00
      • Set ToN_FoeDamagePerTree_PerLvl = 6.00
      • -------- ^^^^^-----Amount of damage inflicted on the enemy unit per each tree in the radius. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_FoeDamage_AttackType = Spells
      • Set ToN_FoeDamage_DamageType = Magic
      • -------- ^^^^^-----Attack and damage type of the inflicted damage on the enemy unit. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_FoeDamageSFX = Abilities\Spells\Undead\DeathCoil\DeathCoilSpecialArt.mdl
      • Set ToN_FoeDamageSFXPosition = origin
      • -------- ^^^^^-----Damaging SFX and it's position on the enemy unit. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_FoeSFX_Ability = ToN_Foe SFX
      • -------- ^^^^^-----A dummy ability which is cast from each tree to mimic the energy that is sucked out of it. --------
      • -------- Note!! ==To change the SFX, change the "Lightning Effects" of the Spell "ToN_Foe SFX" in the object editor. --------
      • -------- Note!! ==And to change the sound of the SFX, change the "Sound Effect" of the Spell "ToN_Foe SFX" in the object editor. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • -------- XXXXXXXXXXXXXXXXXXXXXXXXXXXX Target = Enemy/Neutral Structures XXXXXXXXXXXXXXXXXXXXXXXXXXXX --------
      • -------- >>>>>>Cast on Enemy/Neutral Buildings --------
      • Set ToN_FoeBuildingRadius = 450.00
      • Set ToN_FoeBuildingRadius_PerLvl = 0.00
      • -------- ^^^^^-----Radius around the enemy/neutral structure which a random tree is selected from. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_FoeBuildingTreeDamage = 5.00
      • Set ToN_FoeBuildTreeDamage_PerLvl = 15.00
      • -------- ^^^^^-----Damage inflicted to the randomly selected tree in radius after casting this ability on enemy/neutral structures. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_FoeBuildingRootTime = 8.00
      • Set ToN_FoeBuildingRootTime_PerLvl = 4.00
      • -------- ^^^^^-----The duration that the roots around the enemy/neutral structure will last. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_FoeBuildingRoot_Ability = ToN_Foe Building Root
      • -------- ^^^^^-----This ability is used to cast roots on the building and It is made of "Inner Fire" spell. --------
      • -------- Note!! ==To change the amount of armor and life degeneration of the spell, change the "Defence Increase" and "Life Regen Rate" of the spell "ToN_Foe Building Root" in the object editor. --------
      • -------- Note!! ==The level of this ability should correspond to the level of Nature's Touch (ToN). --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_FoeBuildingRootSFX_Unit = ToN_DummyUnit_Root
      • -------- ^^^^^-----This dummy unit serves as the roots around the building. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_FoeBuildingRootSFX_Scale = 2.00
      • -------- ^^^^^-----This is the coefficient for the scale of the roots around the building (The dummy unit in the above). --------
      • -------- ^^^^^-----This number is multiplied in the scale of the building. (Recommended value = 2) --------
      • -------- Note!! ==Be carful with this one. Setting it too high, results in the SFX bumping to the game camera! --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_FoeBuildingSFX_Ability = ToN_Foe Building SFX
      • -------- ^^^^^-----A dummy ability which is cast from the randomly selected tree to mimic the energy that is sucked out of it. --------
      • -------- Note!! ==To change the SFX, change the "Lightning Effects" of the Spell "ToN_Foe Building SFX" in the object editor. --------
      • -------- Note!! ==And to change the sound of the SFX, change the "Sound Effect" of the Spell "ToN_Foe Building SFX" in the object editor. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • -------- XXXXXXXXXXXXXXXXXXXXXXXXXXXX Target = Neutral Passive Non-Structure Units XXXXXXXXXXXXXXXXXXXXXXXXXXXX --------
      • Set ToN_NeutralRadius = 500.00
      • Set ToN_NeutralRadius_PerLvl = 0.00
      • -------- ^^^^^-----Radius around the neutral passive unit in which the trees are selected. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_NeutralTreeLimit = 100
      • Set ToN_NeutralTreeLimit_PerLvl = 0
      • -------- ^^^^^-----Maximum number of selectable trees. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_NeutralTreeDamage = 1000.00
      • Set ToN_NeutralTreeDamage_PerLvl = 0.00
      • -------- ^^^^^-----Damage inflicted to the picked trees if there are enough trees around the unit. --------
      • -------- Note!! ==I've set this in a way that the trees die. you can change this and make changes accordingly to the tooltip. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_NeutralHPTreshold = 75.00
      • Set ToN_NeutralHPTreshold_PerLvl = 15.00
      • -------- ^^^^^-----This is the amount of target unit's HP that requires a tree. --------
      • -------- ^^^^^-----For each amount of this configurable, a tree will be needed to capture the neutral passive unit. --------
      • -------- ^^^^^-----The higher you set this, the less trees would be needed for tougher units. --------
      • -------- ^^^^^-----For Example: If a unit has a max HP of 250 and the amount of this configurable is set to 80, so there needs to be (250/80 = 3.125 = 4) trees around the unit so that the unit can be captured. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_NeutralCaptureSFX = Abilities\Spells\Other\Charm\CharmTarget.mdl
      • Set ToN_NeutralCaptureSFX_Position = origin
      • -------- ^^^^^-----Capturing SFX and it's position on the enemy unit. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_NeutralSFX_Ability = ToN_Neutral SFX
      • -------- ^^^^^-----A dummy ability which is cast from each tree to mimic the energy that is sucked out of it. --------
      • -------- Note!! ==To change the SFX, change the "Lightning Effects" of the Spell "ToN_Neutral SFX" in the object editor. --------
      • -------- Note!! ==And to change the sound of the SFX, change the "Sound Effect" of the Spell "ToN_Neutral SFX" in the object editor. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • -------- XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Target = Trees XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX --------
      • Set ToN_PulseTreeSelectionRadius = 70.00
      • -------- ^^^^^-----The radius the target point will detect a tree as a target (Recommended Values = 60 - 85). --------
      • -------- Note!! ==The less you set this value, the harder it will be for you to select trees as target of the spell. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_PulseTreeDamage = 1.00
      • Set ToN_PulseTreeDamage_PerLvl = 0.50
      • -------- ^^^^^-----Damage inflicted to the tree by each pulse (each instance of damage to all units by the pulse). --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_PulseDamage = 6.00
      • Set ToN_PulseDamage_PerLvl = 6.00
      • -------- ^^^^^-----The damage inflicted on each unit by each pulse. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_PulseDamage_AttackType = Spells
      • Set ToN_PulseDamage_DamageType = Magic
      • -------- ^^^^^-----Attack and damage type of the inflicted damage on the enemy units by each pulse. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_PulseDamageSourceIsCaster = False
      • -------- ^^^^^-----This will determine if the caster is the source of the damage or the dummy unit which is pulsing on the tree. --------
      • -------- Note!! ==What's the difference? If the caster is the source, the units will run away from the caster instead of the tree that is pulsing. --------
      • -------- Note!! ==And this might result in the unit running toward the pulsing tree (If it is caught between the caster and the tree). --------
      • -------- Note!! ==And if the source is the caster, the killer will be considered the caster, instead of another unit. --------
      • -------- Note!! ==And if the source is the caster, there won't be any damage after its death or removal. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_PulseInterval = 1.00
      • Set ToN_PulseInterval_PerLvl = -0.10
      • -------- ^^^^^-----The interval between each pulse. The less you set it the more pulses will be cast. --------
      • -------- Note!! ==The number won't get below 0.03, for safety measures! (The cooldown of the spell is set to 0.03) --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_PulseDuration = 9.00
      • Set ToN_PulseDuration_PerLvl = 1.00
      • -------- ^^^^^-----The duration that the pulsing will continue. --------
      • -------- Note!! ==To calculate the number of pulses for each level, devide the duration by the interval and sum the result with 1 (The first pulse). --------
      • -------- Note!! ==For example: [(9+1) / (1-0.1)] + 1 = (10/0.9) + 1 = (100/9) + 1 = 11.111 +1 = 12.111 = 13 pulse --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_Pulse_Ability = ToN_Tree Pulse
      • -------- ^^^^^-----This ability is used to cast the pulsing on behalf of the tree. It is made of "Fan of Knives" spell. --------
      • -------- Note!! ==The level of this ability should correspond to the level of Touch of Nature (ToN). --------
      • -------- Note!! ==To change the radius of the pulse, change the "Area of Effect" of the spell "ToN_Tree Pulse" in the object editor. --------
      • -------- Note!! ==And to change the missile effect/arc of the pulse, change the "Missile Art/Arc" of the Spell "ToN_Tree Pulse" in the object editor. --------
      • -------- Note!! ==And to change the burst SFX of the pulse, change the "Effect" of the Spell "ToN_Tree Pulse" in the object editor. --------
      • -------- Note!! ==And to change the sound of the pulse, change the "Sound Effect" of the Spell "ToN_Tree Pulse" in the object editor. --------
      • -------- Note!! ==If you set the built-in damage of the spell to a non-zero value, the configurable damage in here will get overridden. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • -------- XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Target = Ground XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX --------
      • Set ToN_GroundRadius = 400.00
      • Set ToN_GroundRadius_PerLvl = 75.00
      • -------- ^^^^^-----Radius around the target point in which the corpses and dead trees are selected and the trees' HP get recovered. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_GroundCorpseLimit = 2
      • Set ToN_GroundCorpseLimit_PerLvl = 1
      • -------- ^^^^^-----Maximum number of selectable corpses. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_GroundTreeLimit = 0
      • Set ToN_GroundTreeLimit_PerLvl = 2
      • -------- ^^^^^-----Maximum number of selectable dead trees. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_GroundTreePerCorpse = 1
      • Set ToN_GroundTreePerCorpse_PerLvl = 0
      • -------- ^^^^^-----Number of tree(s) created per each corpse. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_GroundTreePerTree = 1
      • Set ToN_GroundTreePerTree_PerLvl = 0
      • -------- ^^^^^-----Number of tree(s) created per each dead tree. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_GroundSummonedTreeSize_Min = 1.00
      • Set ToN_GroundSummonedTreeSize_Max = 1.00
      • -------- ^^^^^-----Minimum and maximum size of the summoned tree(s). --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_GroundGrowthDelay = 9.00
      • Set ToN_GroundGrowthDelay_PerLvl = 0.00
      • -------- ^^^^^-----After this period is finished, new trees will sprout from dead trees and corpses. During this period, the alive trees in the area get healed. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_GroundTreeHeal = 15.00
      • Set ToN_GroundTreeHeal_PerLvl = 5.00
      • -------- ^^^^^-----The total HP recovered for the trees in the delay time. --------
      • -------- Note!! ==This amount is devided by the delay duration and then devided by 33.33 and applied to the trees each 0.03 second. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_GroundGrowthTime = 235.00
      • Set ToN_GroundGrowthTime_PerLvl = -35.00
      • -------- ^^^^^-----The time that takes until the trees finish growing and get spawned (This period starts after the delay period (set in the previous section) ends. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_GroundGrowthSFX_Unit = ToN_DummyUnit_Growth Process
      • -------- ^^^^^-----This dummy unit serves as the growth process of the trees. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_GroundGrowthSFXUnitSizeMin = 0.50
      • Set ToN_GroundGrowthSFXUnitSizeMax = 1.40
      • -------- ^^^^^-----The minimum and maximum scale of the SFX unit for growth process of the trees. --------
      • -------- Note!! ==The sprouts will start from minimum and get bigger and reach to maximum scale. All this gets done during the growth process duration of the trees. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_GroundGrowthDelaySFX_1 = Abilities\Spells\Other\Drain\DrainCaster.mdl
      • -------- ^^^^^-----SFX for growth delay and it's position on the SFX unit. This is placed in the center of the area selected. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_GroundGrowthDelaySFX_Unit1 = ToN_DummyUnit_Growth Delay Center
      • -------- ^^^^^-----This dummy unit serves as the central growth delay SFX on which the above SFX will be placed. This unit is placed in the center of the area selected. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_GroundDelaySFX1Size = 2.50
      • Set ToN_GroundDelaySFX1Size_PerLvl = 0.00
      • Set ToN_GroundGrowthDelaySFX_Trans = 90.00
      • -------- ^^^^^-----The scale and transparency of the above SFX unit that is in the center of the area selected. --------
      • -------- Note!! ==Minimum scale = 0.1 and maximum scale = 10. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_GroundGrowDelaySFX_Ability = ToN_Ground Growth Delay Sound Effect
      • -------- ^^^^^-----This dummy ability is used only for its SFX and specially for its sound. It is cast on another dummy unit which gets hidden. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_GroundGrowthDelaySFX_Unit2 = ToN_DummyUnit_Growth Delay Margin
      • -------- ^^^^^-----This dummy unit serves as the SFXs that rotate around the center of the area selected, during the delay time. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_GroundDelaySFX2Size = 1.00
      • -------- ^^^^^-----The scale of the above SFX unit that rotate around the center of the area selected. --------
      • -------- Note!! ==Minimum scale = 0.1 and maximum scale = 10. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_GroundDelaySFXRotationRate = 90.00
      • -------- ^^^^^-----The speed that the above SFX unit will rotate around the center of the area selected. (measured as degree per second) --------
      • -------- Note!! ==For example: Setting it to 90 means that the SFX will rotate 90 degrees in one second. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_GroundDelaySFXSinusRate = 400.00
      • -------- ^^^^^-----The speed at which the above SFX unit will go to and fro in relation to the center of the area selected. (measured as point per second). --------
      • -------- Note!! ==For example: Setting it to 250 means that the SFX will travel 250 points in one second. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_GroundDelaySFXSinusMin = 50.00
      • -------- ^^^^^-----The closest distance that the above SFX unit will get to the center of the area selected. --------
      • -------- Note!! ==The maximum distance will be set as the radius of the area selected. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set ToN_GroundGrowSoundSFX_Ability = ToN_Ground Growth SFX/Sound Effect
      • -------- ^^^^^-----This dummy ability serves as SFX and sound of the growing initiation and termination of the trees. --------
      • -------- Note!! ==To change the sound or SFX of this, change the "Sound Effect" or "Effect" of the Spell "ToN_Ground Growth SFX/Sound Effect" in the object editor. --------


Credits
"Bribe" for "Unit Indexer" trigger
"Weep" for "GUI Friendly Damage Detection"
This spell is made for the "Dark Ancient" model made by "DireFury"
Contents

Touch of Nature V 1.0.0 (Map)

Reviews
KILLCIDE
The spell is definitely going to need to be improved, but due to what you said in the Poll thread: I will be setting this to Substandard for now. If you ever feel like you make any changes to this resource that warrant it out of Substandard, let us...
Level 9
Joined
Oct 14, 2013
Messages
238
The rest of the triggers:

[box]

Cast

Groupings

Damage

Debug


  • ToN Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to ToN_TouchOfNature_Ability
    • Actions
      • -------- vvvvv-----Some general preparations for casting the spell. --------
      • Set ToN_HealDamageHappened[(Custom value of (Triggering unit))] = False
      • -------- ^^^^^-----This will be needed for casting on enemy/allied/neutral non-structure units and self. --------
      • Set ToN_BuildingArmorRootsHappened[(Custom value of (Triggering unit))] = False
      • -------- ^^^^^-----This will be needed for casting on enemy/allied/neutral structures. --------
      • Set ToN_CaptureHappened[(Custom value of (Triggering unit))] = False
      • -------- ^^^^^-----This will be needed for casting on neutral passive non-structure units. --------
      • Set ToN_TreePulseHappened[(Custom value of (Triggering unit))] = False
      • -------- ^^^^^-----This will be needed for casting on the trees. --------
      • Set ToN_TargetIsTree[(Player number of (Triggering player))] = False
      • -------- ^^^^^-----This will be needed for casting on trees. --------
      • Set ToN_GroundHappened[(Custom value of (Triggering unit))] = False
      • -------- ^^^^^-----This will be needed for casting on ground. --------
      • Set ToN_TreeLimitIsReached[(Custom value of (Triggering unit))] = False
      • -------- ^^^^^-----This will be needed for limiting the number of selectable trees. --------
      • Set ToN_TempReal_F[(Custom value of (Triggering unit))] = (ToN_ManaCost + (ToN_ManaCost_PerLvl x (Real((Level of ToN_TouchOfNature_Ability for (Triggering unit))))))
      • -------- ^^^^^-----Setting the amount of the mana. If casting is fruitless, the mana is returned to the caster. --------
      • Set ToN_TempInteger_C[(Custom value of (Triggering unit))] = 0
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • -------- vvvvv-----Detecting if the target is a unit or no unit. --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Target unit of ability being cast) Not equal to No unit
        • Then - Actions
          • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
          • -------- vvvvv-----Some general preparations for casting the spell on units. --------
          • Set ToN_TempReal_A[(Custom value of (Triggering unit))] = 0.00
          • Set ToN_TempReal_B[(Custom value of (Triggering unit))] = 0.00
          • Set ToN_TempReal_C[(Custom value of (Triggering unit))] = 0.00
          • Set ToN_TempReal_D[(Custom value of (Triggering unit))] = 0.00
          • Set ToN_TempInteger_B[(Custom value of (Triggering unit))] = 0
          • Set ToN_TempUnit_A[(Custom value of (Triggering unit))] = (Target unit of ability being cast)
          • Set ToN_TempUnit_C[(Custom value of (Triggering unit))] = No unit
          • Set ToN_TargetIsPossible[(Custom value of (Triggering unit))] = False
          • -------- ^^^^^-----This one boolean is needed to determine if the targeted unit is disabled by the user or not. --------
          • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
          • -------- vvvvv-----Some specific preparations for casting the spell on units. --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ToN_TempUnit_A[(Custom value of (Triggering unit))] Equal to (Triggering unit)
            • Then - Actions
              • -------- vvvvv-----Some specific preparations for casting the spell on self. --------
              • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
              • Set ToN_TargetIsPossible[(Custom value of (Triggering unit))] = ToN_TargetSelfEnabled
              • -------- ^^^^^-----This one boolean determines if the self is enabled or disabled by the user. --------
              • -------- vvvvv-----Radius, damage on trees, healing per tree, SFXs, and tree limits are assigned to temp variables (This will save so much repetition). --------
              • Set ToN_TempReal_A[(Custom value of (Triggering unit))] = (ToN_SelfRadius + (ToN_SelfRadius_PerLvl x (Real((Level of ToN_TouchOfNature_Ability for (Triggering unit))))))
              • Set ToN_TempReal_B[(Custom value of (Triggering unit))] = (ToN_SelfTreeDamage + (ToN_SelfTreeDamage_PerLvl x (Real((Level of ToN_TouchOfNature_Ability for (Triggering unit))))))
              • Set ToN_TempReal_C[(Custom value of (Triggering unit))] = (ToN_SelfHealPerTree + (ToN_SelfHealPerTree_PerLvl x (Real((Level of ToN_TouchOfNature_Ability for (Triggering unit))))))
              • Set ToN_TempAbility_A[(Custom value of (Triggering unit))] = ToN_SelfSFX_Ability
              • Set ToN_TempString_A[(Custom value of (Triggering unit))] = ToN_SelfHealSFX
              • Set ToN_TempString_B[(Custom value of (Triggering unit))] = ToN_SelfHealSFXPosition
              • Set ToN_TempInteger_C[(Custom value of (Triggering unit))] = (ToN_SelfTreeLimit + (ToN_SelfTreeLimit_PerLvl x (Level of ToN_TouchOfNature_Ability for (Triggering unit))))
              • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ToN_TempUnit_A[(Custom value of (Triggering unit))] Not equal to (Triggering unit)
              • (ToN_TempUnit_A[(Custom value of (Triggering unit))] belongs to an ally of (Triggering player)) Equal to True
              • (Owner of ToN_TempUnit_A[(Custom value of (Triggering unit))]) Not equal to Neutral Passive
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (ToN_TempUnit_A[(Custom value of (Triggering unit))] is A structure) Not equal to True
                • Then - Actions
                  • -------- vvvvv-----Some specific preparations for casting the spell on allied/owned non-structure units. --------
                  • -------- vvvvv-----As the above --------
                  • Set ToN_TargetIsPossible[(Custom value of (Triggering unit))] = ToN_TargetAlliedEnabled
                  • Set ToN_TempReal_A[(Custom value of (Triggering unit))] = (ToN_AlliedRadius + (ToN_AlliedRadius_PerLvl x (Real((Level of ToN_TouchOfNature_Ability for (Triggering unit))))))
                  • Set ToN_TempReal_B[(Custom value of (Triggering unit))] = (ToN_AlliedTreeDamage + (ToN_AlliedTreeDamage_PerLvl x (Real((Level of ToN_TouchOfNature_Ability for (Triggering unit))))))
                  • Set ToN_TempReal_C[(Custom value of (Triggering unit))] = (ToN_AlliedHealPerTree + (ToN_AlliedHealPerTree_PerLvl x (Real((Level of ToN_TouchOfNature_Ability for (Triggering unit))))))
                  • Set ToN_TempAbility_A[(Custom value of (Triggering unit))] = ToN_AlliedSFX_Ability
                  • Set ToN_TempString_A[(Custom value of (Triggering unit))] = ToN_AlliedHealSFX
                  • Set ToN_TempString_B[(Custom value of (Triggering unit))] = ToN_AlliedHealSFXPosition
                  • Set ToN_TempInteger_C[(Custom value of (Triggering unit))] = (ToN_AlliedTreeLimit + (ToN_AlliedTreeLimit_PerLvl x (Level of ToN_TouchOfNature_Ability for (Triggering unit))))
                • Else - Actions
                  • -------- vvvvv-----Some specific preparations for casting the spell on allied/owned structures. --------
                  • -------- vvvvv-----As the above but the ability for casting the armor and armor duration are also saved to temp variables. --------
                  • Set ToN_TargetIsPossible[(Custom value of (Triggering unit))] = ToN_TargetAllyBuildingEnabled
                  • Set ToN_TempReal_A[(Custom value of (Triggering unit))] = (ToN_AllyBuildingRadius + (ToN_AllyBuildingRadius_PerLvl x (Real((Level of ToN_TouchOfNature_Ability for (Triggering unit))))))
                  • Set ToN_TempReal_B[(Custom value of (Triggering unit))] = (ToN_AllyBuildingTreeDamage + (ToN_AllyBuildTreeDamage_PerLvl x (Real((Level of ToN_TouchOfNature_Ability for (Triggering unit))))))
                  • Set ToN_TempReal_C[(Custom value of (Triggering unit))] = (ToN_AllyBuildingArmorTime + (ToN_AllyBuildArmorTime_PerLvl x (Real((Level of ToN_TouchOfNature_Ability for (Triggering unit))))))
                  • Set ToN_TempReal_D[(Custom value of (Triggering unit))] = ToN_AllyBuildingArmorSFX_Scale
                  • Set ToN_TempAbility_A[(Custom value of (Triggering unit))] = ToN_AllyBuildingSFX_Ability
                  • Set ToN_TempAbility_B[(Custom value of (Triggering unit))] = ToN_AllyBuildingArmor_Ability
                  • Set ToN_TempInteger_C[(Custom value of (Triggering unit))] = 1
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (ToN_TempUnit_A[(Custom value of (Triggering unit))] belongs to an ally of (Triggering player)) Not equal to True
              • (ToN_TempUnit_A[(Custom value of (Triggering unit))] is A structure) Not equal to True
            • Then - Actions
              • -------- vvvvv-----Some specific preparations for casting the spell on enemy/neutral non-structure units. --------
              • -------- vvvvv-----As the above. --------
              • Set ToN_TargetIsPossible[(Custom value of (Triggering unit))] = ToN_TargetEnemyEnabled
              • Set ToN_TempReal_A[(Custom value of (Triggering unit))] = (ToN_FoeRadius + (ToN_FoeRadius_PerLvl x (Real((Level of ToN_TouchOfNature_Ability for (Triggering unit))))))
              • Set ToN_TempReal_B[(Custom value of (Triggering unit))] = (ToN_FoeTreeDamage + (ToN_FoeTreeDamage_PerLvl x (Real((Level of ToN_TouchOfNature_Ability for (Triggering unit))))))
              • Set ToN_TempReal_C[(Custom value of (Triggering unit))] = (ToN_FoeDamagePerTree + (ToN_FoeDamagePerTree_PerLvl x (Real((Level of ToN_TouchOfNature_Ability for (Triggering unit))))))
              • Set ToN_TempAbility_A[(Custom value of (Triggering unit))] = ToN_FoeSFX_Ability
              • Set ToN_TempString_A[(Custom value of (Triggering unit))] = ToN_FoeDamageSFX
              • Set ToN_TempString_B[(Custom value of (Triggering unit))] = ToN_FoeDamageSFXPosition
              • Set ToN_TempInteger_C[(Custom value of (Triggering unit))] = (ToN_FoeTreeLimit + (ToN_FoeTreeLimit_PerLvl x (Level of ToN_TouchOfNature_Ability for (Triggering unit))))
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (ToN_TempUnit_A[(Custom value of (Triggering unit))] belongs to an ally of (Triggering player)) Not equal to True
                  • (Owner of ToN_TempUnit_A[(Custom value of (Triggering unit))]) Equal to Neutral Passive
              • (ToN_TempUnit_A[(Custom value of (Triggering unit))] is A structure) Equal to True
            • Then - Actions
              • -------- vvvvv-----Some specific preparations for casting the spell on enemy/neutral structures. --------
              • -------- vvvvv-----As the above. --------
              • Set ToN_TargetIsPossible[(Custom value of (Triggering unit))] = ToN_TargetEnemyBuildingEnabled
              • Set ToN_TempReal_A[(Custom value of (Triggering unit))] = (ToN_FoeBuildingRadius + (ToN_FoeBuildingRadius_PerLvl x (Real((Level of ToN_TouchOfNature_Ability for (Triggering unit))))))
              • Set ToN_TempReal_B[(Custom value of (Triggering unit))] = (ToN_FoeBuildingTreeDamage + (ToN_FoeBuildTreeDamage_PerLvl x (Real((Level of ToN_TouchOfNature_Ability for (Triggering unit))))))
              • Set ToN_TempReal_C[(Custom value of (Triggering unit))] = (ToN_FoeBuildingRootTime + (ToN_FoeBuildingRootTime_PerLvl x (Real((Level of ToN_TouchOfNature_Ability for (Triggering unit))))))
              • Set ToN_TempReal_D[(Custom value of (Triggering unit))] = ToN_FoeBuildingRootSFX_Scale
              • Set ToN_TempAbility_A[(Custom value of (Triggering unit))] = ToN_FoeBuildingSFX_Ability
              • Set ToN_TempAbility_B[(Custom value of (Triggering unit))] = ToN_FoeBuildingRoot_Ability
              • Set ToN_TempInteger_C[(Custom value of (Triggering unit))] = 1
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of ToN_TempUnit_A[(Custom value of (Triggering unit))]) Equal to Neutral Passive
              • (ToN_TempUnit_A[(Custom value of (Triggering unit))] is A structure) Not equal to True
            • Then - Actions
              • -------- vvvvv-----Some specific preparations for casting the spell on neutra passive non-structure units. --------
              • -------- vvvvv-----As the above. Just the max HP of the unit and HP needed for each tree are saved to temp variables. --------
              • Set ToN_TargetIsPossible[(Custom value of (Triggering unit))] = ToN_TargetNeutralEnabled
              • Set ToN_TempReal_A[(Custom value of (Triggering unit))] = (ToN_NeutralRadius + (ToN_NeutralRadius_PerLvl x (Real((Level of ToN_TouchOfNature_Ability for (Triggering unit))))))
              • Set ToN_TempReal_B[(Custom value of (Triggering unit))] = (ToN_NeutralTreeDamage + (ToN_NeutralTreeDamage_PerLvl x (Real((Level of ToN_TouchOfNature_Ability for (Triggering unit))))))
              • Set ToN_TempReal_C[(Custom value of (Triggering unit))] = (ToN_NeutralHPTreshold + (ToN_NeutralHPTreshold_PerLvl x (Real((Level of ToN_TouchOfNature_Ability for (Triggering unit))))))
              • Set ToN_TempReal_D[(Custom value of (Triggering unit))] = (Max life of ToN_TempUnit_A[(Custom value of (Triggering unit))])
              • Set ToN_TempAbility_A[(Custom value of (Triggering unit))] = ToN_NeutralSFX_Ability
              • Set ToN_TempString_A[(Custom value of (Triggering unit))] = ToN_NeutralCaptureSFX
              • Set ToN_TempString_B[(Custom value of (Triggering unit))] = ToN_NeutralCaptureSFX_Position
              • Set ToN_TempInteger_C[(Custom value of (Triggering unit))] = (ToN_NeutralTreeLimit + (ToN_NeutralTreeLimit_PerLvl x (Level of ToN_TouchOfNature_Ability for (Triggering unit))))
            • Else - Actions
          • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
          • -------- vvvvv-----If the target is disabled by the user, the whole casting will be skipped and the mana will be returned to the caster at the end. --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ToN_TargetIsPossible[(Custom value of (Triggering unit))] Equal to False
            • Then - Actions
              • Skip remaining actions
            • Else - Actions
              • Set ToN_TempLoc_A[(Custom value of (Triggering unit))] = (Position of (Target unit of ability being cast))
              • -------- vvvvv-----Here we check to see if the target is mechanical or not. If it is, the cast will get canceled again and the mana will return to the caster at the end. --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • (ToN_TempUnit_A[(Custom value of (Triggering unit))] is Mechanical) Not equal to True
                      • ToN_TempUnit_A[(Custom value of (Triggering unit))] Equal to (Triggering unit)
                      • (ToN_TempUnit_A[(Custom value of (Triggering unit))] is A structure) Equal to True
                • Then - Actions
                  • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
                  • -------- vvvvv-----Deviding the process between neutral passives and the rest, because one extra step is needed for neutral passives. --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Owner of ToN_TempUnit_A[(Custom value of (Triggering unit))]) Equal to Neutral Passive
                      • (ToN_TempUnit_A[(Custom value of (Triggering unit))] is A structure) Not equal to True
                    • Then - Actions
                      • -------- vvvvv-----First we check to see if there are enough trees for capturing the neutral passive non-structure unit. --------
                      • Destructible - Pick every destructible within ToN_TempReal_A[(Custom value of (Triggering unit))] of ToN_TempLoc_A[(Custom value of (Triggering unit))] and do (Actions)
                        • Loop - Actions
                          • -------- vvvvv-----We check to see if the destructibles selected are alive and are specified tree types which are set by the user. --------
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • ((Picked destructible) is dead) Not equal to True
                            • Then - Actions
                              • For each (Integer ToN_TempInteger_A[(Custom value of (Triggering unit))]) from 1 to ToN_MaxTreeTypes, do (Actions)
                                • Loop - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • (Destructible-type of (Picked destructible)) Equal to ToN_TargetTreeType[ToN_TempInteger_A[(Custom value of (Triggering unit))]]
                                      • ToN_TempReal_D[(Custom value of (Triggering unit))] Greater than 0.00
                                      • ToN_TempInteger_C[(Custom value of (Triggering unit))] Greater than 0
                                    • Then - Actions
                                      • -------- vvvvv-----The temp real (unit's max HP) will get reduced by the threshold amount and one integer will be added for each reduction to see how many trees are needed. --------
                                      • Set ToN_TempReal_D[(Custom value of (Triggering unit))] = (ToN_TempReal_D[(Custom value of (Triggering unit))] - ToN_TempReal_C[(Custom value of (Triggering unit))])
                                      • Set ToN_TempInteger_B[(Custom value of (Triggering unit))] = (ToN_TempInteger_B[(Custom value of (Triggering unit))] + 1)
                                      • -------- vvvvv-----Along with this process, an integer will get reduced from the tree limit (if there is one) to prevent the spell from being cast if the trees needed exceed the limit specified. --------
                                      • Set ToN_TempInteger_C[(Custom value of (Triggering unit))] = (ToN_TempInteger_C[(Custom value of (Triggering unit))] - 1)
                                    • Else - Actions
                            • Else - Actions
                      • -------- vvvvv-----If unit's max HP reaches 0 (only in our calculation), it means there were enough trees in the area and the amount needed is below tree limit. --------
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • ToN_TempReal_D[(Custom value of (Triggering unit))] Less than or equal to 0.00
                          • ToN_TempInteger_B[(Custom value of (Triggering unit))] Greater than 0
                        • Then - Actions
                          • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
                          • Set ToN_CaptureHappened[(Custom value of (Triggering unit))] = True
                          • -------- ^^^^^-----This will turn true as an indicator that capturing a unit has happened, so there won't be any need to return any mana to the caster. --------
                          • -------- ^^^^^-----This will also be needed later for SFXs and other stuff. --------
                          • -------- vvvvv-----Again we check to see if the destructibles selected are alive and are specified tree types which are set by the user. --------
                          • Destructible - Pick every destructible within ToN_TempReal_A[(Custom value of (Triggering unit))] of ToN_TempLoc_A[(Custom value of (Triggering unit))] and do (Actions)
                            • Loop - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • ((Picked destructible) is dead) Not equal to True
                                • Then - Actions
                                  • For each (Integer ToN_TempInteger_A[(Custom value of (Triggering unit))]) from 1 to ToN_MaxTreeTypes, do (Actions)
                                    • Loop - Actions
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • (Destructible-type of (Picked destructible)) Equal to ToN_TargetTreeType[ToN_TempInteger_A[(Custom value of (Triggering unit))]]
                                          • ToN_TempInteger_B[(Custom value of (Triggering unit))] Greater than 0
                                        • Then - Actions
                                          • -------- vvvvv-----Cast begins --------
                                          • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
                                          • Set ToN_TempInteger_B[(Custom value of (Triggering unit))] = (ToN_TempInteger_B[(Custom value of (Triggering unit))] - 1)
                                          • -------- ^^^^^-----This is the number of trees needed for the capturing process, which will be reduced with each tree selection, until it reaches 0. --------
                                          • Destructible - Set life of (Picked destructible) to ((Current life of (Picked destructible)) - ToN_TempReal_B[(Custom value of (Triggering unit))])
                                          • -------- ^^^^^-----damage is dealt to each tree. --------
                                          • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
                                          • -------- vvvvv-----Creating a dummy unit to cast a spell only to show the SFX. --------
                                          • Set ToN_TempLoc_B = (Position of (Picked destructible))
                                          • Unit - Create 1 ToN_DummyUnit_Main for (Triggering player) at ToN_TempLoc_B facing Default building facing degrees
                                          • Custom script: call RemoveLocation(udg_ToN_TempLoc_B)
                                          • Set ToN_TempUnit_C[(Custom value of (Triggering unit))] = (Last created unit)
                                          • Unit - Add ToN_TempAbility_A[(Custom value of (Triggering unit))] to ToN_TempUnit_C[(Custom value of (Triggering unit))]
                                          • Unit - Order ToN_TempUnit_C[(Custom value of (Triggering unit))] to Orc Far Seer - Chain Lightning ToN_TempUnit_A[(Custom value of (Triggering unit))]
                                          • Unit - Remove ToN_TempUnit_C[(Custom value of (Triggering unit))] from the game
                                          • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
                                          • -------- The capturing of the unit will be done at the end of the trigger. --------
                                        • Else - Actions
                                • Else - Actions
                        • Else - Actions
                    • Else - Actions
                      • -------- vvvvv-----Again we check to see if the destructibles selected are alive and are specified tree types which are set by the user. --------
                      • -------- vvvvv-----There is one extra condition though, which will prevent the spell from selecting all the trees, in case a structure is selected as the target. --------
                      • Destructible - Pick every destructible within ToN_TempReal_A[(Custom value of (Triggering unit))] of ToN_TempLoc_A[(Custom value of (Triggering unit))] and do (Actions)
                        • Loop - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • ((Picked destructible) is dead) Not equal to True
                              • ToN_BuildingArmorRootsHappened[(Custom value of (Triggering unit))] Equal to False
                            • Then - Actions
                              • For each (Integer ToN_TempInteger_A[(Custom value of (Triggering unit))]) from 1 to ToN_MaxTreeTypes, do (Actions)
                                • Loop - Actions
                                  • -------- vvvvv-----And of course checking the tree limitation. --------
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • (Destructible-type of (Picked destructible)) Equal to ToN_TargetTreeType[ToN_TempInteger_A[(Custom value of (Triggering unit))]]
                                      • ToN_TempInteger_C[(Custom value of (Triggering unit))] Greater than 0
                                    • Then - Actions
                                      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • (ToN_TempUnit_A[(Custom value of (Triggering unit))] is A structure) Equal to True
                                        • Then - Actions
                                          • Set ToN_BuildingArmorRootsHappened[(Custom value of (Triggering unit))] = True
                                          • -------- ^^^^^-----This boolean will prevent any other trees from being selected, if the target is a structure. --------
                                        • Else - Actions
                                          • Set ToN_TempInteger_C[(Custom value of (Triggering unit))] = (ToN_TempInteger_C[(Custom value of (Triggering unit))] - 1)
                                          • -------- ^^^^^-----This integer will get reduced by each tree selection to account for the tree limitation. If it reaches 0 there won't be any more trees selected. --------
                                          • Set ToN_HealDamageHappened[(Custom value of (Triggering unit))] = True
                                          • -------- ^^^^^-----If at least one tree was available in the radius, this booleans will turn true. This takes care of all self and allied/enemy/neutral non-structure units. --------
                                          • -------- ^^^^^-----This will also be needed later for SFXs and other stuff. --------
                                          • Set ToN_TempReal_D[(Custom value of (Triggering unit))] = (ToN_TempReal_D[(Custom value of (Triggering unit))] + ToN_TempReal_C[(Custom value of (Triggering unit))])
                                          • -------- ^^^^^-----The amount of damage or heal will be calculated with each tree selection. --------
                                      • Destructible - Set life of (Picked destructible) to ((Current life of (Picked destructible)) - ToN_TempReal_B[(Custom value of (Triggering unit))])
                                      • -------- ^^^^^-----Damaging the tree. --------
                                      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
                                      • -------- vvvvv-----Creating a dummy unit to cast a spell only to show the SFX. --------
                                      • Set ToN_TempLoc_B = (Position of (Picked destructible))
                                      • Unit - Create 1 ToN_DummyUnit_Main for (Triggering player) at ToN_TempLoc_B facing Default building facing degrees
                                      • Custom script: call RemoveLocation(udg_ToN_TempLoc_B)
                                      • Set ToN_TempUnit_C[(Custom value of (Triggering unit))] = (Last created unit)
                                      • Unit - Add ToN_TempAbility_A[(Custom value of (Triggering unit))] to ToN_TempUnit_C[(Custom value of (Triggering unit))]
                                      • Unit - Order ToN_TempUnit_C[(Custom value of (Triggering unit))] to Orc Far Seer - Chain Lightning ToN_TempUnit_A[(Custom value of (Triggering unit))]
                                      • -------- ^^^^^-----The unit will not get removed, because if the unit is structure there is still work that the unit has to do. --------
                                      • -------- vvvvv-----No we check to see if the unit is structure or not. --------
                                      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • (ToN_TempUnit_A[(Custom value of (Triggering unit))] is A structure) Equal to True
                                        • Then - Actions
                                          • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
                                          • -------- vvvvv-----The dummy unit will cast an armor/ root on the structure. --------
                                          • Unit - Add ToN_TempAbility_B[(Custom value of (Triggering unit))] to (Last created unit)
                                          • Unit - Set level of ToN_TempAbility_B[(Custom value of (Triggering unit))] for (Last created unit) to (Level of ToN_TouchOfNature_Ability for (Triggering unit))
                                          • Unit - Order (Last created unit) to Human Priest - Inner Fire ToN_TempUnit_A[(Custom value of (Triggering unit))]
                                          • Unit - Remove ToN_TempUnit_C[(Custom value of (Triggering unit))] from the game
                                          • -------- ^^^^^-----Now we have no need of this unit and it will get removed. --------
                                          • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
                                          • Set ToN_TempReal_E[(Custom value of ToN_TempUnit_A[(Custom value of (Triggering unit))])] = ToN_TempReal_C[(Custom value of (Triggering unit))]
                                          • -------- ^^^^^-----The duration that the building needs to be in armor/roots is saved in a temp variable. --------
                                          • -------- ^^^^^-----This will be needed for adding the building to a group for buff calculations. --------
                                          • -------- ^^^^^-----If the building is already in the unit group, its timer will get updated. --------
                                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            • If - Conditions
                                              • (ToN_TempUnit_A[(Custom value of (Triggering unit))] is in ToN_MainGroup) Not equal to True
                                            • Then - Actions
                                              • -------- vvvvv-----Adding the building to the buff-handling group. --------
                                              • Unit Group - Add ToN_TempUnit_A[(Custom value of (Triggering unit))] to ToN_MainGroup
                                              • -------- vvvvv-----Here we roughly calculate the scale of the building to change the scale of the armor/root SFX (dummy unit). --------
                                              • -------- vvvvv-----The calculation is done through spawning a unit on the building. The unit will be spawned on the first available point next to the building. --------
                                              • Unit - Create 1 ToN_DummyUnit_ScaleFinder for (Triggering player) at ToN_TempLoc_A[(Custom value of (Triggering unit))] facing Default building facing degrees
                                              • Set ToN_TempLoc_B = (Position of (Last created unit))
                                              • Unit - Remove (Last created unit) from the game
                                              • -------- vvvvv-----The distance between the spawned unit and the building is returned as a rough scaling value of the building. --------
                                              • -------- vvvvv-----It's not exact, but doesn't matter much, since we only want to scale the armor SFX to be visible from outside of the building. --------
                                              • Set ToN_TempReal_C[(Custom value of (Triggering unit))] = (Distance between ToN_TempLoc_B and ToN_TempLoc_A[(Custom value of (Triggering unit))])
                                              • Custom script: call RemoveLocation(udg_ToN_TempLoc_B)
                                              • -------- vvvvv-----Creating the dummy SFX unit (armor/root arounf the building). --------
                                              • Unit - Create 1 ToN_DummyUnit_Armor for (Triggering player) at ToN_TempLoc_A[(Custom value of (Triggering unit))] facing Default building facing degrees
                                              • -------- vvvvv-----Saving the spawned SFX unit and the structure's timer for buff handling. --------
                                              • Set ToN_TempUnit_B[(Custom value of ToN_TempUnit_A[(Custom value of (Triggering unit))])] = (Last created unit)
                                              • Set ToN_TempReal_D[(Custom value of (Triggering unit))] = (ToN_TempReal_D[(Custom value of (Triggering unit))] x ToN_TempReal_C[(Custom value of (Triggering unit))])
                                              • -------- vvvvv-----Scaling the armor/root SFX (the dummy unit). --------
                                              • Animation - Change (Last created unit)'s size to (ToN_TempReal_D[(Custom value of (Triggering unit))]%, ToN_TempReal_D[(Custom value of (Triggering unit))]%, ToN_TempReal_D[(Custom value of (Triggering unit))]%) of its original size
                                              • -------- vvvvv-----Pausing/unpausing the building based on the owners of the caster and the building. --------
                                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                • If - Conditions
                                                  • (ToN_TempUnit_A[(Custom value of (Triggering unit))] belongs to an ally of (Triggering player)) Equal to True
                                                  • (Owner of ToN_TempUnit_A[(Custom value of (Triggering unit))]) Not equal to Neutral Passive
                                                • Then - Actions
                                                  • -------- vvvvv-----Unpausing the building when armor is cast on it. This is done because the building may be in roots (cast by enemy hero with the same spell) --------
                                                  • Unit - Unpause ToN_TempUnit_A[(Custom value of (Triggering unit))]
                                                • Else - Actions
                                                  • -------- vvvvv-----Pausing the building when root is cast on it. This is done to disable the building. --------
                                                  • Unit - Pause ToN_TempUnit_A[(Custom value of (Triggering unit))]
                                            • Else - Actions
                                        • Else - Actions
                                          • Unit - Remove ToN_TempUnit_C[(Custom value of (Triggering unit))] from the game
                                          • -------- ^^^^^-----If the unit is not a structure, the dummy unit will get removed. --------
                                    • Else - Actions
                            • Else - Actions
                • Else - Actions
              • -------- vvvvv-----Now we do the core part of the spell. --------
              • -------- vvvvv-----If one of the following booleans are true it means an instance of this spell is applied on self or allied/owned/enemy/neutral non-structure units. --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • ToN_HealDamageHappened[(Custom value of (Triggering unit))] Equal to True
                      • ToN_CaptureHappened[(Custom value of (Triggering unit))] Equal to True
                • Then - Actions
                  • -------- vvvvv-----First creating the SFX of healing/capturing/damaging on the unit. --------
                  • Special Effect - Create a special effect attached to the ToN_TempString_B[(Custom value of (Triggering unit))] of ToN_TempUnit_A[(Custom value of (Triggering unit))] using ToN_TempString_A[(Custom value of (Triggering unit))]
                  • Special Effect - Destroy (Last created special effect)
                  • -------- vvvvv-----The calculated amount in the above turns into healing or damage based on the owner of the unit. --------
                  • -------- vvvvv-----And if the owner is neutral passive, the owner of the unit is changed to the caster's instead. --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (ToN_TempUnit_A[(Custom value of (Triggering unit))] belongs to an ally of (Triggering player)) Equal to True
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Owner of ToN_TempUnit_A[(Custom value of (Triggering unit))]) Equal to Neutral Passive
                        • Then - Actions
                          • Unit - Change ownership of ToN_TempUnit_A[(Custom value of (Triggering unit))] to (Triggering player) and Change color
                        • Else - Actions
                          • Unit - Set life of ToN_TempUnit_A[(Custom value of (Triggering unit))] to ((Life of ToN_TempUnit_A[(Custom value of (Triggering unit))]) + ToN_TempReal_D[(Custom value of (Triggering unit))])
                    • Else - Actions
                      • Unit - Cause (Triggering unit) to damage ToN_TempUnit_A[(Custom value of (Triggering unit))], dealing ToN_TempReal_D[(Custom value of (Triggering unit))] damage of attack type ToN_FoeDamage_AttackType and damage type ToN_FoeDamage_DamageType
                  • Set ToN_TempLoc_B = ToN_TempLoc_A[(Custom value of (Triggering unit))]
                  • Custom script: call RemoveLocation(udg_ToN_TempLoc_B)
                • Else - Actions
          • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
        • Else - Actions
          • -------- vvvvv-----Some general preparations for casting on ground/trees. --------
          • Set ToN_TempLoc_A[(Custom value of (Triggering unit))] = (Target point of ability being cast)
          • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
          • -------- vvvvv-----First we check closely around the target point (the radius is small and is set by the user) to see if any trees are available nearby. --------
          • -------- vvvvv-----And of course we check to see if the destructible selected is alive and is one of the specified tree types which are set by the user. --------
          • Destructible - Pick every destructible within ToN_PulseTreeSelectionRadius of ToN_TempLoc_A[(Custom value of (Triggering unit))] and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ToN_TargetIsTree[(Player number of (Triggering player))] Equal to False
                  • ((Picked destructible) is dead) Equal to False
                • Then - Actions
                  • For each (Integer ToN_TempInteger_A[(Custom value of (Triggering unit))]) from 1 to ToN_MaxTreeTypes, do (Actions)
                    • Loop - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Destructible-type of (Picked destructible)) Equal to ToN_TargetTreeType[ToN_TempInteger_A[(Custom value of (Triggering unit))]]
                        • Then - Actions
                          • Set ToN_TargetIsTree[(Player number of (Triggering player))] = True
                          • -------- ^^^^^-----If a tree is found, the boolean will turn true to prevent further tree selection and to determine that the target is a tree indeed. --------
                          • Set ToN_TargetedTree[(Custom value of (Triggering unit))] = (Picked destructible)
                          • -------- ^^^^^-----And the selected tree will be assigned to a variable. --------
                        • Else - Actions
                • Else - Actions
          • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ToN_TargetIsTree[(Player number of (Triggering player))] Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ToN_TargetTreeEnabled Equal to False
                • Then - Actions
                  • -------- ^^^^^-----If trees are excluded from the possible targets of the spell, the whole trigger will get skipped, and the mana will be returned to the caster at the end. --------
                  • Skip remaining actions
                • Else - Actions
                  • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
                  • -------- vvvvv-----Cast begins. --------
                  • Set ToN_TreePulseHappened[(Custom value of (Triggering unit))] = True
                  • -------- ^^^^^-----This will turn true to prevent the mana from being returned to the caster. --------
                  • Set ToN_TempLoc_B = (Position of ToN_TargetedTree[(Custom value of (Triggering unit))])
                  • -------- vvvvv-----Creating a dummy unit and adding it to a group to constantly cast the pulse. --------
                  • Unit - Create 1 ToN_DummyUnit_Pulse for (Triggering player) at ToN_TempLoc_B facing Default building facing degrees
                  • Animation - Change (Last created unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 100.00% transparency
                  • Custom script: call RemoveLocation(udg_ToN_TempLoc_B)
                  • Unit - Add ToN_Pulse_Ability to (Last created unit)
                  • Unit - Set level of ToN_Pulse_Ability for (Last created unit) to (Level of ToN_TouchOfNature_Ability for (Triggering unit))
                  • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
                  • -------- vvvvv-----All the neccessary data is saved along with the unit (duration, interval, damage, damage to the tree, the caster, and the targeted tree) --------
                  • Set ToN_TempReal_A[(Custom value of (Last created unit))] = (ToN_PulseDuration + (ToN_PulseDuration_PerLvl x (Real((Level of ToN_TouchOfNature_Ability for (Triggering unit))))))
                  • Set ToN_TempReal_E[(Custom value of (Last created unit))] = (ToN_PulseDuration + (ToN_PulseDuration_PerLvl x (Real((Level of ToN_TouchOfNature_Ability for (Triggering unit))))))
                  • Set ToN_TempReal_B[(Custom value of (Last created unit))] = (ToN_PulseInterval + (ToN_PulseInterval_PerLvl x (Real((Level of ToN_TouchOfNature_Ability for (Triggering unit))))))
                  • Set ToN_TempReal_C[(Custom value of (Last created unit))] = (ToN_PulseTreeDamage + (ToN_PulseTreeDamage_PerLvl x (Real((Level of ToN_TouchOfNature_Ability for (Triggering unit))))))
                  • Set ToN_TempReal_D[(Custom value of (Last created unit))] = (ToN_PulseDamage + (ToN_PulseDamage_PerLvl x (Real((Level of ToN_TouchOfNature_Ability for (Triggering unit))))))
                  • Set ToN_TempUnit_A[(Custom value of (Last created unit))] = (Triggering unit)
                  • Set ToN_TargetedTree[(Custom value of (Last created unit))] = ToN_TargetedTree[(Custom value of (Triggering unit))]
                  • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
                  • Unit Group - Add (Last created unit) to ToN_MainGroup
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ToN_TargetGroundEnabled Equal to False
                • Then - Actions
                  • -------- ^^^^^-----If ground is excluded from the possible targets of the spell, the whole trigger will get skipped, and the mana will be returned to the caster at the end. --------
                  • Skip remaining actions
                • Else - Actions
                  • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
                  • -------- vvvvv-----Cast begins. --------
                  • Set ToN_GroundHappened[(Custom value of (Triggering unit))] = True
                  • -------- ^^^^^-----This will turn true to prevent the mana from being returned to the caster. --------
                  • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
                  • -------- vvvvv-----Creating a dummy unit for the SFX in the center of the selected area and its SFX. --------
                  • Unit - Create 1 ToN_GroundGrowthDelaySFX_Unit1 for (Triggering player) at ToN_TempLoc_A[(Custom value of (Triggering unit))] facing Default building facing degrees
                  • Set ToN_TempReal_A[(Custom value of (Triggering unit))] = ((ToN_GroundDelaySFX1Size + (ToN_GroundDelaySFX1Size_PerLvl x (Real((Level of ToN_TouchOfNature_Ability for (Triggering unit)))))) x 100.00)
                  • Animation - Change (Last created unit)'s size to (ToN_TempReal_A[(Custom value of (Triggering unit))]%, ToN_TempReal_A[(Custom value of (Triggering unit))]%, ToN_TempReal_A[(Custom value of (Triggering unit))]%) of its original size
                  • Animation - Change (Last created unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with ToN_GroundGrowthDelaySFX_Trans% transparency
                  • Special Effect - Create a special effect at ToN_TempLoc_A[(Custom value of (Triggering unit))] using ToN_GroundGrowthDelaySFX_1
                  • Set ToN_TempSFX[(Custom value of (Last created unit))] = (Last created special effect)
                  • Set ToN_TempUnit_A[(Custom value of (Triggering unit))] = (Last created unit)
                  • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
                  • -------- vvvvv-----Saving all the necessary data of the unit and add it to a unit group to spend its time.. --------
                  • Set ToN_TempReal_A[(Custom value of (Last created unit))] = (ToN_GroundGrowthDelay + (ToN_GroundGrowthDelay_PerLvl x (Real((Level of ToN_TouchOfNature_Ability for (Triggering unit))))))
                  • Set ToN_TempReal_B[(Custom value of (Last created unit))] = (ToN_GroundRadius + (ToN_GroundRadius_PerLvl x (Real((Level of ToN_TouchOfNature_Ability for (Triggering unit))))))
                  • Set ToN_TempReal_C[(Custom value of (Last created unit))] = (ToN_GroundGrowthTime + (ToN_GroundGrowthTime_PerLvl x (Real((Level of ToN_TouchOfNature_Ability for (Triggering unit))))))
                  • Set ToN_TempReal_D[(Custom value of (Last created unit))] = (ToN_GroundTreeHeal + (ToN_GroundTreeHeal_PerLvl x (Real((Level of ToN_TouchOfNature_Ability for (Triggering unit))))))
                  • Set ToN_TempReal_D[(Custom value of (Last created unit))] = (ToN_TempReal_D[(Custom value of (Last created unit))] / ToN_TempReal_A[(Custom value of (Last created unit))])
                  • Set ToN_TempInteger_A[(Custom value of (Last created unit))] = (ToN_GroundTreeLimit + (ToN_GroundTreeLimit_PerLvl x (Level of ToN_TouchOfNature_Ability for (Triggering unit))))
                  • Set ToN_TempInteger_B[(Custom value of (Last created unit))] = (ToN_GroundCorpseLimit + (ToN_GroundCorpseLimit_PerLvl x (Level of ToN_TouchOfNature_Ability for (Triggering unit))))
                  • Set ToN_TempInteger_C[(Custom value of (Last created unit))] = (ToN_GroundTreePerTree + (ToN_GroundTreePerTree_PerLvl x (Level of ToN_TouchOfNature_Ability for (Triggering unit))))
                  • Set ToN_TempInteger_D[(Custom value of (Last created unit))] = (ToN_GroundTreePerCorpse + (ToN_GroundTreePerCorpse_PerLvl x (Level of ToN_TouchOfNature_Ability for (Triggering unit))))
                  • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
                  • -------- vvvvv-----This dummy ability is used on another dummy unit for its looping sound. --------
                  • Unit - Add ToN_GroundGrowDelaySFX_Ability to (Last created unit)
                  • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
                  • Unit Group - Add (Last created unit) to ToN_MainGroup
                  • -------- vvvvv-----This temp boolean is needed and changed repeatedly for shifting the location that the next dummy SFX units will be created. --------
                  • Set ToN_TempBoolean[(Custom value of (Triggering unit))] = True
                  • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
                  • -------- vvvvv-----8 dummy unit will be created. 4 close to the center, and 4 far from the center. --------
                  • For each (Integer ToN_TempInteger_A[(Custom value of (Triggering unit))]) from 0 to 7, do (Actions)
                    • Loop - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • ToN_TempBoolean[(Custom value of (Triggering unit))] Equal to True
                        • Then - Actions
                          • Set ToN_TempLoc_B = (ToN_TempLoc_A[(Custom value of (Triggering unit))] offset by (ToN_GroundDelaySFXSinusMin + (ToN_GroundDelaySFXSinusRate / 33.33)) towards ((Real(ToN_TempInteger_A[(Custom value of (Triggering unit))])) x 45.00) degrees)
                          • -------- ^^^^^-----Birth location of the unit will be set near the center. --------
                          • -------- ^^^^^-----Birth location will be bumped one instance closer to the center so that it doesn't fall out of the area, --------
                          • Set ToN_TempBoolean[(Custom value of (Triggering unit))] = False
                          • Set ToN_TempReal_A[(Custom value of (Triggering unit))] = 1.00
                          • -------- ^^^^^-----This +1 will be multiplied in the movement direction of this dummy unit, It serves only as the determinant of the movement direction. --------
                        • Else - Actions
                          • Set ToN_TempLoc_B = (ToN_TempLoc_A[(Custom value of (Triggering unit))] offset by ((ToN_GroundRadius - (ToN_GroundDelaySFXSinusRate / 33.33)) + (ToN_GroundRadius_PerLvl x (Real((Level of ToN_TouchOfNature_Ability for (Triggering unit)))))) towards ((Real(ToN_TempInteger_A[(Custo
                          • -------- ^^^^^-----Birth location of the unit will be set far from the center. --------
                          • -------- ^^^^^-----Birth location will be bumped one instance farther from the center so that it doesn't fall out of the area, --------
                          • Set ToN_TempBoolean[(Custom value of (Triggering unit))] = True
                          • Set ToN_TempReal_A[(Custom value of (Triggering unit))] = -1.00
                          • -------- ^^^^^-----This -1 will be multiplied in the movement direction of this dummy unit, It serves only as the determinant of the movement direction. --------
                      • -------- vvvvv-----Creating the dummy unit for the rotating SFX around the center of the selected area. --------
                      • Unit - Create 1 ToN_GroundGrowthDelaySFX_Unit2 for (Triggering player) at ToN_TempLoc_B facing Default building facing degrees
                      • Animation - Change (Last created unit)'s size to ((ToN_GroundDelaySFX2Size x 100.00)%, (ToN_GroundDelaySFX2Size x 100.00)%, (ToN_GroundDelaySFX2Size x 100.00)%) of its original size
                      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
                      • -------- vvvvv-----Saving all the necessary data for the unit and add it to a unit group for rotation. --------
                      • -------- vvvvv-----(Radius, direction of the constant movement (Reals: -1 and +1), direction of the sinus movement (Boolean), The central unit around which these units will rotate. --------
                      • Set ToN_TempReal_A[(Custom value of (Last created unit))] = (ToN_GroundRadius + (ToN_GroundRadius_PerLvl x (Real((Level of ToN_TouchOfNature_Ability for (Triggering unit))))))
                      • Set ToN_TempReal_B[(Custom value of (Last created unit))] = ToN_TempReal_A[(Custom value of (Triggering unit))]
                      • Set ToN_TempBoolean[(Custom value of (Last created unit))] = False
                      • Set ToN_TempUnit_A[(Custom value of (Last created unit))] = ToN_TempUnit_A[(Custom value of (Triggering unit))]
                      • Unit Group - Add (Last created unit) to ToN_WaitingGroup
                      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
                      • Custom script: call RemoveLocation(udg_ToN_TempLoc_B)
                  • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
                  • -------- vvvvv-----This dummy unit is created so that the central SFX dummy unit casts a spell on it for looping the sound effect of the spell. The unit will be hidden. --------
                  • Unit - Create 1 ToN_DummyUnit_ScaleFinder for (Triggering player) at ToN_TempLoc_A[(Custom value of (Triggering unit))] facing Default building facing degrees
                  • Set ToN_TempUnit_B[(Custom value of ToN_TempUnit_A[(Custom value of (Triggering unit))])] = (Last created unit)
                  • Unit - Order ToN_TempUnit_A[(Custom value of (Triggering unit))] to Human Blood Mage - Banish (Last created unit)
                  • Unit - Hide (Last created unit)
                  • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
          • Set ToN_TempLoc_B = ToN_TempLoc_A[(Custom value of (Triggering unit))]
          • Custom script: call RemoveLocation(udg_ToN_TempLoc_B)
      • -------- vvvvv-----Now if none of the targets are selected or castable, the mana used for the spell will be returned to the caster. --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ToN_HealDamageHappened[(Custom value of (Triggering unit))] Equal to False
          • ToN_CaptureHappened[(Custom value of (Triggering unit))] Equal to False
          • ToN_BuildingArmorRootsHappened[(Custom value of (Triggering unit))] Equal to False
          • ToN_TreePulseHappened[(Custom value of (Triggering unit))] Equal to False
          • ToN_GroundHappened[(Custom value of (Triggering unit))] Equal to False
        • Then - Actions
          • Unit - Order (Triggering unit) to Stop
          • Wait 0.03 seconds
          • Unit - Set mana of (Triggering unit) to ((Mana of (Triggering unit)) + ToN_TempReal_F[(Custom value of (Triggering unit))])
        • Else - Actions

  • ToN Groupings
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (ToN_MainGroup is empty) Equal to False
          • (ToN_WaitingGroup is empty) Equal to False
    • Actions
      • Unit Group - Pick every unit in ToN_MainGroup and do (Actions)
        • Loop - Actions
          • -------- vvvvv-----Three types of units are in this group. (Units that are pulsing on behalf of the trees, structures that are in armor/roots, and dummy SFX unit in the center of the area when the spell cast on the ground) --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to ToN_DummyUnit_Pulse
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • ToN_TempReal_A[(Custom value of (Picked unit))] Less than or equal to 0.00
                      • (ToN_TargetedTree[(Custom value of (Picked unit))] is dead) Equal to True
                      • ToN_TargetedTree[(Custom value of (Picked unit))] Equal to No destructible
                      • (ToN_TempUnit_A[(Custom value of (Picked unit))] is dead) Equal to True
                      • ToN_TempUnit_A[(Custom value of (Picked unit))] Equal to No unit
                • Then - Actions
                  • -------- ^^^^^-----If you haven't set the caster of Touch of Nature (ToN) as the damage source of the pulse, you can freely remove the last 2 conditions. (But its totally optional) --------
                  • -------- vvvvv-----The pulsing unit will be removed from the group when its timer ends or the tree dies or gets removed or the caster dies or gets removed. --------
                  • -------- vvvvv-----But the unit won't get removed from the game immediately, insead it is sent to the next group to wait for 5 seconds. --------
                  • -------- vvvvv-----This waiting period is spent due to the damage detection engine. Since it may take a little time till the pulse reaches the unit, if the source gets removed during this time, the damage source won't be detected. --------
                  • Unit Group - Remove (Picked unit) from ToN_MainGroup
                  • Set ToN_TempReal_A[(Custom value of (Picked unit))] = 5.00
                  • Unit Group - Add (Picked unit) to ToN_WaitingGroup
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ToN_TempReal_E[(Custom value of (Picked unit))] Less than or equal to ToN_TempReal_A[(Custom value of (Picked unit))]
                    • Then - Actions
                      • -------- vvvvv-----Reducing one interval-time from the whole duration. and when the timer reaces it, it will cast a pulse. --------
                      • Set ToN_TempReal_A[(Custom value of (Picked unit))] = (ToN_TempReal_A[(Custom value of (Picked unit))] - ToN_TempReal_B[(Custom value of (Picked unit))])
                      • -------- vvvvv-----Counting down the timer of the unit. --------
                      • Set ToN_TempReal_E[(Custom value of (Picked unit))] = (ToN_TempReal_E[(Custom value of (Picked unit))] - 0.03)
                      • -------- vvvvv-----Casting a pulse when the interval is reached and damaging the source tree of the pulse. --------
                      • Unit - Order (Picked unit) to Night Elf Warden - Fan Of Knives
                      • Unit - Order (Picked unit) to Stop
                      • Destructible - Set life of ToN_TargetedTree[(Custom value of (Picked unit))] to ((Current life of ToN_TargetedTree[(Custom value of (Picked unit))]) - ToN_TempReal_C[(Custom value of (Picked unit))])
                    • Else - Actions
                      • -------- vvvvv-----Counting down the timer of the unit. --------
                      • Set ToN_TempReal_E[(Custom value of (Picked unit))] = (ToN_TempReal_E[(Custom value of (Picked unit))] - 0.03)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is A structure) Equal to True
            • Then - Actions
              • -------- vvvvv-----Counting down the timer of the unit. --------
              • Set ToN_TempReal_E[(Custom value of (Picked unit))] = (ToN_TempReal_E[(Custom value of (Picked unit))] - 0.03)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ToN_TempReal_E[(Custom value of (Picked unit))] Less than or equal to 0.00
                • Then - Actions
                  • -------- vvvvv-----When its timer is finished, the structure will get removed from the unit group, its armor/root SFX will be killed. its buff will be lifted, and it will get unpaused if the building is paused due to being rooted. --------
                  • Unit Group - Remove (Picked unit) from ToN_MainGroup
                  • Unit - Kill ToN_TempUnit_B[(Custom value of (Picked unit))]
                  • Unit - Remove ToN_Rooting buff from (Picked unit)
                  • Unit - Unpause (Picked unit)
                • Else - Actions
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to ToN_GroundGrowthDelaySFX_Unit1
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ToN_TempReal_A[(Custom value of (Picked unit))] Less than or equal to 0.00
                • Then - Actions
                  • -------- vvvvv-----When the delay time of this unit ends, it will create sprouts from corpses and dead trees. --------
                  • Set ToN_TempLoc_C = (Position of (Picked unit))
                  • Set ToN_TempLoc_E = (Position of (Picked unit))
                  • Set ToN_TempUnitGroup = (Units within ToN_TempReal_B[(Custom value of (Picked unit))] of ToN_TempLoc_C)
                  • Custom script: call RemoveLocation(udg_ToN_TempLoc_C)
                  • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
                  • -------- vvvvv-----These are saved into new temp variables, because we are about to pick new units while we have already picked a unit. --------
                  • Set ToN_TempInteger_E = ToN_TempInteger_B[(Custom value of (Picked unit))]
                  • Set ToN_TempInteger_F = 0
                  • Set ToN_TempInteger_G = (Player number of (Owner of (Picked unit)))
                  • Set ToN_TempInteger_H = ToN_TempInteger_D[(Custom value of (Picked unit))]
                  • Set ToN_TempReal_G = ToN_TempReal_C[(Custom value of (Picked unit))]
                  • Set ToN_TempReal_H = ((ToN_GroundGrowthSFXUnitSizeMax - ToN_GroundGrowthSFXUnitSizeMin) / ToN_TempReal_G)
                  • Set ToN_TempReal_I = (ToN_GroundGrowthSFXUnitSizeMin x 100.00)
                  • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
                  • -------- vvvvv-----Picking all the dead units for sprouting. --------
                  • -------- vvvvv-----But also checking the limitation of the corpses. --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ToN_TempInteger_H Greater than 0
                    • Then - Actions
                      • Unit Group - Pick every unit in ToN_TempUnitGroup and do (Actions)
                        • Loop - Actions
                          • -------- vvvvv-----Excluding the mechanical and structure units. --------
                          • -------- vvvvv-----But also checking the limitation of the sprouts for each corpse. --------
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Life of (Picked unit)) Less than or equal to 0.00
                              • ((Picked unit) is A structure) Equal to False
                              • ((Picked unit) is Mechanical) Equal to False
                              • ToN_TempInteger_F Less than ToN_TempInteger_E
                            • Then - Actions
                              • For each (Integer ToN_TempInteger_A[(Custom value of (Picked unit))]) from 1 to ToN_TempInteger_H, do (Actions)
                                • Loop - Actions
                                  • -------- vvvvv-----Removing the corpse, creating new sprout(s) for the corpse. --------
                                  • Set ToN_TempLoc_C = (Position of (Picked unit))
                                  • Unit - Remove (Picked unit) from the game
                                  • Set ToN_TempLoc_D = (ToN_TempLoc_C offset by 80.00 towards ((Real(ToN_TempInteger_A[(Custom value of (Picked unit))])) x (Random real number between 30.00 and 60.00)) degrees)
                                  • Unit - Create 1 ToN_GroundGrowthSFX_Unit for (Player(ToN_TempInteger_G)) at ToN_TempLoc_D facing (Random angle) degrees
                                  • Custom script: call RemoveLocation(udg_ToN_TempLoc_C)
                                  • Custom script: call RemoveLocation(udg_ToN_TempLoc_D)
                                  • Animation - Change (Last created unit)'s size to (ToN_TempReal_I%, ToN_TempReal_I%, ToN_TempReal_I%) of its original size
                                  • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
                                  • -------- vvvvv-----Saving the neccassary data relating to the sprouts minimum size, scaling rate, and growing time. --------
                                  • Set ToN_TempReal_A[(Custom value of (Last created unit))] = ToN_TempReal_G
                                  • Set ToN_TempReal_B[(Custom value of (Last created unit))] = ToN_TempReal_I
                                  • Set ToN_TempReal_C[(Custom value of (Last created unit))] = ToN_TempReal_H
                                  • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
                                  • -------- vvvvv-----Adding this dummy ability for SFX and sound effect for sprouting initiation and termination, and casting it for growing initiation. --------
                                  • Unit - Add ToN_GroundGrowSoundSFX_Ability to (Last created unit)
                                  • Unit - Order (Last created unit) to Night Elf Warden - Fan Of Knives
                                  • -------- vvvvv-----Adding the sprout to the next group for growing. --------
                                  • Unit Group - Add (Last created unit) to ToN_WaitingGroup
                              • -------- vvvvv-----Limit counter. (Limit of trees for each corpse). --------
                              • Set ToN_TempInteger_F = (ToN_TempInteger_F + 1)
                            • Else - Actions
                    • Else - Actions
                  • Custom script: call DestroyGroup(udg_ToN_TempUnitGroup)
                  • -------- vvvvv-----Resetting the limit counter for the dead trees. --------
                  • Set ToN_TempInteger_E = ToN_TempInteger_A[(Custom value of (Picked unit))]
                  • Set ToN_TempInteger_F = 0
                  • -------- vvvvv-----Picking all the dead trees for sprouting. --------
                  • -------- vvvvv-----And also checking the limitation of the dead trees. --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ToN_TempInteger_C[(Custom value of (Picked unit))] Greater than 0
                    • Then - Actions
                      • -------- vvvvv-----And again here we check to see if the selected destructible is a defined tree type or not. --------
                      • -------- vvvvv-----And making sure it is dead. --------
                      • Destructible - Pick every destructible within ToN_TempReal_B[(Custom value of (Picked unit))] of ToN_TempLoc_E and do (Actions)
                        • Loop - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • ((Picked destructible) is dead) Equal to True
                            • Then - Actions
                              • For each (Integer ToN_TempInteger_G) from 1 to ToN_MaxTreeTypes, do (Actions)
                                • Loop - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • (Destructible-type of (Picked destructible)) Equal to ToN_TargetTreeType[ToN_TempInteger_G]
                                      • ToN_TempInteger_F Less than ToN_TempInteger_E
                                    • Then - Actions
                                      • For each (Integer ToN_TempInteger_H) from 1 to ToN_TempInteger_C[(Custom value of (Picked unit))], do (Actions)
                                        • Loop - Actions
                                          • -------- vvvvv-----Removing the dead tree, creating new sprout(s) for the dead tree. --------
                                          • Set ToN_TempLoc_C = (Position of (Picked destructible))
                                          • Destructible - Remove (Picked destructible)
                                          • Set ToN_TempLoc_D = (ToN_TempLoc_C offset by 50.00 towards ((Real(ToN_TempInteger_H)) x (Random real number between 30.00 and 60.00)) degrees)
                                          • Unit - Create 1 ToN_GroundGrowthSFX_Unit for (Owner of (Picked unit)) at ToN_TempLoc_D facing (Random angle) degrees
                                          • Custom script: call RemoveLocation(udg_ToN_TempLoc_C)
                                          • Custom script: call RemoveLocation(udg_ToN_TempLoc_D)
                                          • Animation - Change (Last created unit)'s size to (ToN_TempReal_I%, ToN_TempReal_I%, ToN_TempReal_I%) of its original size
                                          • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
                                          • -------- vvvvv-----Saving the neccassary data relating to the sprouts minimum size, scaling rate, and growing time. --------
                                          • Set ToN_TempReal_A[(Custom value of (Last created unit))] = ToN_TempReal_C[(Custom value of (Picked unit))]
                                          • Set ToN_TempReal_B[(Custom value of (Last created unit))] = ToN_TempReal_I
                                          • Set ToN_TempReal_C[(Custom value of (Last created unit))] = ToN_TempReal_H
                                          • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
                                          • -------- vvvvv-----Adding this dummy ability for SFX and sound effect for sprouting initiation and termination, and casting it for growing initiation. --------
                                          • Unit - Add ToN_GroundGrowSoundSFX_Ability to (Last created unit)
                                          • Unit - Order (Last created unit) to Night Elf Warden - Fan Of Knives
                                          • -------- vvvvv-----Adding the sprout to the next group for growing. --------
                                          • Unit Group - Add (Last created unit) to ToN_WaitingGroup
                                      • -------- vvvvv-----Limit counter. (Limit of trees for each dead tree). --------
                                      • Set ToN_TempInteger_F = (ToN_TempInteger_F + 1)
                                    • Else - Actions
                            • Else - Actions
                    • Else - Actions
                  • Custom script: call RemoveLocation(udg_ToN_TempLoc_E)
                  • Special Effect - Destroy ToN_TempSFX[(Custom value of (Picked unit))]
                  • -------- vvvvv-----And of course removing the SFX unit and the unit that is hidden from view and is making the looping sound. --------
                  • Unit - Remove ToN_TempUnit_B[(Custom value of (Picked unit))] from the game
                  • Unit - Remove (Picked unit) from the game
                • Else - Actions
                  • -------- vvvvv-----If this unit's delay duration is not finished, it will heal trees in the area. --------
                  • Set ToN_TempReal_A[(Custom value of (Picked unit))] = (ToN_TempReal_A[(Custom value of (Picked unit))] - 0.03)
                  • Set ToN_TempLoc_E = (Position of (Picked unit))
                  • -------- vvvvv-----checking again to see if the selected destructible is a defined tree type or not. --------
                  • -------- vvvvv-----And making sure it is alive and it is a damaged tree.. --------
                  • Destructible - Pick every destructible within ToN_TempReal_B[(Custom value of (Picked unit))] of ToN_TempLoc_E and do (Actions)
                    • Loop - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • ((Picked destructible) is dead) Equal to False
                          • (Current life of (Picked destructible)) Less than (Max life of (Picked destructible))
                        • Then - Actions
                          • For each (Integer ToN_TempInteger_G) from 1 to ToN_MaxTreeTypes, do (Actions)
                            • Loop - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Destructible-type of (Picked destructible)) Equal to ToN_TargetTreeType[ToN_TempInteger_G]
                                • Then - Actions
                                  • Destructible - Set life of (Picked destructible) to ((Current life of (Picked destructible)) + (ToN_TempReal_D[(Custom value of (Picked unit))] / 33.33))
                                • Else - Actions
                        • Else - Actions
            • Else - Actions
      • Unit Group - Pick every unit in ToN_WaitingGroup and do (Actions)
        • Loop - Actions
          • -------- vvvvv-----And three types of units are in this group, too. (The pulsing unit that is waiting idly for its removal after 5 seconds, the sprouts that are growing, and the rotating units arounf the center of the spell when cast on the ground) --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to ToN_DummyUnit_Pulse
            • Then - Actions
              • -------- vvvvv-----This unit is only waiting to be removed due to debugging reasons for detection of source damage of the pulse. --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ToN_TempReal_A[(Custom value of (Picked unit))] Less than or equal to 0.00
                • Then - Actions
                  • Unit Group - Remove (Picked unit) from ToN_WaitingGroup
                  • Unit - Remove (Picked unit) from the game
                • Else - Actions
                  • Set ToN_TempReal_A[(Custom value of (Picked unit))] = (ToN_TempReal_A[(Custom value of (Picked unit))] - 0.03)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to ToN_GroundGrowthSFX_Unit
            • Then - Actions
              • -------- vvvvv-----This unit is only growing in scale, and when its timer ends, the specified number of trees will be created from default/custom tree-type groups in its place. --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ToN_TempReal_A[(Custom value of (Picked unit))] Less than or equal to 0.00
                • Then - Actions
                  • Set ToN_TempLoc_C = (Position of (Picked unit))
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ToN_DefaultSummonedTreeTypes Equal to True
                    • Then - Actions
                      • Destructible - Create a ToN_TargetTreeType[(Random integer number between 1 and ToN_MaxTreeTypes)] at ToN_TempLoc_C facing (Random angle) with scale (Random real number between ToN_GroundSummonedTreeSize_Min and ToN_GroundSummonedTreeSize_Max) and variation (Random integer number between 0 and 9)
                    • Else - Actions
                      • Destructible - Create a ToN_CustomSummonedTreeType[(Random integer number between 1 and ToN_MaxCostumTreeTypes)] at ToN_TempLoc_C facing (Random angle) with scale (Random real number between ToN_GroundSummonedTreeSize_Min and ToN_GroundSummonedTreeSize_Max) and variation (Random integer number between 0 and 9)
                  • Custom script: call RemoveLocation(udg_ToN_TempLoc_C)
                  • Unit Group - Remove (Picked unit) from ToN_WaitingGroup
                  • -------- vvvvv-----And one cast of the previously added spell for SFX and sound effect. --------
                  • Unit - Order (Picked unit) to Night Elf Warden - Fan Of Knives
                  • -------- vvvvv-----And of course removing it. --------
                  • Unit - Remove (Picked unit) from the game
                • Else - Actions
                  • -------- vvvvv-----Growing in scale, each moment. --------
                  • Set ToN_TempReal_A[(Custom value of (Picked unit))] = (ToN_TempReal_A[(Custom value of (Picked unit))] - 0.03)
                  • Set ToN_TempReal_B[(Custom value of (Picked unit))] = (ToN_TempReal_B[(Custom value of (Picked unit))] + (3.00 x ToN_TempReal_C[(Custom value of (Picked unit))]))
                  • Animation - Change (Picked unit)'s size to (ToN_TempReal_B[(Custom value of (Picked unit))]%, ToN_TempReal_B[(Custom value of (Picked unit))]%, ToN_TempReal_B[(Custom value of (Picked unit))]%) of its original size
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to ToN_GroundGrowthDelaySFX_Unit2
            • Then - Actions
              • -------- vvvvv-----This unit will only be rotated around and pushed toward or away from the center of the spell when it is cast on the ground (only in delay time when the trees are being healed in the area. --------
              • -------- vvvvv-----There is nothing special about it. They are just being moved based on their negative or positive direction and based on their boolean that indicates the sinus movement. --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (ToN_TempUnit_A[(Custom value of (Picked unit))] is in ToN_MainGroup) Not equal to True
                • Then - Actions
                  • Unit Group - Remove (Picked unit) from ToN_WaitingGroup
                  • Unit - Remove (Picked unit) from the game
                • Else - Actions
                  • Set ToN_TempLoc_C = (Position of (Picked unit))
                  • Set ToN_TempLoc_D = (Position of ToN_TempUnit_A[(Custom value of (Picked unit))])
                  • Set ToN_TempReal_I = (Distance between ToN_TempLoc_C and ToN_TempLoc_D)
                  • Set ToN_TempReal_H = (Angle from ToN_TempLoc_D to ToN_TempLoc_C)
                  • Set ToN_TempReal_H = (ToN_TempReal_H + (ToN_TempReal_B[(Custom value of (Picked unit))] x (ToN_GroundDelaySFXRotationRate / 33.33)))
                  • -------- vvvvv-----When the unit reaches a boundary, its boolean is changed and then it moves in the opposite direction toward or away from the center. --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ToN_TempReal_I Greater than or equal to ToN_GroundDelaySFXSinusMin
                      • ToN_TempReal_I Less than or equal to ToN_TempReal_A[(Custom value of (Picked unit))]
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • ToN_TempBoolean[(Custom value of (Picked unit))] Equal to True
                        • Then - Actions
                          • Set ToN_TempReal_I = (ToN_TempReal_I + (ToN_GroundDelaySFXSinusRate / 33.33))
                        • Else - Actions
                          • Set ToN_TempReal_I = (ToN_TempReal_I - (ToN_GroundDelaySFXSinusRate / 33.33))
                    • Else - Actions
                      • -------- vvvvv-----The only thing here that needs mentioning is the double bump of the unit, which is done due to debugging reasons. (In case the unit gets bumped too much out of the area). --------
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • ToN_TempBoolean[(Custom value of (Picked unit))] Equal to True
                        • Then - Actions
                          • Set ToN_TempBoolean[(Custom value of (Picked unit))] = False
                          • Set ToN_TempReal_I = (ToN_TempReal_I - (ToN_GroundDelaySFXSinusRate / 33.33))
                          • Set ToN_TempReal_I = (ToN_TempReal_I - (ToN_GroundDelaySFXSinusRate / 33.33))
                        • Else - Actions
                          • Set ToN_TempBoolean[(Custom value of (Picked unit))] = True
                          • Set ToN_TempReal_I = (ToN_TempReal_I + (ToN_GroundDelaySFXSinusRate / 33.33))
                          • Set ToN_TempReal_I = (ToN_TempReal_I + (ToN_GroundDelaySFXSinusRate / 33.33))
                  • Custom script: call RemoveLocation(udg_ToN_TempLoc_C)
                  • Set ToN_TempLoc_C = (ToN_TempLoc_D offset by ToN_TempReal_I towards ToN_TempReal_H degrees)
                  • Unit - Move (Picked unit) instantly to ToN_TempLoc_C
                  • Custom script: call RemoveLocation(udg_ToN_TempLoc_C)
                  • Custom script: call RemoveLocation(udg_ToN_TempLoc_D)
            • Else - Actions

  • ToN Damage
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • (Unit-type of GDD_DamageSource) Equal to ToN_DummyUnit_Pulse
      • GDD_Damage Equal to 0.00
    • Actions
      • -------- vvvvv-----When targeting the trees, a dummy units beging spraying the area with 0 damage. --------
      • -------- vvvvv-----The damage source will be either the dummy unit itslef or the caster, based on the user's choice. --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ToN_PulseDamageSourceIsCaster Equal to True
        • Then - Actions
          • Unit - Cause ToN_TempUnit_A[(Custom value of GDD_DamageSource)] to damage GDD_DamagedUnit, dealing ToN_TempReal_D[(Custom value of GDD_DamageSource)] damage of attack type ToN_PulseDamage_AttackType and damage type ToN_PulseDamage_DamageType
        • Else - Actions
          • Unit - Cause GDD_DamageSource to damage GDD_DamagedUnit, dealing ToN_TempReal_D[(Custom value of GDD_DamageSource)] damage of attack type ToN_PulseDamage_AttackType and damage type ToN_PulseDamage_DamageType

  • ToN Debug
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is in ToN_MainGroup) Equal to True
    • Actions
      • Unit Group - Remove (Triggering unit) from ToN_MainGroup
      • Unit - Kill ToN_TempUnit_B[(Custom value of (Triggering unit))]
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
      • -------- vvvvv-----If in your map, a unit has the possibility of being removed, you should place all of the following scripts right before the removal of that unit. --------
      • -------- vvvvv-----And assign your soon-to-be-removed unit to ToN_TempUnit_D, instead of No unit. --------
      • Set ToN_TempUnit_D = No unit
      • Unit Group - Remove ToN_TempUnit_D from ToN_MainGroup
      • Unit - Kill ToN_TempUnit_B[(Custom value of ToN_TempUnit_D)]
      • Set ToN_TempLoc_B = ToN_TempLoc_A[(Custom value of ToN_TempUnit_D)]
      • Custom script: call RemoveLocation(udg_ToN_TempLoc_B)
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------
[/box]
 

KILLCIDE

Spell Moderator
Level 36
Joined
Jul 22, 2015
Messages
3,488
The spell is definitely going to need to be improved, but due to what you said in the Poll thread:

If it doesn't get approved because of code deficiency, just reject it, because I don't have time to fix it and in most cases I don't even know how.

I will be setting this to Substandard for now. If you ever feel like you make any changes to this resource that warrant it out of Substandard, let us know in Staff Contact.
 
Top