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

Lightning Levitation - v0.01

165558-albums2488-picture26035.jpeg



JASS:
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
X                                     X
X        Lightning Levitation         X
X                                     X
X          by D4RK_G4ND4LF            X
X                                     X
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


How to import:

1. Copy the slow buff
2. Copy the slow spell
3/4. Copy the slow dummy
3/4. Copy the Lightning Levitation spell
5. Create a variable named "i" of type integer
6. Enable "Automatically create unknown variables while pasting trigger data" [File\Preferences\General\...]
7. Copy the loop trigger
8. Copy the cast trigger
9. Save the map

Additional:
You may also want to export and import the modified Splats\LightningData.slk
It makes the lightning look a lot smoother but finger of death will look different

Have fun with it

Variable information:

------------------------LL_Data[x]-----------------------

[0] CounterMax            //How often the loop trigger should run to levitate a new unit
                          //The loop will be executed 40 times a second
[1] Counter               //Counter to count the executions
[2] AoE                   //Area of effect for levitation
[3] Damage                //Damage of impact
[4] Speed up              //Elevation speed (per 0.025 seconds)
[5] Speed down            //Falling speed (per 0.025 seconds)
[6] Rotation speed        //Rotation speed (per 0.025 seconds in radians)
[7] Max height            //When the unit has reached this height it will fall down
[8] Impact AoE            //Area of effect of impact
[9] Size                  //Size of the pyramid

--------------------LL_Target_Data[x]--------------------

[0] Current Height        //Current height of the levitated unit
[1] Rotation angle        //Current angle of the pyramid (in radians)
[2] Traveling Direction   //0 = up, 1 = down
[3] Damage                //Damage of impact
[4] Speed up              //Elevation speed per 0.025 seconds
[5] Speed down            //Falling speed per 0.025 seconds
[6] Rotation speed        //Rotation speed per 0.025 seconds in radians
[7] Max height            //When the unit has reached this height it will fall down
[8] Impact AoE            //Area of effect of impact
[9] Size                  //Size of the pyramid
  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Lightning Levitation
  • Actions
    • -------- Increase number of instances of casters casting this spell --------
    • Set LL_Max = (LL_Max + 1)
    • -------- Set caster --------
    • Set LL_Caster[LL_Max] = (Triggering unit)
    • -------- How many loops the spell will need to elevate a unit (trigger runs 40 times a second so 40 is equal to 1 unit per second, 20 to 2, 10 to 4, etc.) --------
    • Set LL_Data[(LL_Max x 10)] = 40.00
    • -------- Counter (if we start with the max value the first unit will be elevated instantly and we won't have to wait 0.5 seconds) --------
    • Set LL_Data[((LL_Max x 10) + 1)] = LL_Data[(LL_Max x 10)]
    • -------- Area of effect (every valid enemy within that range might be elevated) --------
    • Set LL_Data[((LL_Max x 10) + 2)] = 500.00
    • -------- Damage (100 + 50 x level) --------
    • Set LL_Data[((LL_Max x 10) + 3)] = (Real((((Level of (Ability being cast) for LL_Caster[LL_Max]) x 50) + 100)))
    • -------- Speed for levitating upwards --------
    • Set LL_Data[((LL_Max x 10) + 4)] = 5.00
    • -------- Falling speed --------
    • Set LL_Data[((LL_Max x 10) + 5)] = 30.00
    • -------- Pyramid rotation angle in radians per 0.025 seconds --------
    • Set LL_Data[((LL_Max x 10) + 6)] = 0.05
    • -------- Maximum height (after the unit has reached this height it will fall down --------
    • Set LL_Data[((LL_Max x 10) + 7)] = 800.00
    • -------- Area of effect of the impact --------
    • Set LL_Data[((LL_Max x 10) + 8)] = 250.00
    • -------- Pyramid size (radius) --------
    • Set LL_Data[((LL_Max x 10) + 9)] = 130.00
    • -------- Run the loop to levitate --------
    • Trigger - Turn on LightningLevitationLoop <gen>
    • -------- You may create the zLoc location in your map ini trigger as well --------
    • Custom script: if udg_zLoc == null then
    • Set zLoc = (Point(0.00, 0.00))
    • Custom script: endif
  • Events
    • Time - Every (1.00 / 40.00) seconds of game time
  • Conditions
  • Actions
    • -------- Loop through all instances of casters --------
    • For each (Integer i) from 1 to LL_Max, do (Actions)
      • Loop - Actions
        • -------- Save caster in a non-array variable to increase speed and readability --------
        • Set u = LL_Caster[i]
        • -------- Check if the unit is alive, not removed and channeling --------
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • u Not equal to No unit
            • (Life of u) Greater than 0.00
            • (Current order of u) Equal to (Order(channel))
          • Then - Actions
            • -------- Increase counter --------
            • Set LL_Data[((i x 10) + 1)] = (LL_Data[((i x 10) + 1)] + 1.00)
            • -------- Check if counter has reached its max value --------
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • LL_Data[((i x 10) + 1)] Greater than or equal to LL_Data[(i x 10)]
              • Then - Actions
                • -------- Reset counter --------
                • Set LL_Data[((i x 10) + 1)] = 0.00
                • -------- Move a location to the position of the caster --------
                • Custom script: call MoveLocation(udg_zLoc, GetUnitX(udg_u), GetUnitY(udg_u))
                • -------- Number of units to levitate per execution //1 = 1 unit, 2 = 2 units, 3 = 3 units, etc. :P --------
                • Set r = 1.00
                • -------- Prepare to remove leak --------
                • Custom script: set bj_wantDestroyGroup = true
                • -------- Pick all valid enemys --------
                • Unit Group - Pick every unit in (Units within LL_Data[((i x 10) + 2)] of zLoc matching (((((((Matching unit) has buff Slow (Custom)) Equal to False) and ((((Matching unit) is A structure) Equal to False) and (((Matching unit) is in LL_Group) Equal to False))) and ((((Matching unit) is visib and do (Actions)
                  • Loop - Actions
                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • If - Conditions
                        • r Greater than 0.00
                      • Then - Actions
                        • -------- Apply unit-animation-change-flyingheight-hack --------
                        • Unit - Add Storm Crow Form to (Picked unit)
                        • Unit - Remove Storm Crow Form from (Picked unit)
                        • -------- Pause enemy --------
                        • Unit - Pause (Picked unit)
                        • -------- Make enemy invulnerable --------
                        • Unit - Make (Picked unit) Invulnerable
                        • -------- Increase levitated units instance counter --------
                        • Set LL_Target_Max = (LL_Target_Max + 1)
                        • -------- Save enemy --------
                        • Set LL_Target_Unit[(LL_Target_Max x 2)] = (Picked unit)
                        • -------- Save caster --------
                        • Set LL_Target_Unit[((LL_Target_Max x 2) + 1)] = u
                        • -------- Create 7 lightnings --------
                        • For each (Integer i2) from 0 to 6, do (Actions)
                          • Loop - Actions
                            • Lightning - Create a Finger of Death lightning effect from source zLoc to target zLoc
                            • Set LL_Lightning[((LL_Target_Max x 7) + i2)] = (Last created lightning effect)
                        • -------- Copy data from caster instance to levitation unit instance --------
                        • Set LL_Target_Data[(LL_Target_Max x 10)] = 0.00
                        • Set LL_Target_Data[((LL_Target_Max x 10) + 1)] = 0.00
                        • Set LL_Target_Data[((LL_Target_Max x 10) + 2)] = 0.00
                        • For each (Integer i2) from 3 to 9, do (Actions)
                          • Loop - Actions
                            • Set LL_Target_Data[((LL_Target_Max x 10) + i2)] = LL_Data[((i x 10) + i2)]
                        • -------- Add enemy to unit group of levitating units --------
                        • Unit Group - Add (Picked unit) to LL_Group
                        • -------- Increase levitated units counter --------
                        • Set r = (r - 1.00)
                      • Else - Actions
              • Else - Actions
          • Else - Actions
            • -------- Shift data for indexing --------
            • Set LL_Caster[i] = LL_Caster[LL_Max]
            • For each (Integer i2) from 0 to 9, do (Actions)
              • Loop - Actions
                • Set LL_Data[((i x 10) + i2)] = LL_Data[((LL_Max x 10) + i2)]
            • Set LL_Max = (LL_Max - 1)
            • Set i = (i - 1)
    • -------- Loop through all instances of levitating units --------
    • For each (Integer i) from 1 to LL_Target_Max, do (Actions)
      • Loop - Actions
        • -------- Save levitation unit in a non-array variable to increase speed and readability --------
        • Set u = LL_Target_Unit[(i x 2)]
        • -------- Save x and y coords of the unit --------
        • Custom script: set udg_x = GetUnitX(udg_u)
        • Custom script: set udg_y = GetUnitY(udg_u)
        • Custom script: call MoveLocation(udg_zLoc, udg_x, udg_y)
        • -------- Check if the unit is alive, not on ground or removed --------
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • u Not equal to No unit
            • (Life of u) Greater than 0.00
            • LL_Target_Data[(i x 10)] Greater than or equal to 0.00
          • Then - Actions
            • -------- Save radius in a non-array variable --------
            • Set r = LL_Target_Data[((i x 10) + 9)]
            • -------- Get terrain height at the position of the unit --------
            • Custom script: set udg_r2 = GetLocationZ(udg_zLoc)
            • -------- Check if unit has to fly up or fall down --------
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • LL_Target_Data[((i x 10) + 2)] Equal to 0.00
              • Then - Actions
                • -------- Increase unit flying height --------
                • Set LL_Target_Data[(i x 10)] = (LL_Target_Data[(i x 10)] + LL_Target_Data[((i x 10) + 4)])
                • -------- Height of the tip of the pyramid --------
                • Set r2 = (LL_Target_Data[(i x 10)] + (r2 + (r x 1.50)))
                • -------- Apply height of the lightning the pyramid is hanging on --------
                • Custom script: call MoveLightningEx(udg_LL_Lightning[udg_i*7], true, udg_x, udg_y, 2000, udg_x, udg_y, udg_r2)
                • -------- Usual height of the pyramid --------
                • Set r2 = (r2 - (r x 1.50))
                • -------- Check if the unit has reached its maximum height yet --------
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • LL_Target_Data[(i x 10)] Greater than or equal to LL_Target_Data[((i x 10) + 7)]
                  • Then - Actions
                    • -------- Change traveling direction from flying up to falling down --------
                    • Set LL_Target_Data[((i x 10) + 2)] = 1.00
                    • -------- Destroy hanging lightning --------
                    • Lightning - Destroy LL_Lightning[(i x 7)]
                  • Else - Actions
              • Else - Actions
                • -------- Decrease flying height --------
                • Set LL_Target_Data[(i x 10)] = (LL_Target_Data[(i x 10)] - LL_Target_Data[((i x 10) + 5)])
                • -------- Summarize terrain height and unit height --------
                • Set r2 = (LL_Target_Data[(i x 10)] + r2)
            • -------- Angle of the pyramid (in radians) --------
            • Set a = LL_Target_Data[((i x 10) + 1)]
            • -------- Move all 6 lightnings of the pyramid --------
            • For each (Integer i2) from 1 to 3, do (Actions)
              • Loop - Actions
                • -------- Increase angle by 120 degrees (2.1 radians nearly equal to 120 degrees) --------
                • Set a = (a + 2.10)
                • Custom script: call MoveLightningEx(udg_LL_Lightning[udg_i*7+udg_i2], true, udg_x, udg_y, udg_r2+udg_r * 1.5, udg_x + udg_r * Cos(udg_a), udg_y + udg_r * Sin(udg_a), udg_r2)
                • Custom script: call MoveLightningEx(udg_LL_Lightning[udg_i*7+udg_i2+3], true, udg_x + udg_r * Cos(udg_a+2.1), udg_y + udg_r * Sin(udg_a+2.1), udg_r2, udg_x + udg_r * Cos(udg_a), udg_y + udg_r * Sin(udg_a), udg_r2)
            • -------- New angle --------
            • Set LL_Target_Data[((i x 10) + 1)] = (LL_Target_Data[((i x 10) + 1)] + LL_Target_Data[((i x 10) + 6)])
            • -------- Apply height change --------
            • Animation - Change u flying height to LL_Target_Data[(i x 10)] at 0.00
          • Else - Actions
            • -------- Reset unit fly height --------
            • Animation - Change u flying height to 0.00 at 0.00
            • -------- Unpause unit --------
            • Unit - Unpause u
            • -------- Make unit vulnerable --------
            • Unit - Make u Vulnerable
            • -------- Remove unit from levitating units --------
            • Unit Group - Remove u from LL_Group
            • -------- Prepare to remove leak --------
            • Custom script: set bj_wantDestroyGroup = true
            • -------- Damage and slow all valid enemys --------
            • Unit Group - Pick every unit in (Units within LL_Target_Data[((i x 10) + 8)] of zLoc matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) is A ground unit) Equal to True) and ((((Matching unit) is Ethereal and do (Actions)
              • Loop - Actions
                • -------- A nice special effect --------
                • Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Spells\Orc\FeralSpirit\feralspirittarget.mdl
                • -------- Remove most of the special effect leak --------
                • Special Effect - Destroy (Last created special effect)
                • -------- Create slow dummy --------
                • Unit - Create 1 Dummy for Neutral Passive at zLoc facing 0.00 degrees
                • -------- Hide dummy --------
                • Unit - Hide (Last created unit)
                • -------- Remove dummy after 5 seconds --------
                • Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
                • -------- Order dummy to slow valid enemy --------
                • Unit - Order (Last created unit) to Human Sorceress - Slow (Picked unit)
                • -------- Damage valid enemy --------
                • Unit - Cause LL_Target_Unit[((i x 2) + 1)] to damage (Picked unit), dealing LL_Target_Data[((i x 10) + 3)] damage of attack type Spells and damage type Normal
            • -------- Shift data for indexing --------
            • Set LL_Target_Unit[(i x 2)] = LL_Target_Unit[(LL_Target_Max x 2)]
            • Set LL_Target_Unit[((i x 2) + 1)] = LL_Target_Unit[((LL_Target_Max x 2) + 1)]
            • For each (Integer i2) from 0 to 9, do (Actions)
              • Loop - Actions
                • Set LL_Target_Data[((i x 10) + i2)] = LL_Target_Data[((LL_Target_Max x 10) + i2)]
            • Set LL_Lightning[(i x 7)] = LL_Lightning[(LL_Target_Max x 7)]
            • For each (Integer i2) from 1 to 6, do (Actions)
              • Loop - Actions
                • -------- Destroy 6 remaining lightnings --------
                • Lightning - Destroy LL_Lightning[((i x 7) + i2)]
                • Set LL_Lightning[((i x 7) + i2)] = LL_Lightning[((LL_Target_Max x 7) + i2)]
            • Set LL_Target_Max = (LL_Target_Max - 1)
            • Set i = (i - 1)
    • -------- Turn off the trigger to save performance if no instance is running --------
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • LL_Max Less than 1
        • LL_Target_Max Less than 1
      • Then - Actions
        • Trigger - Turn off (This trigger)
      • Else - Actions
Keywords:
lightning, levitation, pyramid, pull, fly, elevate, NARUTO, TITTIES
Contents

Lightning Levitation (Map)

Reviews
00:05, 17th Jun 2010 Hanky: Your spell looks really good. Nice effects, leakless and MUI. I see no reason why I shouldn't approve your spell.

Moderator

M

Moderator

00:05, 17th Jun 2010
Hanky:
Your spell looks really good. Nice effects, leakless and MUI. I see no reason why I shouldn't approve your spell.
 
Level 22
Joined
Nov 14, 2008
Messages
3,256
I wonder if it is possible to make it in hashtable-way, because I can't do the indexing MUI?

Why do you when it is MUI with indexing?

Edit:

Checked the code abit, loved the periodic event!

The only I could come up with was if you set a temp integer at the start with i * 10 it would increase some effiencentreiyhdikhndhfmy but not much to make it noticeable
 
Top