1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. Head to the 33rd Modeling Contest Poll and drink to your heart's desire.
    Dismiss Notice
  3. Choose your means of doom in the 17th Mini Mapping Contest Poll.
    Dismiss Notice
  4. A slave to two rhythms, the 22nd Terraining Contest is here.
    Dismiss Notice
  5. The heavens smile on the old faithful. The 16th Techtree Contest has begun.
    Dismiss Notice
  6. The die is cast - the 6th Melee Mapping Contest results have been announced. Onward to the Hive Cup!
    Dismiss Notice
  7. The glory of the 20th Icon Contest is yours for the taking!
    Dismiss Notice
  8. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Lightning Storm v1.4 [Lightning Graphic 21s]

Submitted by nhocklanhox6
This bundle is marked as approved. It works and satisfies the submission rules.
-------------------------------------------
**
**L I G H T N I N G**
**
**S T O R M**
**

http://www.youtube.com/watch?v=rQ4Dbc5Qs2U&feature=youtu.be
I/ Spell Information:
[​IMG]
II/ Spell Code:
Lightning Storm
Code (vJASS):

//*************************************************************************************
//*************************************************************************************
//*************************************************************************************
//*************************************************************************************
//*************************************************************************************
//*************************************************************************************
//          L I G H T N I N G     S T O R M
//                                  - Spell Create By:
//                                                      + Elphis
//*************************************************************************************
//*************************************************************************************
//*************************************************************************************
library LightningStorm /*                  
*/
                                     requires /*
//                                              -*/
DelFX /* http://www.hiveworkshop.com/forums/spells-569/delfx-delayed-effects-1-4-2-a-116064/?prev=search%3DDel%2520Effect%26d%3Dlist%26r%3D20%26c%3D112
//                                              -*/
TimerUtils /* http://www.wc3c.net/showthread.php?t=101322
//                                              -*/
SpellEffectEvent /* http://www.hiveworkshop.com/forums/jass-resources-412/snippet-spelleffectevent-187193/
//                                              -*/
xebasic /* http://www.wc3c.net/showthread.php?t=101150
//                                              -*/
xedamage /* http://www.wc3c.net/showthread.php?t=101150
//                                              -*/
Table /* http://www.wc3c.net/showthread.php?t=101246
//                                              -*/
LightningStormPlugin /* Plugin */
//                                      Optional:
//                                                LightningAura.mdx - http://www.hiveworkshop.com/forums/models-530/lightning-aura-98346/?prev=search%3DLightning%2520Aura%26d%3Dlist%26r%3D20
//                                                BoundSentinel - http://www.wc3c.net/showthread.php?t=102576 (You must adding it, this library help you prevent crash the game when lightning outside XY of map.
//*************************************************************************************
//*************************************************************************************
//*************************************************************************************
//*************************************************************************************
//          - Spell Information:
//                              - Call a powerful beam of energy from the ground, accumulate and discharge power super strong
//                                when enemies within 150 range of this power, enemies will shock and lost 30/60/90/120 hit points
//                                after storm release 30/40/50/60 lightning, it will absorbed all previous energy
//                                and discharge 30/40/50/60 lightning again also deals 30 damage to enemies
//                                and then, it accumulates, and exploded, the explosion caused a power flow and deals 15/30/45/60 damage to enemies.
//*************************************************************************************
//*************************************************************************************
//*************************************************************************************
//*************************************************************************************
//          - Installation:
//                                - Import/copy the required libraries and Lightning Storm code to your map
//                                - Import/copy the custom ability and unit to your map and change the SPELL_ID,DUMMY_LIGHTNING if needed
//                                - Export model LightningAura.mdx, dummy.mdx and import it into your map
//                                - You may view the raw ID of the objects by pressing CTRL+D in the object editor
//                                - You may play with the configurables below
//                                - When you copy dummy "xe unit (Caster System?)", you must change rawcode ID of this dummy = xeca
//                                  or you must change rawcode in xebasic with name globals: XE_DUMMY_UNITID
//*************************************************************************************
//*************************************************************************************
//*************************************************************************************
//*************************************************************************************
//*************************************************************************************
    globals
        //============================================SPELL CONFIGURATION==========================================================
        //*************************************************************************************************************************
        //Spell rawcode, change if needed
        private             constant                integer             SPELL_ID              =               'A000'
        //
        //Dummy lightning rawcode, change if needed
        private             constant                integer             DUMMY_LIGHTNING       =               'e000'
        //Ability allow unit can fly change if needed
        private             constant                integer             ABI_FLY               =               'Amrf'
        //Spell Periodic
        private             constant                real                PERIODIC              =               0.031250000
        //
        //*************************************************************************************************************************
        //*************************************************************************************************************************
        //*************************************************************************************************************************
        //Damage base when lightning hit enemies
        private             constant                real                DAMAGE_BASE           =               30.
        //Damag radius when lightning hit ground
        private             constant                real                DAMAGE_RADIUS         =               150.
        //Damage radius when powerful lightning causes an explotion, don't increase this value too much because it very powerful
        private             constant                real                DAMAGE_RADIUS_EXPLORE =               75.
        //Area of effect of spell
        //This value must be divisible by two
        private             constant                real                AREA_OF_EFFECT        =               600.
        //Powerful lightning height
        //This value must be divisible by two
        private             constant                real                L_HEIGHT_POWER        =               600.
        //Lightning release intevar, decrease if you want to spell "SPAM" ^^ (just kidding), increase if spell very powerful :)
        private             constant                real                RELEASE_INTEVAR       =               0.1
        //Size of center lighning (also size of other lightning/2)
        private             constant                real                SIZE                  =               3.
        //Min height of lightning
        private             constant                real                MIN_HEIGHT            =               50.
        //Distance increase of other lightning per periodic
        private             constant                real                DISTANCE_INC          =               10.
        //Min distance release lightning
        private             constant                real                MIN_REALSE_L          =               200.
        //Lightning release speed
        private             constant                real                LIGHTNING_R_S         =               10.
        //Height of center lightning when spell expire
        private             constant                real                HEIGHT_INC            =               15.
        //
        //*************************************************************************************************************************
        //*************************************************************************************************************************
        //*************************************************************************************************************************
        //Total lightning release of spell (Spell expire when release all lightning with value)
        private            constant                 integer             RELEASE_COUNT         =                30
        //
        //*************************************************************************************************************************
        //*************************************************************************************************************************
        //*************************************************************************************************************************
        //Center Lightning Vortex (Like Eye Storm)
        private             constant                string              M_MODEL               =               "war3mapImported\\LightningAura.mdx"
        //Lightning effect when all lightning causes an explotion
        private             constant                string              E_MODEL               =               "war3mapImported\\Great Lightning.mdx"
        //Orb of lightning model
        private             constant                string              O_MODEL               =               "Abilities\\Weapons\\FarseerMissile\\FarseerMissile.mdl"
        //Effect when lightning hit ground
        private             constant                string              RELEASE_L_EFFECT      =               "Abilities\\Weapons\\Bolt\\BoltImpact.mdl"
        //Main lightning attach to orb
        private             constant                string              M_ALT                 =               "DRAM"
        //Other lightning attach to orb
        private             constant                string              O_ALT                 =               "MFPB"
        //Hmm, i don't know how to explain
        private             constant                string              E_ALT                 =               "CLPB"
        //Release lightning model
        private             constant                string              R_ALT                 =               "AFOD"
        //Attachment effect of dummy
        private             constant                string              D_ATTACHMENT          =               "origin"
        //Attachment effect of center lightning
        private             constant                string              M_ATTACHMENT          =               "origin"
        //
        //*************************************************************************************************************************
        //*************************************************************************************************************************
        //*************************************************************************************************************************
        //                                     ======DAMAGE SETTINGS======
        private             constant                attacktype          ATTACKTYPE            =           ATTACK_TYPE_HERO
        private             constant                damagetype          DAMAGETYPE            =           DAMAGE_TYPE_COLD
        private             constant                weapontype          WEAPONTYPE            =           WEAPON_TYPE_METAL_HEAVY_BASH
        //*************************************************************************************************************************
        //*************************************************************************************************************************
        //*************************************************************************************************************************
    endglobals
   
    struct LighningStorm
       
        unit caster
        unit dummy
        //
        real xx
        real yy
        real angle
        real s
        real reach = 0.
        real intevar = 0.
        real dam
        //
        integer count
        integer k = 0
        //
        Table tab
        xedamage xed
       
        static method onCount takes unit u returns integer
            return RELEASE_COUNT + GetUnitAbilityLevel(u,SPELL_ID)*10 //Count lightning release per periodic
        endmethod
       
        static method onDamage takes unit u returns real
            return DAMAGE_BASE + GetUnitAbilityLevel(u,SPELL_ID) //Damage per lightning hit enemies unit
        endmethod
       
        static method onPeriodic takes nothing returns nothing
            //
            local timer t = GetExpiredTimer()
            local thistype this = GetTimerData(t)
            //
            local integer i = 6
            local real x
            local real y
            local real cos
            local real sin
            //
            if k == 0 then
                if s < SIZE then
                    set s = s + tab.real[this]
                    //
                    call SetUnitScale(dummy,s,0.,0.)
                    //
                    loop
                        exitwhen i == 0
                        call SetUnitScale(tab.unit[i],s/2,0.,0.)
                        call SetUnitScale(tab.unit[10+i],s/2,0.,0.)
                        set i = i - 1
                    endloop
                    //
                    set reach = reach + DISTANCE_INC
                    //
                else
                    if intevar < RELEASE_INTEVAR then
                        set intevar = intevar + PERIODIC
                    else
                        set intevar = 0.
                        set count = count - 1
                        //This line release lightning
                        call RLPLLS.add(R_ALT,RELEASE_L_EFFECT,caster,tab.unit[50+GetRandomInt(1,6)],dam,GetRandomReal(MIN_REALSE_L,AREA_OF_EFFECT),DAMAGE_RADIUS,LIGHTNING_R_S,ATTACKTYPE,DAMAGETYPE,WEAPONTYPE)
                        //
                        if count == 0 then
                            set k = 1
                            set s = 0.
                            set intevar = 0.
                        endif
                        //
                    endif
                endif
            elseif k == 1 then
                set reach = reach - DISTANCE_INC
            endif
            //
            //
            if k <= 1 then
                //
                set angle = angle + 5.
                set i = 6
                //
                loop
                    exitwhen i == 0
                    //
                    if reach > 0. then
                        set cos = Cos((tab.real[20+i]+angle)*.0174533)
                        set sin = Sin((tab.real[20+i]+angle)*.0174533)
                        set x = xx + reach/2 * cos
                        set y = yy + reach/2 * sin
                        //
                        call SetUnitX(tab.unit[i],x)
                        call SetUnitY(tab.unit[i],y)
                        call MoveLightning(tab.lightning[30+i],true,x,y,xx,yy)
                        //
                        set x = xx + reach * cos
                        set y = yy + reach * sin
                        //
                        call SetUnitX(tab.unit[10+i],x)
                        call SetUnitY(tab.unit[10+i],y)
                        call MoveLightning(tab.lightning[40+i],true,x,y,GetWidgetX(tab.unit[i]),GetWidgetY(tab.unit[i]))
                        call MoveLightningEx(tab.lightning[60+i],true,x,y,MIN_HEIGHT,GetWidgetX(tab.unit[51]),GetWidgetY(tab.unit[51]),GetUnitFlyHeight(tab.unit[51]))
                    else
                        set k = 2
                        set s = 0.
                        call RemoveUnit(tab.unit[i])
                        call RemoveUnit(tab.unit[10+i])
                        call DestroyLightning(tab.lightning[30+i])
                        call DestroyLightning(tab.lightning[40+i])
                        call DestroyLightning(tab.lightning[60+i])
                        //
                        set tab.unit[i] = null
                        set tab.unit[10+i] = null
                        set tab.lightning[30+i] = null
                        set tab.lightning[40+i] = null
                        set tab.lightning[60+i] = null
                        //
                    endif
                    //
                    set i = i - 1
                endloop
            elseif s < L_HEIGHT_POWER and k == 2 then
                //
                set s = s + HEIGHT_INC
                //
                call SetUnitFlyHeight(dummy,s,0.)
                //
                set i = 6
                //
                loop
                    exitwhen i == 0
                    if s >= tab.real[70+i] and tab.unit[50+i] != null then
                        call RemoveUnit(tab.unit[50+i])
                        set tab.unit[50+i] = null
                    endif
                    set i = i - 1
                endloop
                //
                if s >= L_HEIGHT_POWER then
                    //
                    set i = 6
                    set k = 3
                    //
                    loop
                        exitwhen i == 0
                        //
                        set x = xx + 100. * Cos(i*60*.0174533)
                        set y = yy + 100. * Sin(i*60*.0174533)
                        //
                        set tab.unit[i] = CreateUnit(Player(15),DUMMY_LIGHTNING,x,y,0.)
                        set tab.lightning[10+i] = AddLightningEx(M_ALT,true,x,y,s,xx,yy,s)
                        call SetUnitScale(tab.unit[i],SIZE/2,0.,0.)
                        call UnitAddAbility(tab.unit[i],ABI_FLY)
                        call UnitRemoveAbility(tab.unit[i],ABI_FLY)
                        call SetUnitFlyHeight(tab.unit[i],s,0.)
                        //
                        set i = i - 1
                    endloop
                    //
                endif
                //
            elseif reach < AREA_OF_EFFECT and k == 3 then
                //
                set reach = reach + DISTANCE_INC
                //
                loop
                    exitwhen i == 0
                    //
                    set x = xx + reach * Cos((tab.real[20+i]+angle)*.0174533)
                    set y = yy + reach * Sin((tab.real[20+i]+angle)*.0174533)
                    //
                    call SetUnitX(tab.unit[i],x)
                    call SetUnitY(tab.unit[i],y)
                    call MoveLightningEx(tab.lightning[10+i],true,x,y,s,xx,yy,L_HEIGHT_POWER)
                    //
                    set i = i - 1
                endloop
                //
                if reach >= AREA_OF_EFFECT then
                    set k = 4
                endif
            elseif s > MIN_HEIGHT and k == 4 then
                //
                set s = s - HEIGHT_INC*2
                //
                loop
                    exitwhen i == 0
                    //
                    set x = xx + reach * Cos((tab.real[20+i]+angle)*.0174533)
                    set y = yy + reach * Sin((tab.real[20+i]+angle)*.0174533)
                    //
                    call MoveLightningEx(tab.lightning[10+i],true,x,y,s,xx,yy,L_HEIGHT_POWER)
                    //
                    call SetUnitFlyHeight(tab.unit[i],s,0.)
                    //
                    set i = i - 1
                endloop
                //
                if s <= MIN_HEIGHT then
                    set k = 5
                    set count = onCount(caster)
                endif
                //
            elseif count > 0 and k == 5 then
                set count = count - 1
                //This line release lightning
                call RLPLLS.add(R_ALT,RELEASE_L_EFFECT,caster,dummy,dam,GetRandomReal(MIN_REALSE_L,AREA_OF_EFFECT),DAMAGE_RADIUS,LIGHTNING_R_S*3,ATTACKTYPE,DAMAGETYPE,WEAPONTYPE)
               
                if count == 0 then
                    set k = 6
                endif
            elseif s < L_HEIGHT_POWER and k == 6 then
                set s = s + HEIGHT_INC
                call SetUnitFlyHeight(dummy,GetUnitFlyHeight(dummy)-HEIGHT_INC,0.)
                loop
                    exitwhen i == 0
                    //
                    call MoveLightningEx(tab.lightning[10+i],true,GetWidgetX(tab.unit[i]),GetWidgetY(tab.unit[i]),s,xx,yy,GetUnitFlyHeight(dummy))
                    //
                    call SetUnitFlyHeight(tab.unit[i],s,0.)
                    //
                    set i = i - 1
                endloop
                if s >= L_HEIGHT_POWER then
                    set k = 7
                endif
            elseif reach > 0. and k == 7 then
                set reach = reach - DISTANCE_INC
                loop
                    exitwhen i == 0
                    //
                    set x = xx + reach * Cos((tab.real[20+i]+angle)*.0174533)
                    set y = yy + reach * Sin((tab.real[20+i]+angle)*.0174533)
                    //
                    call MoveLightningEx(tab.lightning[10+i],true,x,y,s,xx,yy,0.)
                    //
                    call SetUnitX(tab.unit[i],x)
                    call SetUnitY(tab.unit[i],y)
                    //
                    set i = i - 1
                endloop
                if reach <= 0. then
                    set k = 8
                endif
            elseif s > MIN_HEIGHT and k == 8 then
                set s = s - HEIGHT_INC*2
                //
                loop
                    exitwhen i == 0
                    //
                    call MoveLightningEx(tab.lightning[10+i],true,GetWidgetX(tab.unit[i]),GetWidgetY(tab.unit[i]),s,xx,yy,0.)
                    //
                    call SetUnitFlyHeight(tab.unit[i],s,0.)
                    //
                    set i = i - 1
                endloop
                //
                set i = 6
                //
                if s <= MIN_HEIGHT then
                    set k = 9
                    //
                    loop
                        exitwhen i == 0
                        //
                        call RemoveUnit(tab.unit[i])
                        call DestroyLightning(tab.lightning[10+i])
                        //
                        set tab.unit[i] = null
                        set tab.lightning[10+i] = null
                        //
                        set i = i - 1
                    endloop
                    //
                    set s = SIZE
                    //
                endif
            elseif s > 0. and k == 9 then
                set s = s - tab.real[this]*2
                call SetUnitScale(dummy,s,0.,0.)
                //
                if s <= 0. then
                    set k = 10
                    call RemoveUnit(dummy)
                    set dummy = null
                endif
            elseif reach < AREA_OF_EFFECT and k == 10 then
                set reach = reach + DISTANCE_INC*4
                loop
                    exitwhen i == 0
                    //
                    set x = xx + reach * Cos(i*60*.0174533)
                    set y = yy + reach * Sin(i*60*.0174533)
                    //
                    call DestroyEffect(AddSpecialEffect(RELEASE_L_EFFECT,x,y))
                    //This line deals damage to enemies unit
                    call xed.damageAOE(caster,x,y,DAMAGE_RADIUS_EXPLORE,dam/2)
                    //
                    set i = i - 1
                endloop
            else
                //Clean data
                call ReleaseTimer(t)
                set caster = null
                call tab.flush()
                call tab.destroy()
                call xed.destroy()
                call destroy()
            endif
            //
            set t = null
            //
        endmethod
       
        static method onCast takes nothing returns nothing
            //
            local thistype this = allocate()
            //
            local integer ii = 6
            local real x
            local real y
            //Spell config
            set caster = GetTriggerUnit()
            //
            set tab = Table.create()
            //
            set xx = GetSpellTargetX()
            set yy = GetSpellTargetY()
            //Xe damage install
            set xed = xedamage.create()
            set xed.dtype = DAMAGETYPE
            set xed.atype = ATTACKTYPE
            set xed.wtype = WEAPONTYPE
            set xed.exception = UNIT_TYPE_STRUCTURE
            set xed.damageEnemies = true
            set xed.damageTrees   = true
            //
            set dam = onDamage(caster)
            set angle = L_HEIGHT_POWER/6
            set count = onCount(caster)
            set tab.real[this] = SIZE/AREA_OF_EFFECT*DISTANCE_INC
            //
            set dummy = CreateUnit(Player(15),XE_DUMMY_UNITID,xx,yy,0.)
            call SetUnitScale(dummy,0.,0.,0.)
            call UnitAddAbility(dummy,ABI_FLY)
            call UnitRemoveAbility(dummy,ABI_FLY)
            call CreateDelayedEffectTarget(M_MODEL,dummy,M_ATTACHMENT,0.,30.)
            //
            loop
                exitwhen ii == 0
                //
                set x = xx + 100. * Cos(ii*60*.0174533)
                set y = yy + 100. * Sin(ii*60*.0174533)
                //
                set tab.unit[ii] = CreateUnit(Player(15),DUMMY_LIGHTNING,x,y,0.)
                set tab.real[20+ii] = 57.29582 * Atan2(y - yy, x - xx)
                call SetUnitScale(tab.unit[ii],0.,0.,0.)
                call UnitAddAbility(tab.unit[ii],ABI_FLY)
                call UnitRemoveAbility(tab.unit[ii],ABI_FLY)
                call SetUnitFlyHeight(tab.unit[ii],MIN_HEIGHT,MIN_HEIGHT)
                //
                set tab.unit[10+ii] = CreateUnit(Player(15),DUMMY_LIGHTNING,x,y,0.)
                call SetUnitScale(tab.unit[10+ii],0.,0.,0.)
                call UnitAddAbility(tab.unit[10+ii],ABI_FLY)
                call UnitRemoveAbility(tab.unit[10+ii],ABI_FLY)
                call SetUnitFlyHeight(tab.unit[10+ii],MIN_HEIGHT,MIN_HEIGHT)
                //
                set tab.unit[50+ii] = CreateUnit(Player(15),DUMMY_LIGHTNING,xx,yy,0.)
                call SetUnitScale(tab.unit[50+ii],SIZE/2,0.,0.)
                call UnitAddAbility(tab.unit[50+ii],ABI_FLY)
                call UnitRemoveAbility(tab.unit[50+ii],ABI_FLY)
                set s = s + angle
                call SetUnitFlyHeight(tab.unit[50+ii],s,s)
                set tab.real[70+ii] = s
                //
                set tab.lightning[30+ii] = AddLightning(M_ALT,true,x,y,xx,yy)
                set tab.lightning[40+ii] = AddLightning(O_ALT,true,x,y,xx,yy)
                set tab.lightning[60+ii] = AddLightning(E_ALT,true,x,y,xx,yy)
                //
                //
                set ii = ii - 1
            endloop
            //
            set angle = 0.
            set s = 0.
            //
            call TimerStart(NewTimerEx(this),PERIODIC,true,function thistype.onPeriodic)
            //
        endmethod
       
        static method onInit takes nothing returns nothing
            call RegisterSpellEffectEvent(SPELL_ID,function thistype.onCast)
        endmethod
       
    endstruct
   
endlibrary[/HIDDEN]

Plugin
Code (vJASS):
library LightningStormPlugin requires TimerUtils,xedamage
    //
    globals
        private         constant            real            PERIODIC            =           0.031250000
    endglobals
    //
    struct RLPLLS
        //
        unit c
        unit dummy
        //
        lightning l
        //
        real xx
        real yy
        real an
        real s
        real reach
        real in
        real dam
        real cos
        real sin
        real sp
        real dr
        //
        string ef
        //
        xedamage xed
        //
       
        //PLUGIN OF STORM LIGHTNING
        static method periodicPlugin takes nothing returns nothing
            //
            local timer t = GetExpiredTimer()
            local thistype this = GetTimerData(t)
            //
            local real x
            local real y
            //
            if an > 0. then
                //
                set an = an - in
                //
                set reach = reach + sp
                //
                set x = xx + reach * cos
                set y = yy + reach * sin
                //
                call MoveLightningEx(l,true,xx,yy,s,x,y,an)
                //
            else
                //
                call ReleaseTimer(t)
                //
                set x = xx + reach * cos
                set y = yy + reach * sin
                //
                call xed.damageAOE(c,x,y,dr,dam)
                call DestroyEffect(AddSpecialEffect(ef,x,y))
                //
                call DestroyLightning(l)
                set l = null
                set dummy = null
                set c = null
                call xed.destroy()
                call destroy()
            endif
            //
            set t = null
            //
        endmethod
       
        static method add takes string lightningmodel,string effe,unit caster,unit attach,real damage,real dis,real damageradius,real speed,attacktype a,damagetype dd,weapontype w returns nothing
            local thistype this = allocate()
            //
            set c = caster
            set ef = effe
            set dummy = attach
            set dam = damage
            set sp = speed
            set reach = 0.
            set an = GetRandomReal(0,360)
            set s = GetUnitFlyHeight(dummy)
            set in = s/dis*sp
            set l = AddLightning(lightningmodel,true,GetUnitX(dummy),GetUnitY(dummy),GetUnitX(dummy),GetUnitY(dummy))
            set xx = GetUnitX(dummy)
            set yy = GetUnitY(dummy)
            set cos = Cos(an*0.0174533)
            set sin = Sin(an*0.0174533)
            set dr = damageradius
            set an = s
            //
            set xed = xedamage.create()
            set xed.dtype = dd
            set xed.atype = a
            set xed.wtype = w
            set xed.damageEnemies = true
            set xed.damageTrees   = true
            //
            call TimerStart(NewTimerEx(this),PERIODIC,true,function thistype.periodicPlugin)
            //
        endmethod
    //
    endstruct
    //
endlibrary

III/ Spell Look Like:
Screen Shot

[​IMG]
[​IMG]
[​IMG]
[​IMG]
[​IMG]

IV/ Credits:
Click to view library DelFX
Click to view Timer Utils
Click to view library SpellEffectEvent
Click to view library Bound Sentinel
Click to view library Table
Click to view model Lightning Aura
-------------------------------------------
Lightning Storm

Change Log

v1.0: First release version.
v1.1: Optimized, fixed bug
v1.2: Optimized.
v1.3: Leaks stuff fixed
v1.4: Optimized.


Keywords:
storm, lightning
Contents

Lightning Storm (Map)

Reviews
Moderator
Lightning Storm v1.4 | Reviewed by Maker | 17th Oct 2013 APPROVED [IMG] Approved [tr] [IMG] Names like RLPLLS are not very descriptive I would use bj_DEGTORAD and bj_RADTODEG instead of custom values You have many...
  1. Lightning Storm v1.4 | Reviewed by Maker | 17th Oct 2013
    APPROVED
    [​IMG]
    • Approved
    [​IMG]
    • Names like
      RLPLLS
      are not very descriptive
    • I would use
      bj_DEGTORAD
      and
      bj_RADTODEG
      instead of custom values
    • You have many repeated calculations/conversions, mainly when using
      Cos
      and
      Sin
    • I think it would look better if the lightnings were at a height that matches the center of
      the dummy unit's model
    • The ability is better suited for the local disco than Warcraft 3. It lasts very long time,
      it is easy to escape from it. The damage it deals is inconsistent.
      Lightnings everywhere but no damage for long periods of time
      I think you should make the spell more "tight", make it last less time

     
  2. nhocklanhox6

    nhocklanhox6

    Joined:
    Feb 12, 2012
    Messages:
    335
    Resources:
    28
    Models:
    6
    Spells:
    21
    Tutorials:
    1
    Resources:
    28
    New spell updated !!
     
  3. Rheiko

    Rheiko

    Joined:
    Aug 27, 2013
    Messages:
    2,926
    Resources:
    7
    Icons:
    2
    Spells:
    3
    Tutorials:
    2
    Resources:
    7
    most of your spells are lightning, onee-san @.@
    anyway, cool spell :)
     
  4. nhocklanhox6

    nhocklanhox6

    Joined:
    Feb 12, 2012
    Messages:
    335
    Resources:
    28
    Models:
    6
    Spells:
    21
    Tutorials:
    1
    Resources:
    28
    I love lightning :x
     
  5. Rheiko

    Rheiko

    Joined:
    Aug 27, 2013
    Messages:
    2,926
    Resources:
    7
    Icons:
    2
    Spells:
    3
    Tutorials:
    2
    Resources:
    7
    just like me :3
    but i'm still learning about lightning :p
     
  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
    It hurts my eyes... too colorful... haha... maybe I'll call it the Rainbow Lightning!!!
     
  7. JAKEZINC

    JAKEZINC

    Joined:
    Aug 13, 2013
    Messages:
    1,615
    Resources:
    9
    Spells:
    9
    Resources:
    9
    when the spell casted two times this what happens in the lightning.. ( bug )
    [​IMG]
     
  8. nhocklanhox6

    nhocklanhox6

    Joined:
    Feb 12, 2012
    Messages:
    335
    Resources:
    28
    Models:
    6
    Spells:
    21
    Tutorials:
    1
    Resources:
    28
    JakeZinc


    fixed
     
  9. bowser499

    bowser499

    Joined:
    Jul 20, 2009
    Messages:
    782
    Resources:
    7
    Tools:
    1
    Maps:
    3
    Spells:
    3
    Resources:
    7
    The element of lightning is very powerful. If it hits someone, it has a 50% chance to die.
    What do we have here in this wonderful spell by nhocklanhox6?

    Originality: 4/5. Being a lightning element spell, it's still original. Not 5/5 because there are many spells with the element Lightning and WarCraft 3 lightning handles. Being honest at that point, I've seen a lot of different YouTube videos when this was used. Just going to show some examples below:
    Execution: 4/5. I suggest using Lightning Utils instead of Table-based lightnings. Lightning Utils is safer way of operations with lightnings in WarCraft. Do 'Amrf' as a global constant. It's a lot more handy. Also, just for safety purposes:
    Code (vJASS):
    if UnitAddAbility(tab.unit[i],'Amrf') then
        call UnitRemoveAbility(tab.unit[i],'Amrf')
    endif

    This code is safer since the unit might have this ability and this prevents from accidentally removing it. Also, why is it better to use
    0.01747
    instead of
    .0174532
    ? I am curious about the explanation by author.
    SetUnitPosition
    is a lot more slower than
    SetUnitX
    and
    SetUnitY
    natives since they do not check the pathing.
    These lines:
    Code (vJASS):
                        set x = xx + reach * Cos(i*60*0.01747)
                        set y = yy + reach * Sin(i*60*0.01747)

    60.*.01747 can be calculated by using a calculator, so no need to make the PC's work harder by the laziness. You won't lose readability.
    This:
    Code (vJASS):
                loop
                    exitwhen ii == 0
                    //
                    set x = xx + 100. * Cos(ii*60*0.01747)
                    set y = yy + 100. * Sin(ii*60*0.01747)
                    //
                    set tab.unit[ii] = CreateUnit(Player(15),DUMMY_LIGHTNING,x,y,0.)
                    set tab.real[20+ii] = 57.29582 * Atan2(y - yy, x - xx)
                    set tab.lightning[30+ii] = AddLightning(M_ALT,true,x,y,xx,yy)
                    call SetUnitScale(tab.unit[ii],0.,0.,0.)
                    call UnitAddAbility(tab.unit[ii],'Amrf')
                    call UnitRemoveAbility(tab.unit[ii],'Amrf')
                    call SetUnitFlyHeight(tab.unit[ii],MIN_HEIGHT,MIN_HEIGHT)
                    //
                    set tab.unit[10+ii] = CreateUnit(Player(15),DUMMY_LIGHTNING,x,y,0.)
                    set tab.lightning[40+ii] = AddLightning(O_ALT,true,x,y,xx,yy)
                    call SetUnitScale(tab.unit[10+ii],0.,0.,0.)
                    call UnitAddAbility(tab.unit[10+ii],'Amrf')
                    call UnitRemoveAbility(tab.unit[10+ii],'Amrf')
                    call SetUnitFlyHeight(tab.unit[10+ii],MIN_HEIGHT,MIN_HEIGHT)
                    //
                   
                    set tab.unit[50+ii] = CreateUnit(Player(15),DUMMY_LIGHTNING,xx,yy,0.)
                    call SetUnitScale(tab.unit[50+ii],SIZE/2,0.,0.)
                    call UnitAddAbility(tab.unit[50+ii],'Amrf')
                    call UnitRemoveAbility(tab.unit[50+ii],'Amrf')
                    set s = s + an
                    call SetUnitFlyHeight(tab.unit[50+ii],s,s)
                    set tab.real[70+ii] = s
                    set tab.lightning[60+ii] = AddLightning(E_ALT,true,x,y,xx,yy)
                    //
                    set ii = ii - 1
                endloop
    can be optimized if it will be in the loop. I will leave it up to the author of this spell to figure out how.
    Now this:
    k == 0 or k == 1
    Your k is always positive. The condition in this form:
    k <= 1
    will be better than the current one because 'or' is operator and requires resources aswell.
    That's all that I can point out here. But these mistakes are quite small, so it is -1 point.

    Effects: 5/5. Very impressive, nothing said!

    Overall: ((4+4+5)/3) = 4.3/5 = 4/5. This is a very good example on how to make a lightning spell!

    4/5: Recommended
     
  10. nhocklanhox6

    nhocklanhox6

    Joined:
    Feb 12, 2012
    Messages:
    335
    Resources:
    28
    Models:
    6
    Spells:
    21
    Tutorials:
    1
    Resources:
    28
    Review


    Thanks a lot ^^,
    ...actually..., =.=!, Lightning Utils use duration to expire lightning, i don't know what time this spell expire, so i can't use it >.<....

    P/S: Spell Updated.