• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

enchancing bash/ critical skills

Status
Not open for further replies.
Level 5
Joined
Apr 16, 2005
Messages
135
hi..i know this wasasked before.. but.. i cant see em..
um.. as for the question.. how do i find if the bash or critical passive ability had just activated.. or finds out if the unit has just bashed or criticaled the enemy unit?.. =p
 
Level 6
Joined
Sep 17, 2005
Messages
276
:?: Im not english but i think u have to improve your english skills first :? . I dont really know what you want...

Did you create a new custom ability with critical and you cant give it to a hero or what?

Or you need a trigger which detects when a hero does a critical strike?

phew...
 
Level 5
Joined
Apr 16, 2005
Messages
135
o.. ok..
.. 8D

i wanna make a new skill based on a bash or critical..
hers an idea.. whenever the hero bashes the unit.. a lightning up on the sky strikes the target..
that only happens if the unit is bashed.. =p

gets?.. 8D
 
Level 6
Joined
Sep 17, 2005
Messages
276
Well now i got it :wink: ...

but sry i got no answer for ya. i tried several things but i didnt find an event (unit does animation >critical-animation<)
or a condition where u can say (>if unit does animation - then do.... >).

I know that wasnt an answer for you but just a hint for those who are familiar to JASS or so. perhaps they can help you.

sry :(
 
Level 10
Joined
Jul 2, 2004
Messages
690
events-
unit is attacked
conditions-
random integar equal or less than 15
events-
create dummy
order last created unit to lightning attacked unit.

the random integar is between 1 and 100
(unit is attacked) isnt so good because you can keep clicking "s" (hotkey for stop) and it will still work. there is a jass version which is more effective, but you got to find it out yourself.

Personal Note: please dont EVER put "=p" again. if you feel awkward saying something, then dont say it at all.
 
Level 6
Joined
Sep 17, 2005
Messages
276
qwerty said:
events-
Code:
unit is attacked
conditions-
random integar equal or less than 15
events-
create dummy
order last created unit to lightning attacked unit.

hm... but then the special effect doesnt fit with the animation. He wanted an effect only WHEN the critical strike fires.
 
Level 6
Joined
Sep 17, 2005
Messages
276
PHEW....

i finally got a detector for ya :).

1) you have to make your custom spell based from a spell that does criticals AND deals a buff to enemies.
(i took the human-dwarfen-hero-bash). Customize your ability like you want but DONT set effect duration below 0.2 seconds. well, that was the preparation...

2) make a trigger like following:

CRITICAL DETECTOR

Code:
Events
    Unit - A unit Is attacked
Conditions
Actions
    Wait 0.10 seconds
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        If - Conditions
            ((Attacked unit) has buff <<the buff from your custom critical ability>> (Pause)) Equal to True
        Then - Actions
            Game - Display to (All players) the text: The unit has done a critical strike
        Else - Actions

Well this is easy if you know it but took me long time to figure it out...
I hope this could help ya. :wink:
 
Level 4
Joined
Mar 19, 2005
Messages
95
Don't use event unit ATTACKED.
Use event unit DAMAGED, because attacked event even registers attacked event if the unit was "going" to attack, so didn't really attack or even if the unit misses(I think)
 
Level 6
Joined
Sep 17, 2005
Messages
276
Shadowstalker said:
um.. one ques.. the critical strike doesnt have any buffs..

well, as i said above use not the ability critical strike >> use for example the human-dwarfen-hero-bash ability which u customize for you.

This ability has a buff and u can customize it so, that is the same like critical strike. Then it works fine - i tested it already. But remember not to set the duration below 0.2 sec cz then the trigger dont work correct....
 
Level 10
Joined
Jul 2, 2004
Messages
690
Sunny_D said:
qwerty said:
events-
Code:
unit is attacked
conditions-
random integar equal or less than 15
events-
create dummy
order last created unit to lightning attacked unit.

hm... but then the special effect doesnt fit with the animation. He wanted an effect only WHEN the critical strike fires.

add an event

event-
play (unit)'s (attack, slam) animation
 
Level 5
Joined
Apr 16, 2005
Messages
135
well.. it kinda work.. for bash..
but.. sometimes.. it doesnt'..
well.. so far.. this is the best..

still.. i hope we could find better results..
i'm also trying..
 
Level 5
Joined
Apr 16, 2005
Messages
135
o.. i placed 1 second instead of 0.10 seconds..
and the duration of the bash.. since i wanted to hide the stun thing..
so i made it .? somthing..
so i think when it tried to checked.. it didnt find the buff..
haha..
well.. thxn very much.. =p
 
Level 10
Joined
Apr 9, 2004
Messages
502
That's kinda sloppy. Checking for unit being attacked is the way of the past. I've found a way to detect on when a unit takes damage, factoring in misses and anims and such. Actually it's quite simple to do i'll post the actions.

Now in GUI it takes at least 2 triggers but i'm sure jass can do this with 2 functions within the same tirggerds (i dunno exactly how you guys work it but this is what i've figured out)

i'll explain it ass i go through and this one works with global vairables so you can easily customize.

Code:
Intiate attack
    Events
        Unit - A unit Is attacked
    Conditions
        (Attacking unit) Equal to [Attacking unit VAR]
        ((Attacked unit) belongs to an enemy of (Owner of [Attacking unit VAR]))Equal to True
    Actions
        Set ADattackedUnit = (Attacked unit)
        Trigger - Add to Unit takes Damage <gen> the event (Unit - ADattackedUnit Takes damage)
        Trigger - Turn on Unit takes Damage <gen>

//This trigger just detects who is attacked and if they are firendly or enemies.  I took out the % chance but that's easy to put in, it's just another condition that checks for a random numbers being less or equal than the value for % that you want).  Make sure that the unit is stored as a global otherwise this will not work

Unit takes Damage
    Events
    Conditions
        (Damage source) Equal to [Attacking unit VAR]
    Actions
        Unit - Cause PlayerDamager[(Player number of (Owner of [Attacking unit VAR]))] to damage (ADattackedUnit), dealing [crit value] damage of attack type Hero and damage type Normal
        Floating Text - Create floating text that reads (Smashed + !) at (Position of (Picked unit)) with Z offset 100.00, using font size 8.00, color (100.00%, 0.00%, 0.00%), and 15.00% transparency
        Floating Text - Set the velocity of Last created floating text to 64.00 towards 90.00 degrees
        Floating Text - Change Last rcreated floatign text: Disable permanence
        Floating Text - Change the lifespan of Last created floating text to 1.30 seconds
        Floating Text - Change the fading age of Last created floating text to 0.70 seconds
        Trigger - Turn off (This trigger)

//This checks that the attacked unit took damage first before applying the crit damage (sometimes when ur gonna crit you do miss).  Don't worry about turning this on and off as if refreshes each time you attack so it never screws up.

Extra stuff you need to know

One last thing that you need is to have a damage source other than the attacking unit as the way it's set up, he's currently dealing the damage so it will crash if he's also told to damage them. What i did was made a unit for each hero (it's written as PlayerDamager) that would do the damage. This way yuor heroe is not directly dealing the damage, so it won't crash. I also added a floating text in there too. The only issued would be creating a point variable instead and removing it after the floating text was created to remove any leaks you would have. If you want to get a precise ctril based on a percentage increase, all you have to do is first make it display the integer of (damage taken * (1.00 = (your bonus percentage) with a +! for the true look. The same goes for delaing the damage but instead you get it to deal (damage taken * (your percentage bonus)) that should be it. BTW this works perfectly and will always incorporate missing also so you don't have to worry about unfair hits based on poor triggering. One last last thing, firing the anims is based on the unit attacking, just play the anim then if the % chance is reached and reset their anim if they deal the damage) Hope this helps out, please post any questiosn you have here.
 
Status
Not open for further replies.
Top