• 🏆 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 Speed Laceration 1.09

Lightning Speed Laceration v1.09 by Maker.

LSL_4.jpg


The basic idea is simple yet somewhat unique. The spell was very fun and somewhat challenging to create. I'm very happy with the result, it looks great to me in action.

I appreciate all comments and improvement suggestions.


LSL_1.jpg


LSL_2.jpg


LSL_3.jpg







  • Init LSL
    • Events
      • Map Initialization
    • Conditions
    • Actions
      • -------- -------------------------------------------------- --------
      • -------- Create hashtable to store all data --------
      • -------- -------------------------------------------------- --------
      • Hashtable - Create a hashtable
      • Set MH_Hash = (Last created hashtable)
      • -------- -------------------------------------------------- --------
      • -------- Abilities --------
      • -------- -------------------------------------------------- --------
      • -------- Lightning Speed Laceration --------
      • Set MH_Ability[0] = Lightning Speed Laceration
      • -------- LSL Dummy --------
      • Set MH_Ability[1] = LSL Dummy
      • -------- Disable Attack --------
      • Set MH_Ability[2] = Disable Attack
      • -------- -------------------------------------------------- --------
      • -------- Effects --------
      • -------- -------------------------------------------------- --------
      • -------- The effect to be attached on attacking units --------
      • Set MH_Effect[0] = Abilities\Weapons\FaerieDragonMissile\FaerieDragonMissile.mdl
      • -------- The effect to be attached on target on hit --------
      • Set MH_Effect[1] = Abilities\Weapons\GyroCopter\GyroCopterImpact.mdl
      • -------- -------------------------------------------------- --------
      • -------- The attachment point for the effect on the attacker --------
      • -------- -------------------------------------------------- --------
      • Set MH_Attach_Point = weapon
      • -------- -------------------------------------------------- --------
      • -------- Unit type of the dummy --------
      • -------- -------------------------------------------------- --------
      • Set MH_Dummy_Type = Paladin Dummy
      • -------- -------------------------------------------------- --------
      • -------- How many attack animations are you using --------
      • -------- -------------------------------------------------- --------
      • Set MH_Animation_Indexes[0] = 2
      • -------- -------------------------------------------------- --------
      • -------- The animation indexes of your attack animations --------
      • -------- -------------------------------------------------- --------
      • Set MH_Animation_Indexes[1] = 4
      • Set MH_Animation_Indexes[2] = 5
      • -------- -------------------------------------------------- --------
      • -------- Attack duration --------
      • -------- -------------------------------------------------- --------
      • Set MH_Reals[0] = 1.50
      • -------- -------------------------------------------------- --------
      • -------- First Dummy Creation Delay --------
      • -------- -------------------------------------------------- --------
      • Set MH_Reals[1] = 0.21
      • -------- -------------------------------------------------- --------
      • -------- Dummy Creation Interval --------
      • -------- -------------------------------------------------- --------
      • Set MH_Reals[2] = 0.12
      • -------- -------------------------------------------------- --------
      • -------- Dummy Visibility Time --------
      • -------- -------------------------------------------------- --------
      • Set MH_Reals[3] = 1.00
      • -------- -------------------------------------------------- --------
      • -------- Base damage --------
      • -------- -------------------------------------------------- --------
      • Set MH_Reals[4] = 40.00
      • -------- -------------------------------------------------- --------
      • -------- Bonus damage per level --------
      • -------- -------------------------------------------------- --------
      • Set MH_Reals[5] = 10.00
      • -------- -------------------------------------------------- --------
      • -------- Dummy transparency --------
      • -------- -------------------------------------------------- --------
      • Set MH_Reals[6] = 50.00
      • -------- -------------------------------------------------- --------
      • -------- Damage delay --------
      • -------- -------------------------------------------------- --------
      • Set MH_Reals[7] = 0.30
      • -------- -------------------------------------------------- --------
      • -------- Cast delay --------
      • -------- -------------------------------------------------- --------
      • Set MH_Reals[8] = 0.48
      • -------- -------------------------------------------------- --------
      • -------- Does the spell stun --------
      • -------- -------------------------------------------------- --------
      • Set MH_Booleans[0] = True
      • -------- -------------------------------------------------- --------
  • MH Begin Attack
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to MH_Ability[0]
    • Actions
      • Set u1 = (Triggering unit)
      • Set u2 = (Target unit of ability being cast)
      • -------- -------------------------------------------------- --------
      • -------- The unit handle for hashtable key --------
      • -------- -------------------------------------------------- --------
      • Custom script: set udg_i1 = GetHandleId(udg_u1)
      • -------- -------------------------------------------------- --------
      • -------- Removes the attack ability from the caster, so he does not attack on his own --------
      • -------- -------------------------------------------------- --------
      • Unit - Add MH_Ability[2] to u1
      • -------- -------------------------------------------------- --------
      • -------- Randomizes an attack animation --------
      • -------- -------------------------------------------------- --------
      • Set i2 = MH_Animation_Indexes[(Random integer number between 1 and MH_Animation_Indexes[0])]
      • -------- -------------------------------------------------- --------
      • Custom script: call SaveInteger( udg_MH_Hash, udg_i1 , StringHash( "index") , udg_i2)
      • Custom script: call SaveInteger( udg_MH_Hash, udg_i1 , StringHash( "level") , GetUnitAbilityLevel( udg_u1 , udg_MH_Ability[0] - 1 ) )
      • Custom script: call SaveReal( udg_MH_Hash, udg_i1 , StringHash("x") , GetUnitX(udg_u1) )
      • Custom script: call SaveReal( udg_MH_Hash, udg_i1 , StringHash("y") , GetUnitY(udg_u1) )
      • Custom script: call SaveUnitHandle( udg_MH_Hash , udg_i1, StringHash("target") , udg_u2 )
      • -------- -------------------------------------------------- --------
      • -------- Attach a special effect on the unit and save it --------
      • -------- -------------------------------------------------- --------
      • Custom script: call SaveEffectHandle( udg_MH_Hash, udg_i1 , StringHash("effect1") , AddSpecialEffectTarget( udg_MH_Effect[0] , udg_u1 , udg_MH_Attach_Point ) )
      • -------- -------------------------------------------------- --------
      • Unit Group - Add u1 to MH_Caster_Execute
      • Unit Group - Add u1 to MH_Caster_Stop
      • Unit Group - Add u2 to MH_Images
      • -------- -------------------------------------------------- --------
      • Trigger - Turn on MH Clear Images <gen>
      • Trigger - Turn on MH Start Effect <gen>
      • Trigger - Turn on MH Create <gen>
  • MH Start Effect
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to MH_Ability[0]
    • Actions
      • Trigger - Turn on MH Delay Order <gen>
  • MH Delay Order
    • Events
      • Time - Every 0.00 seconds of game time
    • Conditions
    • Actions
      • -------- -------------------------------------------------- --------
      • -------- This trigger is needed because I need that small delay, otherwise the orders --------
      • -------- are issued in wrong order and animations get messed up. --------
      • -------- -------------------------------------------------- --------
      • Unit Group - Pick every unit in MH_Caster_Stop and do (Actions)
        • Loop - Actions
          • Set u1 = (Picked unit)
          • -------- -------------------------------------------------- --------
          • Unit - Order u1 to Hold Position
          • -------- -------------------------------------------------- --------
          • Custom script: call SetUnitAnimationByIndex(udg_u1, LoadInteger( udg_MH_Hash, GetHandleId(udg_u1), StringHash("index")) )
          • -------- -------------------------------------------------- --------
          • Unit Group - Remove u1 from MH_Caster_Stop
          • -------- -------------------------------------------------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (MH_Caster_Stop is empty) Equal to True
            • Then - Actions
              • Trigger - Turn off (This trigger)
              • Trigger - Turn off MH Start Effect <gen>
            • Else - Actions
  • MH Create
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in MH_Caster_Execute and do (Actions)
        • Loop - Actions
          • Set u1 = (Picked unit)
          • -------- -------------------------------------------------- --------
          • Custom script: set udg_i1 = GetHandleId(udg_u1)
          • Custom script: set udg_r1 = LoadReal( udg_MH_Hash , udg_i1 , StringHash("time") )
          • Custom script: set udg_u2 = LoadUnitHandle( udg_MH_Hash, udg_i1, StringHash("target"))
          • -------- -------------------------------------------------- --------
          • Custom script: set udg_r2 = GetUnitX(udg_u1)
          • Custom script: set udg_r3 = GetUnitY(udg_u1)
          • -------- -------------------------------------------------- --------
          • Custom script: set udg_r4 = LoadReal( udg_MH_Hash , udg_i1 , StringHash("x") )
          • Custom script: set udg_r5 = LoadReal( udg_MH_Hash , udg_i1 , StringHash("y") )
          • -------- -------------------------------------------------- --------
          • -------- Check that the spell timer isn't over and that the caster and target are still alive --------
          • -------- Also check that the unit hasn't moved, thus is still casting --------
          • -------- -------------------------------------------------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (u1 is alive) Equal to True
              • (u2 is alive) Equal to True
              • r1 Less than MH_Reals[0]
              • r4 Equal to r2
              • r5 Equal to r3
            • Then - Actions
              • -------- -------------------------------------------------- --------
              • -------- The following values are the delays for creating a dummy --------
              • -------- -------------------------------------------------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • r1 Equal to (MH_Reals[8] - MH_Reals[2])
                      • r1 Equal to (MH_Reals[8] + MH_Reals[2])
                      • r1 Equal to (MH_Reals[8] - (2.00 x MH_Reals[2]))
                      • r1 Equal to (MH_Reals[8] + (2.00 x MH_Reals[2]))
                • Then - Actions
                  • -------- -------------------------------------------------- --------
                  • -------- Tracks how many dummies there are --------
                  • -------- -------------------------------------------------- --------
                  • Custom script: set udg_i2 = 1 + LoadInteger( udg_MH_Hash , udg_i1 , StringHash("dummies") )
                  • -------- -------------------------------------------------- --------
                  • -------- Create a dummy attacker --------
                  • -------- -------------------------------------------------- --------
                  • Custom script: set udg_u3 = CreateUnit(Player(15) , udg_MH_Dummy_Type, udg_r2 , udg_r3 , GetUnitFacing(udg_u1) )
                  • -------- -------------------------------------------------- --------
                  • Custom script: call SaveInteger( udg_MH_Hash , udg_i1 , StringHash("dummies") , udg_i2)
                  • -------- -------------------------------------------------- --------
                  • -------- Link the dummy to caster --------
                  • -------- -------------------------------------------------- --------
                  • Custom script: call SaveUnitHandle( udg_MH_Hash , udg_i1 , udg_i2 , udg_u3 )
                  • -------- -------------------------------------------------- --------
                  • -------- Create and attach a special effect on the dummy --------
                  • -------- -------------------------------------------------- --------
                  • Custom script: set bj_lastCreatedEffect = AddSpecialEffectTarget( udg_MH_Effect[0] , udg_u3 , udg_MH_Attach_Point )
                  • Custom script: call SaveEffectHandle( udg_MH_Hash, GetHandleId(udg_u3) , StringHash("effect1") , bj_lastCreatedEffect)
                  • -------- -------------------------------------------------- --------
                  • -------- Make the dummy partially transparent --------
                  • -------- -------------------------------------------------- --------
                  • Animation - Change u3's vertex coloring to (100.00%, 100.00%, 100.00%) with MH_Reals[6]% transparency
                  • Unit - Change color of u3 to (Color of (Owner of u1))
                  • -------- -------------------------------------------------- --------
                  • -------- Limit the life time of the dummy --------
                  • -------- -------------------------------------------------- --------
                  • Unit - Add a MH_Reals[3] second Generic expiration timer to u3
                  • -------- -------------------------------------------------- --------
                  • -------- Adjust stats of the dummy to affect attack speed --------
                  • -------- -------------------------------------------------- --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (u1 is A Hero) Equal to True
                    • Then - Actions
                      • Hero - Set u3 Hero-level to (Hero level of u1), Hide level-up graphics
                    • Else - Actions
                  • -------- -------------------------------------------------- --------
                  • -------- Retrieve the attack anmation for the caster and play it --------
                  • -------- -------------------------------------------------- --------
                  • Custom script: call SetUnitAnimationByIndex(udg_u3, LoadInteger( udg_MH_Hash, udg_i1, StringHash("index") ) )
                • Else - Actions
              • -------- -------------------------------------------------- --------
              • -------- Reduce the spell timer --------
              • -------- -------------------------------------------------- --------
              • Custom script: call SaveReal( udg_MH_Hash, udg_i1 , StringHash("time") , udg_r1 + 0.03)
              • -------- -------------------------------------------------- --------
              • -------- Check whether damage should be applied or not --------
              • -------- -------------------------------------------------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • r1 Equal to (MH_Reals[8] + MH_Reals[7])
                      • r1 Equal to (MH_Reals[8] + (MH_Reals[7] + MH_Reals[2]))
                      • r1 Equal to (MH_Reals[8] + (MH_Reals[7] + (2.00 x MH_Reals[2])))
                      • r1 Equal to (MH_Reals[8] + (MH_Reals[7] - MH_Reals[2]))
                      • r1 Equal to (MH_Reals[8] + (MH_Reals[7] - (2.00 x MH_Reals[2])))
                • Then - Actions
                  • -------- -------------------------------------------------- --------
                  • -------- Apply damage --------
                  • -------- -------------------------------------------------- --------
                  • Custom script: call UnitDamageTarget( udg_u1 , udg_u2 , ( udg_MH_Reals[4] + ( udg_MH_Reals[5] * LoadInteger( udg_MH_Hash , udg_i1 , StringHash("level") ) ) ) , true , false , ATTACK_TYPE_NORMAL , DAMAGE_TYPE_NORMAL , WEAPON_TYPE_METAL_HEAVY_BASH )
                  • -------- -------------------------------------------------- --------
                  • -------- Create effect on the target --------
                  • -------- -------------------------------------------------- --------
                  • Custom script: call DestroyEffect( AddSpecialEffectTarget( udg_MH_Effect[1] , udg_u2 , "chest" ) )
                  • -------- -------------------------------------------------- --------
                  • -------- If the original caster applies damage, create a dummy and make it cast stunning spell on the target --------
                  • -------- -------------------------------------------------- --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • MH_Booleans[0] Equal to True
                      • r1 Equal to (MH_Reals[7] + MH_Reals[8])
                    • Then - Actions
                      • Custom script: set udg_u1 = CreateUnit(Player(15) , udg_MH_Dummy_Type, GetUnitX(udg_u2) , GetUnitY(udg_u2) , GetUnitFacing(udg_u2) )
                      • -------- -------------------------------------------------- --------
                      • Animation - Change u1's vertex coloring to (100.00%, 100.00%, 100.00%) with 100.00% transparency
                      • -------- -------------------------------------------------- --------
                      • Unit - Add MH_Ability[1] to u1
                      • Unit - Order u1 to Human Mountain King - Storm Bolt u2
                      • Unit - Add a MH_Reals[3] second Generic expiration timer to u1
                      • -------- -------------------------------------------------- --------
                    • Else - Actions
                • Else - Actions
            • Else - Actions
              • -------- -------------------------------------------------- --------
              • -------- Spell over, destroy the effect on the caster --------
              • -------- -------------------------------------------------- --------
              • Custom script: call DestroyEffect(LoadEffectHandle( udg_MH_Hash, udg_i1,StringHash("effect1") ) )
              • -------- -------------------------------------------------- --------
              • Unit Group - Remove u1 from MH_Caster_Execute
              • -------- -------------------------------------------------- --------
              • Unit - Remove MH_Ability[2] from u1
              • -------- -------------------------------------------------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • r4 Equal to r2
                  • r5 Equal to r3
                • Then - Actions
                  • Unit - Order u1 to Stop
                • Else - Actions
                  • -------- -------------------------------------------------- --------
                  • -------- Kill dummies --------
                  • -------- -------------------------------------------------- --------
                  • For each (Integer loopA) from 1 to (Load (Key dummies) of (Key (Picked unit)) from MH_Hash), do (Actions)
                    • Loop - Actions
                      • Unit - Kill (Load loopA of i1 in MH_Hash)
              • -------- -------------------------------------------------- --------
              • Custom script: call FlushChildHashtable( udg_MH_Hash, udg_i1 )
              • -------- -------------------------------------------------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (MH_Caster_Execute is empty) Equal to True
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
  • MH Clear Images
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to MH_Dummy_Type
    • Actions
      • -------- -------------------------------------------------- --------
      • -------- This trigger handles the dummy units --------
      • -------- -------------------------------------------------- --------
      • Set u1 = (Triggering unit)
      • -------- -------------------------------------------------- --------
      • Custom script: set udg_i1 = GetHandleId(udg_u1)
      • -------- -------------------------------------------------- --------
      • Custom script: call DestroyEffect(LoadEffectHandle( udg_MH_Hash, udg_i1,StringHash("effect1") ) )
      • -------- -------------------------------------------------- --------
      • Custom script: call FlushChildHashtable( udg_MH_Hash, udg_i1 )
      • -------- -------------------------------------------------- --------
      • Unit Group - Remove u1 from MH_Images
      • -------- -------------------------------------------------- --------
      • Unit - Remove u1 from the game
      • -------- -------------------------------------------------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (MH_Images is empty) Equal to True
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions


JASS:
//==================================================================================//
//                                                                                  //
//  LIGHTNING SPEED LACERATION by Maker v1.00                                       //                      
//                                                                                  //
//          The caster strikes the target several times at lightning-like speed     //
//          causing severe blunt force trauma and stun.                             //
//                                                                                  //
//          Requires  JNGP and TimerUtils                                           //
//                                                                                  //
//      How to import:                                                              //
//          1.  Copy the ability                                                    //
//          2.  Copy the dummy ability                                              //
//          3.  Create a copy of your unit and make it a dummy unit.                //
//              You can take a look at the paladin dummy in this map to see         //
//              which data field you need to edit.                                  //
//          4.  Set ABILID, DUMABILID and DUMMYID to correct raw codes.             //
//              You can view raw codes in object editor by clicking Ctrl + D.       //
//          5.  Edit animation indexes in SetAnim function.                         //
//              You can use the Animation Test trigger in Test folder to            //
//              check animation indexes.                                            //
//                                                                                  //
//==================================================================================//


scope LSL

    globals
        // Ability raw code
        private constant integer        ABILID      = 'A003'
        // Dummy stun ability raw code
        private constant integer        DUMABILID   = 'A002'
        // Dummy unit raw code
        private constant integer        DUMMYID     = 'H000'
        
        private constant attacktype     ATT         = ATTACK_TYPE_NORMAL
        private constant damagetype     DAM         = DAMAGE_TYPE_NORMAL
        // Affects the sound when damage is applied
        private constant weapontype     WEA         = WEAPON_TYPE_METAL_HEAVY_BASH
        
        // Delay between starting the hit animation and applying damage
        private constant real           DMGDELAY    = 0.25
        // Delay between applying damage and removing dummies
        private constant real           DEATHDELAY  = 0.50
        // Delay of dummy creation between creating copies
        private constant real           CREATEDELAY = 0.15
        // How fast the animation plays
        private constant real           TIMESCALE   = 1.50
        // Dummy unit transparency. 0 = invisible, 255 = fully visible
        private constant integer        ALPHA       = 127
        
        // Attached to the the attackers
        private constant string         WPNEFF      = "Abilities\\Weapons\\FaerieDragonMissile\\FaerieDragonMissile.mdl"
        // Attached on the target
        private constant string         HITEFF      = "Abilities\\Weapons\\GyroCopter\\GyroCopterImpact.mdl"
        // Attach point of WPNEFF
        private constant string         HITATT      = "weapon"
        // Attach point of HITEFF
        private constant string         DMGATT      = "chest"
        
        
        private         integer         ANIMCOUNT
        private         integer array   ANIMS
    endglobals
    
    // Configure the attack animation indexes an how many of the exist
    private function SetAnims takes nothing returns nothing
        set ANIMS[1] = 4
        set ANIMS[2] = 5
        set ANIMCOUNT = 2
    endfunction
    
    // How many times the ability hits
    private constant function GetHits takes integer lvl returns integer
        return 2 + lvl
    endfunction
    
    // Damage per hit
    private constant function GetDamage takes integer lvl returns real
        return 15. + lvl * 15.
    endfunction
    
    // Handles hit instances
    private struct Hit
        unit hit
        unit caster
        unit target
        real dmg
        real dmgdelay
        real dur
        timer tim
        effect eff
        boolean b
        
        static method remove takes nothing returns nothing
            local timer t = GetExpiredTimer()
            local thistype this = GetTimerData(t)
            if .b then
                call RemoveUnit(.hit)
            else
                call SetUnitTimeScale(.hit, TIMESCALE)
            endif
            call DestroyEffect(.eff)
            call ReleaseTimer(t)
            call .destroy()
            set t = null
        endmethod
        
        static method damage takes nothing returns nothing
            local timer t = GetExpiredTimer()
            local thistype this = GetTimerData(t)
            call UnitDamageTarget(.caster, .target, .dmg, true, false, ATT, DAM, WEA)
            call DestroyEffect(AddSpecialEffectTarget(HITEFF, .target, DMGATT))
            call TimerStart(.tim, DEATHDELAY, false, function thistype.remove)
            set t = null
        endmethod
        
        static method onHit takes boolean b, integer ind, unit caster, unit tar, real dmg, real x, real y returns nothing
            local thistype this = thistype.allocate()
            
            if b then
                set .hit = CreateUnit(Player(15), DUMMYID, x, y, GetUnitFacing(caster))
                call UnitApplyTimedLife(.hit, 1, 2)
                call SetUnitColor(.hit, GetPlayerColor(GetOwningPlayer(caster)))
                call SetUnitVertexColor(.hit, 255, 255, 255, ALPHA)
                call SetUnitAnimationByIndex(.hit, ind)
            else
                set .hit = caster
            endif
            
            set .b = b
            set .caster = caster
            set .target = tar
            set .dmg = dmg
            set .tim = NewTimer()
            
            call SetUnitTimeScale(.hit, TIMESCALE)
            set .eff = AddSpecialEffectTarget(WPNEFF, .hit, HITATT)
            call SetTimerData(.tim, this)
            call TimerStart(.tim, DMGDELAY, false, function thistype.damage)
        endmethod
    endstruct
    
    private struct LSL
        real x
        real y
        real dmg
        integer lvl
        integer loops
        integer maxLoops
        unit caster
        unit target
        integer anim
        timer tim
        
        static method periodic takes nothing returns nothing
            local timer t = GetExpiredTimer()
            local thistype this = GetTimerData(t)
            
            if not(IsUnitType(.caster, UNIT_TYPE_DEAD) or GetUnitTypeId(.caster) == 0)      /*
            */ and not(IsUnitType(.target, UNIT_TYPE_DEAD) or GetUnitTypeId(.target) == 0)  /*
            */ and .loops != maxLoops                                                       /*
            */ and .x == GetUnitX(.caster)                                                  /*
            */ and .y == GetUnitY(.caster)                                                  then
                if .loops == 0 then
                    set bj_lastCreatedUnit = CreateUnit(Player(15), DUMMYID, .x, .y, GetUnitFacing(.caster))
                    call UnitApplyTimedLife(bj_lastCreatedUnit, 1, 1)
                    call SetUnitAbilityLevel(bj_lastCreatedUnit, DUMABILID, .lvl)
                    call IssueTargetOrder(bj_lastCreatedUnit, "thunderbolt", .target)
                    call ShowUnit(bj_lastCreatedUnit, false)
                    call Hit.onHit(false, .anim, .caster, .target, .dmg, .x, .y)
                else
                    call Hit.onHit(true, .anim, .caster, .target, .dmg, .x, .y)
                endif
                set .loops = .loops + 1
            else
                call ReleaseTimer(t)
                call .destroy()
            endif
            
            set t = null
        endmethod
        
        static method onCast takes nothing returns nothing
            local thistype this = thistype.allocate()
            
            set .lvl = GetUnitAbilityLevel(GetTriggerUnit(), ABILID)
            set .tim = NewTimer()
            set .loops = 0
            set .maxLoops = GetHits(.lvl)
            set .dmg = GetDamage(.lvl)
            set .caster = GetTriggerUnit()
            set .target = GetSpellTargetUnit()
            set .x = GetUnitX(.caster)
            set .y = GetUnitY(.caster)
            set .anim = ANIMS[GetRandomInt(1, ANIMCOUNT)]
            
            call SetTimerData(.tim, this)
            call SetUnitAnimationByIndex(.caster, .anim)
            call TimerStart(.tim, CREATEDELAY, true, function thistype.periodic)
        endmethod
        
        static method condition takes nothing returns boolean
            if GetSpellAbilityId() == ABILID then
                call thistype.onCast()
            endif
            return false
        endmethod
        
        private static method onInit takes nothing returns nothing
            local trigger t = CreateTrigger()
            call SetAnims()
            call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
            call TriggerAddCondition(t, Condition(function thistype.condition))
            set t = null
        endmethod
    endstruct
    
endscope


v1.00 Uploaded @ 14.09.2010
v1.01 Uploaded @ 14.09.2010
*Dummies removed from the game rather than just hiding them.
*Sound is now destroyed.
*Dummies are created for neutral, not P1.
*Tooltip fixed.
*Uses bj_lastCreatedEffect rather than GetLastCreatedEffectBJ().
v1.02 Uploaded @ 14.09.2010
*Changed the event for "Starts the effect..." to "Begins casting..." for reduced delay between casting and executing the spell for smoother effect.
*Adjusted timing values, tooltip, damage.
*Increased the number of hits from 4 to 5.
v1.03 Uploaded @ 14.09.2010
*Back to "Starts the effect..." event, since "Begins casting..." doesn't trigger cooldown or reduce mana.
*The spell effect vanishes if you move while it's on.
v1.04 Uploaded @ 15.09.2010
*Re-added Locust to the dummy.
*Added target filters
v1.05 Uploaded @ 15.09.2010
*Now uses a combination of "Begins casting... and Start the effect..." to reduce the delay of starting the effect, but it still triggers cooldown and mana cost.
*How to impot -instructions.
*Adjusted timings.
v1.06 Uploaded @ 16.09.2010
*Fixed a bug causing the spell not to stun.
*Replaced some pure GUI actions with custom script JASS actions.
v1.06a Uploaded @ 27.09.2010
*The special effect attached to the caster's weapon is now correctly removed.
*Removed debug messages.
v1.07 Uploaded @ 25.01.2011
*Now using UnitDamageTarget instead of UnitDamageTargetBJ. Now the hit sound can be controlled by weapon type, and the sound plays on all hits.
v1.08 Uploaded @ 28.01.2011
*Several trigger optimizations.
*Fixed a special effect leak.
v1.09 Uploaded @ 01.03.2011
*Changed initalization trigger event fro 0.00 game time to Map initialization
*Made adding the dummy ability to use a variable.
Update @ 26.09.2011
*Added vJASS version.



Keywords:
fast, speed, multihit, lightning, maker, stun
Contents

Lightning Speed Laceration v1.08 (Map)

Reviews
12:27, 1st Mar 2011 Bribe: The short variable names are still something I would like to see prefixed or given a disclaimer for ("don't use these variable names as arrays or use them for longer than 0 seconds") The initialization should just be...
Level 6
Joined
Jun 18, 2011
Messages
147
Aww, did you add vJass just for me?

I figured out why I couldn't get the GUI version working, and I customized it to be performed by King Arthur with Excalibur. I renamed it Flurry, and changed the debuff it causes. Here is my description:

The caster strikes the target five times at lightning-like speed causing severe fiery lacerations cauterizing flesh. Each successful swing deals Arthur's attack damage as well as...

Level 1 - 15 bonus damage.
Level 2 - 30 bonus damage.
Level 3 - 45 bonus damage.

Cauterization can cause damage over time, preventing the casting of spells, and reducing attack damage by 25%.

Level 1 - 100 damage over 14 seconds.
Level 2 - 225 damage over 16 seconds.
Level 3 - 375 damage over 18 seconds.

Burning lasts roughly half as long on Heroes.


Thank you, and Launtanen said it best, "This Spell is Awesome."
 
Level 2
Joined
May 19, 2013
Messages
32
yeah i should delete it.Sorry.

Meh this LSL is like flash moving. EPIC.
 
Last edited by a moderator:
Top