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

Electric Whirlwind v1.03

I haven't made a spell in ages lol :> Made this for a small project I'm working on. A bit basic, but rather useful. This spell has DIR (Dynamic Index Recycling).

Electric Whirlwind v1.03

Description: Causes a bladestorm of destructive force around the Blademaster, rendering him immune to magic and dealing 25/30/35 damage per second to nearby enemy land units. His thunder blade also releases chain lightnings every 0.5 seconds, striking 4 enemies dealing 15/20/25 damage. Chain loses 25% damage after each strike. The blademaster finishes the spell by striking the ground and purging all nearby targets in a 300/350/400 aoe. Lasts 4/5/6 seconds.

v1.01:
*Few minor fixes.
v1.02
*Fixed a bug where the spell continued when the hero was dead.
*Fixed dummy leak
*Added configuration trigger.
*Optimized triggering player.
*Optimized triggering unit.
*Increased performance.
v1.03
*Purge is now also configurable.
*Continuous lightning effect is now configurable.
*Removed Unnecessary location
*Fixed mass dummy issue.


  • Electric Whirlwind Config
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Here you can change the effect attached to the hero for the duration of the spell. (Default : Lightning Shield) --------
      • Set CL_Effect[1] = Abilities\Spells\Orc\LightningShield\LightningShieldTarget.mdl
      • -------- Here you can change the attached position of the previous effect. (Default : origin) --------
      • Set CL_EffectPosition[1] = origin
      • -------- Here you can change the slam effect which happens at the end of the spell. (Default : Thunder Clap) --------
      • Set CL_Effect[2] = Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
      • -------- Here you can change the attached position of the previous effect. (Default : origin) --------
      • Set CL_EffectPosition[2] = origin
      • -------- Here you can change the continueous effect after each lightning. (Default : Chimaera Lightning Missile) --------
      • Set CL_Effect[3] = Abilities\Weapons\ChimaeraLightningMissile\ChimaeraLightningMissile.mdl
      • -------- Here you can set the AOE of the units getting purged at the end of the spell.. (Default : 250/300/350) --------
      • Set CL_PurgeAOE[1] = 250
      • Set CL_PurgeAOE[2] = 300
      • Set CL_PurgeAOE[3] = 350
      • -------- Here you can set the duration of the spell. (Default : 4/5/6) --------
      • Set CL_Duration[1] = 4
      • Set CL_Duration[2] = 5
      • Set CL_Duration[3] = 6
      • -------- Here you can set the intervals between chain lightnings. (Default : 0.49) --------
      • Set CL_Interval = 0.49
  • Electric Whirlwind Kill Dummy
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Dummy
    • Actions
      • Unit - Remove (Triggering unit) from the game
  • Electric Whirlwind Start
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Electric Whirlwind
    • Actions
      • -------- Indexing Start --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • MUI_1 Equal to 0
        • Then - Actions
          • -------- If there are currently no instances running, we turn on the loop. --------
          • Trigger - Turn on Electric Whirlwind Loop <gen>
        • Else - Actions
      • -------- Increase the indexes --------
      • Set MUI_1 = (MUI_1 + 1)
      • -------- End of Indexing --------
      • -------- Start of Dynamic Indexing --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • MUI_1 Greater than Max_Index
        • Then - Actions
          • -------- Indexing ~~ --------
          • Set MUI_2[MUI_1] = MUI_1
          • Set Max_Index = MUI_1
        • Else - Actions
      • -------- End of Dynamic Indexing --------
      • -------- Makes it easier to read and cleaner. --------
      • Set Temp = MUI_2[MUI_1]
      • -------- Setting The Caster --------
      • Set CL_Caster[Temp] = (Triggering unit)
      • -------- Setting the Player --------
      • Set CL_Player[Temp] = (Triggering player)
      • -------- Setting the ability level for the caster --------
      • Set CL_AbilityLevel[Temp] = (Level of Electric Whirlwind for CL_Caster[Temp])
      • -------- The special effect (lightning shield) --------
      • Special Effect - Create a special effect attached to the CL_Effect[1] of CL_Caster[Temp] using CL_Effect[1]
      • -------- Storing the effect --------
      • Set CL_Special[Temp] = (Last created special effect)
      • -------- Leave these --------
      • Set CL_Count[Temp] = 0.00
      • Set CL_FinalCount[Temp] = 0.00
  • Electric Whirlwind Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer MUI_3) from 1 to MUI_1, do (Actions)
        • Loop - Actions
          • -------- Makes it easier to read and cleaner. --------
          • Set Temp = MUI_2[MUI_3]
          • -------- Counting --------
          • Set CL_Count[Temp] = (CL_Count[Temp] + 0.03)
          • -------- Counting --------
          • Set CL_FinalCount[Temp] = (CL_FinalCount[Temp] + 0.03)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • CL_Count[Temp] Greater than or equal to CL_Interval
              • (CL_Caster[Temp] is alive) Equal to True
            • Then - Actions
              • -------- Resetting Count Real --------
              • Set CL_Count[Temp] = 0.00
              • -------- Setting loc to prevent leak --------
              • Set CL_Loc1 = (Position of CL_Caster[Temp])
              • -------- Group for target selection --------
              • Set CL_Group1 = (Units within 650.00 of CL_Loc1 matching ((((Matching unit) belongs to an enemy of CL_Player[Temp]) Equal to True) and (((Matching unit) is alive) Equal to True)))
              • -------- Unlucky bastard getting shocked --------
              • Custom script: set udg_CL_Target[udg_Temp] = FirstOfGroup(udg_CL_Group1)
              • -------- Creating the dummy unit to cast chain lightning --------
              • Unit - Create 1 Dummy for CL_Player[Temp] at CL_Loc1 facing Default building facing degrees
              • -------- Setting the correct level for the chain lightning --------
              • Unit - Set level of Chain Lightning (Customizable) for (Last created unit) to CL_AbilityLevel[Temp]
              • -------- Finally Issueing order --------
              • Unit - Order (Last created unit) to Orc Far Seer - Chain Lightning CL_Target[Temp]
              • -------- Adding a death timer for the dummy --------
              • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
              • -------- *** Here you can change the continuous effect.*** --------
              • Special Effect - Create a special effect at CL_Loc1 using CL_Effect[3]
              • Special Effect - Destroy (Last created special effect)
              • -------- Removing Leaks --------
              • Custom script: call RemoveLocation( udg_CL_Loc1 )
              • Custom script: call DestroyGroup(udg_CL_Group1)
              • -------- Nullify --------
              • Set CL_Target[Temp] = No unit
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • CL_FinalCount[Temp] Greater than or equal to (Real(CL_Duration[CL_AbilityLevel[Temp]]))
              • (CL_Caster[Temp] is alive) Equal to True
            • Then - Actions
              • -------- Setting the loc of the hero --------
              • Set CL_Loc2 = (Position of CL_Caster[Temp])
              • -------- Poor bastards getting zapped --------
              • Set CL_Group2 = (Units within (Real(CL_PurgeAOE[CL_AbilityLevel[Temp]])) of CL_Loc2 matching ((((Matching unit) belongs to an enemy of CL_Player[Temp]) Equal to True) and (((Matching unit) is alive) Equal to True)))
              • Unit - Create 1 Dummy for CL_Player[Temp] at CL_Loc2 facing Default building facing degrees
              • -------- So the dummy won't live indefinitely --------
              • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
              • -------- Adding the purge ability to dummy --------
              • Unit - Add Purge (Customizable) to (Last created unit)
              • Unit Group - Pick every unit in CL_Group2 and do (Actions)
                • Loop - Actions
                  • -------- Issueing the order for purging --------
                  • Unit - Order (Last created unit) to Orc Shaman - Purge (Picked unit)
              • -------- Removing Leak --------
              • Custom script: call RemoveLocation( udg_CL_Loc2 )
              • Custom script: call DestroyGroup( udg_CL_Group2 )
              • -------- Destroying his weapon effect --------
              • Special Effect - Destroy CL_Special[Temp]
              • -------- *** Here you can change the slam effect.*** --------
              • Special Effect - Create a special effect attached to the CL_Effect[2] of CL_Caster[Temp] using CL_Effect[2]
              • Special Effect - Destroy (Last created special effect)
              • -------- Recycling all the indexes --------
              • Set MUI_2[MUI_3] = MUI_2[MUI_1]
              • Set MUI_2[MUI_1] = Temp
              • Set MUI_1 = (MUI_1 - 1)
              • Set MUI_3 = (MUI_3 - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • MUI_1 Equal to 0
                • Then - Actions
                  • -------- Turning off this trigger. Pointless to keep running --------
                  • Trigger - Turn off (This trigger)
                  • -------- --------------------------------------------------------- --------
                • Else - Actions
            • Else - Actions
Keywords:
Lightning, thunder, storm, chain, blade, blademaster, master, element, arcane, magic, orb, spell, spin, spiral, rotate, electric, electricity.
Contents

Electric Whirwind v1.03 (Map)

Reviews
00:31, 10th Dec 2012 Magtheridon96: Approved. A tip: You can store the dummy that does the orders into a unit variable so that you don't have to repeat (Last Created Unit) multiple times (It's in the Loop code of a group enumeration, so it gets...

Moderator

M

Moderator

00:31, 10th Dec 2012
Magtheridon96: Approved.

A tip:
You can store the dummy that does the orders into a unit variable so that you don't have to repeat (Last Created Unit) multiple times (It's in the Loop code of a group enumeration, so it gets repeated many, many times.)

I don't know what to rate this exactly :/

Some of your comments are outdated ;D
 

Wrda

Spell Reviewer
Level 25
Joined
Nov 18, 2012
Messages
1,864
Few details:
1.
  • -------- Group for target selection --------
  • Set CL_Group1 = (Units within 750.00 of CL_Loc1 matching ((((Matching unit) belongs to an enemy of CL_Player[Temp]) Equal to True) and (((Matching unit) is alive) Equal to True)))
  • -------- Unlucky bastard getting shocked --------
  • Set CL_Target[Temp] = (Random unit from CL_Group1)
You save a unit into a variable, and you don't nullify it, it will be overwritten more times and will cause a small leak.

2.
  • Set CL_Player[Temp] = (Owner of (Triggering unit))
  • Unit - Create 1 Dummy for CL_Player[Temp] at CL_Loc3 facing Default building facing degrees
The variable CL_Player isn't needed for the spell as you can do this:
  • Unit - Create 1 Dummy for (Owner of CL_Caster[Temp]) at CL_Loc3 facing Default building facing degrees
3.
  • Set CL_Group2 = (Units within (Real(CL_PurgeAOE[Temp])) of CL_Loc2 matching ((((Matching unit) belongs to an enemy of CL_Player[Temp]) Equal to True) and (((Matching unit) is alive) Equal to True)))
  • Custom script: set bj_wantDestroyGroup = true
  • Unit Group - Pick every unit in CL_Group2 and do (Actions)
->
  • Set CL_Group2 = (Units within (Real(CL_PurgeAOE[Temp])) of CL_Loc2 matching ((((Matching unit) belongs to an enemy of CL_Player[Temp]) Equal to True) and (((Matching unit) is alive) Equal to True)))
  • Unit Group - Pick every unit in CL_Group2 and do (Actions)
  • etc...
  • Custom script: call DestroyGroup(udg_CL_Group2)
You're trying to destroy the group by 2 ways, the pick every unit function is destroyed but the group variable isnt destroyed :eek:, just do what i did above.

The rest of triggering, is pretty readable and solid for GUIers, and i like the spell too.
This is 4.9/5 for me, that means 5/5 :p keep the good work and fix those details :D
 
Level 14
Joined
Nov 2, 2008
Messages
579
It's strange how every mod has their own way of doing things :>

You need to have a trigger that runs on map initialization for the purpose of spell constant configuration. It makes it easier for users to modify spells without having to mess with the actual code. (Special effects, damage, range, duration, etc...).

Fixed. :>

In the Start trigger, you can use CL_Caster[Temp] instead of repeating Triggering unit again in the next 2 lines.

Fixed :>

(Owner of (Triggering unit)) == (Triggering player), but (triggering player) is faster.

Fixed :>

This next suggestion is totally optional, and it has a con, but it will increase your code's performance considerably: Instead of using (Random unit in (group)), you can set the unit using custom scripts to FirstOfGroup(udg_group). The only con that this has is that this will always pick the unit with the greatest Y-coordinate according to most people I know. In a real map, this shouldn't be much of a problem. I'd only suggest using it if it's not giving you weird results while you're testing.

Fixed :>. Tested and the results seemed fine since the lightnings spreads anyway.

Adding an expiration timer to a unit doesn't finish the job. You need to have a trigger that runs upon the death of a unit. If this unit is a dummy, remove it from the game.

Fixed :>

You shouldn't be creating a dummy /inside/ the enumeration code for every single unit in the group you're picking inside your loop trigger because that would create too many unneeded dummies. One dummy is plenty. It would just need to have animation backswing times of 0. Create it before you pick all the units, give it the expiration timer and the ability, and inside the enumeration code, all you would do is order it.

Fixed :>
 
Last edited:
Top