Adding stun effect to Shockwave

krainert

Member
Reaction score
10
Hello again,

I need my Shockwave ability to stun enemies. How is this best done?

Secondary question: How can I get a trigger to fire when a unit is affected by a spell - such as when units are hit by Shockwave? Even if triggers aren't the ideal solution to this particular issue I'm curious.
 

Andrewgosu

The Silent Pandaren Helper
Reaction score
715
I think Shockwave gives the targeted units a buff, so I imagine trying this:

1) group all the units in the range of the spellcaster (range = the range of Shockwave) when he casts Shockwave
2) filter the units with the Shockwave's buff
3) use dummy casters to cast a stun-type of a spell on them
 

krainert

Member
Reaction score
10
I think Shockwave gives the targeted units a buff, so I imagine trying this:
1) group all the units in the range of the spellcaster (range = the range of Shockwave) when he casts Shockwave
2) filter the units with the Shockwave's buff
3) use dummy casters to cast a stun-type of a spell on them
The problem with that is that Shockwave uses a relatively complex shape for its area of effect so I would have to device a formula to replicate this (which I would say is extremely difficult - especially in "GUI" or even JASS).
 

Whoareyou.

New Member
Reaction score
24
Is it possible to base it off Storm Bolt and change the hammers model to shockwave? [Notsure]
 

HeX.16

Isn't Trollin You Right Now
Reaction score
131
Lazy, noob and my way are all 1 simple way.

Its simple, clumsy and the last thing i would use if i wasnt to lazy to code something better.

Normal shockwave spell, which will deal damage etc

Then a dummy spell based off impale with no target effect to do the stun.

Then in the trigger just create and order a dummy to impale(dummy spell) towards target point of shockwave.
 

Andrewgosu

The Silent Pandaren Helper
Reaction score
715
I don't see a problem with using "units in range" nevertheless its circle shape - if you filter out the units with the specific buff, you know that Shockwave hit them.
 

HeX.16

Isn't Trollin You Right Now
Reaction score
131
Shockwave only gives a buff to the caster, not to the targets it hits.
 

krainert

Member
Reaction score
10
I don't see a problem with using "units in range" nevertheless its circle shape - if you filter out the units with the specific buff, you know that Shockwave hit them.
Yeah, I get that, except
Shockwave only gives a buff to the caster, not to the targets it hits.
right? :/

Normal shockwave spell, which will deal damage etc
Then a dummy spell based off impale with no target effect to do the stun.
Then in the trigger just create and order a dummy to impale(dummy spell) towards target point of shockwave.
But Impale only works in a straight line, right? I need the effect to widen as it moves so that it forms a cone.
 

Andrewgosu

The Silent Pandaren Helper
Reaction score
715
My bad, the memory is kind of rusty.

1) You can try using Impale, but I think it will look funny
2) Use a dummy unit and "slide" it in the same direction; pick units in the range (increase the range if the sliding unit get further of the caster) of the sliding unit and use dummies to cast stun on the filtered targets;
- make sure the sliding speed matches the Shockwave's speed (trial-and-error)
- make sure the picking range matches the Shockwave's effect range (also trial-and-error)
- make sure you filter out units already stunned (check stun buff)
 

HeX.16

Isn't Trollin You Right Now
Reaction score
131
If you wait a little ill code you one, i need to practice using hashtables =/

Attached, should be lagless, leakless and MUI
 

Attachments

  • Shockwave.w3x
    19.5 KB · Views: 435

hgkjfhfdsj

Active Member
Reaction score
55
another way
create dummy (must either recycle or create new, not global dummy)– order to cast shockwave (no projectile but same properties as hero's) inplace of you, apply damage/stun on dummy's 0 damage hit. caster can be saved to dummy's handle id or otherwise a custom unit indexer.
 

Forsaken

New Member
Reaction score
1
how i would do it would be to create a dummy unit which cast warstomp along the line which is the direction of the shockwave, depending on the speed distance and size, this is quite alot of work but doable. using a similar trigger to sliding but instead of moving a unit creating another one and command it to use a larger/smaller warstomp however this is probably a long process it will create a line which stuns them along the shockwave... =w= and u can adjust the time intervals to match the speed.
 

krainert

Member
Reaction score
10
If you wait a little ill code you one, i need to practice using hashtables =/
Attached, should be lagless, leakless and MUI
Now that's just awesome :)
How'd you make that widen over time? Changing 200.00 in
Set Enemies = (Units within 200.00 of Points[2] matching (((((Matching unit) is A structure) Not equal to True) and (((Matching unit) has buff Stun (Custom)) Not equal to True)) and ((((Matching unit) is Mechanical) Not equal to True) and ((((Matching unit) is Magic Immune
to some var incremented over time?

Also, I didn't even know WE's hashtables work like maps.
 

HeX.16

Isn't Trollin You Right Now
Reaction score
131
Hmm, making it widen over time would be a massive waste of resources as you would need a periodic event too.

like

every .2 secs

Trigger:
  • Set Enemies = (Units within 200.00 + 20.00 of Points[2] matching (((((Matching unit) is A structure) Not equal to True) and (((Matching unit) has buff Stun (Custom)) Not equal to True)) and ((((Matching unit) is Mechanical) Not equal to True) and ((((Matching unit) is Magic Immune
 

luorax

Invasion in Duskwood
Reaction score
67
Coding it is unnecessary. Just create a Shockwave ability, and create a dummy ability based on Impale. When the hero casts the Shockwave, just create a dummy, and the dummy ability and order it to cast. That's all (Well, you'll have to play with the missile speeds a bit)
 

krainert

Member
Reaction score
10
Inspired by HeX I started writing my own triggers for it to support increasing radius. Unfortunately, it does nothing. Have a look:

EDIT: Code removed due to general obscurity.
 

HeX.16

Isn't Trollin You Right Now
Reaction score
131
My code was butchered D:
I would look through that but im too lazy. Ill try look later or tomorrow.

Ok i cleared my thought process and fixed it for you. Remember Simple is better an less laggy. the one i made is a bit extreme on the increases but you seem to know how to code and change it. I made a new variable Size which is a real. Then in the loop i increased it by 5 every 0.03 secs then at the end reset it back to MY default 20, which was also set in the Init trigger.
Dont ever butcher my code like that again :)
 

Attachments

  • Shockwave.w3x
    34.7 KB · Views: 294

krainert

Member
Reaction score
10
Okay, I minimized the amount of data stored in the hashtable, and suddenly my code looked a bit less absurd. Frankly, I also managed to find the errors in it so now it functions flawlessly - even with widening AoE.

Thanks for the help :)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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