HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Triggering a spell of a Critical strike-style ability

10-24-2006, 07:34 PM#1
aidan_124
Does EVENT_UNIT_SPELL_EFFECT (or w/e it is) trigger when Crit Strike "Crits" or every time the hero attacks (assuming its the only ability the hero has)?
10-24-2006, 07:40 PM#2
Captain Griffen
It doesn't trigger on critical strike. Critical strikes are basically impossible to detect, I believe.
10-24-2006, 07:49 PM#3
Vexorian
Impossible to detect, `kind of´ possible to simulate
10-24-2006, 08:21 PM#4
Chuckle_Brother
Possible to simulate, to and extent. What Vex means(I BELIEVE) is that ranged units will have a time between the actual attack(which is normally when you see the text) and the missile strike where the text would now be seen.
10-24-2006, 08:25 PM#5
Fireeye
uhm, would this way work (may sound a bit noobish and only works for some units, because of space needed), you store the "normal" damage of a unit and when it is higher than the max damage, then there are 2 possibilitys: 1. Stun 2. Crit Strike.
I'm just curious if this would work.
10-24-2006, 08:30 PM#6
oNdizZ
if you would do that way, you would also need to use a Damagedetection system(since you would use unit takes damage event which also detects spells). besides, storing the normal damage all the time, with all items and bonuses is just to much of a hazzle.
10-24-2006, 08:54 PM#7
aidan_124
Trying to figure out a way to do a %ge chance to do damage (i can do that) at the same time as the projectile hits without using a dummy ability or a system :/. I'd assume if you used the projectile speed and some trig its possible...but i dont really understand how to use trig in JASS.
10-25-2006, 01:17 AM#8
TaintedReality
Finding the distance between points is simply using pythag's theorem. The code would be SquareRoot(dx*dx+dy*dy), where dx is difference in x between the points and y is difference in y between the points. Then divide this by the projectile speed, and that's the time it takes. *However*, that doesn't account for whether the unit is moving or not. As long as you don't have very fast units or teleporting units it's a decent approximation, but it can get messy.
10-25-2006, 01:39 AM#9
shadowange1
I think this should work
Vars Reals
strike = 100
lands = 0

Vars Units
strikeunit

First trigger
Event
Unit is Attacked

condition
unit has ability extra damage (some ability passive that does nothing).

Action
set strike = random from 1-100
if strike < 10 then
make attacking unit damage attacked unit Xdamage
(you may play an animation or put floating text to simulate it properly)
set lands = 1
set strikeunit = attacked unit
Endif

Now to detect

2nd Trigger
Event
lands becomes equal to 1

Condition
unit strikeunit is alive = true
(Anyothers you want to add)

Action
Any action you want to add *(strikeunit was set so if you wanted to do something to that unit) then set vars to none
set lands = 0
set strikeunit = no unit