Hello,
I've been trying to figure out how I could make a spell that stuns for a duration that's based on the caster's agility, however, I've tried a few different ways (all I could think of) using triggers (due to my lack of JASS knowledge) and none seem to work perfectly.
The idea is basically to have a ranger-type character shoot an arrow straight in front that stuns everything in its path for a duration that's agility-based (and deals agility-based damage as well - but I'll be fine for that part). The stun duration formula I took was d = 0.23a^(0.5), where d is the stun duration and a is the agility of the caster and that part seems to work fine in every case. The spell is based on Impale.
This is the closest I got to making it work :
These 3 triggers work when the spell hits only a single target (it worked on a few tries on multiple targets, but I couldn't figure out exactly why). The Concussive Shot Placeholder unit is an invisible, unselectable 0-collision, walkable unit that cannot move or attack. (I've been thinking that unit might actually be the problem, if it's not trigger-related; if the triggers are fine, I might have missed changing something on that unit, though I can't personally find what. The information I posted is what I believe has some importance in these triggers.) That was my most fruitful attempt.
Here's the first thing I tried; in case it could work just by fixing this small trigger a little bit (my few other attempts are not worth mentioning; they're only slight modifications to the 3 triggers above, which didn't work) :
Any suggestion is welcome . Thanks in advance!
Oh and for the record, my skills with WE aren't very much better than this, and my skills in JASS are limited to one single line: local <variable type> udg_<variable name>, so my apologies if I failed at going further than this.
I've been trying to figure out how I could make a spell that stuns for a duration that's based on the caster's agility, however, I've tried a few different ways (all I could think of) using triggers (due to my lack of JASS knowledge) and none seem to work perfectly.
The idea is basically to have a ranger-type character shoot an arrow straight in front that stuns everything in its path for a duration that's agility-based (and deals agility-based damage as well - but I'll be fine for that part). The stun duration formula I took was d = 0.23a^(0.5), where d is the stun duration and a is the agility of the caster and that part seems to work fine in every case. The spell is based on Impale.
This is the closest I got to making it work :
-
Concussive Shot
-
Events
- Unit - A unit Finishes casting an ability
-
Conditions
- (Ability being cast) Equal to Concussive Shot
-
Actions
- Set ConcussiveShotTimer = (0.23 x (Power((Real((Agility of (Casting unit) (Include bonuses)))), 0.50)))
- Trigger - Run Concussive Shot group <gen> (ignoring conditions)
-
Events
-
Concussive Shot group
- Events
- Conditions
-
Actions
- Custom script: local real udg_ConcussiveShotTimer2
- Set ConcussiveShotTimer2 = ConcussiveShotTimer
- Wait 0.50 seconds
-
Unit Group - Pick every unit in (Units in (Playable map area) matching ((((Matching unit) has buff Concussive Shot ) Equal to True) and ((Number of units in (Units within 20.00 of (Position of (Matching unit)) matching ((Unit-type of (Matching unit)) Equal to Concussive Shot Placeholder))) and do (Actions)
-
Loop - Actions
- Unit - Create 1 Concussive Shot Placeholder for Player 1 (Red) at (Position of (Picked unit)) facing Default building facing degrees
- Unit - Add a ConcussiveShotTimer second Generic expiration timer to (Last created unit)
-
Loop - Actions
-
Concussive Shot Expire
-
Events
- Unit - A unit Dies
-
Conditions
- (Unit-type of (Dying unit)) Equal to Concussive Shot Placeholder
-
Actions
-
Unit Group - Pick every unit in (Units within 15.00 of (Position of (Dying unit))) and do (Actions)
-
Loop - Actions
- Unit - Remove Concussive Shot buff from (Picked unit)
-
Loop - Actions
-
Unit Group - Pick every unit in (Units within 15.00 of (Position of (Dying unit))) and do (Actions)
-
Events
These 3 triggers work when the spell hits only a single target (it worked on a few tries on multiple targets, but I couldn't figure out exactly why). The Concussive Shot Placeholder unit is an invisible, unselectable 0-collision, walkable unit that cannot move or attack. (I've been thinking that unit might actually be the problem, if it's not trigger-related; if the triggers are fine, I might have missed changing something on that unit, though I can't personally find what. The information I posted is what I believe has some importance in these triggers.) That was my most fruitful attempt.
Here's the first thing I tried; in case it could work just by fixing this small trigger a little bit (my few other attempts are not worth mentioning; they're only slight modifications to the 3 triggers above, which didn't work) :
-
Concussive Shot stun
-
Events
- Unit - A unit Finishes casting an ability
-
Conditions
- (Ability being cast) Equal to Concussive Shot
-
Actions
-
Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) has buff Concussive Shot ) Equal to True)) and do (Actions)
-
Loop - Actions
- Wait (0.23 x (Power((Real((Agility of (Casting unit) (Include bonuses)))), 0.50))) seconds
- Unit - Remove Concussive Shot buff from (Picked Unit)
-
Loop - Actions
-
Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) has buff Concussive Shot ) Equal to True)) and do (Actions)
-
Events
Any suggestion is welcome . Thanks in advance!
Oh and for the record, my skills with WE aren't very much better than this, and my skills in JASS are limited to one single line: local <variable type> udg_<variable name>, so my apologies if I failed at going further than this.
Last edited: