• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Spell] Chain Lightning Spell

Status
Not open for further replies.

sentrywiz

S

sentrywiz

How would I go about making a custom chain lightning spell?
I want it to deal custom damage, increased from items and stats.

The main "challenge" I have with that is that I want a lightning effect
to appear when the spell "jumps" to the next unit. I guess it can be done
with a for loop that takes the first unit, then a random unit that's not the first, then again with not first or second.

Either way, GUI or vJass is good, just as long as your code is clean and easy to read and understand.
 
I usually use a dummy unit with a Chain Lightning ability.
Create a unit target Channel ability.

-When you cast the Channel ability set a group that picks every unit in X range of the target of the ability cast matching Y conditions.
-Set an integer variable to the amount of jumps you want.
-Create a dummy Chain Lightning unit at the position of the caster and order it to Chain Lightning the target.
-Deal damage to the target.
-Remove targeted unit from the Unit Group.
-Then loop 1 to Jump_Amount_Integer.
-Set a unit variable to the target unit and lower the integer by 1.
-Create an if/then/else with the condition "Jump_Amount_Integer greater than 0".
-Create a new Chain Lightning unit to target a random unit in your unit group.
-Deal damage and remove that unit as well.
-The loop will repeat this the amount of jumps you want.
 

sentrywiz

S

sentrywiz

There is a system in spell section called Timed Lightning (i believe that is the correct name) that does exactly what you are looking for.

Mind giving me a link for it?
I searched but didn't find that exact thread.
All I found were some lightning pack spells.
I want to learn to make it myself not just import and use them.

I usually use a dummy unit with a Chain Lightning ability.
Create a unit target Channel ability.

-When you cast the Channel ability set a group that picks every unit in X range of the target of the ability cast matching Y conditions.
-Set an integer variable to the amount of jumps you want.
-Create a dummy Chain Lightning unit at the position of the caster and order it to Chain Lightning the target.
-Deal damage to the target.
-Remove targeted unit from the Unit Group.
-Then loop 1 to Jump_Amount_Integer.
-Set a unit variable to the target unit and lower the integer by 1.
-Create an if/then/else with the condition "Jump_Amount_Integer greater than 0".
-Create a new Chain Lightning unit to target a random unit in your unit group.
-Deal damage and remove that unit as well.
-The loop will repeat this the amount of jumps you want.

That might work for the effect, however I want chain lightning to also deal custom damage not just static damage.

Thanks for the idea though.
 
Mind giving me a link for it?
I searched but didn't find that exact thread.
All I found were some lightning pack spells.
I want to learn to make it myself not just import and use them.



That might work for the effect, however I want chain lightning to also deal custom damage not just static damage.

Thanks for the idea though.

What?
You trigger the damage to whatever you want it to be.

As the first action you set a Unit_Variable to the casting unit, and then do the damage calculations from there.
 

sentrywiz

S

sentrywiz

What?
You trigger the damage to whatever you want it to be.

As the first action you set a Unit_Variable to the casting unit, and then do the damage calculations from there.

Oh my bad, I saw you said create chain lightning, didn't see that is just a dummy. I can create a lightning dummy? That I didn't know.

+rep will try it out.
 
Level 28
Joined
Sep 26, 2009
Messages
2,520
You can't create lightning dummy, as lightning is just a texture projected and moved from point A to point B.
What he meant is that you make a dummy spell for your hero (which does nothing but drains the mana and starts trigger) and the trigger creates dummy units that have the actual chain lightning spell and you make the dummies cast the spell. Then you catch when unit takes damage from the dummy and modify the damage.

Creating many dummies though is always less efficient than using systems :X
 
Status
Not open for further replies.
Top