HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Crit Strike triggering

01-23-2004, 02:23 PM#1
ElvenCommander
I am making an ability that needs to detect when a critical hit is made, I made an ability based on Critical Strike, but I want to detect by triggers when the unit with the CS does one

Any help?
(btw I'm not a mapping nub, no need to make a real precise description, just give the general idea)
01-23-2004, 02:41 PM#2
DaKaN
I don't think there is a way to detect when a crit goes off
01-23-2004, 02:47 PM#3
The_Inquisitor3
just make a trigger

Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Critical Strike
Action:
Game- Text: CRITICAL STRIKE!!!
01-23-2004, 05:45 PM#4
th15
Passive abilities do not call events when triggered. The only way to do this is to simulate the passive skill COMPLETELY with triggers.
01-23-2004, 06:17 PM#5
Shark
i needed the same thing for D&D map to add critical strike "effects" like daze stun etc....the only way u can try to do it is by making it like Orb of slow but just use the critical strike....i dunno, try something , and if u do figure it out how to do it, contact me :)
01-23-2004, 08:49 PM#6
DaKaN
Quote:
Originally posted by The_Inquisitor3
just make a trigger

Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Critical Strike
Action:
Game- Text: CRITICAL STRIKE!!!


Its not that simple, because you do not cast the critial strike ability, ever. it just happens.

th15's solution is the only way i can see it happening
01-23-2004, 09:34 PM#7
Narwanza
Hey guys, its not that hard. I made a trigger that detects damage done to a unit. I will post it up here in a minute. What you have to do is decide how much damage your hero will do at maximum, and then detect if the damage done was greater that that. Give me a min to post a function.

[edit]Shiz, the WE crashed when I was adding comments, so I will just write it here.

Code:
[b]Events:[/b]
A unit is attacked

[b]Conditions[/b]
Attacking unit = to (put your hero here)
Custom value of attacking unit = 25

[b]Actions:[/b]
Set MAXDAMAGE = (the max damage your hero can do on a normal attack)
Add to (this trigger) the event Attacked unit takes damage
Set DAMAGETAKEN = (damage taken)
If DAMAGETAKEN > MAXDAMAGE then
(do whatever actions you want here) else
Do Nothing

Okay, there are a few thing you need to understand here. The things in ALL CAPS are variables. When you set the max damage make sure it is more than just what the game says the max damage done is. You have to account for armor types. Make sure that critical strke beats out the attack of the unit by at least a 2:1 ratio, or you might have troubles with it thinking it did a critical, but it was only attacking a unit with 0 of the armor that the heros attack does more against.
01-23-2004, 11:54 PM#8
DaKaN
Ok, how do you get the max damage of your hero? It varies alot from lvl 1 to 10 (or more) not to mention + dmg from items. As far as I know there is no trigger to get Min or Max damage of a unit.

Your method is a good idea, but I dont think it will work.

A hero at lvl 1 could do a max of 15 dmg, but by lvl 10, he can do 50, thats clearly higher than a 2:1 ratio. That doesnt doesnt even acount for +dmg items
01-24-2004, 12:28 AM#9
Narwanza
The problem you are suggesting would be fixed very easily. Here is another trigger that would fix it.

Code:
[b]Actions:[/b]
Unit Gains a Level

[b]Conditions:[/b]
Unit-type of (leveling hero) = to (hero type)

[b]Actions:[/b]
Set MAXDAMAGE = (the max damage of your hero at whatever level, you could tinker around with making a mathematical function
 that would work like (MAXDAMAGE * level number of level gained) or you could enter it w/10 different if-then statements)

You see, the MAXDAMAGE variable doesn't have to be set in the previous trigger posted.

If you wanted to you could actually make a copy of the first trigger posted and set MAXDAMAGE = ((damage taken) * 1.6) or something like that to account for +dmg items.

And see, if you knew JASS (which I do) it would be easy to combine these two triggers into one.
01-24-2004, 12:58 AM#10
DaKaN
sloppy way of doing it, but i suppose it would work in theory.
01-27-2004, 02:46 AM#11
VolEs
Make an abilaty for criticle strike (Non Passive)
make a trigger that casts it in a random amount of time.
Then you can do DaKaN's way to detect it.
01-27-2004, 02:54 AM#12
BBDino
And if worst comes to worst just trigger the whole damn thing using random numbers etc

And if worst comes to worst just trigger the whole damn thing using random numbers etc (migth be best if you using small numbers, i heard somewhere that blizz rounds % chance spells ie. 1% bash never fires and 3% fires alot more then it should, this may be incorrect of course but im sure i heard it soemwhere.)
01-27-2004, 02:56 AM#13
Narwanza
I don't see why you people are debating over other ways of doing it, my way would work perfectly, not sayin that I am perfect.
01-27-2004, 02:58 AM#14
VolEs
lol :) yes, his way will work
01-27-2004, 02:58 AM#15
weaaddar
Well Dakan an easy way is to keep count of the damage.

Now a CS minium is 2.0 so you let an allowable range of change tolerance of like .8-1.2 per attacks. Now ofcourse theres a problem if your first attack is a cs.

Basically everytime your old value is less then your new attack, but not greater by a factor of 1.2*old value you set the new val=the old one. And if the attack is greater then 1.2 factor then you know a CS has gone off.