Spell Pillar of Lightning

Ghan

Administrator - Servers are fun
Staff member
Reaction score
888
Hey, it's my first spell to be submitted! :p

JASS - Yes
MUI - Yes in JASS version
Works - Yes
Fun - Yes
Leaks - What's a leak?

Pillar of Lightning

This spell channels forces of chaotic nature, conjuring a large pillar out of the ground, which randomly fires off lightning bolts at nearby enemies. Each lightning bolt deals 100 damage.

Screenshots:

Lightning1.gif


Lightning2.gif


For the sake of an intelligible post, I will use spoiler tags. (Yes, I know. Deal with it.)

GUI Code:

Code:
Pillar of Lightning
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Pillar of Lightning 
    Actions
        Set TempPoint = ((Target point of ability being cast) offset by (0.00, 0.00))
        Special Effect - Create a special effect at TempPoint using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
        Special Effect - Destroy (Last created special effect)
        For each (Integer A) from 1 to 10, do (Actions)
            Loop - Actions
                Unit - Create 1 Effect Unit for (Owner of (Triggering unit)) at TempPoint facing Default building facing degrees
                Unit - Order (Last created unit) to Stop
                Animation - Play (Last created unit)'s stand animation
                Set Wisps[(Integer A)] = (Last created unit)
                Animation - Change Wisps[(Integer A)] flying height to (50.00 x ((Real((Integer A))) - 1.00)) at 500.00
        Wait 0.10 seconds
        For each (Integer A) from 1 to LightningIntervals, do (Actions)
            Loop - Actions
                For each (Integer B) from 1 to NumberofTargets, do (Actions)
                    Loop - Actions
                        Custom script:   if (bj_forLoopBIndex == 1 or GetRandomInt(1,100) <= udg_ChanceforBolt) then
                        Unit - Create 1 Effect Unit for (Owner of (Triggering unit)) at TempPoint facing Default building facing degrees
                        Set Caster = (Last created unit)
                        Unit - Hide Caster
                        Unit - Add a 3.00 second Generic expiration timer to Caster
                        Animation - Change Caster flying height to (Random real number between 100.00 and 450.00) at 4000.00
                        Set TempGroup = (Units within BoltRange of TempPoint matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True))
                        Set Target = (Random unit from TempGroup)
                        Unit - Order Caster to Orc Far Seer - Chain Lightning Target
                        Custom script:   call DestroyGroup(udg_TempGroup)
                        Custom script:   endif
                Wait (Random real number between 1.00 and 3.00) seconds
        For each (Integer A) from 1 to 10, do (Actions)
            Loop - Actions
                Animation - Change Wisps[(Integer A)] flying height to 0.00 at 300.00
        Wait 2.50 seconds
        For each (Integer A) from 1 to 10, do (Actions)
            Loop - Actions
                Unit - Remove Wisps[(Integer A)] from the game
        Custom script:   call RemoveLocation(udg_TempPoint)

JASS Code:

JASS:
//Constant functions, you may edit these//
constant function POL_rawcode takes nothing returns integer
    return &#039;A000&#039; //The rawcode of the spell//
    //POL means Pillar_Of_Lightning//
endfunction

constant function POL_ThunderClap takes nothing returns string
    return &quot;Abilities\\Spells\\Human\\ThunderClap\\ThunderClapCaster.mdl&quot;
endfunction

constant function LightningIntervals takes nothing returns integer
    return 50
endfunction
constant function NumberofTargets takes nothing returns integer
    return 3
endfunction
constant function ChanceforBolt takes nothing returns integer
    return 20
endfunction
constant function BoltRange takes nothing returns real
    return 600.
endfunction
//Do NOT edit past this point unless you know what you are doing//

function Pillar_Of_Lightning_UnitEnemy takes nothing returns boolean
    return ( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit())) == true )
endfunction

function Trig_Pillar_of_Lightning_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == POL_rawcode()
endfunction

function Trig_Pillar_of_Lightning_Actions takes nothing returns nothing
    local unit array Wisps
    local location TempPoint
    local unit Caster
    local unit Target
    local group TempGroup
    local integer i                      = 0   
    local integer i2                     = 0 
    set TempPoint = GetSpellTargetLoc()
    call DestroyEffect(AddSpecialEffectLoc(POL_ThunderClap(), TempPoint  ))
    set i = 1
    loop
        exitwhen i &gt; 10
        set Wisps<i> = CreateUnitAtLoc(GetOwningPlayer(GetTriggerUnit()) , &#039;e000&#039;, TempPoint, bj_UNIT_FACING )
        call IssueImmediateOrder( Wisps<i>, &quot;stop&quot; )
        call SetUnitAnimation( Wisps<i>, &quot;stand&quot; )
        call ResetUnitAnimation( Wisps<i> )
        call SetUnitFlyHeight( Wisps<i>, ( 50.00 * ( I2R(i) - 1 ) ), 500.00 )
        set i = i + 1
    endloop
    call TriggerSleepAction( 0.10 )
    set i = 1
    loop
        exitwhen i &gt; LightningIntervals()
        set i2 = 1
        loop
            exitwhen i2 &gt; NumberofTargets()
            if (i2 == 1 or GetRandomInt(1,100) &lt;= ChanceforBolt()) then
                set Caster = CreateUnitAtLoc(GetOwningPlayer(GetTriggerUnit()) , &#039;e000&#039;, TempPoint, bj_UNIT_FACING )
                call ShowUnitHide( Caster )
                call UnitApplyTimedLife(Caster, &#039;BTLF&#039;, 3.00 )
                call SetUnitFlyHeight( Caster, GetRandomReal(100.00, 450.00), 4000.00 )
                set TempGroup = CreateGroup()
                call GroupEnumUnitsInRangeOfLoc(TempGroup, TempPoint, BoltRange(), Condition(function Pillar_Of_Lightning_UnitEnemy))
                set Target = GroupPickRandomUnit(TempGroup)
                call IssueTargetOrder( Caster, &quot;chainlightning&quot;, Target )
                call DestroyGroup(TempGroup)
                set TempGroup            = null
                set Caster               = null
                set Target               = null
            endif
            set i2 = i2 + 1
        endloop
        call TriggerSleepAction( GetRandomReal(1.00, 3.00) )
        set i = i + 1
    endloop
    set i = 1
    loop
        exitwhen i &gt; 10
        call SetUnitFlyHeight( Wisps<i>, 0.00, 300.00 )
        set i = i + 1
    endloop
    call TriggerSleepAction( 2.50 )
    set i = 1
    loop
        exitwhen i &gt; 10
        call RemoveUnit( Wisps<i> )
        set Wisps<i>                     = null
        set i = i + 1
    endloop
    call RemoveLocation(TempPoint)
    set TempPoint                        = null
endfunction

//===========================================================================
function InitTrig_Pillar_of_Lightning takes nothing returns nothing
    set gg_trg_Pillar_of_Lightning = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Pillar_of_Lightning, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition(gg_trg_Pillar_of_Lightning,Condition(function Trig_Pillar_of_Lightning_Conditions))
    call TriggerAddAction( gg_trg_Pillar_of_Lightning, function Trig_Pillar_of_Lightning_Actions )
endfunction</i></i></i></i></i></i></i></i>
 

Attachments

  • Spell - Pillar of Lightning.w3x
    58.1 KB · Views: 669
  • Spell - Pillar of Lightning - JASS Version.w3x
    58.4 KB · Views: 481

0zaru

Learning vJASS ;)
Reaction score
60
The effects looks nice.. i would think of using a Finger of death effect ray but it's nice anyway.. i will look to the code later
 

Sim

Forum Administrator
Staff member
Reaction score
534
I just... love that one spell :D

Good job, approved!

> Is this level able or just one level?

You can change the level of the chain lightning in the object editor, as well as the damage.
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
888
> Is this level able or just one level?

Sure. Just add more levels to both the hero ability and dummy unit ability.

> Good job, approved!

Really? Already? That's unexpected. I thought you'd love to shoot my code down for a while. :p
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
888
> This is your first spell submitted?

Yes. It is. :p
Usually can't come up with a feasible idea or don't want to take the time.
I did create a spell for the Spell Contest III, though.

However, the idea for this spell actually came from a completely different idea that didn't work as expected....
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
888
> cool spell...its better to make the lightning's color to purple...

Methinks that would require a model editor, right?
I don't do model editing.
Or pratically anything to do with art. :p
 

waaaks!

Zinctified
Reaction score
255
well i think there are already made models out there

or use the lightning trigger and change the tinting color of the lightning

wait! i dont mean to push u make that...i just want to suggest
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
888
> Why is that variable set that way?

Because in debugging, I thought that the Target Point of Ability being Cast might be getting lost in the same way that All Players won't work if you set a variable to it and destroy it, so I made the point unique.
It may not make any difference.

> The 'ReadMe Template' was untouched

For now.
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
888
Thanks for all the positive comments. :D

I updated the spell. Added more variables to give the user easier control over the spell, and also added implementation instructions.
 

Sim

Forum Administrator
Staff member
Reaction score
534
> I suppose though if I give it 'approval', it doesn't mean much.

:rolleyes:

> Really? Already? That's unexpected. I thought you'd love to shoot my code down for a while.

GUI is too simplistic :p If you do things the right way, it works, heh.
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
888
> GUI is too simplistic If you do things the right way, it works, heh.

No!! I want you to shoot my code down! :p

Fine. Have it your way. JASS version posted.
 

Sim

Forum Administrator
Staff member
Reaction score
534
Locals under the names of globals?

Why? :eek:
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top