Custom slowing effect that conserves unit movespeed

Frozenhelfir

set Gwypaas = Guhveepaws
Reaction score
56
I'm trying to make a custom slowing (orb) effect. The unit in question already has an orb that is used for something else, and I want its attacks to hit units with a stacking slow. For simplicity, each attack slows the units movement speed by 10% of its current speed. So if it were hitting a unit with 100 ms, it would drop it to 90, and then 81 (10% of 90 is 9). So I start out with a concept:

JASS:
struct data
     unit u
     real maxMS
     real curMS
endstruct


This will store the unit being effected, conserve its MAX MS, and keep the current MS stored for the slow. This isn't the problem. Restoring the movement speed is the problem. I can either set it back to the max MS or divide by .9 for each iteration. Both of these wont work. What if the unit gains a movement speed increasing buff, like a speed scroll? Then if I set its movespeed back to its maxMS, when the speed scroll wears off it will be slower than it used to be. Also, if it had that buff when the unit started getting slowed, and then the effect wore off in the middle of the slow, at the end it would go back to the speed scrolled ms.

Is there any way I can do this without making it into a huge headache?
 

Jesus4Lyf

Good Idea™
Reaction score
397
Use a levelled dummy ability to "set" what the slow from the orb effect should be. Y'know, remove buff and then cast slow kinda thing.

The native set move speed stuff... yeah, what you said about it. :(
>What if the unit gains a movement speed increasing buff, like a speed scroll? Then if I set its movespeed back to its maxMS, when the speed scroll wears off it will be slower than it used to be.
 

Frozenhelfir

set Gwypaas = Guhveepaws
Reaction score
56
>speed scroll wears off it will be slower than it used to be.

Well, I meant if the scroll was on before it started getting slowed. But it doesn't really matter, the point remains the same. :(

I have to make 10 dummy units for this then? I have a question about unit buffs. If I made a buff that reduces movement speed, could I add it to the unit(how)? And would it have a delay or would it be instant?
 

Faust

You can change this now in User CP.
Reaction score
123
You can just lower base attack speed with triggers, save the amount with struct attachment, and restore. Stacks.
 

Frozenhelfir

set Gwypaas = Guhveepaws
Reaction score
56
No no, this is move speed :p I.E. if someone picks up boots while under this slow, their speed will be cheezed. It'll give them the MS they had before even though they should have more with the boots!
 

Faust

You can change this now in User CP.
Reaction score
123
Well just remove the boots and give them back again :O
 
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