• 🏆 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 Flare v1.0b

Places a flare on the targeted location that shoots lightnings at random enemy every 1.5 seconds (6 is the shooting limit(9 seconds)) or until is destroyed.

This Spell Is MUI


TRIGGERS(UPDATED)


  • LF Variables
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Setting the units --------
      • Set LF_CastingDummy = Casting Dummy
      • Set LF_FlareType[1] = Flare (Level 1)
      • Set LF_FlareType[2] = Flare (Level 2)
      • Set LF_FlareType[3] = Flare (Level 3)
      • Set LF_FlareType[4] = Flare (Level 4)
      • -------- Setting the units --------
      • -------- ---==========--- --------
      • -------- Setting Values --------
      • Set LF_MaxNumberofStrikes = 6
      • Set LF_StrikeTime = 1.50
      • Set LF_GroupAoE = 550.00
      • Set LF_NumberOfRandomUnits = 1
      • Set LF_GroupInteger = 0
      • -------- Setting Values --------
      • -------- ---==========--- --------
      • -------- Setting Abilities --------
      • Set LF_MainAbility = Lightning Flare
      • Set LF_DummyAbility = Chain Lightning (LF)
      • -------- Setting Abilities --------
      • -------- ---==========--- --------
      • -------- Adding Event --------
      • Trigger - Add to LF Loop <gen> the event (Time - Every 0.05 seconds of game time)



  • LF Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to LF_MainAbility
    • Actions
      • Set LF_Index = (LF_Index + 1)
      • Set LF_Caster[LF_Index] = (Triggering unit)
      • Set LF_OwnerOfCaster[LF_Index] = (Owner of LF_Caster[LF_Index])
      • Set LF_Level[LF_Index] = (Level of LF_MainAbility for LF_Caster[LF_Index])
      • Set tempPoint = (Target point of ability being cast)
      • Set LF_NumberOfStrikes[LF_Index] = 0
      • Set LF_Interval[LF_Index] = 0.00
      • Unit - Create 1 LF_FlareType[LF_Level[LF_Index]] for LF_OwnerOfCaster[LF_Index] at tempPoint facing Default building facing degrees
      • Set LF_Flare[LF_Index] = (Last created unit)
      • Animation - Play LF_Flare[LF_Index]'s birth animation
      • Animation - Queue LF_Flare[LF_Index]'s stand animation
      • Custom script: call RemoveLocation (udg_tempPoint)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • LF_Index Equal to 1
        • Then - Actions
          • Trigger - Turn on LF Loop <gen>
        • Else - Actions



  • LF Loop
    • Events
    • Conditions
    • Actions
      • For each (Integer tempInt) from 1 to LF_Index, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (LF_Flare[tempInt] is alive) Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • LF_NumberOfStrikes[tempInt] Equal to LF_MaxNumberofStrikes
                • Then - Actions
                  • Unit - Kill LF_Flare[tempInt]
                  • Set LF_Caster[tempInt] = LF_Caster[LF_Index]
                  • Set LF_Flare[tempInt] = LF_Flare[LF_Index]
                  • Set LF_Interval[tempInt] = LF_Interval[LF_Index]
                  • Set LF_Level[tempInt] = LF_Level[LF_Index]
                  • Set LF_OwnerOfCaster[tempInt] = LF_OwnerOfCaster[LF_Index]
                  • Set LF_NumberOfStrikes[tempInt] = LF_NumberOfStrikes[LF_Index]
                  • Set LF_Caster[LF_Index] = No unit
                  • Set LF_Flare[LF_Index] = No unit
                  • Set LF_Index = (LF_Index - 1)
                  • Set tempInt = (tempInt - 1)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • LF_Index Equal to 0
                    • Then - Actions
                      • Trigger - Turn off (This trigger)
                    • Else - Actions
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • LF_Interval[tempInt] Equal to LF_StrikeTime
                    • Then - Actions
                      • Set tempPoint = (Position of LF_Flare[tempInt])
                      • Set tempGroup = (Units within LF_GroupAoE of tempPoint matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) belongs to an enemy of LF_OwnerOfCaster[tempInt]) Equal to True) and ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) i
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Number of units in tempGroup) Greater than LF_GroupInteger
                        • Then - Actions
                          • Set tempGroup2 = (Random LF_NumberOfRandomUnits units from tempGroup)
                          • Unit Group - Pick every unit in tempGroup2 and do (Actions)
                            • Loop - Actions
                              • Set tempUnit = (Picked unit)
                              • Unit - Create 1 LF_CastingDummy for LF_OwnerOfCaster[tempInt] at tempPoint facing Default building facing degrees
                              • Set tempUnit2 = (Last created unit)
                              • Unit - Add a 1.00 second Generic expiration timer to tempUnit2
                              • Unit - Add LF_DummyAbility to tempUnit2
                              • Unit - Set level of LF_DummyAbility for tempUnit2 to LF_Level[tempInt]
                              • Unit - Order tempUnit2 to Orc Far Seer - Chain Lightning tempUnit
                              • Set tempUnit = No unit
                              • Set tempUnit2 = No unit
                              • Custom script: call DestroyGroup(udg_tempGroup2)
                        • Else - Actions
                      • Custom script: call DestroyGroup(udg_tempGroup)
                      • Custom script: call RemoveLocation (udg_tempPoint)
                      • Set LF_NumberOfStrikes[tempInt] = (LF_NumberOfStrikes[tempInt] + 1)
                      • Set LF_Interval[tempInt] = 0.00
                    • Else - Actions
                      • Set LF_Interval[tempInt] = (LF_Interval[tempInt] + 0.05)
            • Else - Actions
              • Unit - Kill LF_Flare[tempInt]
              • Set LF_Caster[tempInt] = LF_Caster[LF_Index]
              • Set LF_Flare[tempInt] = LF_Flare[LF_Index]
              • Set LF_Interval[tempInt] = LF_Interval[LF_Index]
              • Set LF_Level[tempInt] = LF_Level[LF_Index]
              • Set LF_OwnerOfCaster[tempInt] = LF_OwnerOfCaster[LF_Index]
              • Set LF_NumberOfStrikes[tempInt] = LF_NumberOfStrikes[LF_Index]
              • Set LF_Caster[LF_Index] = No unit
              • Set LF_Flare[LF_Index] = No unit
              • Set LF_Index = (LF_Index - 1)
              • Set tempInt = (tempInt - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • LF_Index Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions


Keywords:
Flare, Lightning.
Contents

Just another Warcraft III map (Map)

Reviews
16:27, 20th Sep 2014 TriggerHappy: I don't understand why you're using a different dummy unit for each level. For the dummy caster it would probably be best to create one at initialization and reuse it as Dalvengyr said. Doing this at map...

Kazeon

Hosted Project: EC
Level 33
Joined
Oct 12, 2011
Messages
3,449
if multiple units cast this, then the dummy is moved around constantly, the lightning will be stretched from previous pos to new pos.
I don't think so, since ordering dummy to cast spell via trigger seems fairly instant (no delay). So, when you move the dummy to another pos right after order, the cast event has been finished. So lightning wont be stretched.

It depends on what spell your dummy is using,
If you can, so why not? :p Even if you have to add another bunch of code, it's still a right thing to do. Because by using wc3 native abiltities, that doesn't mean no script is running behind, another bunch of code. Chain lightning is one good example.

a channeling dummy spell can't be accommodated by a single dummy
That's right.
 
Top