1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. The Melee Mapping Contest #4: 2v2 - Results are out! Step by to congratulate the winners!
    Dismiss Notice
  3. We're hosting the 15th Mini-Mapping Contest with YouTuber Abelhawk! The contestants are to create a custom map that uses the hidden content within Warcraft 3 or is inspired by any of the many secrets within the game.
    Dismiss Notice
  4. The 20th iteration of the Terraining Contest is upon us! Join and create exquisite Water Structures for it.
    Dismiss Notice
  5. Check out the Staff job openings thread.
    Dismiss Notice

[GUI]Timed Lightning v1.3

Submitted by Almia
This bundle is marked as approved. It works and satisfies the submission rules.

  • This is the timed lightning,this supports any lightning.
    Features:
    unit to unit
    unit to point
    point to point
    destructable to unit
    destructable to destructable.
    To use:
    Create timed lightning by calling call ExecuteFunc("CreateTimedLightning")
    The Loop will move all the timed lightning
    The temp fake source is used so that it will have different indexes instead of replacing any lightning and variables.
    If you want the lightning to be created in a point by source or target,just make the boolean
    SourceUnitIsALocation or TargetUnitIsALocation to true.
    The configuration can be found inside the setup.
    Dont touch the functions.

    If you want a JASS version,here: Timed Light by Maker
    [tab=Triggers]
      • Timed Lightning
        • Events
          • Map initialization
        • Conditions
        • Actions
          • Custom script: set udg_TL_Hash = InitHashtable()
          • -------- ----------------------------------- --------
          • -------- Lightning Codes --------
          • -------- ----------------------------------- --------
          • -------- Chain Lightning - Primary --------
          • Set TL_LightningType[1] = CLPB
          • -------- Chain Lightning - Secondary --------
          • Set TL_LightningType[2] = CLSB
          • -------- Healing Wave - Primary --------
          • Set TL_LightningType[3] = HWPB
          • -------- Healing Wave - Secondary --------
          • Set TL_LightningType[4] = HWSB
          • -------- Finger of Death --------
          • Set TL_LightningType[5] = AFOD
          • -------- Magic Leash/Aerial Shackles --------
          • Set TL_LightningType[6] = LEAS
          • -------- Drain Mana --------
          • Set TL_LightningType[7] = DRAM
          • -------- Drain Life --------
          • Set TL_LightningType[8] = DRAL
          • -------- Forked Lightning --------
          • Set TL_LightningType[9] = FORK
          • -------- Mana Burn --------
          • Set TL_LightningType[10] = MBUR
          • -------- Chimera Attack --------
          • Set TL_LightningType[11] = CHIM
          • -------- Mana Flare --------
          • Set TL_LightningType[12] = MFPB
          • -------- Spirit Link --------
          • Set TL_LightningType[13] = SPLK
          • Custom script: call ExecuteFunc("InitTimedLightning")
          • Custom script: endfunction
          • -------- ----------------------------------- --------
          • -------- This function destroys any kind of lightning,of course,depending on time or if a unit is dead --------
          • -------- call DestroyTimedLightning() as a key to destroy it. --------
          • -------- ----------------------------------- --------
          • Custom script: function DestroyTimedLightning takes nothing returns nothing
          • Lightning - Destroy TL_TempLightning
          • Hashtable - Clear all child hashtables of child TL_Key in TL_Hash
          • Unit Group - Remove TL_TempSource from TL_LoopGroup
          • Unit - Kill TL_TempSource
          • Custom script: endfunction
          • -------- ----------------------------------- --------
          • -------- This function creates the timed lightning --------
          • -------- Use call CreateTimedLightning --------
          • -------- ----------------------------------- --------
          • Custom script: function CreateTimedLightning takes nothing returns nothing
          • -------- ----------------------------------- --------
          • -------- Coordinates X,Y,Z --------
          • -------- ----------------------------------- --------
          • -------- ----------------------------------- --------
          • -------- Checks if a source unit is a location(via boolean) --------
          • -------- ----------------------------------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • TL_IsSourceLocation Equal to True
            • Then - Actions
              • Custom script: set udg_TL_SourceZ = GetUnitFlyHeight(udg_TL_Source)
            • Else - Actions
              • Custom script: set udg_TL_SourceZ = GetUnitFlyHeight(udg_TL_Source) + 50
          • -------- ----------------------------------- --------
          • -------- Checks if a target unit is a location(via boolean) --------
          • -------- ----------------------------------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • TL_IsTargetLocation Equal to True
            • Then - Actions
              • Custom script: set udg_TL_TargetZ = GetUnitFlyHeight(udg_TL_Target)
            • Else - Actions
              • Custom script: set udg_TL_TargetZ = GetUnitFlyHeight(udg_TL_Target) + 50
          • -------- ----------------------------------- --------
          • -------- X,Y of source and target --------
          • -------- ----------------------------------- --------
          • Custom script: set udg_TL_SourceX = GetUnitX(udg_TL_Source)
          • Custom script: set udg_TL_SourceY = GetUnitX(udg_TL_Source)
          • Custom script: set udg_TL_TargetX = GetUnitX(udg_TL_Target)
          • Custom script: set udg_TL_TargetY = GetUnitX(udg_TL_Target)
          • -------- ----------------------------------- --------
          • -------- Creating Lightning --------
          • -------- ----------------------------------- --------
          • Custom script: set udg_TL_Lightning = AddLightningEx(udg_TL_LCode,true,udg_TL_SourceX,udg_TL_SourceY,udg_TL_SourceZ,udg_TL_TargetX,udg_TL_TargetY,udg_TL_TargetZ)
          • -------- ----------------------------------- --------
          • -------- Colors --------
          • -------- ----------------------------------- --------
          • Lightning - Change color of TL_Lightning to (TL_Red TL_Green TL_Blue) with 1.00 alpha
          • -------- ----------------------------------- --------
          • -------- Save --------
          • -------- ----------------------------------- --------
          • Hashtable - Save Handle OfTL_Lightning as (Key Lightning) of TL_CastKey in TL_Hash
          • Hashtable - Save TL_MaxTime as (Key TempMaxTime) of TL_CastKey in TL_Hash
          • Hashtable - Save TL_StartTime as (Key Current) of TL_CastKey in TL_Hash
          • Hashtable - Save Handle OfTL_Target as (Key Target) of TL_CastKey in TL_Hash
          • Hashtable - Save Handle OfTL_FakeSource as (Key FakeSource) of TL_CastKey in TL_Hash
          • Hashtable - Save TL_SourceZ as (Key SourceHeight) of TL_CastKey in TL_Hash
          • Hashtable - Save TL_TargetZ as (Key TargetHeight) of TL_CastKey in TL_Hash
          • Hashtable - Save TL_Blue as (Key TempBlue) of TL_CastKey in TL_Hash
          • Hashtable - Save TL_Green as (Key TempRed) of TL_CastKey in TL_Hash
          • Hashtable - Save TL_Red as (Key TempRed) of TL_CastKey in TL_Hash
          • Unit Group - Add TL_Source to TL_LoopGroup
          • Custom script: endfunction
          • -------- ----------------------------------- --------
          • -------- This function moves lightning periodicallly --------
          • -------- ----------------------------------- --------
          • Custom script: function MoveTimedLightning takes nothing returns nothing
          • -------- ----------------------------------- --------
          • -------- Load --------
          • -------- ----------------------------------- --------
          • Set TL_TempTarget = (Load (Key Target) of TL_Key in TL_Hash)
          • Set TL_TempFakeSource = (Load (Key FakeSource) of TL_Key in TL_Hash)
          • Set TL_CurrentTime = (Load (Key Current) of TL_Key from TL_Hash)
          • Set TL_TempMaxTime = (Load (Key TempMaxTime) of TL_Key from TL_Hash)
          • Set TL_TempLightning = (Load (Key Lightning) of TL_Key in TL_Hash)
          • Set TL_TempSourceZ = (Load (Key SourceHeight) of TL_Key from TL_Hash)
          • Set TL_TempTargetZ = (Load (Key TargetHeight) of TL_Key from TL_Hash)
          • Set TL_TempBlue = (Load (Key TempBlue) of TL_Key from TL_Hash)
          • Set TL_TempGreen = (Load (Key TempGreen) of TL_Key from TL_Hash)
          • Set TL_TempRed = (Load (Key TempRed) of TL_Key from TL_Hash)
          • -------- ----------------------------------- --------
          • -------- Check if time is not ending --------
          • -------- ----------------------------------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • TL_CurrentTime Greater than TL_TempMaxTime
            • Then - Actions
              • Custom script: call DestroyTimedLightning()
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (TL_TempSource is alive) Equal to True
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (TL_TempTarget is alive) Equal to True
                    • Then - Actions
                      • -------- ----------------------------------- --------
                      • -------- Moving unit to the original caster(if not location) --------
                      • -------- ----------------------------------- --------
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • TL_TempFakeSource Not equal to No unit
                        • Then - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (TL_TempFakeSource is dead) Equal to True
                            • Then - Actions
                              • Custom script: call DestroyTimedLightning()
                            • Else - Actions
                              • Custom script: call SetUnitX(udg_TL_TempSource,GetUnitX(udg_TL_TempFakeSource))
                              • Custom script: call SetUnitY(udg_TL_TempSource,GetUnitY(udg_TL_TempFakeSource))
                        • Else - Actions
                      • -------- ----------------------------------- --------
                      • -------- Coordinates --------
                      • -------- ----------------------------------- --------
                      • Custom script: set udg_TL_TempSourceX = GetUnitX(udg_TL_TempSource)
                      • Custom script: set udg_TL_TempSourceY = GetUnitY(udg_TL_TempSource)
                      • Custom script: set udg_TL_TempTargetX = GetUnitX(udg_TL_TempTarget)
                      • Custom script: set udg_TL_TempTargetY = GetUnitY(udg_TL_TempTarget)
                      • -------- ----------------------------------- --------
                      • -------- Move Lightning --------
                      • -------- ----------------------------------- --------
                      • Custom script: call MoveLightningEx(udg_TL_TempLightning,true,udg_TL_TempSourceX,udg_TL_TempSourceY,udg_TL_TempSourceZ,udg_TL_TempTargetX,udg_TL_TempTargetY,udg_TL_TempTargetZ)
                      • -------- ----------------------------------- --------
                      • -------- Fade --------
                      • -------- ----------------------------------- --------
                      • Set TL_Fade = (TL_TempMaxTime - TL_CurrentTime)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • TL_Fade Less than 1.00
                        • Then - Actions
                          • Lightning - Change color of TL_TempLightning to (TL_TempRed TL_TempGreen TL_TempBlue) with TL_Fade alpha
                        • Else - Actions
                      • -------- ----------------------------------- --------
                      • -------- Save --------
                      • -------- ----------------------------------- --------
                      • Hashtable - Save (TL_CurrentTime + 0.03) as (Key Current) of TL_Key in TL_Hash
                    • Else - Actions
                      • Custom script: call DestroyTimedLightning()
                • Else - Actions
                  • Custom script: call DestroyTimedLightning()
          • Custom script: endfunction
          • Custom script: function TimedLightningLoop takes nothing returns nothing
          • Unit Group - Pick every unit in TL_LoopGroup and do (Actions)
            • Loop - Actions
              • Set TL_TempSource = (Picked unit)
              • Custom script: set udg_TL_Key = GetHandleId(udg_TL_TempSource)
              • Custom script: call ExecuteFunc("MoveTimedLightning")
          • Custom script: endfunction
          • Custom script: function InitTimedLightning takes nothing returns nothing
          • Custom script: local trigger t = GetTriggeringTrigger()
          • Custom script: call TriggerClearActions(t)
          • Custom script: call TriggerAddAction(t,function TimedLightningLoop)
          • Trigger - Add to (This trigger) the event (Time - Every 0.03 seconds of game time)
      • TL Cast
        • Events
          • Unit - A unit Starts the effect of an ability
        • Conditions
          • (Ability being cast) Equal to Storm Bolt
        • Actions
          • Set TL_Caster = (Triggering unit)
          • Set TL_Point = (Position of TL_Caster)
          • Set TL_Owner = (Triggering player)
          • Set TL_Target = (Target unit of ability being cast)
          • -------- ------------------------------------ --------
          • -------- Creating Source --------
          • -------- ------------------------------------ --------
          • Unit - Create 1 Dummy for TL_Owner at TL_Point facing Default building facing degrees
          • Set TL_Source = (Last created unit)
          • Custom script: set udg_TL_CastKey = GetHandleId(udg_TL_Source)
          • Set TL_FakeSource = TL_Caster
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • TL_FakeSource Not equal to No unit
            • Then - Actions
              • Set TL_IsSourceLocation = False
            • Else - Actions
              • Set TL_IsSourceLocation = True
              • Unit - Add a TL_MaxTime second Generic expiration timer to TL_Caster
          • Set TL_StartTime = 0.00
          • -------- ------------------------------------ --------
          • -------- Used to create location target --------
          • -------- ------------------------------------ --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of TL_Target) Equal to Dummy
            • Then - Actions
              • Set TL_IsTargetLocation = True
              • Unit - Add a TL_MaxTime second Generic expiration timer to TL_Target
            • Else - Actions
              • Set TL_IsTargetLocation = False
          • Set TL_LCode = TL_LightningType[9]
          • Set TL_MaxTime = 5.00
          • -------- ----------------------------------- --------
          • -------- Color from 0.00 to 1.00 only --------
          • -------- ----------------------------------- --------
          • Set TL_Red = 1.00
          • Set TL_Green = 0.00
          • Set TL_Blue = 1.00
          • Custom script: call ExecuteFunc("CreateTimedLightning")
          • Custom script: call RemoveLocation(udg_TL_Point)
      • TL Remove Dummies
        • Events
          • Unit - A unit Dies
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Dummy
        • Actions
          • Unit - Remove (Triggering unit) from the game
    [/tab][tab=Credits]
    Bribe for the idea of functions based on his Knockback 2D
    Magtheridon96 for explaining me how functions work.[/tab][tab=Changelogs]v1.0
    -Released
    v1.1
    -Fixed Fading
    v1.2
    -Fixed some codes
    -Now uses only one trigger for the setup and loop instead of three
    v1.3
    -Removed Configuration
    -Removed Encapsulation(of course)
    [/tab]
[tab=Description][/tab]
[tab=Description][/tab][/tabs][/center]
Contents

Timed Lightning v1.2 (Map)

Reviews
Moderator
15:36, 25th Oct 2012 Magtheridon96: Approved.
  1. 15:36, 25th Oct 2012
    Magtheridon96: Approved.
     
  2. Almia

    Almia

    Joined:
    Apr 24, 2012
    Messages:
    4,860
    Resources:
    35
    Spells:
    30
    Tutorials:
    4
    JASS:
    1
    Resources:
    35
    ~Reserved
    If you want an indexing method,try defskulls' Lightning Handling
    If you want to use the configuration,just copy the variables and the ability code,then copy the encapsulate call:call ExecuteFunc("Encapsulate"),dont copy the InitTimedlightning call all over again
     
    Last edited: Oct 21, 2012
  3. Ketsuno Anson

    Ketsuno Anson

    Joined:
    May 14, 2011
    Messages:
    392
    Resources:
    0
    Resources:
    0
    Why does it have the jass tag ?
    Edit : Damn you unknown BBCODE .
     
    Last edited: Oct 21, 2012
  4. doomhammer99

    doomhammer99

    Joined:
    Dec 5, 2011
    Messages:
    319
    Resources:
    5
    Models:
    1
    Spells:
    3
    Tutorials:
    1
    Resources:
    5
    LOL... Radamantus Posted the Triggers.
    For Radamantus

    Your spell looks likethis


    For me:Approved
     
  5. Almia

    Almia

    Joined:
    Apr 24, 2012
    Messages:
    4,860
    Resources:
    35
    Spells:
    30
    Tutorials:
    4
    JASS:
    1
    Resources:
    35
    This lightning is just an alternate timed lightning of maker.
    i put JASS tag because it has so many scripts
     
  6. Adiktuz

    Adiktuz

    Joined:
    Oct 16, 2008
    Messages:
    9,674
    Resources:
    23
    Models:
    2
    Packs:
    1
    Maps:
    1
    Spells:
    16
    Tutorials:
    1
    JASS:
    2
    Resources:
    23
    Cool... Bribe-ish way of doing things in GUI... XD...

    btw, since you said it yourself that its just a GUI/alternate version of Maker's TLS, maybe you can link Maker's system? :)
     
  7. Almia

    Almia

    Joined:
    Apr 24, 2012
    Messages:
    4,860
    Resources:
    35
    Spells:
    30
    Tutorials:
    4
    JASS:
    1
    Resources:
    35
    Edit:
    Added it now for ya :D
     
  8. Adiktuz

    Adiktuz

    Joined:
    Oct 16, 2008
    Messages:
    9,674
    Resources:
    23
    Models:
    2
    Packs:
    1
    Maps:
    1
    Spells:
    16
    Tutorials:
    1
    JASS:
    2
    Resources:
    23
    and hmmm... destructables... pretty neat... though that can be achieved using points (since destructables cannot be moved), unless there are some things that can be done to destructables... but why no dest to point?

    btw, can you add an example usage of doing the set-up part outside of the main trigger? it might be helpful... :)
     
  9. Almia

    Almia

    Joined:
    Apr 24, 2012
    Messages:
    4,860
    Resources:
    35
    Spells:
    30
    Tutorials:
    4
    JASS:
    1
    Resources:
    35
    what setup example?
    i dont get it.
     
  10. Adiktuz

    Adiktuz

    Joined:
    Oct 16, 2008
    Messages:
    9,674
    Resources:
    23
    Models:
    2
    Packs:
    1
    Maps:
    1
    Spells:
    16
    Tutorials:
    1
    JASS:
    2
    Resources:
    23
    I only looked at what you posted btw...

    • Set TL_LCode = TL_LightningType[9]
    • Set TL_MaxTime = 5.00
    • -------- ----------------------------------- --------
    • -------- Color from 0.00 to 1.00 only --------
    • -------- ----------------------------------- --------
    • Set TL_Red = 1.00
    • Set TL_Green = 0.00
    • Set TL_Blue = 1.00
    • Custom script: call Encapsulate()


    the way I understand it, you set-up the lightning values tied to an integer or an abilityID into a hash so that the user can fetch it afterwards... and that part is set-up during the main trigger... and I think it's also clear that you can do it outside of the main trigger [by using those same actions in another trigger], but there is no example posted on how to do this "set-up"...

    and oh, I think the user can also bypass the hash and just use their own values directly... am I right? maybe you can add an example for that too...

    I don't really think those samples are actually needed but maybe some users might get confused... :)

    btw, I'm really curious why there isn't a dest to point method... I mean you already made dest to dest and dest to unit, so why not complete the list by adding dest to point? I just based this on your features list...
     
  11. Almia

    Almia

    Joined:
    Apr 24, 2012
    Messages:
    4,860
    Resources:
    35
    Spells:
    30
    Tutorials:
    4
    JASS:
    1
    Resources:
    35
    Simple,for the dest to point,just make sure to create a dummy,set it the boolean to IsSourceUnitALocation to true
    Also i didnt make the configuration on another trigger because i only made one trigger,and the actions of the configuration are deleted because of the TimedLightning function
     
  12. Adiktuz

    Adiktuz

    Joined:
    Oct 16, 2008
    Messages:
    9,674
    Resources:
    23
    Models:
    2
    Packs:
    1
    Maps:
    1
    Spells:
    16
    Tutorials:
    1
    JASS:
    2
    Resources:
    23
    well yeah, though it's a waste to add a dummy to the map just to create a "Dest to point" when you can just add the capability to make the system support a "Dest to point" by default... I guess... it's not really that important though... the whole dest functions actually since most destructables are static anyway so you can just always use P2P using the dest's locations... :)
     
  13. Almia

    Almia

    Joined:
    Apr 24, 2012
    Messages:
    4,860
    Resources:
    35
    Spells:
    30
    Tutorials:
    4
    JASS:
    1
    Resources:
    35
    It will take me to create so many functions for that,it becomes handy if your are only using Units
     
  14. maddeem

    maddeem

    Joined:
    Jan 1, 2011
    Messages:
    1,238
    Resources:
    5
    Maps:
    2
    Spells:
    3
    Resources:
    5
    Rewriting other people's work does not make it your own.
     
  15. Almia

    Almia

    Joined:
    Apr 24, 2012
    Messages:
    4,860
    Resources:
    35
    Spells:
    30
    Tutorials:
    4
    JASS:
    1
    Resources:
    35
    What do you mean?
    I coded it myself and i have problems solving these one for days.
    So,you are telling that im stealing again right? oh please,dont make me laugh.
     
  16. Ketsuno Anson

    Ketsuno Anson

    Joined:
    May 14, 2011
    Messages:
    392
    Resources:
    0
    Resources:
    0
    Now now , play nice .
     
  17. MasterTrainer

    MasterTrainer

    Joined:
    Apr 14, 2012
    Messages:
    2,768
    Resources:
    3
    Icons:
    1
    Maps:
    1
    Spells:
    1
    Resources:
    3
    I could really use this!
     
  18. Almia

    Almia

    Joined:
    Apr 24, 2012
    Messages:
    4,860
    Resources:
    35
    Spells:
    30
    Tutorials:
    4
    JASS:
    1
    Resources:
    35
    Thanks :D
     
  19. KILLCIDE

    KILLCIDE

    Administrator

    Joined:
    Jul 22, 2015
    Messages:
    3,489
    Resources:
    20
    Models:
    2
    Icons:
    10
    Spells:
    7
    Tutorials:
    1
    Resources:
    20
    Sorry for the update. Just updating the tags.