| 03-07-2004, 08:21 PM | #1 |
Is it somehow possible to to detect a Critical Strike? If it's not, how do i make my own "%-chance" skill with triggers? |
| 03-07-2004, 08:31 PM | #2 |
Chance skill with triggers would go something like this: (you need a passive skill that does nothing) event - a unit is attacked unit-type comparison - attacking hero is a (hero type that has this pasive) unit-level of skill (your passive) for attacking unit greater than 0 set ChanceToDoSpecial = level of skill (your passive) x 10 (this will give you a 10/20/30% chance) set WillYouActuallyDoSpecial = math-random number between 1 and 100 if WillYouActuallyDoSpecial is equal or less than ChanceToDoSpecial then (do whatever the passive skill is supposed to do) the variables ChanceToDoSpecial and WillYouActuallyDoSpecial are there only to elaborate the system, you don't really need them, you could just type: if math-random number between 1 and 100 is equal or less than level of skill (your passive) x 10 then (do whatever the passive skill is supposed to do) Note: the "unit is attacked" happens not when damage is dealt, but when the attacking unit attacks, that can be a lot sooner whith ranged units. You can try determining the time required for the projectile to reach it's target by determining the range between the units or you could store the attacked unit in a variable and then wait for a specific unit event "unit takes damage", but I haven't done any of this yet so i can't tell which one would work how well... |
| 03-08-2004, 02:29 PM | #3 |
That works fine, but now. I want it to happen when the unit takes damage, but the problem is this. I do this when a unit is attacked and unit attacking = my hero. Code:
Set attacked_unit = (Attacked unit) |
| 03-08-2004, 02:34 PM | #4 |
This would be easier if blizzardcoult implement a way to know the damaging unit, anyways did you try using orb abilities? I think that you can use A unit begins casting an ability for the orb's effect ability and that would be the way to detect that. |
| 03-08-2004, 02:40 PM | #5 |
You could not possibly explain a little more? |
| 03-08-2004, 02:42 PM | #6 |
Certain Orb abilities (like the orb of slow ability) can be changed to make the hero cast a certain effect ability after he attacks, (like slow) based on a percentage. |
| 03-08-2004, 03:07 PM | #7 |
Dude hits other dude, if random number is equal or lower to 20 of 100 then do... |
| 03-08-2004, 03:13 PM | #8 | |
Quote:
|
| 03-08-2004, 03:16 PM | #9 |
Well, you can work around it. I just dont remember how. Havent touched wc3 for months. Altough Im quite sure that I did it here...: http://www.wc3campaigns.com/showthread.php?t=32172 |
| 03-08-2004, 03:46 PM | #10 |
Well, the problem is that i can't detect a i.e slow orb hit ether, or anything. Ability equal to Slow Orb... So i must delay the hit...but how cna i calculate for how long? |
| 03-08-2004, 04:09 PM | #11 |
Hmm, there was a thread but I can't find it now, where someone wrote a way to do a trigger where he responded to a "unit takes damage" event with an "attacking unit" comparison. Don't know if it really worked, because he did say there were still some bugs, but I don't know what they were so I can't say if it had anything to do with the incompatibility of "unit takes damage" event and "attacking unit" comparison... Lord Vexorian, are you sure this does not work? Oxygen, you don't need to respond to the orb of slow, because you can already specify in the orb of slow ability what you want to be cast; unless your spell is more complex and requires triggers anyway; in this case, try responding to "unit starts casting a spell" or "starts the effect of ability" and make the "ability being cast" comparison not to the "orb of slow", but to the ability it casts, therefore "slow(item)" or whatever dummy ability you created instead of it. |
| 03-08-2004, 04:28 PM | #12 |
Well I can't get this stuff to work. Could someone not possibly make a map where this skill is? It is supposed to cast a spell on % chance, including a trigger. Let's say this trigger should say "Yes, it worked!" and that the spell should make the Art - Caster "Thunder Clap" Please |
| 03-08-2004, 06:31 PM | #13 |
You can do it with the action trigger-add event Then set the hero in a variable and change the event to a specific unit event. There is a event like "unit takes damage". The other solution is to edit the orb of slow or the orb of lightning to cast a different spell, as mentioned before. |
| 03-08-2004, 07:01 PM | #14 |
how about using bash with stun 0 sec, but it will probubly still give the opponant the stun buff then when you hit bash. if you make bash with a custom buff then, you should be able to detect that buff, correct? i've been fooling around with crit-type spells for a while, to create a healing attack. i actually did it without using triggers ^^~! |
| 03-08-2004, 07:14 PM | #15 |
Well, i can't find my Variable when i set the Specefic Unit Event. It is a Unit var. And when I try to add a different spell (Custom spell basted on Thunder Clap) it never is used by... Can't anyone MAKE a map with anything off this in it and post, or test if it works and tell me how to...I dont get this.. |
