Spell Pillar of Lightning

Ghan

Administrator - Servers are fun
Staff member
Reaction score
889
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: 672
  • Spell - Pillar of Lightning - JASS Version.w3x
    58.4 KB · Views: 485

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
889
> 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
889
> 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
889
> 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
256
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
889
> 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
889
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
889
> 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.
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top