HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Detecting Critical Strike

06-17-2008, 06:10 AM#1
ShadowWolf
Is there a way to detect when a unit critical strikes? I tried using the 'Unit starts the effect of an ability' event, as it worked for other passive skills such as exhume, but it doesn't seem to work with critical strike.

Any ideas?
06-17-2008, 06:17 AM#2
tamisrah
There's no way to detect any of the passive abilities in wc3. If you had bothered to use the search button you'd have found that the only option to do so is to trigger them completly.
06-17-2008, 06:56 AM#3
BestZero
Make a Critical Strike on your own.
06-17-2008, 07:12 AM#4
ShadowWolf
Quote:
Originally Posted by BestZero
Make a Critical Strike on your own.
Thanks for the constructive response. Just wanted to make sure of it before I did more work than I had to.

And tamisrah, some passive abilities have effects that are possible to detect via triggers using other methods, just not very many.
06-17-2008, 09:12 AM#5
tamisrah
Could you name one? That would be a pleasamt surprise for me if there is. (except you speak of buffs which can be detected)
06-17-2008, 11:11 AM#6
DioD
You cant detect buff of ability without buff.
06-17-2008, 12:08 PM#7
tamisrah
He just sounded like he knew passive abilities that could be detected without the use of buffs. Might be my mistake but thats what I thought when I read his post.

If its about buffs, you can even make critical strike give a buff. So it would be detectable more or less.
06-17-2008, 12:25 PM#8
rulerofiron99
Lightning Orb (one of the two) has a chance to cast purge on attacked targets. If I'm not mistaken, Purge uses a buff.
06-17-2008, 03:52 PM#9
DioD
You can add any buff to orb (any targeted spell), but there is many problems with it.
06-17-2008, 05:48 PM#10
ShadowWolf
It's sloppy, but any ability that creates units for example as a result, with enough conditions to narrow it down, like I said not many, and usually only custom abilities. One specifically I managed to detect was exhume, using the event that a unit enters a transport, then using the condition that the owner of the unit was neutral passive, since no other neutral passive units entered a transport in the rest of the map it worked. I was just checking to see if anyone knew any loopholes like that one for critical strike. I'll see if I can get the buff thing to work, it's worth a try, thanks.
06-17-2008, 06:54 PM#11
ShadowWolf
Ok ye of little faith, I got it to work.

Trigger:
Critical Strike Detection
Collapse Events
Unit - A unit Is attacked
Collapse Conditions
(Unit-type of (Attacking unit)) Equal to Blademaster
Collapse Actions
Wait 0.00 seconds
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Attacked unit) has buff Crit Buff ) Equal to True
Collapse Then - Actions
Game - Display to (All players) the text: Crit!
Collapse Else - Actions
Do nothing

This works for detecting critical strikes. For some reason you have to have the wait function in there, even with a null value, it seems that giving a unit a buff isn't instantaneous with attacking. Also there's some other things that have to be done in order for it to work. You must give critical strike a dummy buff, and give critical strike a slight duration. I used 0.25 duration and it works fine. Also, an interesting thing I found was that in the object editor you must put the 'Combat - Attack 1 - Animation Damage Point' set to 0, or else there's a delay time in the damage. The downside to doing that is the damage will be dealt before the unit finishes its attack animation. However, if you want to leave that value to default, you can just accomodate it by setting the wait function value to 0.20, or higher if need be, and it should work.

The only problem is it's not able to detect crits if the crit kills the target unit, which may be unsatisfactory, but this is better than nothing. Maybe someone can think of a way to get around that? Maybe perhaps find a way to give the buff to the attacking unit (which would clean things up a bit) but I'm not sure how to do that.
06-18-2008, 01:52 AM#12
burningice95
Critical strike CAN be detected

http://wc3campaigns.net/showthread.p...ritical+strike

but it's still lame, it is better (and easy, especially since there are damage detection systems out there) to code your own.
06-18-2008, 01:08 PM#13
DioD
This is not critical, this 0.01 second bash.
06-18-2008, 02:04 PM#14
Rising_Dusk
We already did ridiculous custom critical strike stuff/evasion demomap testing in my IDDS thread. You can perfectly recreate critical strike and evasion strictly with triggers, and once I get off my lazy ass and create samples for them, people won't be so scared of doing so.
06-18-2008, 09:24 PM#15
ShadowWolf
Interesting... but the triggering behind the method I found is minimal, albeit I'm frustrated that it doesn't sense it when the critical strike kills a unit, which on a TS is quite an often occurance. But it works, and I don't know jass anyways. :/