• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Eternal Winter v0.07

Creates a dance of Ice bolts at the field.
My first WTFPWNALL MUI spell.
Thanks for Blast animation for JetFangInferno


  • Eternal Winter Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Eternal Winter
    • Actions
      • -------- Stores Caster and Target into variables --------
      • -------- NOTE 1: From now on, 'Caster and Target' will be changed into 'The Duo' --------
      • Set Caster = (Triggering unit)
      • Set Target = (Target unit of ability being cast)
      • -------- Finds locations of the Duo --------
      • Set Points[1] = (Position of Caster)
      • Set Points[2] = (Position of Target)
      • -------- Counts the Spawn point of the Sphere --------
      • Set Points[3] = (Points[1] offset by 70.00 towards (Angle from Points[1] to Points[2]) degrees)
      • -------- Counts the Blast damage --------
      • -------- NOTE 2: Set your blast damage here. This will be equally split among the bolts that will be spawned after impact --------
      • Set Real[1] = (300.00 + (100.00 x (Real((Level of Eternal Winter for Caster)))))
      • -------- Counts impact damage --------
      • -------- NOTE 3: Change your Impact damage here --------
      • Set Real[2] = (100.00 + (100.00 x (Real((Level of Eternal Winter for Caster)))))
      • -------- Here be your number of bolts --------
      • Set Integer[1] = 5
      • -------- Splits the damage to the Impact Bolts, making this spell not to one-shot everyone --------
      • Set Real[1] = (Real[1] / (Real(Integer[1])))
      • -------- Creates a Sphere projectile unit --------
      • -------- NOTE 4: From now on, by saying 'Sphere unit', I'll mean the Sphere Projectile unit --------
      • Unit - Create 1 Sphere for Player 1 (Red) at Points[3] facing (Angle from Points[1] to Points[2]) degrees
      • -------- Stores all information into variable --------
      • -------- NOTE 5: All information is attached to the Sphere unit --------
      • Hashtable - Save Handle OfCaster as 0 of (Key (Last created unit)) in Hashtable
      • Hashtable - Save Handle OfTarget as 1 of (Key (Last created unit)) in Hashtable
      • Hashtable - Save Real[1] as 2 of (Key (Last created unit)) in Hashtable
      • Hashtable - Save Real[2] as 3 of (Key (Last created unit)) in Hashtable
      • Hashtable - Save Integer[1] as 4 of (Key (Last created unit)) in Hashtable
      • -------- Checks if there is any instance of spell already in effect of the Sphere sliding trigger --------
      • -------- If not, then turns the Sphere sliding trigger on --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Spheres is empty) Equal to True
        • Then - Actions
          • Trigger - Turn on Eternal Winter Sphere <gen>
        • Else - Actions
      • -------- Adds Sphere unit to Spheres' group --------
      • Unit Group - Add (Last created unit) to Spheres
      • -------- Clears the leaks --------
      • Custom script: call RemoveLocation(udg_Points[1])
      • Custom script: call RemoveLocation(udg_Points[2])
      • Custom script: call RemoveLocation(udg_Points[3])
  • Eternal Winter Sphere
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Spheres and do (Actions)
        • Loop - Actions
          • -------- Loads the Duo --------
          • Set Caster = (Load 0 of (Key (Picked unit)) in Hashtable)
          • Set Target = (Load 1 of (Key (Picked unit)) in Hashtable)
          • -------- Finds locations of Target and Sphere unit --------
          • Set Points[1] = (Position of (Picked unit))
          • Set Points[2] = (Position of Target)
          • -------- Counts the Point to which the Sphere unit will be moved if possible --------
          • -------- NOTE 1: Here change your projectile unit's speed. My speed is 8/0.03=267 units per second --------
          • Set Points[3] = (Points[1] offset by 8.00 towards (Angle from Points[1] to Points[2]) degrees)
          • -------- Loads Impact damage and bolts-to-split-to --------
          • Set Real[1] = (Load 3 of (Key (Picked unit)) from Hashtable)
          • Set Integer[1] = (Load 4 of (Key (Picked unit)) from Hashtable)
          • -------- Checks if it is time for Sphere unit to 'hit' Target --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Distance between Points[1] and Points[2]) Greater than or equal to 100.00
            • Then - Actions
              • -------- If not, then... --------
              • -------- Moves Sphere unit to the Counted point --------
              • Unit - Move (Picked unit) instantly to Points[3], facing (Angle from Points[1] to Points[2]) degrees
            • Else - Actions
              • -------- If it is, then... --------
              • -------- Freezes the Target --------
              • -------- NOTE 2: Set the duration of the Freeze in Object Editor, spell Freeze --------
              • -------- NOTE 3: I was quite lazy, so I used same duration for both impact and blast freezes --------
              • Unit - Create 1 Dummy Caster for (Owner of Caster) at Points[3] facing Default building facing degrees
              • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
              • Unit - Add Freeze to (Last created unit)
              • Unit - Order (Last created unit) to Orc Raider - Ensnare Target
              • -------- Causes caster to damage target, dealing impact damage --------
              • Unit - Cause Caster to damage Target, dealing Real[1] damage of attack type Spells and damage type Normal
              • -------- Counts the difference angle between the Bolt units --------
              • Set Real[1] = (360.00 / (Real(Integer[1])))
              • -------- Sets the base angle of the Bolt's spawn --------
              • Set Real[2] = 0.00
              • -------- Loads the Blast damage, as it will be attached to Bolts --------
              • Set Real[3] = (Load 2 of (Key (Picked unit)) from Hashtable)
              • -------- A loop, which creates bolts. Loops the times, you set the Bolts-to-split-to --------
              • For each (Integer A) from 1 to Integer[1], do (Actions)
                • Loop - Actions
                  • -------- Counts the Bolt Spawn point --------
                  • Set Points[4] = (Points[2] offset by 100.00 towards Real[2] degrees)
                  • -------- Creates a Spawn SFX at the counted point and instantly destroys it, fixing the leak --------
                  • -------- NOTE 4: Change your spawn SFX here. You don't want a fire spell with Icy explosions, do you? --------
                  • Special Effect - Create a special effect at Points[4] using Abilities\Spells\Undead\FrostNova\FrostNovaTarget.mdl
                  • Special Effect - Destroy (Last created special effect)
                  • -------- Creates a bolt unit --------
                  • -------- NOTE 5: From now on, by saying 'Bolt unit' I'll refer to this bolt unit individually --------
                  • -------- NOTE 6: Change your bolt unit's model in Object Editor, unit named Bolt --------
                  • Unit - Create 1 Bolt for (Owner of Caster) at Points[1] facing Default building facing degrees
                  • -------- Adds to and instantly removes from Bolt unit Storm Crow Form spell, allowing us to manipulate the Flying height of it --------
                  • Unit - Add Storm Crow Form to (Last created unit)
                  • Unit - Remove Storm Crow Form from (Last created unit)
                  • -------- Stores the information to the Hashtable --------
                  • -------- NOTE 5: All information is attached to the Bolt unit --------
                  • Hashtable - Save Handle OfCaster as 0 of (Key (Last created unit)) in Hashtable
                  • Hashtable - Save Handle OfTarget as 1 of (Key (Last created unit)) in Hashtable
                  • Hashtable - Save Real[3] as 2 of (Key (Last created unit)) in Hashtable
                  • Hashtable - Save Real[2] as 3 of (Key (Last created unit)) in Hashtable
                  • -------- NOTE 6: This 0.00 stored into hashtable is the Base distance from Target to bolt. It is used to see if it is time to land the bolt or start returning --------
                  • Hashtable - Save 0.00 as 4 of (Key (Last created unit)) in Hashtable
                  • -------- Checks if there is any bolt unit already in game --------
                  • -------- If not, then Turns the Bolt Fleeing trigger on --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (FleeingBolts is empty) Equal to True
                    • Then - Actions
                      • Trigger - Turn on Eternal Bolt Flee <gen>
                    • Else - Actions
                  • -------- Adds Bolt unit to Fleeing Bolts' group --------
                  • Unit Group - Add (Last created unit) to FleeingBolts
                  • -------- Updates the Angle at which next bolt will be spawned --------
                  • Set Real[2] = (Real[2] + Real[1])
                  • -------- Clears a leak created at the beggining of the loop --------
                  • Custom script: call RemoveLocation(udg_Points[4])
              • -------- Rids hashtable off of information attached to the Sphere unit --------
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in Hashtable
              • -------- Removes Sphere unit from the Spheres' group --------
              • Unit Group - Remove (Picked unit) from FleeingBolts
              • -------- Removes Sphere unit from game --------
              • Unit - Remove (Picked unit) from the game
          • -------- Clears the leaks --------
          • Custom script: call RemoveLocation(udg_Points[1])
          • Custom script: call RemoveLocation(udg_Points[2])
          • Custom script: call RemoveLocation(udg_Points[3])
      • -------- Checks if there is any sphere left after this loop --------
      • -------- If not, then turns this trigger off --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Spheres is empty) Equal to True
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
  • Eternal Bolt Flee
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in FleeingBolts and do (Actions)
        • Loop - Actions
          • -------- Loads the Target --------
          • -------- NOTE 1: It will be used to determine the center of the Fleeing/Returning bolts' circle. Where moves he, there moves the center --------
          • Set Target = (Load 1 of (Key (Last created unit)) in Hashtable)
          • -------- Loads the angle from Target to Bolt and increases it, making Bolt unit spin --------
          • -------- NOTE 2: If you want your bolt spin Clockwise, substract instead of adding --------
          • Set Real[1] = (Load 3 of (Key (Picked unit)) from Hashtable)
          • Set Real[1] = (Real[1] + 2.50)
          • -------- Loads the Distance from Target to Bolt, making bolt 'Flee' from it --------
          • Set Real[2] = (Load 4 of (Key (Picked unit)) from Hashtable)
          • -------- NOTE 3: The number added to the Distance is speed of the Fleeing Bolt. My speed is 6/0.03=200 units per second --------
          • Set Real[2] = (Real[2] + 6.00)
          • -------- Finds location of Target --------
          • Set Points[1] = (Position of Target)
          • -------- Counts the point to which Bolt unit will be moved --------
          • Set Points[2] = (Points[1] offset by Real[2] towards Real[1] degrees)
          • -------- Moves Bolt unit to the Counted point --------
          • Unit - Move (Picked unit) instantly to Points[2], facing Real[1] degrees
          • -------- Checks if the Bolt unit has already passed the half of the fleeing distance (300 for me) --------
          • -------- If it hasn't, sets the Flying Height boost to positive real number, if it has - to equal negative one --------
          • -------- NOTE 4: The real number compared to the Real[2] should be half of the Distance-to-flee below, unless you want the Bolt to bounce in trajectory like this /\ | --------
          • If (Real[2] Less than or equal to 300.00) then do (Set Real[3] = 7.00) else do (Set Real[3] = -7.00)
          • -------- Modifies flying height of Bolt unit, making it bounce --------
          • Animation - Change (Picked unit) flying height to ((Current flying height of (Picked unit)) + Real[3]) at 0.00
          • -------- Updates the Angle and Distance from Target to Bolt unit --------
          • Hashtable - Save Real[1] as 3 of (Key (Picked unit)) in Hashtable
          • Hashtable - Save Real[2] as 4 of (Key (Picked unit)) in Hashtable
          • -------- Checks if it time for Bolt unit to start to return to the Target --------
          • -------- NOTE 5: In condition, set the Distance at which bolt shall start to return --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Real[2] Greater than or equal to 600.00
            • Then - Actions
              • -------- Restores the Flying height of the Bolt unit to it's default --------
              • Animation - Change (Picked unit) flying height to (Default flying height of (Picked unit)) at 0.00
              • -------- Creates a SFX, marking that Bolt unit shall start returning to the Target --------
              • -------- NOTE 6: Change your SFX here, you don't want a Fire spell with Icy explosions, do you? --------
              • Special Effect - Create a special effect at Points[2] using Abilities\Spells\Undead\FrostNova\FrostNovaTarget.mdl
              • Special Effect - Destroy (Last created special effect)
              • -------- Removes Bolt unit from Fleeing Bolts' Group --------
              • Unit Group - Remove (Picked unit) from FleeingBolts
              • -------- Checks if there is any Returning Bolt in game --------
              • -------- If not, then turns Returning Trigger on --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (ReturningBolts is empty) Equal to True
                • Then - Actions
                  • Trigger - Turn on Eternal Bolt Return <gen>
                • Else - Actions
              • -------- Adds Bolt unit to Returning Bolts' group, making it return --------
              • Unit Group - Add (Picked unit) to ReturningBolts
            • Else - Actions
          • -------- Clears the Leaks --------
          • Custom script: call RemoveLocation(udg_Points[1])
          • Custom script: call RemoveLocation(udg_Points[2])
      • -------- Checks if there is any Fleeing Bolt left after this loop --------
      • -------- If not, then turns this trigger off --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (FleeingBolts is empty) Equal to True
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
  • Eternal Bolt Return
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in ReturningBolts and do (Actions)
        • Loop - Actions
          • -------- Loads the Duo --------
          • Set Caster = (Load 0 of (Key (Picked unit)) in Hashtable)
          • Set Target = (Load 1 of (Key (Picked unit)) in Hashtable)
          • -------- Loads Angle from Target to Bolt and increases it, making Bolt unit spin --------
          • Set Real[1] = (Load 3 of (Key (Picked unit)) from Hashtable)
          • -------- NOTE 1: If you want your bolt spin Clockwise, substract instead of adding --------
          • Set Real[1] = (Real[1] + 5.00)
          • -------- Loads Distance from Target to Bolt, making bolt unit return to Target --------
          • Set Real[2] = (Load 4 of (Key (Picked unit)) from Hashtable)
          • -------- NOTE 2: Don't change this one --------
          • Set Real[2] = (Real[2] - 7.00)
          • -------- Finds position of Target --------
          • Set Points[1] = (Position of Target)
          • -------- Counts the Point to which bolt unit would be moved --------
          • Set Points[2] = (Points[1] offset by Real[2] towards Real[1] degrees)
          • -------- Checks if it is time for Bolt unit to 'hit' Target --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Real[2] Greater than or equal to 0.00
            • Then - Actions
              • -------- If it isn't, then... --------
              • -------- Moves bolt unit to the Counted point --------
              • Unit - Move (Picked unit) instantly to Points[2], facing Real[1] degrees
              • -------- Updates angle and distance from Target to bolt --------
              • Hashtable - Save Real[1] as 3 of (Key (Picked unit)) in Hashtable
              • Hashtable - Save Real[2] as 4 of (Key (Picked unit)) in Hashtable
            • Else - Actions
              • -------- If it is, then... --------
              • -------- Creates a Blast SFX and instantly Destroys it, fixing the leak --------
              • -------- NOTE 3: Change your Blast SFX here --------
              • -------- NOTE 4: Thanks for this awesome Blast SFX to JetFangInferno. --------
              • -------- NOTE 5: I used his, because the Original Frost Nova's SFX is not enough for my eye-candy --------
              • Special Effect - Create a special effect at Points[1] using war3mapImported\FrostBlast.mdx
              • Special Effect - Destroy (Last created special effect)
              • -------- Loads the Blast damage --------
              • Set Real[1] = (Load 2 of (Key (Picked unit)) from Hashtable)
              • -------- Enumerates enemies-to-hit/freeze --------
              • -------- NOTE 6: Hits all live organic enemy units that are near the Target and are not magic immune, so if you die before the Blast and lose the Sight of the Target, blast still will damage Enemies --------
              • Set Enemies = (Units within 600.00 of Points[1] matching ((((Matching unit) is A structure) Not equal to True) and ((((Matching unit) is Mechanical) Not equal to True) and ((((Matching unit) is Magic Immune) Not equal to True) and ((((Matching unit) is dead) Not equal to T
              • -------- Does the Blasting Effect --------
              • Unit Group - Pick every unit in Enemies and do (Actions)
                • Loop - Actions
                  • -------- Freezes Enemies --------
                  • Unit - Create 1 Dummy Caster for (Owner of Caster) at Points[1] facing Default building facing degrees
                  • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
                  • Unit - Add Freeze to (Last created unit)
                  • Unit - Order (Last created unit) to Orc Raider - Ensnare (Picked unit)
                  • -------- Causes caster to damage enemies, dealing Blast damage --------
                  • Unit - Cause Caster to damage (Picked unit), dealing Real[1] damage of attack type Spells and damage type Normal
                  • -------- Creates a blast impact SFX and instantly destroys it, fixing leak --------
                  • -------- NOTE 7: Change your blast impact SFX here. You don't want Fire spell with Icy blasts, do you? --------
                  • Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Weapons\FrostWyrmMissile\FrostWyrmMissile.mdl
                  • Special Effect - Destroy (Last created special effect)
              • -------- Rids hashtable off of Information attached to Bolt unit --------
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in Hashtable
              • -------- Removes Bolt unit from Returning Bolts' Group --------
              • Unit Group - Remove (Picked unit) from ReturningBolts
              • -------- Removes Bolt unit from game --------
              • Unit - Remove (Picked unit) from the game
              • -------- Fixes Group leak --------
              • Custom script: call DestroyGroup(udg_Enemies)
          • -------- Clears the Leaks --------
          • Custom script: call RemoveLocation(udg_Points[1])
          • Custom script: call RemoveLocation(udg_Points[2])
      • -------- Checks if there is any bolt unit left after this loop --------
      • -------- If not, turns this trigger off --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (ReturningBolts is empty) Equal to True
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions




v0.01 - First Release
v0.02 - Moved the Conditional trigger turning off to the end of the loop
v0.03 - Fixed the leak at the Initial trigger
v0.04 - Fixed another leak at the Initial trigger and now using only 1 hashtable
v0.05 - Now it Spins again
v0.06 - Creates only 1 hashtable.
v0.07 - Rewrote the code to be more user-friendly. Added bounce to fleeing bolts' flight.


Keywords:
Dance, ice, frost, spin, close, sphere, lich, cold
Contents

Eternal Winter v0.07 (Map)

Reviews
11:53, 20th Feb 2010 TriggerHappy: You fixed everything I said and I didn't notice any leaks.

Moderator

M

Moderator

11:53, 20th Feb 2010
TriggerHappy:

You fixed everything I said and I didn't notice any leaks.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Are you sure you need three hashtables? You could only use one.

You could move this outside the loop:
  • If ((Bolts_Away is empty) Equal to True) then do (Trigger - Turn on Eternal Winter Bolts Away <gen>) else do (Do nothing)
This causes a leak:
  • Set Points[1] = ((Position of (Triggering unit)) offset by 70.00 towards (Facing of (Triggering unit)) degrees)
 
Level 9
Joined
Oct 31, 2009
Messages
121
Are you sure you need three hashtables? You could only use one.

You could move this outside the loop:
  • If ((Bolts_Away is empty) Equal to True) then do (Trigger - Turn on Eternal Winter Bolts Away <gen>) else do (Do nothing)
This causes a leak:
  • Set Points[1] = ((Position of (Triggering unit)) offset by 70.00 towards (Facing of (Triggering unit)) degrees)

1.Well, i think yes.
2. Well, i'll change that in all triggers.
3. Where did you see such usage of setting a point? i cant find one. Looked trice
 
Level 9
Joined
Oct 31, 2009
Messages
121
Humm , why your spell damage all the person close and not only enemy , Imported stuff should be avoid and why you make 3 periodic trigger just make one and use condition to make it work correctly

Did it damage the Lich?
Did you see how it works?
The original frost nova model isn't enough.
It works fine.

No, you don't need three hashtables.

The very first line in acctions in Eternal Winter Init.

I will fix that for tomorrow.
Thanks for initial leak, fixed now.
 
Last edited:
Level 3
Joined
Aug 11, 2018
Messages
15
Great spell but that one trigger within the "initialization" portion that is "create hashtable" and the "set hashtable" really made me spend 8 years trying to figure out why the bolt went over the rainbow nowhere XD
 
Top